# Get it
cd
test -f installed/libzip-1.10.1.tar.xz &&
mv -f installed/libzip-1.10.1.tar.xz .
test ! -f libzip-1.10.1.tar.xz &&
wget https://libzip.org/download/libzip-1.10.1.tar.xz
# Extract it
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "libzip-*" -exec rm -r {} \;
tar xJvf ~/libzip-1.10.1.tar.xz
cd libzip-1.10.1
test $UID = 0 && chown -R root:root .
# Read ./README.md and ./INSTALL.md, if upgrading NEWS.md
# Create a build directory
mkdir build
cd build
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib64 \
-DCMAKE_INSTALL_MANDIR=/usr/man ..
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_MANDIR=/usr/man ..
# Build it
make
# Test the build
make test
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg libzip
# Install it
make install
ldconfig
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/libzip-*.tar.*
mv libzip-1.10.1.tar.xz installed/
# If you ever want to uninstall libzip, this should do it:
cd
su
test -d src/libzip-* &&
( cd src/libzip-* ; cat install_manifest.txt | xargs rm )
( cd /usr/bin ; rm -f zipcmp zipmerge ziptool )
( cd /usr/include ; rm -f zip.h zipconf.h )
( cd /usr/lib ; rm -f libzip.* pkgconfig/libzip.pc )
test -d /usr/lib64 &&
( cd /usr/lib64 ; rm -f libzip.* pkgconfig/libzip.pc )
( cd /usr/man/man1 ; rm -f zipcmp.1 zipmerge.1 ziptool.1 )
( cd /usr/man/man3 ; rm -f ZIP_SOURCE_GET_ARGS.3 libzip.3 zip_*.3 )
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "libzip-*" -exec rm -r {} \;
rm -f ~/installed/libzip-*.tar.*