--- a/Makefile Thu Apr 05 19:17:11 2012 +0300
+++ b/Makefile Fri Apr 06 19:59:58 2012 +0300
@@ -92,13 +92,27 @@
chmod a+x ~/.xinitrc ~/.xserverrc
rm -f ~/.xsession
ln -s ~/.xinitrc ~/.xsession
- mkdir -p $(HOME)/.mc
- install -m 640 .mc/bashrc $(HOME)/.mc
-ifeq '$(host_os)' 'cygwin'
- install -m 640 .mc/bindings.cygwin $(HOME)/.mc/bindings
-else
- install -m 640 .mc/bindings $(HOME)/.mc/bindings
-endif
+ v=`mc --version | sed 's|.*\([0-9]\+\.[0-9]\+\.[0-9]\+\)$$|\1|;q'`; \
+ vmajor=$${v%%.*}; \
+ vminor=$${v#*.}; \
+ vminor=$${vminor%.*}; \
+ if [ $$vmajor -gt 4 -o '(' $$vmajor -eq 4 -a $$vminor -ge 8 ')' ]; then \
+ mkdir -p $(HOME)/.config/mc $(HOME)/.local/share/mc/; \
+ install -m 640 .local/share/mc/bashrc $(HOME)/.local/share/mc/; \
+ if [ '$(host_os)' = 'cygwin' ]; then \
+ install -m 640 .config/mc/mc.ext.cygwin $(HOME)/.config/mc/mc.ext; \
+ else \
+ install -m 640 .config/mc/mc.ext $(HOME)/.config/mc/mc.ext; \
+ fi; \
+ else \
+ mkdir -p $(HOME)/.mc; \
+ install -m 640 .local/share/mc/bashrc $(HOME)/.mc; \
+ if [ '$(host_os)' = 'cygwin' ]; then \
+ install -m 640 .config/mc/mc.ext.cygwin $(HOME)/.mc/bindings; \
+ else \
+ install -m 640 .config/mc/mc.ext $(HOME)/.mc/bindings; \
+ fi; \
+ fi
if command -v file 1>/dev/null; then \
install -m 640 .magic $(HOME); \
cd $(HOME); \