]> git.pld-linux.org Git - packages/apr-util.git/blob - apr-util.spec
- rebuild
[packages/apr-util.git] / apr-util.spec
1 #
2 # Conditional build:
3 %bcond_without  ldap    # without LDAP support
4 %bcond_without  mysql   # with MySQL support
5 %bcond_without  pgsql   # without PostgreSQL support
6 %bcond_with     sqlite2 # with SQLite 2.x support
7 %bcond_without  sqlite3 # without SQLite3 support
8 %bcond_without  dso     # experimental dso linking
9 #
10 Summary:        A companion library to Apache Portable Runtime
11 Summary(pl):    Biblioteka towarzysz±ca Apache Portable Runtime
12 Name:           apr-util
13 Version:        1.2.8
14 Release:        2
15 Epoch:          1
16 License:        Apache v2.0
17 Group:          Libraries
18 Source0:        http://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2
19 # Source0-md5:  b122f35ee6883a216cd2e7d44504521e
20 # http://apache.webthing.com/database/apr_dbd_mysql.c
21 Source1:        apr_dbd_mysql.c
22 Patch0:         %{name}-link.patch
23 Patch1:         %{name}-dso.patch
24 Patch2:         %{name}-dbd.patch
25 Patch3:         %{name}-db45.patch
26 URL:            http://apr.apache.org/
27 BuildRequires:  apr-devel >= 1:1.1.0
28 %{?with_mysql:BuildRequires:    apr-devel >= 1:1.2.2-2.6}
29 BuildRequires:  autoconf
30 BuildRequires:  db-devel >= 4.5
31 BuildRequires:  expat-devel
32 BuildRequires:  gdbm-devel
33 BuildRequires:  libtool
34 %{?with_mysql:BuildRequires:    mysql-devel}
35 %{?with_ldap:BuildRequires:     openldap-devel >= 2.3.0}
36 %{?with_pgsql:BuildRequires:    postgresql-devel}
37 BuildRequires:  sed >= 4.0
38 %{?with_sqlite2:BuildRequires:  sqlite-devel >= 2}
39 %{?with_sqlite3:BuildRequires:  sqlite3-devel >= 3}
40 Requires:       apr >= 1:1.1.0
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %define         _includedir     /usr/include/apr-util
44
45 %description
46 A companion library to Apache Portable Runtime.
47
48 %description -l pl
49 Biblioteka towarzysz±ca dla biblioteki Apache Portable Runtime
50 (przeno¶nej biblioteki uruchomieniowej).
51
52 %package dbd-mysql
53 Summary:        DBD driver for MySQL
54 Summary(pl):    Sterownik DBD dla MySQL-a
55 License:        GPL
56 Group:          Libraries
57 Requires:       %{name} = %{epoch}:%{version}-%{release}
58
59 %description dbd-mysql
60 DBD driver for MySQL.
61
62 %description dbd-mysql -l pl
63 Sterownik DBD dla MySQL-a.
64
65 %package dbd-pgsql
66 Summary:        DBD driver for PostgreSQL
67 Summary(pl):    Sterownik DBD dla PostgreSQL-a
68 Group:          Libraries
69 Requires:       %{name} = %{epoch}:%{version}-%{release}
70
71 %description dbd-pgsql
72 DBD driver for PostgreSQL.
73
74 %description dbd-pgsql -l pl
75 Sterownik DBD dla PostgreSQL-a.
76
77 %package dbd-sqlite2
78 Summary:        DBD driver for SQLite 2
79 Summary(pl):    Sterownik DBD dla SQLite 2
80 Group:          Libraries
81 Requires:       %{name} = %{epoch}:%{version}-%{release}
82
83 %description dbd-sqlite2
84 DBD driver for SQLite 2.
85
86 %description dbd-sqlite2 -l pl
87 Sterownik DBD dla SQLite 2.
88
89 %package dbd-sqlite3
90 Summary:        DBD driver for SQLite 3
91 Summary(pl):    Sterownik DBD dla SQLite 3
92 Group:          Libraries
93 Requires:       %{name} = %{epoch}:%{version}-%{release}
94
95 %description dbd-sqlite3
96 DBD driver for SQLite 3.
97
98 %description dbd-sqlite3 -l pl
99 Sterownik DBD dla SQLite 3.
100
101 %package devel
102 Summary:        Header files and development documentation for apr-util
103 Summary(pl):    Pliki nag³ówkowe i dokumentacja programisty do apr-util
104 Group:          Development/Libraries
105 Requires:       %{name} = %{epoch}:%{version}-%{release}
106 Requires:       apr-devel >= 1:1.1.0
107 Requires:       db-devel
108 Requires:       expat-devel
109 Requires:       gdbm-devel
110 %{?with_ldap:Requires:  openldap-devel >= 2.3.0}
111
112 %description devel
113 Header files and development documentation for apr-util.
114
115 %description devel -l pl
116 Pliki nag³ówkowe i dokumentacja programisty do apr-util.
117
118 %package static
119 Summary:        Static apr-util library
120 Summary(pl):    Statyczna biblioteka apr-util
121 Group:          Development/Libraries
122 Requires:       %{name}-devel = %{epoch}:%{version}-%{release}
123
124 %description static
125 Static apr-util library.
126
127 %description static -l pl
128 Statyczna biblioteka apr-util.
129
130 %prep
131 %setup -q
132 %patch0 -p1
133 %if %{with mysql}
134 cp %{SOURCE1} dbd/apr_dbd_mysql.c
135 %else
136 # not needed, gen-build.py is not packaged in apr-util
137 # (and it shouldn't: apr-devel should have it -glen)
138 %{__sed} -i -e 's/^\(.*gen-build\.py\)/#\1/' buildconf
139 %endif
140 %if %{with dso}
141 %patch1 -p1
142 %patch2 -p1
143 %endif
144 %patch3 -p1
145
146 rm -rf xml/expat
147
148 echo '
149 <Layout PLD>
150     prefix:        %{_prefix}
151     exec_prefix:   %{_exec_prefix}
152     bindir:        %{_bindir}
153     sbindir:       %{_sbindir}
154     libdir:        %{_libdir}
155     libexecdir:    %{_libdir}/apr
156     mandir:        %{_mandir}
157     sysconfdir:    %{_sysconfdir}
158     datadir:       %{_datadir}
159     installbuilddir: %{_datadir}/build
160     includedir:    %{_includedir}
161     localstatedir: %{_localstatedir}
162     runtimedir:    %{_localstatedir}/run
163     libsuffix:     -${APRUTIL_MAJOR_VERSION}
164 </Layout>
165 ' > config.layout
166
167 %build
168 ./buildconf \
169         --with-apr=%{_datadir}/apr
170 %if %{with dso}
171 %{__sed} -i -e '/OBJECTS_all/s, dbd/apr_dbd_[^ ]*\.lo,,g' build-outputs.mk
172 %endif
173
174 %configure \
175         --enable-layout=PLD \
176         --with-apr=%{_bindir}/apr-1-config \
177 %if %{with ldap}
178         --with-ldap \
179         --with-ldap-include=%{_prefix}/include \
180         --with-ldap-lib=%{_libdir} \
181 %endif
182         --with-iconv=%{_prefix} \
183         --with-berkeley-db=%{_prefix} \
184         --with-dbm=db45 \
185         %{?with_mysql:--with-mysql=%{_prefix}} \
186         %{!?with_pgsql:--without-pgsql} \
187         %{!?with_sqlite2:--without-sqlite2} \
188         %{!?with_sqlite3:--without-sqlite3}
189
190 %{__make} \
191         CC="%{__cc}"
192
193 %if %{with dso}
194 %if %{with mysql}
195 %{__make} dbd/apr_dbd_mysql.lo
196 libtool --mode=link --tag=CC %{__cc} -rpath %{_libdir} -avoid-version dbd/apr_dbd_mysql.lo -lmysqlclient_r -o dbd/libapr_dbd_mysql.la
197 %endif
198 %if %{with pgsql}
199 %{__make} dbd/apr_dbd_pgsql.lo
200 libtool --mode=link --tag=CC %{__cc} -rpath %{_libdir} -avoid-version dbd/apr_dbd_pgsql.lo -lpq  -o dbd/libapr_dbd_pgsql.la
201 %endif
202 %if %{with sqlite2}
203 %{__make} dbd/apr_dbd_sqlite2.lo
204 libtool --mode=link --tag=CC %{__cc} -rpath %{_libdir} -avoid-version dbd/apr_dbd_sqlite2.lo -o dbd/libapr_dbd_sqlite2.la
205 %endif
206 %if %{with sqlite3}
207 %{__make} dbd/apr_dbd_sqlite3.lo
208 libtool --mode=link --tag=CC %{__cc} -rpath %{_libdir} -avoid-version dbd/apr_dbd_sqlite3.lo -lsqlite3 -o dbd/libapr_dbd_sqlite3.la
209 %endif
210 %endif
211
212 %install
213 rm -rf $RPM_BUILD_ROOT
214
215 %{__make} install \
216         DESTDIR=$RPM_BUILD_ROOT
217  
218 %if %{with dso}
219 install -d $RPM_BUILD_ROOT%{_libdir}
220 %if %{with mysql}
221 libtool --mode=install /usr/bin/install -c -m 755 dbd/libapr_dbd_mysql.la $RPM_BUILD_ROOT%{_libdir}
222 mv $RPM_BUILD_ROOT%{_libdir}/{lib,}apr_dbd_mysql.so
223 %endif
224 %if %{with pgsql}
225 libtool --mode=install /usr/bin/install -c -m 755 dbd/libapr_dbd_pgsql.la $RPM_BUILD_ROOT%{_libdir}
226 mv $RPM_BUILD_ROOT%{_libdir}/{lib,}apr_dbd_pgsql.so
227 %endif
228 %if %{with sqlite2}
229 libtool --mode=install /usr/bin/install -c -m 755 dbd/libapr_dbd_sqlite2.la $RPM_BUILD_ROOT%{_libdir}
230 mv $RPM_BUILD_ROOT%{_libdir}/{lib,}apr_dbd_sqlite2.so
231 %endif
232 %if %{with sqlite3}
233 libtool --mode=install /usr/bin/install -c -m 755 dbd/libapr_dbd_sqlite3.la $RPM_BUILD_ROOT%{_libdir}
234 mv $RPM_BUILD_ROOT%{_libdir}/{lib,}apr_dbd_sqlite3.so
235 %endif
236 rm -f $RPM_BUILD_ROOT%{_libdir}/libapr_dbd_*.la
237 %endif
238
239 %clean
240 rm -rf $RPM_BUILD_ROOT
241
242 %post   -p /sbin/ldconfig
243 %postun -p /sbin/ldconfig
244
245 %files
246 %defattr(644,root,root,755)
247 %doc CHANGES
248 %attr(755,root,root) %{_libdir}/lib*.so.*.*
249
250 %if %{with dso}
251 %if %{with mysql}
252 %files dbd-mysql
253 %defattr(644,root,root,755)
254 %doc INSTALL.MySQL
255 %attr(755,root,root) %{_libdir}/apr_dbd_mysql.so
256 %endif
257
258 %if %{with pgsql}
259 %files dbd-pgsql
260 %defattr(644,root,root,755)
261 %attr(755,root,root) %{_libdir}/apr_dbd_pgsql.so
262 %endif
263
264 %if %{with sqlite2}
265 %files dbd-sqlite2
266 %defattr(644,root,root,755)
267 %attr(755,root,root) %{_libdir}/apr_dbd_sqlite2.so
268 %endif
269
270 %if %{with sqlite3}
271 %files dbd-sqlite3
272 %defattr(644,root,root,755)
273 %attr(755,root,root) %{_libdir}/apr_dbd_sqlite3.so
274 %endif
275 %endif
276
277 %files devel
278 %defattr(644,root,root,755)
279 %attr(755,root,root) %{_bindir}/*
280 %attr(755,root,root) %{_libdir}/libaprutil*.so
281 %{_libdir}/lib*.la
282 %{_libdir}/aprutil.exp
283 %{_includedir}
284 %{_pkgconfigdir}/apr-util-1.pc
285
286 %files static
287 %defattr(644,root,root,755)
288 %{_libdir}/lib*.a
This page took 0.075133 seconds and 4 git commands to generate.