]> git.pld-linux.org Git - packages/apr-util.git/blob - apr-util.spec
- fixed libaprutil build (in case buildconf puts apr_dbd.lo after apr_dbd_*)
[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.2
14 Release:        3
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:  694228b227e30cb9da3823514516e91c
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}-db4.4.patch
25 Patch3:         %{name}-dso.patch
26 Patch4:         %{name}-dbd.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
32 BuildRequires:  expat-devel
33 BuildRequires:  gdbm-devel
34 BuildRequires:  libtool
35 %{?with_mysql:BuildRequires:    mysql-devel}
36 %{?with_ldap:BuildRequires:     openldap-devel}
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}
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 %patch2 -p1
136 %if %{with mysql}
137 cp %{SOURCE1} dbd/apr_dbd_mysql.c
138 %else
139 # not needed, gen-build.py is not packaged in apr-util
140 # (and it shouldn't: apr-devel should have it -glen)
141 %{__sed} -i -e 's/^\(.*gen-build\.py\)/#\1/' buildconf
142 %endif
143 %if %{with dso}
144 %patch3 -p1
145 %patch4 -p1
146 %endif
147
148 rm -rf xml/expat
149
150 %build
151 ./buildconf \
152         --with-apr=%{_datadir}/apr
153 %if %{with dso}
154 %{__sed} -i -e '/OBJECTS_all/s, dbd/apr_dbd_[^ ]*\.lo,,g' build-outputs.mk
155 %endif
156
157 %configure \
158         --with-apr=%{_bindir}/apr-1-config \
159 %if %{with ldap}
160         --with-ldap \
161         --with-ldap-include=%{_prefix}/include \
162         --with-ldap-lib=%{_libdir} \
163 %endif
164         --with-iconv=%{_prefix} \
165         %{?with_mysql:--with-mysql=%{_prefix}} \
166         %{!?with_pgsql:--without-pgsql} \
167         %{!?with_sqlite2:--without-sqlite2} \
168         %{!?with_sqlite3:--without-sqlite3}
169
170 %{__make} \
171         CC="%{__cc}"
172
173 %if %{with dso}
174 %if %{with mysql}
175 %{__make} dbd/apr_dbd_mysql.lo
176 libtool --mode=link --tag=CC %{__cc} -rpath %{_libdir} -avoid-version dbd/apr_dbd_mysql.lo -lmysqlclient_r -o dbd/libapr_dbd_mysql.la
177 %endif
178 %if %{with pgsql}
179 %{__make} dbd/apr_dbd_pgsql.lo
180 libtool --mode=link --tag=CC %{__cc} -rpath %{_libdir} -avoid-version dbd/apr_dbd_pgsql.lo -lpq  -o dbd/libapr_dbd_pgsql.la
181 %endif
182 %if %{with sqlite2}
183 %{__make} dbd/apr_dbd_sqlite2.lo
184 libtool --mode=link --tag=CC %{__cc} -rpath %{_libdir} -avoid-version dbd/apr_dbd_sqlite2.lo -o dbd/libapr_dbd_sqlite2.la
185 %endif
186 %if %{with sqlite3}
187 %{__make} dbd/apr_dbd_sqlite3.lo
188 libtool --mode=link --tag=CC %{__cc} -rpath %{_libdir} -avoid-version dbd/apr_dbd_sqlite3.lo -lsqlite3 -o dbd/libapr_dbd_sqlite3.la
189 %endif
190 %endif
191
192 %install
193 rm -rf $RPM_BUILD_ROOT
194
195 %{__make} install \
196         DESTDIR=$RPM_BUILD_ROOT
197  
198 %if %{with dso}
199 %if %{with mysql}
200 libtool --mode=install /usr/bin/install -c -m 755 dbd/libapr_dbd_mysql.la $RPM_BUILD_ROOT%{_libdir}
201 mv $RPM_BUILD_ROOT%{_libdir}/{lib,}apr_dbd_mysql.so
202 %endif
203 %if %{with pgsql}
204 libtool --mode=install /usr/bin/install -c -m 755 dbd/libapr_dbd_pgsql.la $RPM_BUILD_ROOT%{_libdir}
205 mv $RPM_BUILD_ROOT%{_libdir}/{lib,}apr_dbd_pgsql.so
206 %endif
207 %if %{with sqlite2}
208 libtool --mode=install /usr/bin/install -c -m 755 dbd/libapr_dbd_sqlite2.la $RPM_BUILD_ROOT%{_libdir}
209 mv $RPM_BUILD_ROOT%{_libdir}/{lib,}apr_dbd_sqlite2.so
210 %endif
211 %if %{with sqlite3}
212 libtool --mode=install /usr/bin/install -c -m 755 dbd/libapr_dbd_sqlite3.la $RPM_BUILD_ROOT%{_libdir}
213 mv $RPM_BUILD_ROOT%{_libdir}/{lib,}apr_dbd_sqlite3.so
214 %endif
215 rm -f $RPM_BUILD_ROOT%{_libdir}/libapr_dbd_*.la
216 %endif
217
218 %clean
219 rm -rf $RPM_BUILD_ROOT
220
221 %post   -p /sbin/ldconfig
222 %postun -p /sbin/ldconfig
223
224 %files
225 %defattr(644,root,root,755)
226 %doc CHANGES
227 %attr(755,root,root) %{_libdir}/lib*.so.*.*
228
229 %if %{with dso}
230 %if %{with mysql}
231 %files dbd-mysql
232 %defattr(644,root,root,755)
233 %doc INSTALL.MySQL
234 %attr(755,root,root) %{_libdir}/apr_dbd_mysql.so
235 %endif
236
237 %if %{with pgsql}
238 %files dbd-pgsql
239 %defattr(644,root,root,755)
240 %attr(755,root,root) %{_libdir}/apr_dbd_pgsql.so
241 %endif
242
243 %if %{with sqlite2}
244 %files dbd-sqlite2
245 %defattr(644,root,root,755)
246 %attr(755,root,root) %{_libdir}/apr_dbd_sqlite2.so
247 %endif
248
249 %if %{with sqlite3}
250 %files dbd-sqlite3
251 %defattr(644,root,root,755)
252 %attr(755,root,root) %{_libdir}/apr_dbd_sqlite3.so
253 %endif
254 %endif
255
256 %files devel
257 %defattr(644,root,root,755)
258 %attr(755,root,root) %{_bindir}/*
259 %attr(755,root,root) %{_libdir}/libaprutil*.so
260 %{_libdir}/lib*.la
261 %{_libdir}/aprutil.exp
262 %{_includedir}
263 %{_pkgconfigdir}/apr-util-1.pc
264
265 %files static
266 %defattr(644,root,root,755)
267 %{_libdir}/lib*.a
This page took 0.059243 seconds and 3 git commands to generate.