apr-util - Companion library to APR ChangeLog

HOWTO


# APR-util 1.6.3
# ==============
# Slackware 14.0: apr-util 1.4.1
# Slackware 14.1: apr-util 1.5.1
# Slackware 14.2: apr-util 1.5.4
# Slackware 15.0: apr-util 1.7.2

# 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:
# https://apr.apache.org/download.cgi

# 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 -

# Verify tarball w/ gpg:
( gpg --list-keys 9088F565 > /dev/null 2>&1 || gpg --recv-keys 9088F565 ) &&
wget https://dlcdn.apache.org/apr/apr-util-1.6.3.tar.bz2.asc &&
  gpg --verify apr-util-1.6.3.tar.bz2.asc && rm apr-util-1.6.3.tar.bz2.asc

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

# Patches for MariaDB >= 10.2.8
#wget -nc \
#"https://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/\
#CHANGES?r1=1872061&r2=1872060&pathrev=1872061&view=patch" \
#"http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/\
#build/dbd.m4?r1=1872061&r2=1872060&pathrev=1872061&view=patch" \
#"http://svn.apache.org/viewvc/apr/apr-util/branches/1.7.x/\
#dbd/apr_dbd_mysql.c?r1=1872061&r2=1872060&pathrev=1872061&view=patch" \
# -O mariadb.patch

## Patch for MariaDB >= 10.2.8
## https://bz.apache.org/bugzilla/show_bug.cgi?id=61517
#wget -nc https://bz.apache.org/bugzilla/attachment.cgi?id=35326 \
# -O mariadb.patch
#patch -p1 < mariadb.patch

## 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.*

List of HOWTOs

Web page itself last updated: 2023-12-20 8:06pm (EDT -0400)
HOWTO last updated: 2023-09-23 5:15pm
Copyright © 2001-2024 Jason Englander. All Rights reserved.
[HTML5]