| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917 |
- ##
- ## apache.spec -- OpenPKG RPM Specification
- ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
- ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
- ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- ## ATTENTION: This package specification is a cruel one. It allows
- ## one to build an Apache package in hundreds of variants with just
- ## a single specification through the use of lots of condition
- ## variables. The reason for this attempt is that it was born out of
- ## the needs from the daily practice at an ISP. So do not treat this
- ## specification as a reference example of any kind, except perhaps as
- ## a example of what is maximum possible with RPM and how far one can
- ## go with the macro mechanism. But do not try to repeat this!
- # package component versions
- %define V_apache 1.3.27
- %define V_mod_ssl 2.8.14-1.3.27
- %define V_mod_perl 1.28
- %define V_mod_php 4.3.2
- %define V_mod_php3 3.0.18
- %define V_mod_dav 1.0.3-1.3.6
- %define V_mod_layout 3.2
- %define V_mod_macro 1.1.2
- %define V_mod_auth_pam 1.1.1
- %define V_mod_auth_ldap 2.4.1
- %define V_mod_gzip 1.3.19.1a
- %define V_mod_fastcgi 2.4.0
- %define V_mod_throttle 312
- %define V_mod_access_referer 1.0.2
- %define V_mod_roaming 1.0.2
- %define V_mod_relocate 1.0
- # package information
- Name: apache
- Summary: Apache HTTP Server
- URL: http://httpd.apache.org/
- Vendor: Apache Software Foundation
- Packager: The OpenPKG Project
- Distribution: OpenPKG [BASE]
- Group: Web
- License: ASF
- Version: %{V_apache}
- Release: 20030703
- # package options (suexec related)
- %option with_suexec yes
- %option with_suexec_caller %{l_nusr}
- %option with_suexec_userdir public_html
- # package options (additionally used Apache modules; can be enabled without thinking)
- %option with_mod_ssl no
- %option with_mod_perl no
- %option with_mod_php no
- %option with_mod_php3 no
- %option with_mod_dav no
- %option with_mod_layout no
- %option with_mod_macro no
- # package options (additionally used Apache modules; you have to know what you do)
- %option with_mod_auth_ldap no
- %option with_mod_auth_pam no
- %option with_mod_gzip no
- %option with_mod_fastcgi no
- %option with_mod_throttle no
- %option with_mod_access_referer no
- %option with_mod_roaming no
- %option with_mod_relocate no
- # package options (optional PHP4 specific settings; requires "with_mod_php")
- %option with_mod_php_calendar no
- %option with_mod_php_mysql no
- %option with_mod_php_gd no
- %option with_mod_php_db no
- %option with_mod_php_debug no
- %option with_mod_php_pdflib no
- %option with_mod_php_zlib no
- %option with_mod_php_bzip2 no
- %option with_mod_php_openssl no
- %option with_mod_php_openldap no
- %option with_mod_php_openldapsasl no
- %option with_mod_php_mm no
- %option with_mod_php_pcre no
- %option with_mod_php_ftp no
- %option with_mod_php_java no
- %option with_mod_php_oci7 no
- %option with_mod_php_oci8 no
- %option with_mod_php_freetype no
- %option with_mod_php_gettext no
- %option with_mod_php_imap no
- %option with_mod_php_xml no
- %option with_mod_php_dom no
- %option with_mod_php_bc no
- %option with_mod_php_transsid no
- %option with_mod_php_curl no
- %option with_mod_php_mhash no
- %option with_mod_php_wddx no
- %option with_mod_php_gdbm no
- %option with_mod_php_versioning no
- # package options (optional PHP3 specific settings; requires "with_mod_php3")
- %option with_mod_php3_ftp no
- %option with_mod_php3_gd no
- %option with_mod_php3_jpeg no
- %option with_mod_php3_mysql no
- %option with_mod_php3_openssl no
- %option with_mod_php3_zlib no
- # package options (braindead ones only)
- %option with_gdbm_ndbm no
- # fixing implicit inter-module dependencies and correlations
- %if "%{with_mod_php}" == "yes"
- %if "%{with_mod_php3}" == "yes"
- RPM ERROR: with_mod_php conflicts with with_mod_php3
- %endif
- %if "%{with_mod_ssl}" == "yes"
- %undefine with_mod_php_openssl
- %undefine with_mod_php_mm
- %define with_mod_php_openssl yes
- %define with_mod_php_mm yes
- %endif
- %if "%{with_mod_php_freetype}" == "yes"
- %undefine with_mod_php_gd
- %define with_mod_php_gd yes
- %endif
- %if "%{with_mod_php_mysql}" == "yes" || "%{with_mod_php_pdflib}" == "yes" || "%{with_mod_php_gd}" == "yes" || "%{with_mod_php_dom}" == "yes"
- %undefine with_mod_php_zlib
- %define with_mod_php_zlib yes
- %endif
- %endif
- %if "%{with_mod_php3}" == "yes"
- %if "%{with_mod_ssl}" == "yes"
- %undefine with_mod_php3_openssl
- %define with_mod_php3_openssl yes
- %endif
- %if "%{with_mod_php3_mysql}" == "yes"
- %undefine with_mod_php3_zlib
- %define with_mod_php3_zlib yes
- %endif
- %endif
- %if "%{with_mod_php_gdbm}" == "yes"
- %undefine with_gdbm_ndbm
- %define with_gdbm_ndbm yes
- %endif
- # list of sources
- Source0: http://www.apache.org/dist/httpd/apache_%{V_apache}.tar.gz
- Source1: http://www.modssl.org/source/mod_ssl-%{V_mod_ssl}.tar.gz
- Source2: http://perl.apache.org/dist/mod_perl-%{V_mod_perl}.tar.gz
- Source3: http://www.php.net/distributions/php-%{V_mod_php}.tar.gz
- Source4: http://www.webdav.org/mod_dav/mod_dav-%{V_mod_dav}.tar.gz
- Source5: http://software.tangent.org/download/mod_layout-%{V_mod_layout}.tar.gz
- Source6: http://www.cri.ensmp.fr/~coelho/mod_macro/mod_macro-%{V_mod_macro}.tar.gz
- Source7: http://pam.sourceforge.net/mod_auth_pam/dist/mod_auth_pam.tar.gz
- Source8: http://www.remotecommunications.com/apache/mod_gzip/src/%{V_mod_gzip}/mod_gzip.c
- Source9: http://www.fastcgi.com/dist/mod_fastcgi-%{V_mod_fastcgi}.tar.gz
- Source10: http://www.snert.com/Software/mod_throttle/mod_throttle%{V_mod_throttle}.tgz
- Source11: http://download.sourceforge.net/accessreferer/mod_access_referer-%{V_mod_access_referer}.tar.gz
- Source12: http://www.klomp.org/mod_roaming/mod_roaming-%{V_mod_roaming}.tar.gz
- Source13: http://software.tangent.org/download/mod_relocate-%{V_mod_relocate}.tar.gz
- Source14: http://www.php.net/distributions/php-%{V_mod_php3}.tar.gz
- Source15: http://www.muquit.com/muquit/software/mod_auth_ldap/mod_auth_ldap.tar.gz
- Source20: apache.conf
- Source21: apache.base
- Source22: apache.vhost
- Source23: apache.pl
- Source24: rc.apache
- Patch0: apache.patch
- Patch1: php.patch
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20030103
- PreReq: OpenPKG, openpkg >= 20030103
- %if "%{with_mod_ssl}" == "yes"
- BuildPreReq: openssl, mm
- %endif
- %if "%{with_mod_perl}" == "yes"
- BuildPreReq: perl
- PreReq: perl
- %endif
- %if "%{with_mod_php}" == "yes"
- BuildPreReq: gcc, sed, flex, bison
- %if "%{with_mod_php_mysql}" == "yes"
- BuildPreReq: MYSQL
- %endif
- %if "%{with_mod_php_gd}" == "yes"
- BuildPreReq: gd, jpeg, png
- %endif
- %if "%{with_mod_php_db}" == "yes"
- BuildPreReq: db
- %endif
- %if "%{with_mod_php_pdflib}" == "yes"
- BuildPreReq: pdflib, jpeg, png
- %endif
- %if "%{with_mod_php_zlib}" == "yes"
- BuildPreReq: zlib
- %endif
- %if "%{with_mod_php_bzip2}" == "yes"
- BuildPreReq: bzip2
- %endif
- %if "%{with_mod_php_openssl}" == "yes"
- BuildPreReq: openssl
- %endif
- %if "%{with_mod_php_openldap}" == "yes"
- BuildPreReq: openldap, openssl
- %if "%{with_mod_php_openldapsasl}" == "yes"
- BuildPreReq: openldap::with_sasl = yes
- %else
- BuildPreReq: openldap::with_sasl = no
- %endif
- %endif
- %if "%{with_mod_php_mm}" == "yes"
- BuildPreReq: mm
- %endif
- %if "%{with_mod_php_pcre}" == "yes"
- BuildPreReq: pcre
- %endif
- %if "%{with_mod_php_java}" == "yes"
- BuildPreReq: j2se
- %endif
- %if "%{with_mod_php_freetype}" == "yes"
- BuildPreReq: freetype
- %endif
- %if "%{with_mod_php_gettext}" == "yes"
- BuildPreReq: gettext, libiconv
- %endif
- %if "%{with_mod_php_imap}" == "yes"
- BuildPreReq: imap, openssl
- %endif
- %if "%{with_mod_php_xml}" == "yes"
- BuildPreReq: expat
- %endif
- %if "%{with_mod_php_dom}" == "yes"
- BuildPreReq: libxml, libxslt
- %endif
- %if "%{with_mod_php_curl}" == "yes"
- BuildPreReq: curl
- %endif
- %if "%{with_mod_php_mhash}" == "yes"
- BuildPreReq: mhash
- %endif
- %if "%{with_mod_php_gdbm}" == "yes"
- BuildPreReq: gdbm
- %endif
- %if "%{with_mod_php_oci7}" == "yes" || "%{with_mod_php_oci8}" == "yes"
- BuildPreReq: ORACLE
- %endif
- %endif
- %if "%{with_mod_php3}" == "yes"
- BuildPreReq: make, bison, flex
- %if "%{with_mod_php3_gd}" == "yes"
- BuildPreReq: gd
- %endif
- %if "%{with_mod_php3_jpeg}" == "yes"
- BuildPreReq: jpeg
- %endif
- %if "%{with_mod_php3_mysql}" == "yes"
- BuildPreReq: MYSQL
- %endif
- %if "%{with_mod_php3_openssl}" == "yes"
- BuildPreReq: openssl
- %endif
- %if "%{with_mod_php3_zlib}" == "yes"
- BuildPreReq: zlib
- %endif
- %endif
- %if "%{with_mod_auth_ldap}" == "yes"
- BuildPreReq: openldap, openssl
- %endif
- %if "%{with_mod_auth_pam}" == "yes"
- BuildPreReq: PAM
- PreReq: PAM
- %endif
- %if "%{with_gdbm_ndbm}" == "yes"
- BuildPreReq: gdbm, gdbm::with_ndbm = yes
- %endif
- AutoReq: no
- AutoReqProv: no
- %description
- The Apache Project is a collaborative software development effort
- aimed at creating a robust, commercial-grade, featureful, and
- freely-available source code implementation of an HTTP (Web) server.
- The project is jointly managed by a group of volunteers located
- around the world, using the Internet and the Web to communicate,
- plan, and develop the server and its related documentation. These
- volunteers are known as the Apache Group. In addition, hundreds
- of users have contributed ideas, code, and documentation to the
- project.
- %prep
- # unpack Apache distribution
- %setup0 -q -c
- %patch0 -p0
- # unpack optional extension modules
- %if "%{with_mod_ssl}" == "yes"
- %setup1 -q -T -D -a 1
- %endif
- %if "%{with_mod_perl}" == "yes"
- %setup2 -q -T -D -a 2
- %endif
- %if "%{with_mod_php}" == "yes"
- %setup3 -q -T -D -a 3
- %patch1 -p0
- %endif
- %if "%{with_mod_dav}" == "yes"
- %setup4 -q -T -D -a 4
- %endif
- %if "%{with_mod_layout}" == "yes"
- %setup5 -q -T -D -a 5
- %endif
- %if "%{with_mod_macro}" == "yes"
- %setup6 -q -T -D -a 6
- %endif
- %if "%{with_mod_auth_pam}" == "yes"
- %setup7 -q -T -D -a 7
- %endif
- %if "%{with_mod_fastcgi}" == "yes"
- %setup9 -q -T -D -a 9
- %endif
- %if "%{with_mod_throttle}" == "yes"
- %setup10 -q -T -D -a 10
- %endif
- %if "%{with_mod_access_referer}" == "yes"
- %setup11 -q -T -D -a 11
- %endif
- %if "%{with_mod_roaming}" == "yes"
- %setup12 -q -T -D -a 12
- %endif
- %if "%{with_mod_relocate}" == "yes"
- %setup13 -q -T -D -a 13
- %endif
- %if "%{with_mod_php3}" == "yes"
- %setup14 -q -T -D -a 14
- %endif
- %if "%{with_mod_auth_ldap}" == "yes"
- %setup15 -q -T -D -a 15
- %endif
- %build
- # prepare environment
- rm -rf $RPM_BUILD_ROOT
- %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}
- # optionally prepare mod_ssl
- %if "%{with_mod_ssl}" == "yes"
- ( cd mod_ssl-%{V_mod_ssl}
- ./configure \
- --with-apache=../apache_%{V_apache} \
- --expert --force
- )
- %endif
- # optionally pre-configure Apache for mod_php, mod_php3 and mod_dav
- %if "%{with_mod_php}" == "yes" || "%{with_mod_php3}" == "yes" || "%{with_mod_dav}" == "yes"
- ( cd apache_%{V_apache}
- CC="%{l_cc}" \
- CFLAGS="%{l_cflags -O}" \
- ./configure \
- %if "%{with_mod_ssl}" == "yes"
- --enable-rule=EAPI \
- %endif
- --target=apache \
- --with-layout=GNU \
- --prefix=%{l_prefix} \
- --sbindir=%{l_prefix}/sbin \
- --sysconfdir=%{l_prefix}/etc/apache \
- --libexecdir=%{l_prefix}/lib/apache \
- --datadir=%{l_prefix}/share/apache \
- --localstatedir=%{l_prefix}/var/apache
- )
- %endif
- # optionally prepare mod_perl
- %if "%{with_mod_perl}" == "yes"
- ( cd mod_perl-%{V_mod_perl}
- eval `%{l_prefix}/bin/perl -V:archname`
- eval `%{l_prefix}/bin/perl -V:version`
- eval `%{l_prefix}/bin/perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
- %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/bin
- perl=$RPM_BUILD_ROOT%{l_prefix}/bin/perl
- echo "#!/bin/sh" >$perl
- echo "exec %{l_prefix}/bin/perl \\" >>$perl
- echo " -I${RPM_BUILD_ROOT}${installarchlib} \\" >>$perl
- echo " -I${RPM_BUILD_ROOT}${installprivlib} \\" >>$perl
- echo " -I${RPM_BUILD_ROOT}${installsitearch} \\" >>$perl
- echo " -I${RPM_BUILD_ROOT}${installsitelib} \\" >>$perl
- echo " \"\$@\"" >>$perl
- chmod a+x $perl
- $perl Makefile.PL \
- PREFIX=$RPM_BUILD_ROOT%{l_prefix} \
- APACHE_SRC=../apache_%{V_apache}/src \
- DO_HTTPD=1 \
- USE_APACI=1 \
- PREP_HTTPD=1 \
- EVERYTHING=1 \
- PERL_TIE_TABLES=1 \
- PERL_DIRECTIVE_HANDLERS=1
- %{l_make} %{l_mflags}
- %{l_make} %{l_mflags} install
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
- %{l_shtool} subst -e "s;^\\(PERL = \\).*;\\1 $perl;" \
- ../apache_%{V_apache}/src/modules/perl/mod_perl.config
- )
- %endif
- # optionally prepare mod_php
- %if "%{with_mod_php}" == "yes"
- ( cd php-%{V_mod_php}
- CC="%{l_cc}"; export CC
- CFLAGS="%{l_cflags -O} %{l_cppflags}"; export CFLAGS
- CPPFLAGS="%{l_cflags -O} %{l_cppflags}"; export CPPFLAGS
- LDFLAGS="%{l_cflags -O} %{l_ldflags}"; export LDFLAGS
- LIBS=""; export LIBS
- %if "%{with_mod_ssl}" == "yes"
- CFLAGS="$CFLAGS -DEAPI"
- %endif
- %if "%{with_mod_php_gd}" == "yes"
- LIBS="$LIBS -lpng -lz"
- %endif
- %if "%{with_mod_php_gettext}" == "yes"
- LIBS="$LIBS -liconv"
- %endif
- %if "%{with_mod_php_openldap}" == "yes" && "%{with_mod_php_openldapsasl}" == "yes"
- LIBS="$LIBS -lsasl2"
- %endif
- %if "%{with_mod_php_imap}" == "yes"
- LIBS="$LIBS -lssl -lcrypto"
- %endif
- %if "%{with_mod_php_db}" == "yes"
- LIBS="$LIBS -ldb"
- %endif
- %if "%{with_mod_php_oci7}" == "yes" || "%{with_mod_php_oci8}" == "yes"
- ORACLE_HOME="`%{l_prefix}/etc/rc --query oracle_home`"
- export ORACLE_HOME
- %endif
- ./configure \
- --prefix=%{l_prefix} \
- --with-apache=../apache_%{V_apache} \
- --with-config-file-path=%{l_prefix}/etc/apache \
- %if "%{with_mod_php_calendar}" == "yes"
- --enable-calendar \
- %endif
- %if "%{with_mod_php_mysql}" == "yes"
- --with-mysql=%{l_prefix} \
- %else
- --without-mysql \
- %endif
- %if "%{with_mod_php_gd}" == "yes"
- --with-gd=%{l_prefix} \
- --with-jpeg-dir=%{l_prefix} \
- --with-png-dir=%{l_prefix} \
- %endif
- %if "%{with_mod_php_freetype}" == "yes"
- --enable-gd-imgstrttf \
- --enable-gd-native-ttf \
- --with-freetype-dir=%{l_prefix} \
- %endif
- %if "%{with_mod_php_db}" == "yes"
- --with-db4=%{l_prefix} \
- %endif
- %if "%{with_mod_php_debug}" == "yes"
- --with-debug=yes \
- %else
- --with-debug=no \
- %endif
- %if "%{with_mod_php_zlib}" == "yes"
- --with-zlib=%{l_prefix} \
- --with-zlib-dir=%{l_prefix} \
- %endif
- %if "%{with_mod_php_bzip2}" == "yes"
- --with-bz2=%{l_prefix} \
- %endif
- %if "%{with_mod_php_pdflib}" == "yes"
- --with-pdflib=%{l_prefix} \
- --with-jpeg-dir=%{l_prefix} \
- --with-png-dir=%{l_prefix} \
- %endif
- %if "%{with_mod_php_openssl}" == "yes" || "%{with_mod_php_openldap}" == "yes"
- --with-openssl=%{l_prefix} \
- %endif
- %if "%{with_mod_php_openldap}" == "yes"
- --with-ldap=%{l_prefix} \
- %endif
- %if "%{with_mod_php_mm}" == "yes"
- --with-mm=%{l_prefix} \
- --enable-session \
- %endif
- %if "%{with_mod_php_pcre}" == "yes"
- --with-pcre=%{l_prefix} \
- %endif
- %if "%{with_mod_php_ftp}" == "yes"
- --enable-ftp \
- %endif
- %if "%{with_mod_php_java}" == "yes"
- --with-java=%{l_prefix}/libexec/j2se \
- %endif
- %if "%{with_mod_php_oci7}" == "yes"
- --with-oracle \
- %endif
- %if "%{with_mod_php_oci8}" == "yes"
- --with-oci8 \
- %endif
- %if "%{with_mod_php_gettext}" == "yes"
- --with-gettext=%{l_prefix} \
- %endif
- %if "%{with_mod_php_imap}" == "yes"
- --with-imap=%{l_prefix} \
- --with-imap-ssl=%{l_prefix} \
- %endif
- %if "%{with_mod_php_xml}" == "yes"
- --with-xml=%{l_prefix} \
- %endif
- %if "%{with_mod_php_dom}" == "yes"
- --with-dom=%{l_prefix} \
- --with-dom-xslt=%{l_prefix} \
- --with-dom-exslt=%{l_prefix} \
- %endif
- %if "%{with_mod_php_wddx}" == "yes"
- --enable-wddx \
- %endif
- %if "%{with_mod_php_bc}" == "yes"
- --enable-bcmath \
- %endif
- %if "%{with_mod_php_transsid}" == "yes"
- --enable-trans-sid \
- %endif
- %if "%{with_mod_php_mhash}" == "yes"
- --with-mhash=%{l_prefix} \
- %endif
- %if "%{with_mod_php_curl}" == "yes"
- --with-curl=%{l_prefix} \
- %endif
- %if "%{with_mod_php_gdbm}" == "yes"
- --with-gdbm=%{l_prefix} \
- %endif
- %if "%{with_mod_php_versioning}" == "yes"
- --enable-versioning \
- %endif
- --disable-cli \
- --without-pear \
- --disable-shared \
- --enable-inline-optimization \
- --enable-track-vars
- %{l_make} %{l_mflags}
- %{l_shtool} subst \
- -e "s;^\\(EXTENSION_DIR = \\)\\(%{l_prefix}\\);\\1$RPM_BUILD_ROOT\\2;" \
- -e "s;^\\(PEAR_INSTALLDIR = \\)\\(%{l_prefix}\\);\\1$RPM_BUILD_ROOT\\2;" \
- config_vars.mk
- %{l_make} %{l_mflags} install \
- prefix=$RPM_BUILD_ROOT%{l_prefix}
- )
- %endif
- # optionally prepare mod_php3
- %if "%{with_mod_php3}" == "yes"
- ( cd php-%{V_mod_php3}
- CC="%{l_cc}" \
- %if "%{with_mod_ssl}" == "yes"
- CFLAGS="%{l_cflags -O} %{l_cppflags} -DEAPI" \
- %else
- CFLAGS="%{l_cflags -O} %{l_cppflags}" \
- %endif
- CPPFLAGS="%{l_cflags -O} %{l_cppflags}" \
- LDFLAGS="%{l_cflags -O} %{l_ldflags}" \
- ./configure \
- --prefix=%{l_prefix} \
- --with-apache=../apache_%{V_apache} \
- --with-config-file-path=%{l_prefix}/etc/apache \
- %if "%{with_mod_php3_ftp}" == "yes"
- --with-ftp \
- %endif
- %if "%{with_mod_php3_mysql}" == "yes"
- --with-mysql=%{l_prefix} \
- %else
- --without-mysql \
- %endif
- %if "%{with_mod_php3_zlib}" == "yes"
- --with-zlib=%{l_prefix} \
- %endif
- %if "%{with_mod_php3_jpeg}" == "yes"
- --with-jpeg=%{l_prefix} \
- %endif
- %if "%{with_mod_php3_gd}" == "yes"
- --with-gd=%{l_prefix} \
- %endif
- %if "%{with_mod_php3_openssl}" == "yes"
- --with-openssl=%{l_prefix} \
- %endif
- --disable-shared \
- --enable-track-vars
- %{l_make} %{l_mflags}
- %{l_make} %{l_mflags} install \
- prefix=$RPM_BUILD_ROOT%{l_prefix}
- )
- %endif
- # optionally prepare mod_dav
- %if "%{with_mod_dav}" == "yes"
- ( cd mod_dav-%{V_mod_dav}
- CC="%{l_cc}" \
- %if "%{with_mod_ssl}" == "yes"
- CFLAGS="%{l_cflags -O}" \
- %else
- CFLAGS="%{l_cflags -O} -DEAPI" \
- %endif
- LDFLAGS="%{l_cflags -O}" \
- ./configure \
- --with-apache=../apache_%{V_apache}
- %{l_make} %{l_mflags}
- %{l_make} %{l_mflags} install
- )
- %endif
- # optionally prepare mod_layout
- %if "%{with_mod_layout}" == "yes"
- ( cd mod_layout-%{V_mod_layout}
- mkdir ../apache_%{V_apache}/src/modules/layout
- cp * ../apache_%{V_apache}/src/modules/layout/ 2>/dev/null || true
- chmod -R u+w ../apache_%{V_apache}/src/modules/layout
- )
- %endif
- # optionally prepare mod_macro
- %if "%{with_mod_macro}" == "yes"
- ( cd mod_macro-%{V_mod_macro}
- cp mod_macro.c ../apache_%{V_apache}/src/modules/extra/
- )
- %endif
- # optionally prepare mod_auth_pam
- %if "%{with_mod_auth_pam}" == "yes"
- ( cd mod_auth_pam-%{V_mod_auth_pam}
- sed -e '234N;s/\n//' -e '239N;s/\n//' <mod_auth_pam.c \
- >../apache_%{V_apache}/src/modules/extra/mod_auth_pam.c
- )
- %endif
- # optionally prepare mod_auth_ldap
- %if "%{with_mod_auth_ldap}" == "yes"
- ( cd modauthldap
- cp mod_auth_ldap.c ../apache_%{V_apache}/src/modules/extra/
- )
- %endif
- # optionally prepare mod_gzip
- %if "%{with_mod_gzip}" == "yes"
- cp %{SOURCE mod_gzip.c} apache_%{V_apache}/src/modules/extra/
- %endif
- # optionally prepare mod_fastcgi
- %if "%{with_mod_fastcgi}" == "yes"
- ( cd mod_fastcgi-%{V_mod_fastcgi}
- mkdir ../apache_%{V_apache}/src/modules/fastcgi
- cp -rp * ../apache_%{V_apache}/src/modules/fastcgi/
- )
- %endif
- # optionally prepare mod_throttle
- %if "%{with_mod_throttle}" == "yes"
- ( cd mod_throttle-*
- cp mod_throttle.c ../apache_%{V_apache}/src/modules/extra/
- )
- %endif
- # optionally prepare mod_access_referer
- %if "%{with_mod_access_referer}" == "yes"
- ( cd mod_access_referer-%{V_mod_access_referer}
- cp mod_access_referer.c ../apache_%{V_apache}/src/modules/extra/
- )
- %endif
- # optionally prepare mod_roaming
- %if "%{with_mod_roaming}" == "yes"
- ( cd mod_roaming-%{V_mod_roaming}
- cp mod_roaming.c ../apache_%{V_apache}/src/modules/extra/
- )
- %endif
- # optionally prepare mod_relocate
- %if "%{with_mod_relocate}" == "yes"
- ( cd mod_relocate-%{V_mod_relocate}
- cp mod_relocate.c ../apache_%{V_apache}/src/modules/extra/
- )
- %endif
- # configure Apache
- ( cd apache_%{V_apache}
- cflags="%{l_cflags -O}"
- ldflags=""
- libs=""
- %if "%{with_mod_auth_pam}" == "yes"
- pam_incdir=`%{l_prefix}/etc/rc --query pam_incdir`
- if [ ".$pam_incdir" != "./usr/include" -a ".$pam_incdir" != "./include" ]; then
- cflags="$cflags -I$pam_incdir"
- fi
- pam_libdir=`%{l_prefix}/etc/rc --query pam_libdir`
- if [ ".$pam_libdir" != "./usr/lib" -a ".$pam_libdir" != "./lib" ]; then
- ldflags="$ldflags -L$pam_libdir"
- fi
- libs="$libs -lpam"
- %endif
- %if "%{with_mod_auth_ldap}" == "yes"
- cflags="$cflags %{l_cppflags}"
- ldflags="$ldflags %{l_ldflags}"
- libs="$libs -lldap -llber -lssl -lcrypto"
- %endif
- %if "%{with_gdbm_ndbm}" == "yes"
- cflags="$cflags %{l_cppflags}"
- ldflags="$ldflags %{l_ldflags}"
- libs="$libs -lndbm -lgdbm"
- %endif
- CC="%{l_cc}" \
- CFLAGS="$cflags" \
- LDFLAGS="$ldflags" \
- LIBS="$libs" \
- %if "%{with_mod_ssl}" == "yes"
- EAPI_MM="%{l_prefix}" \
- SSL_BASE="%{l_prefix}" \
- %endif
- ./configure \
- --target=apache \
- --with-layout=GNU \
- --prefix=%{l_prefix} \
- --sbindir=%{l_prefix}/sbin \
- --sysconfdir=%{l_prefix}/etc/apache \
- --libexecdir=%{l_prefix}/lib/apache \
- --datadir=%{l_prefix}/share/apache \
- --localstatedir=%{l_prefix}/var/apache \
- %if "%{with_suexec}" == "yes"
- --enable-suexec \
- --suexec-caller=%{with_suexec_caller} \
- --suexec-userdir=%{with_suexec_userdir} \
- %endif
- --enable-module=most \
- --with-perl=%{l_prefix}/bin/perl \
- %if "%{with_mod_ssl}" == "yes"
- --enable-rule=EAPI \
- --enable-module=ssl \
- %endif
- %if "%{with_mod_perl}" == "yes"
- --activate-module=src/modules/perl/libperl.a \
- %endif
- %if "%{with_mod_php}" == "yes"
- --activate-module=src/modules/php4/libphp4.a \
- %endif
- %if "%{with_mod_php3}" == "yes"
- --activate-module=src/modules/php3/libphp3.a \
- %endif
- %if "%{with_mod_dav}" == "yes"
- --activate-module=src/modules/dav/libdav.a \
- --enable-rule=EXPAT \
- %else
- --disable-rule=EXPAT \
- %endif
- %if "%{with_mod_layout}" == "yes"
- --activate-module=src/modules/layout/liblayout.a \
- %endif
- %if "%{with_mod_macro}" == "yes"
- --activate-module=src/modules/extra/mod_macro.o \
- %endif
- %if "%{with_mod_auth_pam}" == "yes"
- --activate-module=src/modules/extra/mod_auth_pam.o \
- %endif
- %if "%{with_mod_auth_ldap}" == "yes"
- --activate-module=src/modules/extra/mod_auth_ldap.c \
- %endif
- %if "%{with_mod_gzip}" == "yes"
- --activate-module=src/modules/extra/mod_gzip.o \
- %endif
- %if "%{with_mod_fastcgi}" == "yes"
- --activate-module=src/modules/fastcgi/libfastcgi.a \
- %endif
- %if "%{with_mod_throttle}" == "yes"
- --activate-module=src/modules/extra/mod_throttle.o \
- %endif
- %if "%{with_mod_access_referer}" == "yes"
- --activate-module=src/modules/extra/mod_access_referer.o \
- %endif
- %if "%{with_mod_roaming}" == "yes"
- --activate-module=src/modules/extra/mod_roaming.o \
- %endif
- %if "%{with_mod_relocate}" == "yes"
- --activate-module=src/modules/extra/mod_relocate.o \
- %endif
- --enable-module=so
- %{l_make} %{l_mflags -O} build-quiet
- )
- %install
- # install Apache
- ( cd apache_%{V_apache}
- # perform standard Apache installation procedure
- %{l_make} %{l_mflags} install root=$RPM_BUILD_ROOT
- # post-adjustments to installation tree
- mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/small/* \
- $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/small
- rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/icons/README*
- rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/*.default
- rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/srm.conf
- rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/apache/access.conf
- mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html.en \
- $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html
- rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/index.html.*
- chmod a+rx $RPM_BUILD_ROOT%{l_prefix}/share/apache/cgi-bin/*
- mv $RPM_BUILD_ROOT%{l_prefix}/share/apache/cgi-bin \
- $RPM_BUILD_ROOT%{l_prefix}/cgi/
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/cgi/test-cgi
- )
- %if "%{with_mod_perl}" == "yes"
- # cleanup for mod_perl
- rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/perl
- # provide mod_perl init script
- %{l_shtool} install -c -m 644 \
- %{SOURCE apache.pl} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
- %endif
- # optionally make PHP happy
- %if "%{with_mod_php}" == "yes"
- %{l_shtool} install -c -m 644 /dev/null \
- $RPM_BUILD_ROOT%{l_prefix}/etc/apache/php.ini
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/php
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/php/build
- %endif
- # create default configuration
- l_hostname=`%{l_shtool} echo -e %h`
- l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
- %{l_shtool} install -c -m 644 \
- -e 's;@l_prefix@;%{l_prefix};g' \
- -e "s;@l_hostname@;$l_hostname;g" \
- -e "s;@l_domainname@;$l_domainname;g" \
- -e 's;@l_nusr@;%{l_nusr};g' \
- -e 's;@l_ngrp@;%{l_ngrp};g' \
- %{SOURCE apache.base} \
- %{SOURCE apache.conf} \
- %{SOURCE apache.vhost} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/apache/
- mv $RPM_BUILD_ROOT%{l_prefix}/etc/apache/magic $RPM_BUILD_ROOT%{l_prefix}/etc/apache/mime.magic
- find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
- # create run-command script
- %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
- %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
- -e 's;@l_susr@;%{l_susr};g' -e 's;@l_sgrp@;%{l_sgrp};g' \
- -e 's;@l_musr@;%{l_musr};g' -e 's;@l_mgrp@;%{l_mgrp};g' \
- %{SOURCE rc.apache} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
- # strip installation binaries
- strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
- strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true
- # determine installation tree files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- %if "%{with_suexec}" == "yes"
- '%attr(4755,root,%{l_mgrp}) %{l_prefix}/sbin/suexec' \
- %endif
- '%config %{l_prefix}/etc/apache/*' \
- %if "%{with_mod_ssl}" == "yes"
- '%config %{l_prefix}/etc/apache/ssl.crl/*.crl' \
- '%config %{l_prefix}/etc/apache/ssl.crt/*.crt' \
- '%config %{l_prefix}/etc/apache/ssl.csr/*.csr' \
- '%config %{l_prefix}/etc/apache/ssl.key/*.key' \
- '%config %{l_prefix}/etc/apache/ssl.prm/*.prm' \
- %endif
- '%config %attr(444,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/apache/apache.base' \
- '%config(noreplace) %attr(444,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/apache/apache.vhost'
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
- %post
- %if "%{with_mod_auth_pam}" == "yes"
- # add PAM configuration entry
- if [ $1 -eq 1 ]; then
- $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=apache
- fi
- %endif
- %preun
- %if "%{with_mod_auth_pam}" == "yes"
- # remove PAM configuration entry
- if [ $1 -eq 0 ]; then
- $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=apache
- fi
- %endif
|