cd
test -f installed/mc-4.6.1.tar.gz && mv installed/mc-4.6.1.tar.gz .
test ! -f mc-4.6.1.tar.gz &&
wget http://www.ibiblio.org/pub/Linux/utils/file/managers/mc/mc-4.6.1.tar.gz
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "mc-*" -exec rm -r {} \;
tar xzvf ~/mc-4.6.1.tar.gz
cd mc-4.6.1
test $UID = 0 && chown -R root:root .
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-nls \
--enable-charset \
--with-x=no
make
su -c "removepkg mc ; make install-strip"
cd
mkdir -p -m 0700 installed
rm -f installed/mc-*.tar.*
mv mc-4.6.1.tar.gz installed/
# If you ever decide to uninstall mc, cd into the source directory and run
# 'make uninstall'. If you can't, or just want to make sure that everything
# is gone, try something like this:
( cd /usr/bin ; rm -f mc mcedit mcmfmt mcview )
test -d /usr/lib/mc && rm -r /usr/lib/mc
( cd /usr/man/man1 ; rm -f mc.1 mcedit.1 mcview.1 )
test -d /usr/share/mc && rm -r /usr/share/mc
find ~/src -maxdepth 1 -type d -name "mc-*" -exec rm -r {} \;
rm -f ~/installed/mc-*.tar.*