]> git.pld-linux.org Git - packages/apr-util.git/blob - apr-util.spec
- fix linking with mysql client library
[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.1
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 %define         _noautoreqdep libtool(%{_libdir}/libmysqlclient_r.la)
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 %if %{with mysql}
135 cp %{SOURCE1} dbd/apr_dbd_mysql.c
136 %else
137 # not needed, gen-build.py is not packaged in apr-util
138 # (and it shouldn't: apr-devel should have it -glen)
139 %{__sed} -i -e 's/^\(.*gen-build\.py\)/#\1/' buildconf
140 %endif
141 %if %{with dso}
142 %patch1 -p1
143 %patch2 -p1
144 %endif
145 %patch3 -p1
146
147 rm -rf xml/expat
148
149 echo '
150 <Layout PLD>
151     prefix:        %{_prefix}
152     exec_prefix:   %{_exec_prefix}
153     bindir:        %{_bindir}
154     sbindir:       %{_sbindir}
155     libdir:        %{_libdir}
156     libexecdir:    %{_libdir}/apr
157     mandir:        %{_mandir}
158     sysconfdir:    %{_sysconfdir}
159     datadir:       %{_datadir}
160     installbuilddir: %{_datadir}/build
161     includedir:    %{_includedir}
162     localstatedir: %{_localstatedir}
163     runtimedir:    %{_localstatedir}/run
164     libsuffix:     -${APRUTIL_MAJOR_VERSION}
165 </Layout>
166 ' > config.layout
167
168 %build
169 ./buildconf \
170         --with-apr=%{_datadir}/apr
171 %if %{with dso}
172 %{__sed} -i -e '/OBJECTS_all/s, dbd/apr_dbd_[^ ]*\.lo,,g' build-outputs.mk
173 %endif
174
175 %configure \
176         --enable-layout=PLD \
177         --with-apr=%{_bindir}/apr-1-config \
178 %if %{with ldap}
179         --with-ldap \
180         --with-ldap-include=%{_prefix}/include \
181         --with-ldap-lib=%{_libdir} \
182 %endif
183         --with-iconv=%{_prefix} \
184         --with-berkeley-db=%{_prefix} \
185         --with-dbm=db45 \
186         %{?with_mysql:--with-mysql=%{_prefix}} \
187         %{!?with_pgsql:--without-pgsql} \
188         %{!?with_sqlite2:--without-sqlite2} \
189         %{!?with_sqlite3:--without-sqlite3}
190
191 %{__make} \
192         CC="%{__cc}"
193
194 %if %{with dso}
195 %if %{with mysql}
196 %{__make} dbd/apr_dbd_mysql.lo
197 libtool --mode=link --tag=CC %{__cc} -rpath %{_libdir} -avoid-version dbd/apr_dbd_mysql.lo -lmysqlclient_r -o dbd/libapr_dbd_mysql.la
198 %endif
199 %if %{with pgsql}
200 %{__make} dbd/apr_dbd_pgsql.lo
201 libtool --mode=link --tag=CC %{__cc} -rpath %{_libdir} -avoid-version dbd/apr_dbd_pgsql.lo -lpq  -o dbd/libapr_dbd_pgsql.la
202 %endif
203 %if %{with sqlite2}
204 %{__make} dbd/apr_dbd_sqlite2.lo
205 libtool --mode=link --tag=CC %{__cc} -rpath %{_libdir} -avoid-version dbd/apr_dbd_sqlite2.lo -o dbd/libapr_dbd_sqlite2.la
206 %endif
207 %if %{with sqlite3}
208 %{__make} dbd/apr_dbd_sqlite3.lo
209 libtool --mode=link --tag=CC %{__cc} -rpath %{_libdir} -avoid-version dbd/apr_dbd_sqlite3.lo -lsqlite3 -o dbd/libapr_dbd_sqlite3.la
210 %endif
211 %endif
212
213 %install
214 rm -rf $RPM_BUILD_ROOT
215
216 %{__make} install \
217         DESTDIR=$RPM_BUILD_ROOT
218  
219 %if %{with dso}
220 install -d $RPM_BUILD_ROOT%{_libdir}
221 %if %{with mysql}
222 libtool --mode=install /usr/bin/install -c -m 755 dbd/libapr_dbd_mysql.la $RPM_BUILD_ROOT%{_libdir}
223 mv $RPM_BUILD_ROOT%{_libdir}/{lib,}apr_dbd_mysql.so
224 %endif
225 %if %{with pgsql}
226 libtool --mode=install /usr/bin/install -c -m 755 dbd/libapr_dbd_pgsql.la $RPM_BUILD_ROOT%{_libdir}
227 mv $RPM_BUILD_ROOT%{_libdir}/{lib,}apr_dbd_pgsql.so
228 %endif
229 %if %{with sqlite2}
230 libtool --mode=install /usr/bin/install -c -m 755 dbd/libapr_dbd_sqlite2.la $RPM_BUILD_ROOT%{_libdir}
231 mv $RPM_BUILD_ROOT%{_libdir}/{lib,}apr_dbd_sqlite2.so
232 %endif
233 %if %{with sqlite3}
234 libtool --mode=install /usr/bin/install -c -m 755 dbd/libapr_dbd_sqlite3.la $RPM_BUILD_ROOT%{_libdir}
235 mv $RPM_BUILD_ROOT%{_libdir}/{lib,}apr_dbd_sqlite3.so
236 %endif
237 rm -f $RPM_BUILD_ROOT%{_libdir}/libapr_dbd_*.la
238 %endif
239
240 %clean
241 rm -rf $RPM_BUILD_ROOT
242
243 %post   -p /sbin/ldconfig
244 %postun -p /sbin/ldconfig
245
246 %files
247 %defattr(644,root,root,755)
248 %doc CHANGES
249 %attr(755,root,root) %{_libdir}/lib*.so.*.*
250
251 %if %{with dso}
252 %if %{with mysql}
253 %files dbd-mysql
254 %defattr(644,root,root,755)
255 %doc INSTALL.MySQL
256 %attr(755,root,root) %{_libdir}/apr_dbd_mysql.so
257 %endif
258
259 %if %{with pgsql}
260 %files dbd-pgsql
261 %defattr(644,root,root,755)
262 %attr(755,root,root) %{_libdir}/apr_dbd_pgsql.so
263 %endif
264
265 %if %{with sqlite2}
266 %files dbd-sqlite2
267 %defattr(644,root,root,755)
268 %attr(755,root,root) %{_libdir}/apr_dbd_sqlite2.so
269 %endif
270
271 %if %{with sqlite3}
272 %files dbd-sqlite3
273 %defattr(644,root,root,755)
274 %attr(755,root,root) %{_libdir}/apr_dbd_sqlite3.so
275 %endif
276 %endif
277
278 %files devel
279 %defattr(644,root,root,755)
280 %attr(755,root,root) %{_bindir}/*
281 %attr(755,root,root) %{_libdir}/libaprutil*.so
282 %{_libdir}/lib*.la
283 %{_libdir}/aprutil.exp
284 %{_includedir}
285 %{_pkgconfigdir}/apr-util-1.pc
286
287 %files static
288 %defattr(644,root,root,755)
289 %{_libdir}/lib*.a
This page took 0.049941 seconds and 3 git commands to generate.