# PCRE2 10.39
# ===========
# PCRE is covered in a seperate HOWTO
# Slackware <= 14.2 'pcre' package is the original PCRE
# Slackware >= 15.0 has a 'pcre' package and a 'pcre2' package
# Prerequisites:
# pkg-config
# zlib (if you don't leave off --enable-pcregrep-libz)
# bzip2 (if you don't leave off --enable-pcregrep-libbz2)
# readline
# Apache, KDE, PHP, and other significant things use this library, so I
# would suggest shutting them down before upgrading this library or at least
# knowing what is running that uses it before beginning.
# Try running 'lsof /usr/lib*/libpcre*'
# (if you have lsof installed) to see if anything else is running that
# uses the PCRE shared library.
# Get it
cd
test -f installed/pcre2-10.39.tar.bz2 && mv installed/pcre2-10.39.tar.bz2 .
test ! -f pcre2-10.39.tar.bz2 &&
wget https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.39/\
pcre2-10.39.tar.bz2
# Verify tarball w/ sha256sum:
# (this came from my gpg-verified tarball)
echo "0f03caf57f81d9ff362ac28cd389c055ec2bf0678d277349a1a4bee00ad6d4\
40 pcre2-10.39.tar.bz2" | sha256sum -c
# Become root to clean up old files and to install it
su
# Remove the Slackware package, if there is one
text -x /sbin/removepkg && /sbin/removepkg pcre2
# Remove old shared library files
find /usr/lib* -type f -name "libpcre2-*" -exec rm {} \;
# Install it
make install
ldconfig
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Now if you want, remove old versions of libpcre2-8.so.* and
# libpcre2-posix.* in /usr/lib*/, if there are any. This is purely to avoid
# clutter, so if you feel like leaving them there, that's fine. Normally
# you'd be weary of programs that are linked to libpcre2-8.so.1 when
# you upgrade to libpcre2.so.2 (remove .1 and break that program)
# Run ldd on any program that is linked with libpcre2 to verify that it is
# still OK
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/pcre2-*.tar.*
mv pcre2-10.39.tar.bz2 installed/
# If you ever want to uninstall PCRE2, this should do it:
# ('make uninstall' as root will do it, if you have the source)
cd
su
test -d src/pcre2-* && ( cd src/pcre2-* ; make uninstall )
( /usr/bin ; rm -f pcre2-config pcre2grep pcre2test )
test -d /usr/doc/pcre2 && rm -r /usr/doc/pcre2
( cd /usr/include ; rm -f pcre2.h pcre2posix.h )
for libdir in /usr/lib /usr/lib64;
do
rm -f libpcre2-8.* libpcre2-16.* libpcre2-32.* libpcre2-posix.* \
pkgconfig/libpcre2-8.pc pkgconfig/libpcre2-16.pc \
pkgconfig/libpcre2-32.pc pkgconfig/libpcre2-posix.pc
done
( cd /usr/man/man1 ; rm -f pcre2-config.1 pcre2grep.1 pcre2test.1 )
( cd /usr/man/man3
rm -f pcre2.3 pcre2_*.3 pcre2api.3 pcre2build.3 pcre2callout.3 \
pcre2compat.3 pcre2convert.3 pcre2demo.3 pcre2jit.3 pcre2limits.3 \
pcre2matching.3 pcre2partial.3 pcre2pattern.3 pcre2perform.3 \
pcre2posix.3 pcre2sample.3 pcre2serialize.3 pcre2syntax.3 pcre2unicode.3 )
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "pcre2-*" -exec rm -r {} \;
rm -f ~/installed/pcre2-*.tar.*