# Get the tarball
cd
test -f installed/lftp-4.9.2.tar.xz && mv installed/lftp-4.9.2.tar.xz .
test ! -f lftp-4.9.2.tar.xz &&
wget http://lftp.yar.ru/ftp/lftp-4.9.2.tar.xz
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "lftp-*" -exec rm -r {} \;
tar xJvf ~/lftp-4.9.2.tar.xz
cd lftp-4.9.2
test $UID = 0 && chown -R root:root .
# Read README and if upgrading, NEWS and/or ChangeLog
# As of version 3.2.0, configure will use GnuTLS by default. It will only
# use OpenSSL if you tell it to via the --with-openssl flag, even if GnuTLS
# is not installed. If it was installed in the standard source location,
# pass this to configure: --with-openssl=/usr/local/ssl If GnuTLS is
# installed somewhere where configure can't find it, specify it's prefix
# with --with-libgnutls-prefix=/the/prefix/its/installed/under
# Configure the build for 64-bit
./configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man --disable-nls
# Configure the build for anything else
./configure --prefix=/usr --mandir=/usr/man --disable-nls
# Build it
make
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg lftp
# Remove old files in /usr/lib/ftp then install it
test -d /usr/lib/lftp &&
find /usr/lib/lftp -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \;
test -d /usr/lib64/lftp &&
find /usr/lib64/lftp -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \;
# Install it
make install
ldconfig
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/lftp-*.tar.*
mv lftp-4.9.2.tar.xz installed/
# If you ever need to uninstall lftp, this should do it.
#
# I tried running 'make uninstall' in the source directory with version 3.2.1,
# but that got stuck in a loop and ate up every available file handle bringing
# the load average up to a few hundred, so I ctrl-C'd it :-) Needless to say,
# either run 'make -n uninstall' first to see what would happen, or just don't
# do it at all.
cd
su
find src -maxdepth 1 -type d -name "lftp-*" -exec rm -r {} \;
for cfgfile in /usr/local/etc/lftp.conf /etc/lftp.conf; do
test -f $cfgfile &&
( mkdir -p -m 0700 ~/backup ; mv -f $cfgfile ~/backup/ )
done
for pfx in /usr/local /usr; do
rm -f ${pfx}/bin/lftp ${pfx}/bin/lftpget \
${pfx}/lib/liblftp-jobs.* \
${pfx}/lib/liblftp-tasks.* \
${pfx}/man/man1/lftp.1 \
${pfx}/share/applications/lftp.desktop \
${pfx}/share/icons/hicolor/48x48/apps/lftp-icon.png \
${pfx}/share/man/man1/lftp.1
test -d ${pfx}/lib/lftp && rm -r ${pfx}/lib/lftp
test -d ${pfx}/lib64/lftp &&
( cd ${pfx}/lib64
test -d ./lftp && rm -r ./lftp
rm -f lftp-jobs.* lftp-tasks.* )
test -d ${pfx}/share/lftp && rm -r ${pfx}/share/lftp
find ${pfx}/share/locale -name "lftp.mo" -exec rm {} \;
done
removepkg lftp
exit
test -d ~/.lftp && rm -r ~/.lftp
rm -f ~/installed/lftp-*.tar.*