| 1 |  | 
|---|
| 2 | %define apuver 1 | 
|---|
| 3 |  | 
|---|
| 4 | Summary: Apache Portable Runtime Utility library | 
|---|
| 5 | Name: apr-util | 
|---|
| 6 | Version: 1.4.1 | 
|---|
| 7 | Release: 1%{?dist} | 
|---|
| 8 | License: ASL 2.0 | 
|---|
| 9 | Group: System Environment/Libraries | 
|---|
| 10 | URL: http://apr.apache.org/ | 
|---|
| 11 | Source0: http://www.apache.org/dist/apr/%{name}-%{version}.tar.bz2 | 
|---|
| 12 |  | 
|---|
| 13 | Patch1: aprutil-os2.patch | 
|---|
| 14 |  | 
|---|
| 15 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot | 
|---|
| 16 | BuildRequires: apr-devel >= 1.3.0 | 
|---|
| 17 | #BuildRequires: autoconf | 
|---|
| 18 | #BuildRequires: db4-devel, expat-devel, libuuid-devel | 
|---|
| 19 |  | 
|---|
| 20 | %description | 
|---|
| 21 | The mission of the Apache Portable Runtime (APR) is to provide a | 
|---|
| 22 | free library of C data structures and routines.  This library | 
|---|
| 23 | contains additional utility interfaces for APR; including support | 
|---|
| 24 | for XML, LDAP, database interfaces, URI parsing and more. | 
|---|
| 25 |  | 
|---|
| 26 | %package devel | 
|---|
| 27 | Group: Development/Libraries | 
|---|
| 28 | Summary: APR utility library development kit | 
|---|
| 29 | Requires: apr-util = %{version}-%{release}, apr-devel, pkgconfig | 
|---|
| 30 | Requires: db4-devel | 
|---|
| 31 | #Requires: expat-devel | 
|---|
| 32 | #Requires: openldap-devel | 
|---|
| 33 |  | 
|---|
| 34 | %description devel | 
|---|
| 35 | This package provides the support files which can be used to | 
|---|
| 36 | build applications using the APR utility library.  The mission | 
|---|
| 37 | of the Apache Portable Runtime (APR) is to provide a free | 
|---|
| 38 | library of C data structures and routines. | 
|---|
| 39 |  | 
|---|
| 40 | %package pgsql | 
|---|
| 41 | Group: Development/Libraries | 
|---|
| 42 | Summary: APR utility library PostgreSQL DBD driver | 
|---|
| 43 | #BuildRequires: postgresql-devel | 
|---|
| 44 | Requires: apr-util = %{version}-%{release} | 
|---|
| 45 |  | 
|---|
| 46 | %description pgsql | 
|---|
| 47 | This package provides the PostgreSQL driver for the apr-util | 
|---|
| 48 | DBD (database abstraction) interface. | 
|---|
| 49 |  | 
|---|
| 50 | %package mysql | 
|---|
| 51 | Group: Development/Libraries | 
|---|
| 52 | Summary: APR utility library MySQL DBD driver | 
|---|
| 53 | #BuildRequires: mysql-devel | 
|---|
| 54 | Requires: apr-util = %{version}-%{release} | 
|---|
| 55 |  | 
|---|
| 56 | %description mysql | 
|---|
| 57 | This package provides the MySQL driver for the apr-util DBD | 
|---|
| 58 | (database abstraction) interface. | 
|---|
| 59 |  | 
|---|
| 60 | %package sqlite | 
|---|
| 61 | Group: Development/Libraries | 
|---|
| 62 | Summary: APR utility library SQLite DBD driver | 
|---|
| 63 | BuildRequires: sqlite-devel >= 3.0.0 | 
|---|
| 64 | Requires: apr-util = %{version}-%{release} | 
|---|
| 65 |  | 
|---|
| 66 | %description sqlite | 
|---|
| 67 | This package provides the SQLite driver for the apr-util DBD | 
|---|
| 68 | (database abstraction) interface. | 
|---|
| 69 |  | 
|---|
| 70 | %package freetds | 
|---|
| 71 | Group: Development/Libraries | 
|---|
| 72 | Summary: APR utility library FreeTDS DBD driver | 
|---|
| 73 | #BuildRequires: freetds-devel | 
|---|
| 74 | Requires: apr-util = %{version}-%{release} | 
|---|
| 75 |  | 
|---|
| 76 | %description freetds | 
|---|
| 77 | This package provides the FreeTDS driver for the apr-util DBD | 
|---|
| 78 | (database abstraction) interface. | 
|---|
| 79 |  | 
|---|
| 80 | %package odbc | 
|---|
| 81 | Group: Development/Libraries | 
|---|
| 82 | Summary: APR utility library ODBC DBD driver | 
|---|
| 83 | #BuildRequires: unixODBC-devel | 
|---|
| 84 | Requires: apr-util = %{version}-%{release} | 
|---|
| 85 |  | 
|---|
| 86 | %description odbc | 
|---|
| 87 | This package provides the ODBC driver for the apr-util DBD | 
|---|
| 88 | (database abstraction) interface. | 
|---|
| 89 |  | 
|---|
| 90 | %package ldap | 
|---|
| 91 | Group: Development/Libraries | 
|---|
| 92 | Summary: APR utility library LDAP support | 
|---|
| 93 | #BuildRequires: openldap-devel | 
|---|
| 94 | Requires: apr-util = %{version}-%{release} | 
|---|
| 95 |  | 
|---|
| 96 | %description ldap | 
|---|
| 97 | This package provides the LDAP support for the apr-util. | 
|---|
| 98 |  | 
|---|
| 99 | %prep | 
|---|
| 100 | %setup -q | 
|---|
| 101 | %patch1 -p1 -b .os2 | 
|---|
| 102 |  | 
|---|
| 103 | %build | 
|---|
| 104 | #autoheader && autoconf | 
|---|
| 105 | # A fragile autoconf test which fails if the code trips | 
|---|
| 106 | # any other warning; force correct result for OpenLDAP: | 
|---|
| 107 | #export ac_cv_ldap_set_rebind_proc_style=three | 
|---|
| 108 |  | 
|---|
| 109 | export CONFIG_SHELL="/@unixroot/usr/bin/sh.exe" | 
|---|
| 110 | export LDFLAGS="-Zhigh-mem -Zargs-wild -Zargs-resp" | 
|---|
| 111 | export LIBS="-lurpo -lmmap" | 
|---|
| 112 |  | 
|---|
| 113 | %configure --with-apr=%{_prefix} \ | 
|---|
| 114 | --includedir=%{_includedir}/apr-%{apuver} \ | 
|---|
| 115 | "--cache-file=%{_topdir}/cache/%{name}-%{_target_cpu}.cache" | 
|---|
| 116 |  | 
|---|
| 117 | #        --with-ldap --without-gdbm \ | 
|---|
| 118 | #        --with-sqlite3 --with-pgsql --with-mysql --with-freetds --with-odbc \ | 
|---|
| 119 | #        --with-berkeley-db \ | 
|---|
| 120 | #        --without-sqlite2 | 
|---|
| 121 |  | 
|---|
| 122 | # the TARGET_LIB hack prevents smp builds. %{?_smp_mflags} | 
|---|
| 123 | make | 
|---|
| 124 |  | 
|---|
| 125 | %install | 
|---|
| 126 | rm -rf $RPM_BUILD_ROOT | 
|---|
| 127 | make install DESTDIR=$RPM_BUILD_ROOT | 
|---|
| 128 |  | 
|---|
| 129 | mkdir -p $RPM_BUILD_ROOT/%{_datadir}/aclocal | 
|---|
| 130 | install -m 644 build/find_apu.m4 $RPM_BUILD_ROOT/%{_datadir}/aclocal | 
|---|
| 131 |  | 
|---|
| 132 | # Unpackaged files; remove the static libaprutil | 
|---|
| 133 | rm -f $RPM_BUILD_ROOT%{_libdir}/aprutil.exp \ | 
|---|
| 134 | $RPM_BUILD_ROOT%{_libdir}/apr*.la | 
|---|
| 135 |  | 
|---|
| 136 | # And remove the reference to the static libaprutil from the .la | 
|---|
| 137 | # file. | 
|---|
| 138 | #sed -i '/^old_library/s,libapr.*\.a,,' \ | 
|---|
| 139 | #      $RPM_BUILD_ROOT%{_libdir}/apr*.la | 
|---|
| 140 | # Remove unnecessary exports from dependency_libs | 
|---|
| 141 | #sed -ri '/^dependency_libs/{s,-l(pq|sqlite[0-9]|rt|dl|uuid) ,,g}' \ | 
|---|
| 142 | #      $RPM_BUILD_ROOT%{_libdir}/apr*.la | 
|---|
| 143 |  | 
|---|
| 144 | # Trim libtool DSO cruft | 
|---|
| 145 | rm -f $RPM_BUILD_ROOT%{_libdir}/apr-util-%{apuver}/*.*a | 
|---|
| 146 |  | 
|---|
| 147 | # rename static library | 
|---|
| 148 | mv $RPM_BUILD_ROOT%{_libdir}/apru-%{apuver}.lib $RPM_BUILD_ROOT%{_libdir}/apru-%{apuver}_s.lib | 
|---|
| 149 | # import library | 
|---|
| 150 | emximp -o $RPM_BUILD_ROOT%{_libdir}/apru-%{apuver}.lib $RPM_BUILD_ROOT%{_libdir}/apru-%{apuver}.dll | 
|---|
| 151 |  | 
|---|
| 152 | %clean | 
|---|
| 153 | rm -rf $RPM_BUILD_ROOT | 
|---|
| 154 |  | 
|---|
| 155 | %files | 
|---|
| 156 | %defattr(-,root,root,-) | 
|---|
| 157 | %doc CHANGES LICENSE NOTICE | 
|---|
| 158 | %{_libdir}/apru-%{apuver}.dll | 
|---|
| 159 | %dir %{_libdir}/apr-util-%{apuver} | 
|---|
| 160 |  | 
|---|
| 161 | %files pgsql | 
|---|
| 162 | %defattr(-,root,root,-) | 
|---|
| 163 | #%{_libdir}/apr-util-%{apuver}/apr_dbd_pgsql* | 
|---|
| 164 |  | 
|---|
| 165 | %files mysql | 
|---|
| 166 | %defattr(-,root,root,-) | 
|---|
| 167 | #%{_libdir}/apr-util-%{apuver}/apr_dbd_mysql* | 
|---|
| 168 |  | 
|---|
| 169 | %files sqlite | 
|---|
| 170 | %defattr(-,root,root,-) | 
|---|
| 171 | %{_libdir}/apr-util-%{apuver}/apr_dbd_sqlite* | 
|---|
| 172 |  | 
|---|
| 173 | %files freetds | 
|---|
| 174 | %defattr(-,root,root,-) | 
|---|
| 175 | #%{_libdir}/apr-util-%{apuver}/apr_dbd_freetds* | 
|---|
| 176 |  | 
|---|
| 177 | %files odbc | 
|---|
| 178 | %defattr(-,root,root,-) | 
|---|
| 179 | #%{_libdir}/apr-util-%{apuver}/apr_dbd_odbc* | 
|---|
| 180 |  | 
|---|
| 181 | %files ldap | 
|---|
| 182 | %defattr(-,root,root,-) | 
|---|
| 183 | #%{_libdir}/apr-util-%{apuver}/apr_ldap* | 
|---|
| 184 |  | 
|---|
| 185 | %files devel | 
|---|
| 186 | %defattr(-,root,root,-) | 
|---|
| 187 | %{_bindir}/apu-%{apuver}-config | 
|---|
| 188 | %{_libdir}/apru-%{apuver}_s.lib | 
|---|
| 189 | %{_libdir}/apru-%{apuver}.lib | 
|---|
| 190 | %{_includedir}/apr-%{apuver}/*.h | 
|---|
| 191 | %{_libdir}/pkgconfig/*.pc | 
|---|
| 192 | %{_datadir}/aclocal/*.m4 | 
|---|
| 193 |  | 
|---|
| 194 | %changelog | 
|---|
| 195 | * Fri Mar 02 2012 yd | 
|---|
| 196 | - initial unixroot build. | 
|---|