Skip to content

Commit fefeef1

Browse files
committed
RPM spec file: modernise build for APR v2.0.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1924452 13f79535-47bb-0310-9956-ffa450edef68
1 parent f7d8cbe commit fefeef1

File tree

1 file changed

+94
-90
lines changed

1 file changed

+94
-90
lines changed

build/rpm/apr.spec.in

+94-90
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
Summary: Apache Portable Runtime library
55
Name: apr
66
Version: APR_VERSION
7-
Release: APR_RELEASE
8-
License: Apache Software License
9-
Group: System Environment/Libraries
7+
Release: APR_RELEASE%{?dist}
8+
License: Apache-2.0 AND (Beerware AND LicenseRef-Fedora-Public-Domain AND OLDAP-2.7 AND BSD-4.3RENO)
109
URL: http://apr.apache.org/
11-
Source0: http://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2
12-
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
13-
BuildRequires: autoconf, libtool, doxygen, libuuid-devel, python
10+
Source0: https://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2
11+
BuildRequires: gcc
12+
BuildRequires: autoconf
13+
BuildRequires: pkgconfig(expat), pkgconfig(uuid)
14+
BuildRequires: pkgconfig(libxcrypt)
15+
Recommends: apr-openssl%{_isa} = %{version}-%{release}
16+
Recommends: apr-lmdb%{_isa} = %{version}-%{release}
1417

1518
%description
1619
The mission of the Apache Portable Runtime (APR) is to provide a
@@ -19,176 +22,177 @@ portability layer to as many operating systems as possible,
1922
including Unices, MS Win32, BeOS and OS/2.
2023

2124
%package devel
22-
Group: Development/Libraries
2325
Summary: APR library development kit
24-
Requires: apr = %{version}
26+
Requires: apr%{?_isa} = %{version}-%{release}, pkgconfig
2527

2628
%description devel
2729
This package provides the support files which can be used to
28-
build applications using the APR library. The mission of the
29-
Apache Portable Runtime (APR) is to provide a free library of
30-
C data structures and routines.
30+
build applications using the APR library. The mission
31+
of the Apache Portable Runtime (APR) is to provide a free
32+
library of C data structures and routines.
3133

32-
%package dbm
33-
Group: Development/Libraries
34-
Summary: APR utility library DBM driver
35-
BuildRequires: db4-devel
36-
Requires: apr-util = %{version}-%{release}
34+
%package lmdb
35+
Summary: APR library LMDB driver
36+
BuildRequires: pkgconfig(lmdb)
37+
Requires: apr%{?_isa} = %{version}-%{release}
38+
Provides: apr-%{aprver}(lmdb) = %{version}-%{release}
3739

38-
%description dbm
39-
This package provides the DBM driver for the apr-util.
40+
%description lmdb
41+
This package provides the LMDB driver for the apr
42+
DBM (database abstraction) interface.
4043

4144
%package pgsql
42-
Group: Development/Libraries
43-
Summary: APR utility library PostgreSQL DBD driver
44-
BuildRequires: postgresql-devel
45-
Requires: apr-util = %{version}-%{release}
45+
Summary: APR library PostgreSQL DBD driver
46+
BuildRequires: pkgconfig(libpq)
47+
Requires: apr%{?_isa} = %{version}-%{release}
48+
Provides: apr-%{aprver}(pgsql) = %{version}-%{release}
4649

4750
%description pgsql
48-
This package provides the PostgreSQL driver for the apr-util
51+
This package provides the PostgreSQL driver for the apr
4952
DBD (database abstraction) interface.
5053

5154
%package mysql
52-
Group: Development/Libraries
53-
Summary: APR utility library MySQL DBD driver
54-
BuildRequires: mysql-devel
55-
Requires: apr-util = %{version}-%{release}
55+
Summary: APR library MySQL DBD driver
56+
BuildRequires: pkgconfig(mariadb)
57+
Requires: apr%{?_isa} = %{version}-%{release}
58+
Provides: apr-%{aprver}(mysql) = %{version}-%{release}
5659

5760
%description mysql
58-
This package provides the MySQL driver for the apr-util DBD
61+
This package provides the MySQL driver for the apr DBD
5962
(database abstraction) interface.
6063

