apr/apr.spec

changeset 485
aa99e75f2e06
child 486
87f4014366d2
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/apr/apr.spec	Wed Aug 08 00:07:34 2012 +0200
     1.3 @@ -0,0 +1,221 @@
     1.4 +##
     1.5 +##  apr.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   package version
    1.28 +%define       V_apr       1.4.6
    1.29 +%define       V_apr_util  1.4.1
    1.30 +
    1.31 +#   package information
    1.32 +Name:         apr
    1.33 +Summary:      Apache Portable Runtime
    1.34 +URL:          http://apr.apache.org/
    1.35 +Vendor:       Apache Software Foundation
    1.36 +Packager:     OpenPKG Foundation e.V.
    1.37 +Distribution: OpenPKG Community
    1.38 +Class:        BASE
    1.39 +Group:        Libraries
    1.40 +License:      Apache
    1.41 +Version:      %{V_apr}
    1.42 +Release:      20120214
    1.43 +
    1.44 +#   package options
    1.45 +%option       with_threads  no
    1.46 +%option       with_db       no
    1.47 +%option       with_gdbm     no
    1.48 +%option       with_iconv    no
    1.49 +%option       with_ldap     no
    1.50 +%option       with_odbc     no
    1.51 +%option       with_pgsql    no
    1.52 +%option       with_mysql    no
    1.53 +%option       with_sqlite   no
    1.54 +
    1.55 +#   list of sources
    1.56 +Source0:      http://www.apache.org/dist/apr/apr-%{V_apr}.tar.gz
    1.57 +Source1:      http://www.apache.org/dist/apr/apr-util-%{V_apr_util}.tar.gz
    1.58 +Patch0:       apr.patch
    1.59 +
    1.60 +#   build information
    1.61 +BuildPreReq:  OpenPKG, openpkg >= 20100101, sed, make
    1.62 +PreReq:       OpenPKG, openpkg >= 20100101, sed
    1.63 +BuildPreReq:  expat
    1.64 +PreReq:       expat
    1.65 +%if "%{with_db}" == "yes"
    1.66 +BuildPreReq:  db >= 4.6
    1.67 +PreReq:       db >= 4.6
    1.68 +%endif
    1.69 +%if "%{with_gdbm}" == "yes"
    1.70 +BuildPreReq:  gdbm
    1.71 +PreReq:       gdbm
    1.72 +%endif
    1.73 +%if "%{with_iconv}" == "yes"
    1.74 +BuildPreReq:  libiconv
    1.75 +PreReq:       libiconv
    1.76 +%endif
    1.77 +%if "%{with_ldap}" == "yes"
    1.78 +BuildPreReq:  openldap, openssl >= 0.9.8
    1.79 +PreReq:       openldap, openssl >= 0.9.8
    1.80 +%endif
    1.81 +%if "%{with_odbc}" == "yes"
    1.82 +BuildPreReq:  ODBC
    1.83 +PreReq:       ODBC
    1.84 +%endif
    1.85 +%if "%{with_pgsql}" == "yes"
    1.86 +BuildPreReq:  postgresql
    1.87 +PreReq:       postgresql
    1.88 +%endif
    1.89 +%if "%{with_mysql}" == "yes"
    1.90 +BuildPreReq:  mysql
    1.91 +PreReq:       mysql
    1.92 +%endif
    1.93 +%if "%{with_sqlite}" == "yes"
    1.94 +BuildPreReq:  sqlite
    1.95 +PreReq:       sqlite
    1.96 +%endif
    1.97 +
    1.98 +%description
    1.99 +    Apache Portable Runtime (APR) is a library of C data structures
   1.100 +    and routines, forming a common system portability layer to as many
   1.101 +    operating systems as possible.
   1.102 +
   1.103 +%track
   1.104 +    prog apr = {
   1.105 +        version   = %{V_apr}
   1.106 +        url       = http://www.apache.org/dist/apr/
   1.107 +        regex     = apr-(__VER__)\.tar\.gz
   1.108 +    }
   1.109 +    prog apr:apr-util = {
   1.110 +        version   = %{V_apr_util}
   1.111 +        url       = http://www.apache.org/dist/apr/
   1.112 +        regex     = apr-util-(__VER__)\.tar\.gz
   1.113 +    }
   1.114 +
   1.115 +%prep
   1.116 +    %setup -q -c
   1.117 +    %setup -q -D -T -a 1
   1.118 +    %patch -p0
   1.119 +
   1.120 +%build
   1.121 +    ( cd apr-%{V_apr}
   1.122 +      CC="%{l_cc}" \
   1.123 +      CFLAGS="%{l_cflags -O}" \
   1.124 +      CONFIG_SHELL="/bin/sh" \
   1.125 +      ./configure \
   1.126 +          --enable-layout=GNU \
   1.127 +          --prefix=%{l_prefix} \
   1.128 +          --includedir=%{l_prefix}/include/apr \
   1.129 +          --datadir=%{l_prefix}/share/apr \
   1.130 +%if "%{with_threads}" == "yes"
   1.131 +          --enable-threads \
   1.132 +%else
   1.133 +          --disable-threads \
   1.134 +%endif
   1.135 +          --enable-shared \
   1.136 +          --enable-static
   1.137 +      %{l_make} %{l_mflags -O}
   1.138 +    ) || exit $?
   1.139 +    ( cd apr-util-%{V_apr_util}
   1.140 +      cp /dev/null config.cache
   1.141 +%if "%{with_iconv}" == "no"
   1.142 +      ( echo "ac_cv_header_iconv_h=no"
   1.143 +      ) >config.cache
   1.144 +%endif
   1.145 +      CC="%{l_cc}" \
   1.146 +      CFLAGS="%{l_cflags -O}" \
   1.147 +%if "%{with_ldap}" == "yes"
   1.148 +      LIBS="-lssl -lcrypto" \
   1.149 +%endif
   1.150 +      ./configure \
   1.151 +          --cache-file=./config.cache \
   1.152 +          --enable-layout=GNU \
   1.153 +          --prefix=%{l_prefix} \
   1.154 +          --includedir=%{l_prefix}/include/apr \
   1.155 +          --datadir=%{l_prefix}/share/apr \
   1.156 +          --with-apr=`pwd`/../apr-%{V_apr} \
   1.157 +%if "%{with_db}" == "yes"
   1.158 +          --with-berkeley-db=%{l_prefix} \
   1.159 +%endif
   1.160 +%if "%{with_gdbm}" == "yes"
   1.161 +          --with-gdbm=%{l_prefix} \
   1.162 +%endif
   1.163 +%if "%{with_db}" == "yes"
   1.164 +          --with-dbm=db46 \
   1.165 +%else
   1.166 +%if "%{with_gdbm}" == "yes"
   1.167 +          --with-dbm=gdbm \
   1.168 +%else
   1.169 +          --with-dbm=sdbm \
   1.170 +%endif
   1.171 +%endif
   1.172 +          --with-expat=%{l_prefix} \
   1.173 +%if "%{with_iconv}" == "yes"
   1.174 +          --with-iconv=%{l_prefix} \
   1.175 +%endif
   1.176 +%if "%{with_ldap}" == "yes"
   1.177 +          --with-ldap \
   1.178 +          --with-ldap-include=%{l_prefix}/include/ \
   1.179 +          --with-ldap-lib=%{l_prefix}/lib \
   1.180 +%endif
   1.181 +%if "%{with_odbc}" == "yes"
   1.182 +          --with-odbc=%{l_prefix} \
   1.183 +%else
   1.184 +          --without-odbc \
   1.185 +%endif
   1.186 +%if "%{with_pgsql}" == "yes"
   1.187 +          --with-pgsql=%{l_prefix} \
   1.188 +%else
   1.189 +          --without-pgsql \
   1.190 +%endif
   1.191 +%if "%{with_mysql}" == "yes"
   1.192 +          --with-mysql=%{l_prefix} \
   1.193 +%else
   1.194 +          --without-mysql \
   1.195 +%endif
   1.196 +%if "%{with_sqlite}" == "yes"
   1.197 +          --with-sqlite3=%{l_prefix} \
   1.198 +%else
   1.199 +          --without-sqlite3 \
   1.200 +%endif
   1.201 +          --enable-util-dso \
   1.202 +          --enable-shared \
   1.203 +          --enable-static
   1.204 +      %{l_make} %{l_mflags -O}
   1.205 +    ) || exit $?
   1.206 +
   1.207 +%install
   1.208 +    ( cd apr-%{V_apr}
   1.209 +      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   1.210 +    ) || exit $?
   1.211 +    ( cd apr-util-%{V_apr_util}
   1.212 +      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   1.213 +    ) || exit $?
   1.214 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/apr.exp
   1.215 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/aprutil.exp
   1.216 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/apr-util-1/*.a
   1.217 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
   1.218 +    rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.so*
   1.219 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
   1.220 +
   1.221 +%files -f files
   1.222 +
   1.223 +%clean
   1.224 +

mercurial