# Prerequisites:
# APR
# OpenSSL
# pkg-config
# OpenLDAP (optional; leave off --with-ldap to skip)
# Berkeley DB (optional; leave off --with-berkeley-db to skip)
# PostgreSQL (optional; leave off --with-pgsql to skip)
# MySQL/MariaDB (optional; leave off --with-mysql to skip)
# SQLite (optional)
# Expat
# iconv or libiconv
# Get it
cd
test -f installed/apr-util-1.6.3.tar.bz2 &&
mv installed/apr-util-1.6.3.tar.bz2 .
test ! -f apr-util-1.6.3.tar.bz2 &&
wget https://dlcdn.apache.org//apr/apr-util-1.6.3.tar.bz2
# Verify tarball w/ sha256sum:
# (this also came from the APR site and my gpg-verified tarball)
echo "a41076e3710746326c3945042994ad9a4fcac0ce0277dd8fea076fec3c9772\
b5 apr-util-1.6.3.tar.bz2" | sha256sum -c
# If you are unable to get the key using gpg, download and import:
wget https://dlcdn.apache.org/dist/apr/KEYS -O - | gpg --import -
## With 1.5.4, if you had OpenSSL installed under the < 1.1.0 prefix of
## /usr/local/ssl, and were 64-bit (lib64), you might have needed this patch:
# test -d /usr/local/ssl &&
# test $(uname -m) = 'x86_64' &&
# wget -nc http://englanders.us/pub/linux/patches/apr-util-1.5.4.patch &&
# patch -p0 < apr-util-1.5.4.patch &&
# autoreconf -f -i
# To build it with Berkeley DB support, pass --with-dbm and the type of dbm
# to use (see './configure --help' for the list) and --with-berkeley-db
# specifies the path to it. If you leave off a path, it will look for it
# in standard places. If you leave off a --with-dbm, but do pass
# --with-berkeley-db, it will try all supported versions, newest first.
#
# So, for Slackware 14.2 with the 'db48' package, you can use this
# (or just --with-berkeley-db and let it figure it out)
# --with-dbm=db48 --with-berkeley-db
# or, if you have 4.8 installed from source it would be like this:
# --with-dbm=db48 --with-berkeley-db=/usr/local/BerkeleyDB.4.8
# If your OpenLDAP is not installed under /usr, or somewhere else covered
# by /etc/ld.so.conf, specify where it is with these (and --with-ldap):
# --with-ldap-include=/whatever/include
# --with-ldap-lib=/whatever/lib
# As of 1.2.11, you no longer have to configure MySQL support in ./dbd/,
# now just pass --with-mysql to configure. If not under /usr, you
# may need to pass the path to like so: --with-mysql=/usr/local/mysql
# If you have a mysql_config in your PATH, it should find it
# As usual, see "./configure --help | less" for other configure options
# Configure the build
# The default prefix is /usr/local/apr (without using --prefix=/else/where
# If you are building in support for anything that uses OpenSSL and
# you have and have OpenSSL installed under the default <= 1.0.2 prefix of
# /usr/local/ssl, make sure APR's configure was run with LDFLAGS pointing
# to /usr/local/ssl/lib or lib64 or building APR-util may fail with a
# "cannot find -lssl" and/or "cannot find -lcrypto" error.
#
# You should be fine if it's installed under /usr or /usr/local
# (i.e. libcrypto and libssl are in /usr/local/lib or lib64) as long as
# you have that in /etc/ld.so.conf and run ldconfig.
# --with-mysql is good enough as long as mysql_config is in your PATH
# Configure for 64-bit with OpenSSL in /usr/local/ssl
test -d /usr/local/ssl/include &&
test $(uname -m) = 'x86_64' &&
CFLAGS="-O2 -fPIC" \
./configure --prefix=/usr --libdir=/usr/lib64 --with-apr=/usr \
--with-berkeley-db --with-mysql --disable-util-dso --with-ldap \
--with-crypto
# Configure for 64-bit with OpenSSL in /usr or /usr/local
test ! -d /usr/local/ssl/include &&
test $(uname -m) = 'x86_64' &&
CFLAGS="-O2 -fPIC" ./configure --prefix=/usr --libdir=/usr/lib64 \
--with-apr=/usr --with-berkeley-db --with-mysql --disable-util-dso \
--with-ldap --with-crypto
# Configure for anything else not 64-bit
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --with-apr=/usr --with-berkeley-db \
--with-mysql --disable-util-dso --with-ldap --with-crypto
# Build it
make
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg apr-util
# Remove old leftover library files
rm -f /usr/lib*/libaprutil-1.*
# 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/apr-util-*.tar.*
mv apr-util-1.6.3.tar.bz2 installed/
# If you ever want to uninstall APR-util, this should do it:
su
test -x /sbin/removepkg && /sbin/removepkg apr-util
for pfx in /usr /usr/local;
do
test -d ${pfx}/include/apr-1 && rm -r ${pfx}/include/apr-1
rm -f ${pfx}bin/apu-1-config ${pfx}/lib*/aprutil.exp \
${pfx}/lib*/libaprutil-1.* ${pfx}/lib*/pkgconfig/apr-util-1.pc
done
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "apr-util-*" -exec rm -r {} \;
rm -f ~/installed/apr-util-*.tar.*