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