# If you have flex 2.5.34 installed, make sure you upgrade it to >=
# 2.5.35 before you install libpcap
# Get it
cd
test -f installed/libpcap-1.9.0.tar.gz && mv installed/libpcap-1.9.0.tar.gz .
test ! -f libpcap-1.9.0.tar.gz &&
wget http://www.tcpdump.org/release/libpcap-1.9.0.tar.gz
# Verify tarball w/ sha256sum:
# (this came from my gpg-verified tarball)
echo "2edb88808e5913fdaa8e9c1fcaf272e19b2485338742b5074b9fe44d68f370\
19 libpcap-1.9.0.tar.gz" | sha256sum -c
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "libpcap-*" -exec rm -r {} \;
tar xzvf ~/libpcap-1.9.0.tar.gz
cd libpcap-1.9.0
test $UID = 0 && chown -R root:root .
# Configure for 64-bit:
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man
# Configure for anything else:
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --mandir=/usr/man
# Build it
make
# Become root to install it
su
# Remove the Slackware package, if there is one
# Prior to Slackware 14.0, libpcap was part of the tcpdump package
test -x /sbin/removepkg && /sbin/removepkg libpcap
grep -q \/libpcap\. /var/adm/packages/tcpdump-* &&
test -x /sbin/removepkg && /sbin/removepkg tcpdump
# 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
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/libpcap-*.tar.*
mv libpcap-1.9.0.tar.gz installed/
# If you ever want to uninstall libpcap, this should do it:
# ('make uninstall' as root should do it, the rest is just in case)
cd
su
test -d src/libpcap-* && ( cd src/libpcap-* ; make uninstall )
( cd /usr/include ; rm -f pcap.h pcap-bpf.h pcap-namedb.h )
test -d /usr/include/pcap && rm -r /usr/include/pcap
find /usr/man -type f -name "*.3pcap" -exec rm {} \;
( cd /usr/man/man1 ; rm -f pcap-config.1 pcap_*.1 )
( cd /usr/man/man7 ; rm -f pcap-filter.7 pcap-linktype.7 pcap-tstamp.7 )
rm -f /usr/bin/pcap-config /usr/lib/libpcap.* /usr/lib64/libpcap.* \
/usr/man/man5/pcap-savefile.5
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "libpcap-*" -exec rm -r {} \;
rm -f ~/installed/libpcap-*.tar.*