Linux HOWTOs

About | Home | Search


HOWTO: libgcrypt
Description: Cryptographic library based on the code from GnuPG
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# libgcrypt 1.5.0
# ===============
# Slackware 12.1, 12.2: libgcrypt 1.4.0
# Slackware 13.0: libgcrypt 1.4.4
# Slackware 13.1: libgcrypt 1.4.5
# Slackware 13.37: libgcrypt 1.4.6

# If you want to uninstall libgcrypt or clean up files from an old
# version before you install the new one, skip down to the bottom

# Prerequisites:
# libgpg-error

cd
test -f installed/libgcrypt-1.5.0.tar.bz2 &&
 mv installed/libgcrypt-1.5.0.tar.bz2 .
test ! -f libgcrypt-1.5.0.tar.bz2 &&
 wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.5.0.tar.bz2

# Verify tarball w/ md5sum:
# (this came from my gpg and sha1sum verified tarball)
echo "693f9c64d50c908bc4d6e01da3ff76d8  libgcrypt-1.5.0.tar.bz2" | md5sum -c

# Verify tarball w/ sha1sum:
echo "3e776d44375dc1a710560b98ae8437d5da6e32cf  libgcrypt-1.5.0.tar.bz2" | \
 sha1sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 4F25E3B6 > /dev/null 2>&1 || gpg --recv-keys 4F25E3B6 ) &&
 wget -nc ftp://ftp.gnupg.org/gcrypt/libgcrypt/\
libgcrypt-1.5.0.tar.bz2.sig &&
  gpg --verify libgcrypt-1.5.0.tar.bz2.sig && rm libgcrypt-1.5.0.tar.bz2.sig

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "libgcrypt-*" -exec rm -r {} \;
tar xjvf ~/libgcrypt-1.5.0.tar.bz2
cd libgcrypt-1.5.0
test $UID = 0 && chown -R root:root .
./configure --prefix=/usr --infodir=/usr/info
make

# Become root to install it
su

# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg libgcrypt

# Clean up old shared library files
rm -f /usr/lib/libgcrypt.so.* /usr/local/lib/libgcrypt.so.*

# Install it
make install
ldconfig

# Make sure your non-root user can remove the source later
chown -R $USER .
chmod -R u+w .

# Become yourself again
exit

cd
mkdir -p -m 0700 installed
rm -f installed/libgcrypt-*.tar.*
mv libgcrypt-1.5.0.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.*

Back to the list


Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>