# Get the source
cd
test -f installed/xz-5.4.4.tar.bz2 && mv installed/xz-5.4.4.tar.bz2 .
test ! -f xz-5.4.4.tar.bz2 && wget https://tukaani.org/xz/xz-5.4.4.tar.bz2
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "xz-*" -exec rm -r {} \;
tar xjvf ~/xz-5.4.4.tar.bz2
cd xz-5.4.4
test $UID = 0 && chown -R root:root .
# Be aware that you may have an older liblzma.* in /lib or /lib64
# from the aaa_elflibs package
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --docdir=/usr/doc/xz --infodir=/usr/info \
--libdir=/usr/lib64 --mandir=/usr/man --disable-static --disable-nls
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --docdir=/usr/doc/xz --infodir=/usr/info \
--mandir=/usr/man --disable-static --disable-nls
# Build it
make
# Check the build
make check
# Become root to install it
su
# Remove the Slackware package
test -x /sbin/removepkg && /sbin/removepkg xz
# Install it
make install
ldconfig
# Become your non-root user again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/xz-*.tar.*
mv xz-5.4.4.tar.bz2 installed/
# If you ever want to uninstall XZ Utils, this should do it:
cd
su
test -d src/xz-* && ( cd src/xz-* ; make uninstall )
( cd /usr/bin ; rm -f lzdiff lzgrep lzmadec lzmainfo lzmore xz xzdec \
xzdiff xzgrep xzless xzmore )
type -d /usr/doc/xz && rm -r /usr/doc/xz
find /usr/doc/ -maxdepth 1 -name "xz-*" -exec rm -r {} \;
test -d /usr/include/lzma && rm -r /usr/include/lzma
test -d /usr/lib64 &&
( cd /usr/lib64 ; rm -f liblzma.* pkgconfig/liblzma.pc )
( cd /usr/man/man1 ; rm -f lzdiff.1* lzgrep.1* lzmainfo.1* lzmore.1* \
xz.1* xzdec.1* xzdiff.1* xzgrep.1* xzless.1* xzmore.1* )
type -d /usr/share/doc/xz && rm -r /usr/share/doc/xz
find /usr/share/doc/ -maxdepth 1 -name "xz-*" -exec rm -r {} \;
( cd /usr/share/man/man1 ; rm -f lzdiff.1* lzgrep.1* lzmainfo.1* lzmore.1* \
xz.1* xzdec.1* xzdiff.1* xzgrep.1* xzless.1* xzmore.1* )
rm -f /bin/xz /lib/liblzma.* /usr/include/lzma.h /usr/lib/liblzma.* \
/usr/lib/pkgconfig/liblzma.pc
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "xz-*" -exec rm -r {} \;
rm -f ~/installed/xz-*.tar.*