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