6164
%package sqlite
62-
Group: Development/Libraries
63-
Summary: APR utility library SQLite DBD driver
64-
BuildRequires: sqlite-devel >= 3.0.0
65-
Requires: apr-util = %{version}-%{release}
65+
Summary: APR library SQLite DBD driver
66+
BuildRequires: pkgconfig(sqlite3)
67+
Requires: apr%{?_isa} = %{version}-%{release}
68+
Provides: apr-%{aprver}(sqlite) = %{version}-%{release}
6669

6770
%description sqlite
68-
This package provides the SQLite driver for the apr-util DBD
71+
This package provides the SQLite driver for the apr DBD
6972
(database abstraction) interface.
7073

7174
%package odbc
72-
Group: Development/Libraries
73-
Summary: APR utility library ODBC DBD driver
74-
BuildRequires: unixODBC-devel
75-
Requires: apr-util = %{version}-%{release}
75+
Summary: APR library ODBC DBD driver
76+
BuildRequires: pkgconfig(odbc)
77+
Requires: apr%{?_isa} = %{version}-%{release}
78+
Provides: apr-%{aprver}(odbc) = %{version}-%{release}
7679

7780
%description odbc
78-
This package provides the ODBC driver for the apr-util DBD
81+
This package provides the ODBC driver for the apr DBD
7982
(database abstraction) interface.
8083

84+
%package ldap
85+
Summary: APR library LDAP support
86+
BuildRequires: pkgconfig(ldap)
87+
Requires: apr%{?_isa} = %{version}-%{release}
88+
Provides: apr-%{aprver}(ldap) = %{version}-%{release}
89+
90+
%description ldap
91+
This package provides the LDAP support for the apr.
92+
8193
%package openssl
82-
Group: Development/Libraries
83-
Summary: APR utility library OpenSSL crypto support
84-
BuildRequires: openssl-devel
85-
Requires: apr-util = %{version}-%{release}
94+
Summary: APR library OpenSSL crypto support
95+
BuildRequires: pkgconfig(libcrypto)
96+
Requires: apr%{?_isa} = %{version}-%{release}
97+
Provides: apr-%{aprver}(openssl) = %{version}-%{release}
8698

8799
%description openssl
88-
This package provides crypto support for apr-util based on OpenSSL.
100+
This package provides the OpenSSL crypto support for the apr.
89101

90102
%package nss
91-
Group: Development/Libraries
92-
Summary: APR utility library NSS crypto support
93-
BuildRequires: nss-devel
94-
Requires: apr-util = %{version}-%{release}
103+
Summary: APR library NSS crypto support
104+
BuildRequires: pkgconfig(nss)
105+
Requires: apr%{?_isa} = %{version}-%{release}
106+
Provides: apr-%{aprver}(nss) = %{version}-%{release}
95107

96108
%description nss
97-
This package provides crypto support for apr-util based on Mozilla NSS.
109+
This package provides the NSS crypto support for the apr.
98110

99111
%prep
100112
%setup -q
101113

102114
%build
103115
# regenerate configure script etc.
104-
./buildconf
116+
autoheader && autoconf
105117
%configure \
106118
--prefix=/usr \
107119
--includedir=%{_includedir}/apr-%{aprver} \
108120
--with-installbuilddir=%{_libdir}/apr/build-%{aprver} \
109121
--with-devrandom=/dev/urandom \
110122
--without-gdbm \
111123
--with-sqlite3 --with-pgsql --with-mysql --with-odbc \
112-
--with-berkeley-db \
124+
--with-lmdb \
113125
--with-crypto --with-openssl --with-nss \
114-
--without-sqlite2
115-
CC=gcc CXX=g++
116-
make %{?_smp_mflags} && make dox
117-
118-
%check
119-
# Run non-interactive tests
120-
pushd test
121-
make %{?_smp_mflags} all CFLAGS=-fno-strict-aliasing
122-
make check || exit 1
123-
popd
126+
--with-ldap \
127+
--without-sqlite2 \
128+
|| { cat config.log; exit 1; }
129+
%{make_build}
124130

