diff --git a/.apr-util.metadata b/.apr-util.metadata
new file mode 100644
index 0000000..47e5f63
--- /dev/null
+++ b/.apr-util.metadata
@@ -0,0 +1 @@
+67139f51ee6c484f3f1b7b3edc0b00dae3640b0a SOURCES/apr-util-1.5.2.tar.bz2
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..57a95d8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+SOURCES/apr-util-1.5.2.tar.bz2
diff --git a/SOURCES/apr-util-1.2.7-pkgconf.patch b/SOURCES/apr-util-1.2.7-pkgconf.patch
new file mode 100644
index 0000000..0e394ec
--- /dev/null
+++ b/SOURCES/apr-util-1.2.7-pkgconf.patch
@@ -0,0 +1,25 @@
+--- apr-util-1.2.7/Makefile.in.pkgconf
++++ apr-util-1.2.7/Makefile.in
+@@ -51,7 +51,7 @@
+
+ # Create apu-config script suitable for the install tree
+ apu-config.out: $(APU_CONFIG)
+- sed 's,^\(location=\).*$$,\1installed,' < $(APU_CONFIG) > $@
++ sed 's,^\(location=\).*$$,\1installed,;s,^\(APR_.*_DIR\)=.*,\1="$${libdir}/build",' < $(APU_CONFIG) > $@
+
+ install: $(TARGETS) install-modules
+ $(APR_MKDIR) $(DESTDIR)$(includedir) $(DESTDIR)$(libdir)/pkgconfig \
+--- apr-util-1.2.7/apu-config.in.pkgconf
++++ apr-util-1.2.7/apu-config.in
+@@ -24,9 +24,10 @@
+ prefix="@prefix@"
+ exec_prefix="@exec_prefix@"
+ bindir="@bindir@"
+-libdir="@libdir@"
+ includedir="@includedir@"
+
++libdir=`pkg-config --variable=libdir apr-util-@APRUTIL_MAJOR_VERSION@`
++
+ LIBS="@APRUTIL_EXPORT_LIBS@"
+ INCLUDES="@APRUTIL_INCLUDES@"
+ LDFLAGS="@APRUTIL_LDFLAGS@"
diff --git a/SOURCES/apr-util-1.3.7-nodbmdso.patch b/SOURCES/apr-util-1.3.7-nodbmdso.patch
new file mode 100644
index 0000000..fd0e206
--- /dev/null
+++ b/SOURCES/apr-util-1.3.7-nodbmdso.patch
@@ -0,0 +1,63 @@
+--- apr-util-1.3.7/build/dso.m4.nodbmdso
++++ apr-util-1.3.7/build/dso.m4
+@@ -44,6 +44,16 @@ AC_DEFUN([APU_CHECK_UTIL_DSO], [
+ fi
+ fi
+
++
++ ### Hack: force static linking of DBM code.
++ objs=
++ test $apu_have_db = 1 && objs="$objs dbm/apr_dbm_berkeleydb.lo"
++ test $apu_have_gdbm = 1 && objs="$objs dbm/apr_dbm_gdbm.lo"
++ test $apu_have_ndbm = 1 && objs="$objs dbm/apr_dbm_ndbm.lo"
++ EXTRA_OBJECTS="$EXTRA_OBJECTS $objs"
++ APRUTIL_LIBS="$APRUTIL_LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm"
++ APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm"
++
+ if test "$apu_dso_build" = "0"; then
+
+ # Statically link the drivers:
+@@ -42,9 +65,6 @@ AC_DEFUN([APU_CHECK_UTIL_DSO], [
+ test $apu_have_sqlite3 = 1 && objs="$objs dbd/apr_dbd_sqlite3.lo"
+ test $apu_have_freetds = 1 && objs="$objs dbd/apr_dbd_freetds.lo"
+ test $apu_have_odbc = 1 && objs="$objs dbd/apr_dbd_odbc.lo"
+- test $apu_have_db = 1 && objs="$objs dbm/apr_dbm_berkeleydb.lo"
+- test $apu_have_gdbm = 1 && objs="$objs dbm/apr_dbm_gdbm.lo"
+- test $apu_have_ndbm = 1 && objs="$objs dbm/apr_dbm_ndbm.lo"
+ test $apu_has_ldap = 1 && objs="$objs ldap/apr_ldap_init.lo"
+ test $apu_has_ldap = 1 && objs="$objs ldap/apr_ldap_option.lo"
+ test $apu_has_ldap = 1 && objs="$objs ldap/apr_ldap_rebind.lo"
+@@ -81,11 +81,9 @@
+
+ APRUTIL_LIBS="$APRUTIL_LIBS $LDADD_crypto_openssl $LDADD_crypto_nss"
+ APRUTIL_LIBS="$APRUTIL_LIBS $LDADD_dbd_pgsql $LDADD_dbd_sqlite2 $LDADD_dbd_sqlite3 $LDADD_dbd_oracle $LDADD_dbd_mysql $LDADD_dbd_freetds $LDADD_dbd_odbc"
+- APRUTIL_LIBS="$APRUTIL_LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm"
+ APRUTIL_LIBS="$APRUTIL_LIBS $LDADD_ldap"
+ APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_crypto_openssl $LDADD_crypto_nss"
+ APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbd_pgsql $LDADD_dbd_sqlite2 $LDADD_dbd_sqlite3 $LDADD_dbd_oracle $LDADD_dbd_mysql $LDADD_dbd_freetds $LDADD_dbd_odbc"
+- APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_dbm_db $LDADD_dbm_gdbm $LDADD_dbm_ndbm"
+ APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $LDADD_ldap"
+
+ else
+@@ -82,9 +100,6 @@ AC_DEFUN([APU_CHECK_UTIL_DSO], [
+ test $apu_have_sqlite3 = 1 && dsos="$dsos dbd/apr_dbd_sqlite3.la"
+ test $apu_have_freetds = 1 && dsos="$dsos dbd/apr_dbd_freetds.la"
+ test $apu_have_odbc = 1 && dsos="$dsos dbd/apr_dbd_odbc.la"
+- test $apu_have_db = 1 && dsos="$dsos dbm/apr_dbm_db.la"
+- test $apu_have_gdbm = 1 && dsos="$dsos dbm/apr_dbm_gdbm.la"
+- test $apu_have_ndbm = 1 && dsos="$dsos dbm/apr_dbm_ndbm.la"
+ test $apu_has_ldap = 1 && dsos="$dsos ldap/apr_ldap.la"
+
+ if test -n "$dsos"; then
+--- apr-util-1.3.7/dbm/apr_dbm.c.nodbmdso
++++ apr-util-1.3.7/dbm/apr_dbm.c
+@@ -56,6 +56,9 @@
+ #error a DBM implementation was not specified
+ #endif
+
++#undef APU_DSO_BUILD
++#define APU_DSO_BUILD 0
++
+ #if APU_DSO_BUILD
+
+ static apr_hash_t *drivers = NULL;
diff --git a/SOURCES/apr-util-1.4.1-private.patch b/SOURCES/apr-util-1.4.1-private.patch
new file mode 100644
index 0000000..296362e
--- /dev/null
+++ b/SOURCES/apr-util-1.4.1-private.patch
@@ -0,0 +1,10 @@
+--- apr-util-1.4.1/apr-util.pc.in~ 2008-05-23 16:27:37.000000000 -0500
++++ apr-util-1.4.1/apr-util.pc.in 2013-02-07 08:55:09.717312176 -0600
+@@ -9,5 +9,6 @@
+ Version: @APRUTIL_DOTTED_VERSION@
+ # assume that apr-util requires libapr of same major version
+ Requires: apr-@APRUTIL_MAJOR_VERSION@
+-Libs: -L${libdir} -l@APRUTIL_LIBNAME@ @LDADD_ldap@ @APRUTIL_EXPORT_LIBS@
++Libs: -L${libdir} -l@APRUTIL_LIBNAME@ @LDADD_ldap@
++Libs.private: @APRUTIL_EXPORT_LIBS@
+ Cflags: -I${includedir}
diff --git a/SOURCES/apr-util-1.5.2-aarch64.patch b/SOURCES/apr-util-1.5.2-aarch64.patch
new file mode 100644
index 0000000..a7f21f5
--- /dev/null
+++ b/SOURCES/apr-util-1.5.2-aarch64.patch
@@ -0,0 +1,704 @@
+diff -urN apr-util-1.4.1/build/config.guess apr-util-1.4.1-aarch64/build/config.guess
+--- apr-util-1.5.2/build/config.guess.aarch64
++++ apr-util-1.5.2/build/config.guess
+@@ -1,14 +1,12 @@
+ #! /bin/sh
+ # Attempt to guess a canonical system name.
+-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+-# 2011 Free Software Foundation, Inc.
++# Copyright 1992-2013 Free Software Foundation, Inc.
+
+-timestamp='2011-05-11'
++timestamp='2013-02-12'
+
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2 of the License, or
++# the Free Software Foundation; either version 3 of the License, or
+ # (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful, but
+@@ -17,26 +15,22 @@ timestamp='2011-05-11'
+ # General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+-# 02110-1301, USA.
++# along with this program; if not, see .
+ #
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+ # configuration script generated by Autoconf, you may include it under
+-# the same distribution terms that you use for the rest of that program.
+-
+-
+-# Originally written by Per Bothner. Please send patches (context
+-# diff format) to and include a ChangeLog
+-# entry.
++# the same distribution terms that you use for the rest of that
++# program. This Exception is an additional permission under section 7
++# of the GNU General Public License, version 3 ("GPLv3").
+ #
+-# This script attempts to guess a canonical system name similar to
+-# config.sub. If it succeeds, it prints the system name on stdout, and
+-# exits with 0. Otherwise, it exits with 1.
++# Originally written by Per Bothner.
+ #
+ # You can get the latest version of this script from:
+ # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
++#
++# Please send patches with a ChangeLog entry to config-patches@gnu.org.
++
+
+ me=`echo "$0" | sed -e 's,.*/,,'`
+
+@@ -56,9 +50,7 @@ version="\
+ GNU config.guess ($timestamp)
+
+ Originally written by Per Bothner.
+-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
+-Software Foundation, Inc.
++Copyright 1992-2013 Free Software Foundation, Inc.
+
+ This is free software; see the source for copying conditions. There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -145,7 +137,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` |
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
++ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+@@ -202,6 +194,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
++ *:Bitrig:*:*)
++ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
++ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
++ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+@@ -304,7 +300,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+- arm:riscos:*:*|arm:RISCOS:*:*)
++ arm*:riscos:*:*|arm*:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+@@ -792,21 +788,26 @@ EOF
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+- case ${UNAME_MACHINE} in
+- pc98)
+- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++ UNAME_PROCESSOR=`/usr/bin/uname -p`
++ case ${UNAME_PROCESSOR} in
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
++ *:MINGW64*:*)
++ echo ${UNAME_MACHINE}-pc-mingw64
++ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
++ i*:MSYS*:*)
++ echo ${UNAME_MACHINE}-pc-msys
++ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+@@ -861,6 +862,13 @@ EOF
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
++ aarch64:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
++ aarch64_be:Linux:*:*)
++ UNAME_MACHINE=aarch64_be
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+@@ -895,13 +903,16 @@ EOF
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+- echo cris-axis-linux-gnu
++ echo ${UNAME_MACHINE}-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+- echo crisv32-axis-linux-gnu
++ echo ${UNAME_MACHINE}-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+- echo frv-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
++ hexagon:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+@@ -942,8 +953,11 @@ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
++ or1k:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
+ or32:Linux:*:*)
+- echo or32-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+@@ -978,13 +992,13 @@ EOF
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ tile*:Linux:*:*)
+- echo ${UNAME_MACHINE}-tilera-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+- echo x86_64-unknown-linux-gnu
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+@@ -1191,6 +1205,9 @@ EOF
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
++ x86_64:Haiku:*:*)
++ echo x86_64-unknown-haiku
++ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+@@ -1246,7 +1263,7 @@ EOF
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+- NSE-?:NONSTOP_KERNEL:*:*)
++ NSE-*:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+@@ -1315,11 +1332,11 @@ EOF
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
++ x86_64:VMkernel:*:*)
++ echo ${UNAME_MACHINE}-unknown-esx
++ exit ;;
+ esac
+
+-#echo '(No uname command or uname output not recognized.)' 1>&2
+-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+-
+ eval $set_cc_for_build
+ cat >$dummy.c <.
+ #
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+ # configuration script generated by Autoconf, you may include it under
+-# the same distribution terms that you use for the rest of that program.
++# the same distribution terms that you use for the rest of that
++# program. This Exception is an additional permission under section 7
++# of the GNU General Public License, version 3 ("GPLv3").
+
+
+-# Please send patches to . Submit a context
+-# diff and a properly formatted GNU ChangeLog entry.
++# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+ #
+ # Configuration subroutine to validate and canonicalize a configuration type.
+ # Supply the specified configuration type as an argument.
+@@ -75,9 +68,7 @@ Report bugs and patches to = 1.3.0
+BuildRequires: %{dbdep}, expat-devel, libuuid-devel
+
+%description
+The mission of the Apache Portable Runtime (APR) is to provide a
+free library of C data structures and routines. This library
+contains additional utility interfaces for APR; including support
+for XML, LDAP, database interfaces, URI parsing and more.
+
+%package devel
+Group: Development/Libraries
+Summary: APR utility library development kit
+Requires: apr-util%{?_isa} = %{version}-%{release}, apr-devel%{?_isa}, pkgconfig
+Requires: %{dbdep}%{?_isa}, expat-devel%{?_isa}, openldap-devel%{?_isa}
+
+%description devel
+This package provides the support files which can be used to
+build applications using the APR utility library. The mission
+of the Apache Portable Runtime (APR) is to provide a free
+library of C data structures and routines.
+
+%package pgsql
+Group: Development/Libraries
+Summary: APR utility library PostgreSQL DBD driver
+BuildRequires: postgresql-devel
+Requires: apr-util%{?_isa} = %{version}-%{release}
+
+%description pgsql
+This package provides the PostgreSQL driver for the apr-util
+DBD (database abstraction) interface.
+
+%package mysql
+Group: Development/Libraries
+Summary: APR utility library MySQL DBD driver
+BuildRequires: mysql-devel
+Requires: apr-util%{?_isa} = %{version}-%{release}
+
+%description mysql
+This package provides the MySQL driver for the apr-util DBD
+(database abstraction) interface.
+
+%package sqlite
+Group: Development/Libraries
+Summary: APR utility library SQLite DBD driver
+BuildRequires: sqlite-devel >= 3.0.0
+Requires: apr-util%{?_isa} = %{version}-%{release}
+
+%description sqlite
+This package provides the SQLite driver for the apr-util DBD
+(database abstraction) interface.
+
+%if %{with_freetds}
+
+%package freetds
+Group: Development/Libraries
+Summary: APR utility library FreeTDS DBD driver
+BuildRequires: freetds-devel
+Requires: apr-util%{?_isa} = %{version}-%{release}
+
+%description freetds
+This package provides the FreeTDS driver for the apr-util DBD
+(database abstraction) interface.
+
+%endif
+
+%package odbc
+Group: Development/Libraries
+Summary: APR utility library ODBC DBD driver
+BuildRequires: unixODBC-devel
+Requires: apr-util%{?_isa} = %{version}-%{release}
+
+%description odbc
+This package provides the ODBC driver for the apr-util DBD
+(database abstraction) interface.
+
+%package ldap
+Group: Development/Libraries
+Summary: APR utility library LDAP support
+BuildRequires: openldap-devel
+Requires: apr-util%{?_isa} = %{version}-%{release}
+
+%description ldap
+This package provides the LDAP support for the apr-util.
+
+%package openssl
+Group: Development/Libraries
+Summary: APR utility library OpenSSL crytpo support
+BuildRequires: openssl-devel
+Requires: apr-util%{?_isa} = %{version}-%{release}
+
+%description openssl
+This package provides the OpenSSL crypto support for the apr-util.
+
+%package nss
+Group: Development/Libraries
+Summary: APR utility library NSS crytpo support
+BuildRequires: nss-devel
+Requires: apr-util%{?_isa} = %{version}-%{release}
+
+%description nss
+This package provides the NSS crypto support for the apr-util.
+
+%prep
+%setup -q
+%patch1 -p1 -b .pkgconf
+%patch2 -p1 -b .nodbmdso
+%patch3 -p1 -b .aarch64
+%patch4 -p1 -b .private
+
+%build
+autoheader && autoconf
+# A fragile autoconf test which fails if the code trips
+# any other warning; force correct result for OpenLDAP:
+export ac_cv_ldap_set_rebind_proc_style=three
+%configure --with-apr=%{_prefix} \
+ --includedir=%{_includedir}/apr-%{apuver} \
+ --with-ldap=ldap_r --without-gdbm \
+ --with-sqlite3 --with-pgsql --with-mysql --with-odbc \
+%if %{with_freetds}
+ --with-freetds \
+%else
+ --without-freetds \
+%endif
+ --with-berkeley-db \
+ --without-sqlite2 \
+ --with-crypto --with-openssl --with-nss
+make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+
+mkdir -p $RPM_BUILD_ROOT/%{_datadir}/aclocal
+install -m 644 build/find_apu.m4 $RPM_BUILD_ROOT/%{_datadir}/aclocal
+
+# Unpackaged files; remove the static libaprutil
+rm -f $RPM_BUILD_ROOT%{_libdir}/aprutil.exp \
+ $RPM_BUILD_ROOT%{_libdir}/libapr*.a
+
+# And remove the reference to the static libaprutil from the .la
+# file.
+sed -i '/^old_library/s,libapr.*\.a,,' \
+ $RPM_BUILD_ROOT%{_libdir}/libapr*.la
+
+# Remove unnecessary exports from dependency_libs
+sed -ri '/^dependency_libs/{s,-l(pq|sqlite[0-9]|rt|dl|uuid) ,,g}' \
+ $RPM_BUILD_ROOT%{_libdir}/libapr*.la
+
+# Trim libtool DSO cruft
+rm -f $RPM_BUILD_ROOT%{_libdir}/apr-util-%{apuver}/*.*a
+
+%check
+# Run the less verbose test suites
+export MALLOC_CHECK_=2 MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
+cd test
+make %{?_smp_mflags} testall
+# testall breaks with DBD DSO; ignore
+export LD_LIBRARY_PATH="`echo "../dbm/.libs:../dbd/.libs:../ldap/.libs:$LD_LIBRARY_PATH" | sed -e 's/::*$//'`"
+./testall -v -q || true
+./testall testrmm
+./testall testdbm
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root,-)
+%doc CHANGES LICENSE NOTICE
+%{_libdir}/libaprutil-%{apuver}.so.*
+%dir %{_libdir}/apr-util-%{apuver}
+
+%files pgsql
+%defattr(-,root,root,-)
+%{_libdir}/apr-util-%{apuver}/apr_dbd_pgsql*
+
+%files mysql
+%defattr(-,root,root,-)
+%{_libdir}/apr-util-%{apuver}/apr_dbd_mysql*
+
+%files sqlite
+%defattr(-,root,root,-)
+%{_libdir}/apr-util-%{apuver}/apr_dbd_sqlite*
+
+%if %{with_freetds}
+
+%files freetds
+%defattr(-,root,root,-)
+%{_libdir}/apr-util-%{apuver}/apr_dbd_freetds*
+
+%endif
+
+%files odbc
+%defattr(-,root,root,-)
+%{_libdir}/apr-util-%{apuver}/apr_dbd_odbc*
+
+%files ldap
+%defattr(-,root,root,-)
+%{_libdir}/apr-util-%{apuver}/apr_ldap*
+
+%files openssl
+%defattr(-,root,root,-)
+%{_libdir}/apr-util-%{apuver}/apr_crypto_openssl*
+
+%files nss
+%defattr(-,root,root,-)
+%{_libdir}/apr-util-%{apuver}/apr_crypto_nss*
+
+%files devel
+%defattr(-,root,root,-)
+%{_bindir}/apu-%{apuver}-config
+%{_libdir}/libaprutil-%{apuver}.*a
+%{_libdir}/libaprutil-%{apuver}.so
+%{_includedir}/apr-%{apuver}/*.h
+%{_libdir}/pkgconfig/*.pc
+%{_datadir}/aclocal/*.m4
+
+%changelog
+* Fri Jan 24 2014 Daniel Mach - 1.5.2-6
+- Mass rebuild 2014-01-24
+
+* Wed Jan 15 2014 Honza Horak - 1.5.2-5
+- Rebuild for mariadb-libs
+ Related: #1045013
+
+* Fri Dec 27 2013 Daniel Mach - 1.5.2-4
+- Mass rebuild 2013-12-27
+
+* Thu May 09 2013 Jan Kaluza - 1.5.2-3
+- do not build with freetds when it is not available
+
+* Tue Apr 9 2013 Joe Orton - 1.5.2-2
+- update for aarch64
+
+* Tue Apr 9 2013 Joe Orton - 1.5.2-1
+- update to 1.5.2
+
+* Thu Feb 07 2013 Jon Ciesla - 1.4.1-8
+- Apply private patch from Merge Review BZ 225254.
+
+* Wed Nov 07 2012 Jan Kaluza - 1.4.1-7
+- ensure we use latest libdb5 (not libdb4)
+
+* Thu Oct 18 2012 Joe Orton - 1.4.1-6
+- use -lldap_r instead of -lldap
+
+* Wed Jul 18 2012 Fedora Release Engineering - 1.4.1-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Wed Jun 6 2012 Joe Orton - 1.4.1-4
+- fix crypt_r failure modes (#819650)
+
+* Tue Apr 24 2012 Joe Orton - 1.4.1-3
+- apply _isa to deps
+
+* Mon Apr 23 2012 Joe Orton - 1.4.1-2
+- switch to libdb-devel
+
+* Thu Jan 12 2012 Fedora Release Engineering - 1.4.1-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
+* Thu Dec 15 2011 Bojan Smojver - 1.4.1-1
+- bump up to 1.4.1
+
+* Fri May 20 2011 Bojan Smojver - 1.3.12-1
+- bump up to 1.3.12
+
+* Wed May 11 2011 Bojan Smojver - 1.3.11-2
+- fix crash in apr_ldap_rebind_init()
+
+* Mon May 9 2011 Bojan Smojver - 1.3.11-1
+- bump up to 1.3.11
+
+* Wed Mar 23 2011 Dan HorĂ¡k - 1.3.10-7
+- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient)
+
+* Wed Mar 23 2011 Joe Orton - 1.3.10-6
+- rebuild for MySQL soname bump
+
+* Wed Mar 2 2011 Joe Orton - 1.3.10-5
+- fix build
+
+* Wed Mar 2 2011 Joe Orton - 1.3.10-4
+- rebuild
+
+* Mon Feb 07 2011 Fedora Release Engineering - 1.3.10-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Wed Dec 29 2010 Bojan Smojver - 1.3.10-2
+- rebuild for MySQL 5.5.x
+
+* Tue Oct 5 2010 Joe Orton - 1.3.10-1
+- update to 1.3.10
+
+* Wed Nov 25 2009 Joe Orton - 1.3.9-3
+- rebuild for new BDB
+
+* Fri Aug 21 2009 Tomas Mraz - 1.3.9-2
+- rebuilt with new openssl
+
+* Thu Aug 6 2009 Bojan Smojver - 1.3.9-1
+- bump up to 1.3.9
+- CVE-2009-2412
+- allocator alignment fixes
+
+* Fri Jul 24 2009 Fedora Release Engineering - 1.3.8-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+
+* Wed Jul 15 2009 Bojan Smojver 1.3.8-2
+- adjust apr-util-1.3.7-nodbmdso.patch
+
+* Wed Jul 15 2009 Bojan Smojver 1.3.8-1
+- bump up to 1.3.8
+
+* Wed Jul 15 2009 Bojan Smojver 1.3.7-5
+- BR: +libuuid-devel, -e2fsprogs-devel
+
+* Tue Jun 9 2009 Joe Orton 1.3.7-4
+- disable DBM-drivers-as-DSO support
+- backport r783046 from upstream
+
+* Mon Jun 8 2009 Bojan Smojver - 1.3.7-3
+- make export of LD_LIBRARY_PATH simpler
+
+* Mon Jun 8 2009 Bojan Smojver - 1.3.7-2
+- revert tests
+
+* Mon Jun 8 2009 Bojan Smojver - 1.3.7-1
+- bump up to 1.3.7
+- CVE-2009-0023
+- "billion laughs" fix of apr_xml_* interface
+
+* Mon Feb 23 2009 Fedora Release Engineering - 1.3.4-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
+
+* Fri Jan 23 2009 Joe Orton 1.3.4-2
+- rebuild for new MySQL
+
+* Wed Aug 16 2008 Bojan Smojver - 1.3.4-1
+- bump up to 1.3.4
+- drop PostgreSQL patch, fixed upstream
+
+* Wed Jul 16 2008 Bojan Smojver - 1.3.2-8
+- beat the fuzz, rework apr-util-1.2.7-pkgconf.patch
+
+* Wed Jul 16 2008 Bojan Smojver - 1.3.2-7
+- ship find_apu.m4, fix bug #455189
+
+* Thu Jul 10 2008 Tom "spot" Callaway 1.3.2-6
+- rebuild for new db4-4.7
+
+* Tue Jul 8 2008 Joe Orton 1.3.2-5
+- restore requires for openldap-devel from -devel
+
+* Wed Jul 2 2008 Bojan Smojver - 1.3.2-4
+- properly fix PostgreSQL detection
+
+* Wed Jul 2 2008 Bojan Smojver - 1.3.2-3
+- revert build dependencies, change from -2 didn't help
+- add apr-util-1.3.2-pgsql.patch (remove pgsql_LIBS during detection)
+
+* Wed Jul 2 2008 Bojan Smojver - 1.3.2-2
+- try adding postgresql-server to build dependencies to pull some libs in
+
+* Thu Jun 19 2008 Bojan Smojver - 1.3.2-1
+- bump up to 1.3.2
+
+* Sun Jun 1 2008 Bojan Smojver - 1.3.0-1
+- bump up to 1.3.0
+
+* Tue Feb 19 2008 Fedora Release Engineering - 1.2.12-5
+- Autorebuild for GCC 4.3
+
+* Tue Dec 4 2007 Joe Orton 1.2.12-4
+- rebuild for OpenLDAP soname bump
+
+* Mon Dec 3 2007 Bojan Smojver - 1.2.12-3
+- remove all instances of MySQL flags being added to APRUTIL_LDFLAGS
+
+* Tue Nov 27 2007 Bojan Smojver - 1.2.12-1
+- bump up to 1.2.12
+- drop MySQL DBD driver, shipped upstream
+- adjust various patches to apply
+- rework tests in %%check (1.2.x got tests from trunk)
+
+* Mon Sep 24 2007 Jesse Keating - 1.2.10-2
+- Rebuild for upgrade path (add dist since that's now on F-7 branch)
+
+* Sun Sep 9 2007 Bojan Smojver 1.2.10-1
+- bump up to 1.2.10
+- pick up newly checked in MySQL DBD driver directly from ASF
+- remove dbdopen patch (fixed upstream)
+- remove xmlns patch (fixed upstream)
+- remove autoexpat patch (fixed upstream)
+
+* Sun Sep 2 2007 Joe Orton 1.2.8-12
+- rebuild for fixed APR 32-bit ABI
+- remove sqlite driver from main package (#274521)
+
+* Wed Aug 22 2007 Joe Orton 1.2.8-11
+- rebuild for expat soname bump
+
+* Tue Aug 21 2007 Joe Orton 1.2.8-10
+- fix License
+
+* Wed Aug 8 2007 Joe Orton 1.2.8-9
+- add rewrite of expat autoconf code (upstream r493791)
+- fix build for new glibc open()-as-macro
+- split out sqlite subpackage
+
+* Tue Jul 3 2007 Joe Orton 1.2.8-8
+- add fix for attribute namespace handling in apr_xml (PR 41908)
+
+* Thu Apr 5 2007 Joe Orton 1.2.8-7
+- remove old Conflicts, doxygen BR (#225254)
+
+* Fri Mar 23 2007 Joe Orton 1.2.8-6
+- add DBD DSO lifetime fix (r521327)
+
+* Thu Mar 22 2007 Joe Orton 1.2.8-5
+- drop doxygen documentation (which caused multilib conflicts)
+
+* Wed Feb 28 2007 Joe Orton 1.2.8-4
+- add mysql driver in -mysql subpackage (Bojan Smojver, #222237)
+
+* Tue Feb 27 2007 Joe Orton 1.2.8-3
+- build DBD drivers as DSOs (w/Bojan Smojver, #192922)
+- split out pgsql driver into -pgsql subpackage
+
+* Tue Dec 5 2006 Joe Orton 1.2.8-2
+- update to 1.2.8, pick up new libpq soname
+
+* Fri Dec 1 2006 Joe Orton 1.2.7-5
+- really rebuild for db45
+
+* Sat Nov 11 2006 Joe Orton 1.2.7-4
+- add support for BDB 4.5 from upstream, rebuild
+
+* Wed Jul 19 2006 Joe Orton 1.2.7-3
+- fix buildconf with autoconf 2.60
+
+* Wed Jul 12 2006 Jesse Keating - 1.2.7-2.1
+- rebuild
+
+* Tue May 2 2006 Joe Orton 1.2.7-2
+- update to 1.2.7
+- use pkg-config in apu-1-config to make it libdir-agnostic
+
+* Thu Apr 6 2006 Joe Orton 1.2.6-2
+- update to 1.2.6
+- define LDAP_DEPRECATED in apr_ldap.h (r391985, #188073)
+
+* Fri Feb 10 2006 Jesse Keating - 1.2.2-4.2
+- bump again for double-long bug on ppc(64)
+
+* Tue Feb 07 2006 Jesse Keating - 1.2.2-4.1
+- rebuilt for new gcc4.1 snapshot and glibc changes
+
+* Mon Jan 30 2006 Joe Orton 1.2.2-4
+- rebuild to drop reference to libexpat.la
+
+* Wed Jan 18 2006 Joe Orton 1.2.2-3
+- disable sqlite2 support
+- BuildRequire e2fsprogs-devel
+- enable malloc paranoia in %%check
+
+* Tue Jan 3 2006 Jesse Keating 1.2.2-2.2
+- rebuilt again
+
+* Fri Dec 09 2005 Jesse Keating
+- rebuilt
+
+* Tue Dec 6 2005 Joe Orton 1.2.2-2
+- trim exports from .la file/--libs output (#174924)
+
+* Fri Nov 25 2005 Joe Orton 1.2.2-1
+- update to 1.2.2
+
+* Thu Oct 20 2005 Joe Orton 0.9.7-3
+- fix epoch again
+
+* Thu Oct 20 2005 Joe Orton 0.9.7-2
+- update to 0.9.7
+- drop static libs (#170051)
+
+* Tue Jul 26 2005 Joe Orton 0.9.6-3
+- add FILE bucket fix for truncated files (#159191)
+- add epoch to dependencies
+
+* Fri Mar 4 2005 Joe Orton 0.9.6-2
+- rebuild
+
+* Wed Feb 9 2005 Joe Orton 0.9.6-1
+- update to 0.9.6
+
+* Wed Jan 19 2005 Joe Orton 0.9.5-3
+- restore db-4.3 detection lost in 0.9.5 upgrade
+
+* Wed Jan 19 2005 Joe Orton 0.9.5-2
+- rebuild
+
+* Mon Nov 22 2004 Joe Orton 0.9.5-1
+- update to 0.9.5
+
+* Thu Nov 11 2004 Jeff Johnson 0.9.4-19
+- actually explicitly check for and detect db-4.3.
+
+* Thu Nov 11 2004 Jeff Johnson 0.9.4-18
+- rebuild against db-4.3.21.
+
+* Fri Sep 17 2004 Joe Orton 0.9.4-17
+- add security fix for CAN-2004-0786
+
+* Sat Jun 19 2004 Joe Orton 0.9.4-16
+- have -devel require matching release of apr-util
+
+* Tue Jun 15 2004 Elliot Lee
+- rebuilt
+
+* Thu Apr 1 2004 Joe Orton 0.9.4-14
+- fix use of SHA1 passwords (#119651)
+
+* Tue Mar 30 2004 Joe Orton 0.9.4-13
+- remove fundamentally broken check_sbcs() from xlate code
+
+* Fri Mar 19 2004 Joe Orton 0.9.4-12
+- tweak xlate fix
+
+* Fri Mar 19 2004 Joe Orton 0.9.4-11
+- rebuild with xlate fixes and tests enabled
+
+* Tue Mar 02 2004 Elliot Lee 0.9.4-10.1
+- rebuilt
+
+* Tue Mar 2 2004 Joe Orton 0.9.4-10
+- rename sdbm_* symbols to apu__sdbm_*
+
+* Mon Feb 16 2004 Joe Orton 0.9.4-9
+- fix sdbm apr_dbm_exists() on s390x/ppc64
+
+* Fri Feb 13 2004 Elliot Lee 0.9.4-8
+- rebuilt
+
+* Thu Feb 5 2004 Joe Orton 0.9.4-7
+- fix warnings from use of apr_optional*.h with gcc 3.4
+
+* Thu Jan 29 2004 Joe Orton 0.9.4-6
+- drop gdbm support
+
+* Thu Jan 8 2004 Joe Orton 0.9.4-5
+- fix DB library detection
+
+* Sat Dec 13 2003 Jeff Johnson 0.9.4-4
+- rebuild against db-4.2.52.
+
+* Mon Oct 13 2003 Jeff Johnson 0.9.4-3
+- rebuild against db-4.2.42.
+
+* Mon Oct 6 2003 Joe Orton 0.9.4-2
+- fix 'apu-config --apu-la-file' output
+
+* Mon Oct 6 2003 Joe Orton 0.9.4-1
+- update to 0.9.4.
+
+* Tue Jul 22 2003 Nalin Dahyabhai 0.9.3-10
+- rebuild
+
+* Mon Jul 7 2003 Joe Orton 0.9.3-9
+- rebuild
+- don't run testuuid test because of #98677
+
+* Thu Jul 3 2003 Joe Orton 0.9.3-8
+- rebuild
+
+* Wed Jun 04 2003 Elliot Lee
+- rebuilt
+
+* Tue May 20 2003 Joe Orton 0.9.3-6
+- fix to detect crypt_r correctly (CAN-2003-0195)
+
+* Thu May 15 2003 Joe Orton 0.9.3-5
+- fix to try linking against -ldb first (#90917)
+- depend on openldap, gdbm, db4, expat appropriately.
+
+* Tue May 13 2003 Joe Orton 0.9.3-4
+- rebuild
+
+* Wed May 7 2003 Joe Orton 0.9.3-3
+- make devel package conflict with old subversion-devel
+- run the less crufty parts of the test suite
+
+* Tue Apr 29 2003 Joe Orton 0.9.3-2
+- run ldconfig in post/postun
+
+* Mon Apr 28 2003 Joe Orton 0.9.3-1
+- initial build