apr/apr.spec

Wed, 08 Aug 2012 00:07:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 08 Aug 2012 00:07:34 +0200
changeset 485
aa99e75f2e06
child 486
87f4014366d2
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

     1 ##
     2 ##  apr.spec -- OpenPKG RPM Package Specification
     3 ##  Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
     4 ##
     5 ##  Permission to use, copy, modify, and distribute this software for
     6 ##  any purpose with or without fee is hereby granted, provided that
     7 ##  the above copyright notice and this permission notice appear in all
     8 ##  copies.
     9 ##
    10 ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    11 ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    12 ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    13 ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    14 ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    15 ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    16 ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    17 ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    18 ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    19 ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    20 ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    21 ##  SUCH DAMAGE.
    22 ##
    24 #   package version
    25 %define       V_apr       1.4.6
    26 %define       V_apr_util  1.4.1
    28 #   package information
    29 Name:         apr
    30 Summary:      Apache Portable Runtime
    31 URL:          http://apr.apache.org/
    32 Vendor:       Apache Software Foundation
    33 Packager:     OpenPKG Foundation e.V.
    34 Distribution: OpenPKG Community
    35 Class:        BASE
    36 Group:        Libraries
    37 License:      Apache
    38 Version:      %{V_apr}
    39 Release:      20120214
    41 #   package options
    42 %option       with_threads  no
    43 %option       with_db       no
    44 %option       with_gdbm     no
    45 %option       with_iconv    no
    46 %option       with_ldap     no
    47 %option       with_odbc     no
    48 %option       with_pgsql    no
    49 %option       with_mysql    no
    50 %option       with_sqlite   no
    52 #   list of sources
    53 Source0:      http://www.apache.org/dist/apr/apr-%{V_apr}.tar.gz
    54 Source1:      http://www.apache.org/dist/apr/apr-util-%{V_apr_util}.tar.gz
    55 Patch0:       apr.patch
    57 #   build information
    58 BuildPreReq:  OpenPKG, openpkg >= 20100101, sed, make
    59 PreReq:       OpenPKG, openpkg >= 20100101, sed
    60 BuildPreReq:  expat
    61 PreReq:       expat
    62 %if "%{with_db}" == "yes"
    63 BuildPreReq:  db >= 4.6
    64 PreReq:       db >= 4.6
    65 %endif
    66 %if "%{with_gdbm}" == "yes"
    67 BuildPreReq:  gdbm
    68 PreReq:       gdbm
    69 %endif
    70 %if "%{with_iconv}" == "yes"
    71 BuildPreReq:  libiconv
    72 PreReq:       libiconv
    73 %endif
    74 %if "%{with_ldap}" == "yes"
    75 BuildPreReq:  openldap, openssl >= 0.9.8
    76 PreReq:       openldap, openssl >= 0.9.8
    77 %endif
    78 %if "%{with_odbc}" == "yes"
    79 BuildPreReq:  ODBC
    80 PreReq:       ODBC
    81 %endif
    82 %if "%{with_pgsql}" == "yes"
    83 BuildPreReq:  postgresql
    84 PreReq:       postgresql
    85 %endif
    86 %if "%{with_mysql}" == "yes"
    87 BuildPreReq:  mysql
    88 PreReq:       mysql
    89 %endif
    90 %if "%{with_sqlite}" == "yes"
    91 BuildPreReq:  sqlite
    92 PreReq:       sqlite
    93 %endif
    95 %description
    96     Apache Portable Runtime (APR) is a library of C data structures
    97     and routines, forming a common system portability layer to as many
    98     operating systems as possible.
   100 %track
   101     prog apr = {
   102         version   = %{V_apr}
   103         url       = http://www.apache.org/dist/apr/
   104         regex     = apr-(__VER__)\.tar\.gz
   105     }
   106     prog apr:apr-util = {
   107         version   = %{V_apr_util}
   108         url       = http://www.apache.org/dist/apr/
   109         regex     = apr-util-(__VER__)\.tar\.gz
   110     }
   112 %prep
   113     %setup -q -c
   114     %setup -q -D -T -a 1
   115     %patch -p0
   117 %build
   118     ( cd apr-%{V_apr}
   119       CC="%{l_cc}" \
   120       CFLAGS="%{l_cflags -O}" \
   121       CONFIG_SHELL="/bin/sh" \
   122       ./configure \
   123           --enable-layout=GNU \
   124           --prefix=%{l_prefix} \
   125           --includedir=%{l_prefix}/include/apr \
   126           --datadir=%{l_prefix}/share/apr \
   127 %if "%{with_threads}" == "yes"
   128           --enable-threads \
   129 %else
   130           --disable-threads \
   131 %endif
   132           --enable-shared \
   133           --enable-static
   134       %{l_make} %{l_mflags -O}
   135     ) || exit $?
   136     ( cd apr-util-%{V_apr_util}
   137       cp /dev/null config.cache
   138 %if "%{with_iconv}" == "no"
   139       ( echo "ac_cv_header_iconv_h=no"
   140       ) >config.cache
   141 %endif
   142       CC="%{l_cc}" \
   143       CFLAGS="%{l_cflags -O}" \
   144 %if "%{with_ldap}" == "yes"
   145       LIBS="-lssl -lcrypto" \
   146 %endif
   147       ./configure \
   148           --cache-file=./config.cache \
   149           --enable-layout=GNU \
   150           --prefix=%{l_prefix} \
   151           --includedir=%{l_prefix}/include/apr \
   152           --datadir=%{l_prefix}/share/apr \
   153           --with-apr=`pwd`/../apr-%{V_apr} \
   154 %if "%{with_db}" == "yes"
   155           --with-berkeley-db=%{l_prefix} \
   156 %endif
   157 %if "%{with_gdbm}" == "yes"
   158           --with-gdbm=%{l_prefix} \
   159 %endif
   160 %if "%{with_db}" == "yes"
   161           --with-dbm=db46 \
   162 %else
   163 %if "%{with_gdbm}" == "yes"
   164           --with-dbm=gdbm \
   165 %else
   166           --with-dbm=sdbm \
   167 %endif
   168 %endif
   169           --with-expat=%{l_prefix} \
   170 %if "%{with_iconv}" == "yes"
   171           --with-iconv=%{l_prefix} \
   172 %endif
   173 %if "%{with_ldap}" == "yes"
   174           --with-ldap \
   175           --with-ldap-include=%{l_prefix}/include/ \
   176           --with-ldap-lib=%{l_prefix}/lib \
   177 %endif
   178 %if "%{with_odbc}" == "yes"
   179           --with-odbc=%{l_prefix} \
   180 %else
   181           --without-odbc \
   182 %endif
   183 %if "%{with_pgsql}" == "yes"
   184           --with-pgsql=%{l_prefix} \
   185 %else
   186           --without-pgsql \
   187 %endif
   188 %if "%{with_mysql}" == "yes"
   189           --with-mysql=%{l_prefix} \
   190 %else
   191           --without-mysql \
   192 %endif
   193 %if "%{with_sqlite}" == "yes"
   194           --with-sqlite3=%{l_prefix} \
   195 %else
   196           --without-sqlite3 \
   197 %endif
   198           --enable-util-dso \
   199           --enable-shared \
   200           --enable-static
   201       %{l_make} %{l_mflags -O}
   202     ) || exit $?
   204 %install
   205     ( cd apr-%{V_apr}
   206       %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   207     ) || exit $?
   208     ( cd apr-util-%{V_apr_util}
   209       %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   210     ) || exit $?
   211     rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/apr.exp
   212     rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/aprutil.exp
   213     rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/apr-util-1/*.a
   214     rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
   215     rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.so*
   216     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
   218 %files -f files
   220 %clean

mercurial