125131
%install
126132
rm -rf $RPM_BUILD_ROOT
127-
make install DESTDIR=$RPM_BUILD_ROOT
133+
%{make_install}
128134

129-
# Move docs to more convenient location
130-
mv docs/dox/html html
135+
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/aclocal
136+
install -m 644 build/find_apr.m4 $RPM_BUILD_ROOT/%{_datadir}/aclocal
131137

132-
# Unpackaged files:
133-
rm -f $RPM_BUILD_ROOT%{_libdir}/apr.exp
138+
# Unpackaged files; remove the static libapr
139+
rm -f $RPM_BUILD_ROOT%{_libdir}/apr.exp \
140+
$RPM_BUILD_ROOT%{_libdir}/libapr*.a \
141+
$RPM_BUILD_ROOT%{_libdir}/libapr-%{aprver}.la
134142

135-
%clean
136-
rm -rf $RPM_BUILD_ROOT
143+
# Remove build directory
144+
rm -rf $RPM_BUILD_ROOT%{_libdir}/apr
137145

138-
%post -p /sbin/ldconfig
146+
%check
147+
# Run the less verbose test suites
148+
export MALLOC_CHECK_=2 MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
149+
cd test
150+
%{make_build}
151+
export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}/apr-%{aprver}
152+
./testall -v -q
139153

140-
%postun -p /sbin/ldconfig
154+
%ldconfig_scriptlets
141155

142156
%files
143-
%defattr(-,root,root,-)
144157
%doc CHANGES LICENSE NOTICE
145158
%{_libdir}/libapr-%{aprver}.so.*
146159
%dir %{_libdir}/apr-%{aprver}
147160

148-
%files dbm
149-
%defattr(-,root,root,-)
150-
%{_libdir}/apr-%{aprver}/apr_dbm_db*
161+
%files lmdb
162+
%{_libdir}/apr-%{aprver}/apr_dbm_lmdb*
151163

152164
%files pgsql
153-
%defattr(-,root,root,-)
154165
%{_libdir}/apr-%{aprver}/apr_dbd_pgsql*
155166

156167
%files mysql
157-
%defattr(-,root,root,-)
158168
%{_libdir}/apr-%{aprver}/apr_dbd_mysql*
159169

160170
%files sqlite
161-
%defattr(-,root,root,-)
162171
%{_libdir}/apr-%{aprver}/apr_dbd_sqlite*
163172

164173
%files odbc
165-
%defattr(-,root,root,-)
166174
%{_libdir}/apr-%{aprver}/apr_dbd_odbc*
167175

176+
%files ldap
177+
%{_libdir}/apr-%{aprver}/apr_ldap*
178+
168179
%files openssl
169-
%defattr(-,root,root,-)
170180
%{_libdir}/apr-%{aprver}/apr_crypto_openssl*
171181

172182
%files nss
173-
%defattr(-,root,root,-)
174183
%{_libdir}/apr-%{aprver}/apr_crypto_nss*
175184

176185
%files devel
177-
%defattr(-,root,root,-)
178-
%doc docs/APRDesign.html docs/canonical_filenames.html
179-
%doc docs/incomplete_types docs/non_apr_programs
180-
%doc html
181-
%{_bindir}/apr*config
182-
%{_libdir}/libapr-%{aprver}.*a
186+
%{_bindir}/apr-%{aprver}-config
183187
%{_libdir}/libapr-%{aprver}.so
184-
%dir %{_libdir}/apr
185-
%dir %{_libdir}/apr/build-%{aprver}
186-
%{_libdir}/apr/build-%{aprver}/*
187-
%{_libdir}/pkgconfig/apr-%{aprver}.pc
188-
%dir %{_includedir}/apr-%{aprver}
189188
%{_includedir}/apr-%{aprver}/*.h
189+
%{_libdir}/pkgconfig/*.pc
190+
%{_datadir}/aclocal/*.m4
190191

191192
%changelog
193+
* Tue Mar 18 2025 Graham Leggett <[email protected]> 2.0.0
194+
- update to support v2.0.0 of APR
195+
192196
* Sat Aug 30 2008 Graham Leggett <[email protected]> 1.3.3
193197
- update to depend on the bzip2 binary
194198
- build depends on python

0 commit comments

Comments
 (0)