# Nettle 3.9.1 is source and binary compatible with Nettle 3.6
# Get it
cd
mkdir -p -m 0700 installed
test -f installed/nettle-3.9.1.tar.gz && mv -f installed/nettle-3.9.1.tar.gz .
test ! -f nettle-3.9.1.tar.gz &&
wget https://www.lysator.liu.se/~nisse/archive/nettle-3.9.1.tar.gz
# Verify tarball w/ sha256sum:
# (this came from my gpg-verified tarball)
echo "ccfeff981b0ca71bbd6fbcb054f407c60ffb644389a5be80d6716d5b550c6c\
e3 nettle-3.9.1.tar.gz" | sha256sum -c
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "nettle-*" -exec rm -r {} \;
tar xzvf ~/nettle-3.9.1.tar.gz
cd nettle-3.9.1
test $UID = 0 && chown -R root:root .
# Read README, INSTALL, and NEWS (if upgrading)
# If you want it to find OpenSSL when yours is under the /usr/local/ssl
# prefix, which is the default in < OpenSSL 1.1.0, put these at the
# beginning of your configure line (if 64-bit, use lib64 instead):
# LDCONFIG=-L/usr/local/ssl/lib CPPFLAGS=-I/usr/local/ssl/include
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --docdir=/usr/doc --infodir=/usr/info \
--libdir=/usr/lib64 --mandir=/usr/man
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --docdir=/usr/doc --infodir=/usr/info \
--mandir=/usr/man
# Build it
make
# Check the build
make check
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg nettle
# Install it
make install
ldconfig
# If you installed it over an older version, check here for leftover
# files that are no longer necessary - generally if the date is not
# today, it's no longer used.
# /usr/include/nettle
# /usr/lib*/libhogweed.*
# /usr/lib*/libnettle.*
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become your non-root user again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/nettle-*.tar.*
mv nettle-3.9.1.tar.gz installed/
# If you ever want to uninstall Nettle, this should do it:
cd
su
test -d src/nettle-* && ( cd src/nettle-* ; make uninstall )
( cd /usr/bin
rm -f nettle-hash nettle-pbkdf2 nettle-lfib-stream pkcs1-conv sexp-conv )
test -d /usr/include/nettle && rm -r /usr/include/nettle
rm -f /usr/info/nettle.info
for libdir /usr/lib /usr/lib64;
do
test -d $libdir &&
( cd $libdir ; rm -f libhogweed.* libnettle.* )
test -d $libdir &&
( cd ${libdir}/pkgconfig ; rm -f hogweed.pc nettle.pc )
done
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "nettle-*" -exec rm -r {} \;
rm -f ~/installed/nettle-*.tar.*