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