apr/apr.spec

Wed, 08 Aug 2012 00:10:41 +0200

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

Correct seemingly SVR5 pthread specific source flaw, more specifically
solve: In function 'proc_mutex_choose_method', 'mutex_proc_pthread_methods'
undeclared in locks/unix/proc_mutex.c.

     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:      20120800
    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
   116     %{l_shtool} subst \
   117         -e 's;APR_USE_PROC_PTHREAD_SERIALIZE;APR_HAS_PROC_PTHREAD_SERIALIZE;' \
   118         apr-%{V_apr}/locks/unix/proc_mutex.c
   120 %build
   121     ( cd apr-%{V_apr}
   122       CC="%{l_cc}" \
   123       CFLAGS="%{l_cflags -O}" \
   124       CONFIG_SHELL="/bin/sh" \
   125       ./configure \
   126           --enable-layout=GNU \
   127           --prefix=%{l_prefix} \
   128           --includedir=%{l_prefix}/include/apr \
   129           --datadir=%{l_prefix}/share/apr \
   130 %if "%{with_threads}" == "yes"
   131           --enable-threads \
   132 %else
   133           --disable-threads \
   134 %endif
   135           --enable-shared \
   136           --enable-static
   137       %{l_make} %{l_mflags -O}
   138     ) || exit $?
   139     ( cd apr-util-%{V_apr_util}
   140       cp /dev/null config.cache
   141 %if "%{with_iconv}" == "no"
   142       ( echo "ac_cv_header_iconv_h=no"
   143       ) >config.cache
   144 %endif
   145       CC="%{l_cc}" \
   146       CFLAGS="%{l_cflags -O}" \
   147 %if "%{with_ldap}" == "yes"
   148       LIBS="-lssl -lcrypto" \
   149 %endif
   150       ./configure \
   151           --cache-file=./config.cache \
   152           --enable-layout=GNU \
   153           --prefix=%{l_prefix} \
   154           --includedir=%{l_prefix}/include/apr \
   155           --datadir=%{l_prefix}/share/apr \
   156           --with-apr=`pwd`/../apr-%{V_apr} \
   157 %if "%{with_db}" == "yes"
   158           --with-berkeley-db=%{l_prefix} \
   159 %endif
   160 %if "%{with_gdbm}" == "yes"
   161           --with-gdbm=%{l_prefix} \
   162 %endif
   163 %if "%{with_db}" == "yes"
   164           --with-dbm=db46 \
   165 %else
   166 %if "%{with_gdbm}" == "yes"
   167           --with-dbm=gdbm \
   168 %else
   169           --with-dbm=sdbm \
   170 %endif
   171 %endif
   172           --with-expat=%{l_prefix} \
   173 %if "%{with_iconv}" == "yes"
   174           --with-iconv=%{l_prefix} \
   175 %endif
   176 %if "%{with_ldap}" == "yes"
   177           --with-ldap \
   178           --with-ldap-include=%{l_prefix}/include/ \
   179           --with-ldap-lib=%{l_prefix}/lib \
   180 %endif
   181 %if "%{with_odbc}" == "yes"
   182           --with-odbc=%{l_prefix} \
   183 %else
   184           --without-odbc \
   185 %endif
   186 %if "%{with_pgsql}" == "yes"
   187           --with-pgsql=%{l_prefix} \
   188 %else
   189           --without-pgsql \
   190 %endif
   191 %if "%{with_mysql}" == "yes"
   192           --with-mysql=%{l_prefix} \
   193 %else
   194           --without-mysql \
   195 %endif
   196 %if "%{with_sqlite}" == "yes"
   197           --with-sqlite3=%{l_prefix} \
   198 %else
   199           --without-sqlite3 \
   200 %endif
   201           --enable-util-dso \
   202           --enable-shared \
   203           --enable-static
   204       %{l_make} %{l_mflags -O}
   205     ) || exit $?
   207 %install
   208     ( cd apr-%{V_apr}
   209       %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   210     ) || exit $?
   211     ( cd apr-util-%{V_apr_util}
   212       %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
   213     ) || exit $?
   214     rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/apr.exp
   215     rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/aprutil.exp
   216     rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/apr-util-1/*.a
   217     rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
   218     rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/*.so*
   219     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
   221 %files -f files
   223 %clean

mercurial