About | Home | Search


HOWTO: apr-util
Description: Companion library to APR
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# APR-util 1.3.9
# ===============
# Slackware 11.0: apr-util 1.2.7
# Slackware 12.0: apr-util 1.2.8
# Slackware 12.1: apr-util 1.2.12
# Slackware 12.2: apr-util 1.3.4
# Slackware 13.0: apr-util 1.3.9

# If you ever want to uninstall APR-util, or remove an old version before
# installing a new one, skip to the bottom for instructions.

# If you have trouble with the download URL below, go here for a list of
# other mirrors:
# http://apr.apache.org/download.cgi

# Prerequisites:
# APR
# OpenLDAP (optional; leave off --with-ldap to skip)
# Berkeley DB (optional)
# MySQL (optional; leave off --with-mysql to skip)
# SQLite (optional)
# Expat
# iconv

cd
test -f installed/apr-util-1.3.9.tar.bz2 &&
 mv installed/apr-util-1.3.9.tar.bz2 .
test ! -f apr-util-1.3.9.tar.bz2 &&
 wget http://apache.mirrors.tds.net/apr/apr-util-1.3.9.tar.bz2

# Verify tarball w/ md5sum:
echo "29dd557f7bd891fc2bfdffcfa081db59  apr-util-1.3.9.tar.bz2" | md5sum -c

# Verify tarball w/ sha1sum:
# (this came from my gpg-verified tarball)
echo "7d8979605765df69795699764a262dcf96b3a1d7  apr-util-1.3.9.tar.bz2" | \
 sha1sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 7F7214A7 > /dev/null 2>&1 || gpg --recv-keys 7F7214A7 ) &&
 wget http://www.apache.org/dist/apr/apr-util-1.3.9.tar.bz2.asc &&
  gpg --verify apr-util-1.3.9.tar.bz2.asc && rm apr-util-1.3.9.tar.bz2.asc

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "apr-util-*" -exec rm -r {} \;
tar xjvf ~/apr-util-1.3.9.tar.bz2
cd apr-util-1.3.9
test $UID = 0 && chown -R root:root .

# 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.
#
# So, for Slackware 13.0 with the 'db44' package, I used:
# --with-dbm=db44 --with-berkeley-db
# for a machine with 4.2.x installed from source I used:
# --with-dbm=db42 --with-berkeley-db=/usr/local/BerkeleyDB.4.2

# If your OpenLDAP is not installed under /usr, specify where it is with
# these (and --with-ldap):
# --with-ldap-include=/usr/local/include
# --with-ldap-lib=/usr/local/lib

# As of 1.2.11, you no longer have to configure MySQL support in ./dbd/,
# now just pass --with-mysql to configure.  It will find it in /usr, if
# yours is installed under /usr/local/mysql, use
# --with-mysql=/usr/local/mysql

# As usual, see "./configure --help | less" for other configure options

# Build it
# The default prefix is /usr/local/apr
./configure --with-apr=/usr --prefix=/usr --with-ldap --with-mysql
make

# Become root to install it
su

# Remove Slackware package and old shared libraries
test -x /sbin/removepkg && /sbin/removepkg apr-util
rm -f /usr/lib/libaprutil-1.*

# Install it
make install
ldconfig

# Make sure your non-root user can remove the source later
chown -R $USER .
chmod -R u+w .

# Become yourself again
exit

cd
mkdir -p -m 0700 installed
rm -f installed/apr-util-*.tar.*
mv apr-util-1.3.9.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.*

Back to the list


Last updated: Fri, 26 Mar 2010 13:18:56 -0400
Jason Englander <jason at englanders dot us>