-
Notifications
You must be signed in to change notification settings - Fork 2
/
apr-util.spec
235 lines (188 loc) · 6.18 KB
/
apr-util.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
%if 0%{?fedora} < 18 && 0%{?rhel} < 7
%define dbdep db4-devel
%else
%define dbdep libdb-devel
%endif
%if 0%{?rhel}
%define with_freetds 0
%else
%define with_freetds 1
%endif
%define apuver 1
Summary: Apache Portable Runtime Utility library
Name: apr-util
Version: 1.5.4
Release: 1.%{dist}
License: ASL 2.0
Vendor: %{vendor}
Packager: %{packager}
Group: System Environment/Libraries
URL: http://apr.apache.org/
Source0: http://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2
Patch1: apr-util-1.2.7-pkgconf.patch
Patch2: apr-util-1.3.7-nodbmdso.patch
Patch4: apr-util-1.4.1-private.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: autoconf, apr-devel >= 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}
%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 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
%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:
%configure --with-apr=%{_prefix} \
--includedir=%{_includedir}/apr-%{apuver} \
--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:$LD_LIBRARY_PATH" | sed -e 's/::*$//'`"
./testall -v -q || true
./testall testrmm
./testall testdbm
%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
[ "%{_builddir}/%{name}-%{version}" != "/" ] && %__rm -rf %{_builddir}/%{name}-%{version}
%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 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