michael@485: ## michael@485: ## apr.spec -- OpenPKG RPM Package Specification michael@485: ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. michael@485: ## michael@485: ## Permission to use, copy, modify, and distribute this software for michael@485: ## any purpose with or without fee is hereby granted, provided that michael@485: ## the above copyright notice and this permission notice appear in all michael@485: ## copies. michael@485: ## michael@485: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@485: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@485: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@485: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@485: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@485: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@485: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@485: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@485: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@485: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@485: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@485: ## SUCH DAMAGE. michael@485: ## michael@485: michael@485: # package version michael@485: %define V_apr 1.4.6 michael@485: %define V_apr_util 1.4.1 michael@485: michael@485: # package information michael@485: Name: apr michael@485: Summary: Apache Portable Runtime michael@485: URL: http://apr.apache.org/ michael@485: Vendor: Apache Software Foundation michael@485: Packager: OpenPKG Foundation e.V. michael@485: Distribution: OpenPKG Community michael@485: Class: BASE michael@485: Group: Libraries michael@485: License: Apache michael@485: Version: %{V_apr} michael@485: Release: 20120214 michael@485: michael@485: # package options michael@485: %option with_threads no michael@485: %option with_db no michael@485: %option with_gdbm no michael@485: %option with_iconv no michael@485: %option with_ldap no michael@485: %option with_odbc no michael@485: %option with_pgsql no michael@485: %option with_mysql no michael@485: %option with_sqlite no michael@485: michael@485: # list of sources michael@485: Source0: http://www.apache.org/dist/apr/apr-%{V_apr}.tar.gz michael@485: Source1: http://www.apache.org/dist/apr/apr-util-%{V_apr_util}.tar.gz michael@485: Patch0: apr.patch michael@485: michael@485: # build information michael@485: BuildPreReq: OpenPKG, openpkg >= 20100101, sed, make michael@485: PreReq: OpenPKG, openpkg >= 20100101, sed michael@485: BuildPreReq: expat michael@485: PreReq: expat michael@485: %if "%{with_db}" == "yes" michael@485: BuildPreReq: db >= 4.6 michael@485: PreReq: db >= 4.6 michael@485: %endif michael@485: %if "%{with_gdbm}" == "yes" michael@485: BuildPreReq: gdbm michael@485: PreReq: gdbm michael@485: %endif michael@485: %if "%{with_iconv}" == "yes" michael@485: BuildPreReq: libiconv michael@485: PreReq: libiconv michael@485: %endif michael@485: %if "%{with_ldap}" == "yes" michael@485: BuildPreReq: openldap, openssl >= 0.9.8 michael@485: PreReq: openldap, openssl >= 0.9.8 michael@485: %endif michael@485: %if "%{with_odbc}" == "yes" michael@485: BuildPreReq: ODBC michael@485: PreReq: ODBC michael@485: %endif michael@485: %if "%{with_pgsql}" == "yes" michael@485: BuildPreReq: postgresql michael@485: PreReq: postgresql michael@485: %endif michael@485: %if "%{with_mysql}" == "yes" michael@485: BuildPreReq: mysql michael@485: PreReq: mysql michael@485: %endif michael@485: %if "%{with_sqlite}" == "yes" michael@485: BuildPreReq: sqlite michael@485: PreReq: sqlite michael@485: %endif michael@485: michael@485: %description michael@485: Apache Portable Runtime (APR) is a library of C data structures michael@485: and routines, forming a common system portability layer to as many michael@485: operating systems as possible. michael@485: michael@485: %track michael@485: prog apr = { michael@485: version = %{V_apr} michael@485: url = http://www.apache.org/dist/apr/ michael@485: regex = apr-(__VER__)\.tar\.gz michael@485: } michael@485: prog apr:apr-util = { michael@485: version = %{V_apr_util} michael@485: url = http://www.apache.org/dist/apr/ michael@485: regex = apr-util-(__VER__)\.tar\.gz michael@485: } michael@485: michael@485: %prep michael@485: %setup -q -c michael@485: %setup -q -D -T -a 1 michael@485: %patch -p0 michael@485: michael@485: %build michael@485: ( cd apr-%{V_apr} michael@485: CC="%{l_cc}" \ michael@485: CFLAGS="%{l_cflags -O}" \ michael@485: CONFIG_SHELL="/bin/sh" \ michael@485: ./configure \ michael@485: --enable-layout=GNU \ michael@485: --prefix=%{l_prefix} \ michael@485: --includedir=%{l_prefix}/include/apr \ michael@485: --datadir=%{l_prefix}/share/apr \ michael@485: %if "%{with_threads}" == "yes" michael@485: --enable-threads \ michael@485: %else michael@485: --disable-threads \ michael@485: %endif michael@485: --enable-shared \ michael@485: --enable-static michael@485: %{l_make} %{l_mflags -O} michael@485: ) || exit $? michael@485: ( cd apr-util-%{V_apr_util} michael@485: cp /dev/null config.cache michael@485: %if "%{with_iconv}" == "no" michael@485: ( echo "ac_cv_header_iconv_h=no" michael@485: ) >config.cache michael@485: %endif michael@485: CC="%{l_cc}" \ michael@485: CFLAGS="%{l_cflags -O}" \ michael@485: %if "%{with_ldap}" == "yes" michael@485: LIBS="-lssl -lcrypto" \ michael@485: %endif michael@485: ./configure \ michael@485: --cache-file=./config.cache \ michael@485: --enable-layout=GNU \ michael@485: --prefix=%{l_prefix} \ michael@485: --includedir=%{l_prefix}/include/apr \ michael@485: --datadir=%{l_prefix}/share/apr \ michael@485: --with-apr=`pwd`/../apr-%{V_apr} \ michael@485: %if "%{with_db}" == "yes" michael@485: --with-berkeley-db=%{l_prefix} \ michael@485: %endif michael@485: %if "%{with_gdbm}" == "yes" michael@485: --with-gdbm=%{l_prefix} \ michael@485: %endif michael@485: %if "%{with_db}" == "yes" michael@485: --with-dbm=db46 \ michael@485: %else michael@485: %if "%{with_gdbm}" == "yes" michael@485: --with-dbm=gdbm \ michael@485: %else michael@485: --with-dbm=sdbm \ michael@485: %endif michael@485: %endif michael@485: --with-expat=%{l_prefix} \ michael@485: %if "%{with_iconv}" == "yes" michael@485: --with-iconv=%{l_prefix} \ michael@485: %endif michael@485: %if "%{with_ldap}" == "yes" michael@485: --with-ldap \ michael@485: --with-ldap-include=%{l_prefix}/include/ \ michael@485: --with-ldap-lib=%{l_prefix}/lib \ michael@485: %endif michael@485: %if "%{with_odbc}" == "yes" michael@485: --with-odbc=%{l_prefix} \ michael@485: %else michael@485: --without-odbc \ michael@485: %endif michael@485: %if "%{with_pgsql}" == "yes" michael@485: --with-pgsql=%{l_prefix} \ michael@485: %else michael@485: --without-pgsql \ michael@485: %endif michael@485: %if "%{with_mysql}" == "yes" michael@485: --with-mysql=%{l_prefix} \ michael@485: %else michael@485: --without-mysql \ michael@485: %endif michael@485: %if "%{with_sqlite}" == "yes" michael@485: --with-sqlite3=%{l_prefix} \ michael@485: %else michael@485: --without-sqlite3 \ michael@485: %endif michael@485: --enable-util-dso \ michael@485: --enable-shared \ michael@485: --enable-static michael@485: %{l_make} %{l_mflags -O} michael@485: ) || exit $? michael@485: michael@485: %install michael@485: ( cd apr-%{V_apr} michael@485: %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT michael@485: ) || exit $? michael@485: ( cd apr-util-%{V_apr_util} michael@485: %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT michael@485: ) || exit $? michael@485: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/apr.exp michael@485: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/aprutil.exp michael@485: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/apr-util-1/*.a michael@485: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.la michael@485: rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.so* michael@485: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} michael@485: michael@485: %files -f files michael@485: michael@485: %clean michael@485: