%bcond_with sqlite2 # with SQLite 2.x DBD module
%bcond_without sqlite3 # without SQLite3 DBD module
%bcond_without ldap # without LDAP module
-#
+%bcond_without tests
+
+# define dbver db50
+%if 0%{!?dbver:1}
+ %if "%{pld_release}" == "th"
+ %define dbver db47
+ %endif
+ %if "%{pld_release}" == "ti"
+ %define dbver db45
+ %endif
+ %if "%{pld_release}" == "ac"
+ %define dbver db42
+ %endif
+%endif
+
Summary: A companion library to Apache Portable Runtime
Summary(pl.UTF-8): Biblioteka towarzysząca Apache Portable Runtime
Name: apr-util
-Version: 1.3.4
-Release: 3
+Version: 1.3.12
+Release: 2
Epoch: 1
License: Apache v2.0
Group: Libraries
Source0: http://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2
-# Source0-md5: adfbe525cf3914cf769340e8f6a6d14b
+# Source0-md5: 0f671b037ca62751a8a7005578085560
Patch0: %{name}-link.patch
Patch1: %{name}-config-noldap.patch
Patch2: %{name}-libtool.patch
+Patch3: %{name}-flags.patch
URL: http://apr.apache.org/
BuildRequires: apr-devel >= 1:1.3.0
-BuildRequires: autoconf
-%if "%{pld_release}" == "ti"
-BuildRequires: db-devel >= 4.5
-%else
+BuildRequires: autoconf >= 2.59
%if "%{pld_release}" == "th"
BuildRequires: db-devel >= 4.7
-%else
-BuildRequires: db-devel
%endif
+%if "%{pld_release}" == "ti"
+BuildRequires: db-devel >= 4.5
+%endif
+%if "%{pld_release}" == "ac"
+BuildRequires: db-devel >= 4.2
+BuildConflicts: db4.5-devel
%endif
BuildRequires: expat-devel
%{?with_freetds:BuildRequires: freetds-devel}
BuildRequires: libtool
%{?with_mysql:BuildRequires: mysql-devel}
%{?with_ldap:BuildRequires: openldap-devel >= 2.3.0}
-%{?with_odbc:BuildRequires: unixODBC-devel}
%{?with_pgsql:BuildRequires: postgresql-devel}
BuildRequires: rpm >= 4.4.9-56
%{?with_sqlite2:BuildRequires: sqlite-devel >= 2}
%{?with_sqlite3:BuildRequires: sqlite3-devel >= 3}
+%{?with_odbc:BuildRequires: unixODBC-devel}
+BuildRequires: which
Requires: apr >= 1:1.3.0
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Biblioteka towarzysząca dla biblioteki Apache Portable Runtime
(przenośnej biblioteki uruchomieniowej).
+%package dbm-db
+Summary: DBM driver for DB
+Summary(pl.UTF-8): Sterownik DBM dla DB
+Group: Libraries
+Requires: %{name} = %{epoch}:%{version}-%{release}
+
+%description dbm-db
+DBM driver for DB.
+
+%description dbm-db -l pl.UTF-8
+Sterownik DBM dla DB.
+
%package dbd-freetds
Summary: DBD driver for FreeTDS (Sybase/MS SQL)
Summary(pl.UTF-8): Sterownik DBD dla FreeTDS (Sybase/MS SQL)
Group: Development/Libraries
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: apr-devel >= 1:1.3.0
-Requires: db-devel
Requires: expat-devel
%description devel
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
-rm -rf xml/expat
+# be sure to link with db version requested
+%{__sed} -i -e 's/db4 db\|db5 db//' build/dbm.m4
+
+%{__rm} -r xml/expat
echo '
<Layout PLD>
--enable-layout=PLD \
--with-apr=%{_bindir}/apr-1-config \
--with-berkeley-db=%{_prefix} \
-%if "%{pld_release}" == "ti"
- --with-dbm=db45 \
-%else
-%if "%{pld_release}" == "th"
- --with-dbm=db47 \
-%else
- --with-dbm=db4 \
-%endif
-%endif
+ --with-dbm=%{dbver} \
--with-iconv=%{_prefix} \
%if %{with ldap}
--with-ldap \
%{__make} \
CC="%{__cc}"
+%{?with_tests:%{__make} -j1 check}
+
%install
rm -rf $RPM_BUILD_ROOT
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-rm $RPM_BUILD_ROOT%{_libdir}/apr-util-1/*.{la,a}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/apr-util-1/*.{la,a}
%clean
rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %ghost %{_libdir}/libaprutil-1.so.0
%dir %{_libdir}/apr-util-1
+%files dbm-db
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/apr-util-1/apr_dbm_db-1.so
+%attr(755,root,root) %{_libdir}/apr-util-1/apr_dbm_db.so
+
%if %{with freetds}
%files dbd-freetds
%defattr(644,root,root,755)
%if %{with mysql}
%files dbd-mysql
%defattr(644,root,root,755)
-%doc README.MySQL
%attr(755,root,root) %{_libdir}/apr-util-1/apr_dbd_mysql-1.so
%attr(755,root,root) %{_libdir}/apr-util-1/apr_dbd_mysql.so
%endif