# Get the source
cd
test -f installed/libgcrypt-1.10.2.tar.bz2 &&
mv installed/libgcrypt-1.10.2.tar.bz2 .
test ! -f libgcrypt-1.10.2.tar.bz2 &&
wget https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.10.2.tar.bz2
# Verify tarball w/ sha256sum:
# (this came from the integrity check page and my gpg-verified tarball)
echo "3b9c02a004b68c256add99701de00b383accccf37177e0d6c58289664cce0c\
03 libgcrypt-1.10.2.tar.bz2" | sha256sum -c
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "libgcrypt-*" -exec rm -r {} \;
tar xjvf ~/libgcrypt-1.10.2.tar.bz2
cd libgcrypt-1.10.2
test $UID = 0 && chown -R root:root .
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --infodir=/usr/info --libdir=/usr/lib64
# Configure the build for anything else
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --infodir=/usr/info
# Build it
make
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg libgcrypt
# 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
# Saved the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/libgcrypt-*.tar.*
mv libgcrypt-1.10.2.tar.bz2 installed/
# If you ever need to uninstall libgcrypt, this should do it:
test -d ~/src/libgcrypt-* && ( cd ~/src/libgcrypt-* ; make uninstall )
su
for pfx in /usr /usr/local; do
( cd ${pfx}/bin ; rm -f dumpsexp hmac256 libgcrypt-config )
rm -f ${pfx}/lib*/libgcrypt.* ${pfx}/share/aclocal/libgcrypt.m4 \
${pfx}/info/gcrypt.info ${pfx}/share/info/gcrypt.info
( cd ${pfx}/include ; rm -f gcrypt.h gcrypt-module.h )
done
exit
find ~/src -maxdepth 1 -type d -name "libgcrypt-*" -exec rm -r {} \;
rm -f ~/installed/libgcrypt-*.tar.*