# TCP Wrappers 7.6
# ================
# This version of TCP Wrappers was released in 1997
# There will be some patching required below to get it to compile
# The patch also enables a shared libwrap.so which you will need
# to build-in TCP Wrappers support in source sendmail
# Get the tarball
cd
mkdir -p -m 0700 installed
test -f installed/tcp_wrappers_7.6.tar.gz &&
mv -f installed/tcp_wrappers_7.6.tar.gz .
test ! -f tcp_wrappers_7.6.tar.gz &&
wget http://ftp.porcupine.org/pub/security/tcp_wrappers_7.6.tar.gz
# Confirm that the tarball file size is what it should be
test "99438" = $(stat -c %s tcp_wrappers_7.6.tar.gz) && echo "Yey!" || echo Boo
# This may only work if you somehow still have GnuPG 1.x installed,
# or built GnuPG 2.x with --enable-gpg-is-gpg2 and have a gpg and gpg2.
# Verify tarball w/ gpg:
( gpg --list-keys DC80F2A6D5327CB9 > /dev/null 2>&1 ||
wget -O - http://www.porcupine.org/wietse/wietse.pgp | gpg --import )
wget -nc http://ftp.porcupine.org/pub/security/\
tcp_wrappers_7.6.tar.gz.sig &&
gpg --verify tcp_wrappers_7.6.tar.gz.sig &&
rm tcp_wrappers_7.6.tar.gz.sig
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "tcp_wrappers_*" -exec rm -r {} \;
tar xzvf ~/tcp_wrappers_7.6.tar.gz
cd tcp_wrappers_7.6
test $UID = 0 && chown -R root:root .
chmod -R u+w .
# Patch to enable shared library (.so)
# Includes adding -DHAVE_STRERROR to Makefile (for glibc)
test ! -f tcp_wrappers-7.6-shared_lib_plus_plus-1.patch &&
wget -nc https://ftp2.osuosl.org/pub/blfs/conglomeration/tcp_wrappers/\
tcp_wrappers-7.6-shared_lib_plus_plus-1.patch
test -s tcp_wrappers-7.6-shared_lib_plus_plus-1.patch &&
patch -p1 < tcp_wrappers-7.6-shared_lib_plus_plus-1.patch
# Do this also to help with some build issues
sed -i -e "s,^extern char \*malloc();,/* & */," scaffold.c
# Build it
make REAL_DAEMON_DIR=/usr/sbin linux
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg tcp_wrappers
# Remove old man pages that may conflict, having gzipped ones
# and regular ones at the same time, etc.
( cd /usr/man
rm -f man3/hosts_access.3* \
man5/hosts_access.5* \
man5/hosts_options.5* \
man8/tcpd.8* man8/tcpdchk.8* man8/tcpdmatch.8* )