michael@684: ## michael@684: ## apache.spec -- OpenPKG RPM Package Specification michael@684: ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. michael@684: ## michael@684: ## Permission to use, copy, modify, and distribute this software for michael@684: ## any purpose with or without fee is hereby granted, provided that michael@684: ## the above copyright notice and this permission notice appear in all michael@684: ## copies. michael@684: ## michael@684: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@684: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@684: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@684: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@684: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@684: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@684: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@684: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@684: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@684: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@684: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@684: ## SUCH DAMAGE. michael@684: ## michael@684: michael@684: # package information michael@684: Name: apache michael@684: Summary: Apache HTTP Server michael@684: URL: http://httpd.apache.org/ michael@684: Vendor: Apache Software Foundation michael@684: Packager: OpenPKG Foundation e.V. michael@684: Distribution: OpenPKG Community michael@684: Class: BASE michael@684: Group: Web michael@684: License: ASF michael@684: Version: 2.2.22 michael@685: Release: 20120800 michael@684: michael@684: # package options michael@684: %option with_mpm_prefork yes michael@684: %option with_mpm_worker no michael@684: %option with_mpm_event no michael@684: %option with_suexec yes michael@684: %option with_suexec_caller %{l_nusr} michael@684: %option with_suexec_userdir public_html michael@684: %option with_mod_deflate no michael@684: %option with_mod_ext_filter no michael@684: %option with_mod_substitute no michael@684: %option with_mod_ssl no michael@684: %option with_mod_dav no michael@684: %option with_mod_ldap no michael@684: %option with_mod_dbd no michael@684: %option with_mod_proxy no michael@684: %option with_mod_cache no michael@684: %option with_mod_diskcache no michael@684: %option with_mod_memcache no michael@684: %option with_mod_filecache no michael@684: %option with_mod_authn_alias no michael@684: michael@684: # fixing implicit inter-module dependencies and correlations michael@684: %if "%{with_mpm_prefork}" == "yes" michael@684: %undefine with_mpm_worker michael@684: %undefine with_mpm_event michael@684: %endif michael@684: %if "%{with_mpm_worker}" == "yes" michael@684: %undefine with_mpm_prefork michael@684: %undefine with_mpm_event michael@684: %endif michael@684: %if "%{with_mpm_event}" == "yes" michael@684: %undefine with_mpm_prefork michael@684: %undefine with_mpm_worker michael@684: %endif michael@684: %if "%{with_mod_memcache}" == "yes" || "%{with_mod_diskcache}" == "yes" michael@684: %undefine with_mod_cache michael@684: %define with_mod_cache yes michael@684: %endif michael@684: michael@684: # list of sources michael@684: Source0: http://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2 michael@684: Source1: rc.apache michael@684: Source2: apache.base michael@684: Source3: apache.conf michael@684: Source4: apache.sh michael@684: Patch0: apache.patch michael@685: Patch1: apache.patch.davquo michael@684: michael@684: # build information michael@684: BuildPreReq: OpenPKG, openpkg >= 20100101, perl, make michael@684: PreReq: OpenPKG, openpkg >= 20100101, perl michael@684: BuildPreReq: apr, pcre michael@684: PreReq: apr, pcre michael@684: %if "%{with_mpm_worker}" == "yes" || "%{with_mpm_event}" == "yes" || "%{with_mod_memcache}" == "yes" michael@684: BuildPreReq: apr::with_threads = yes michael@684: PreReq: apr::with_threads = yes michael@684: %endif michael@684: %if "%{with_mod_ldap}" == "yes" michael@684: BuildPreReq: apr::with_ldap = yes michael@684: PreReq: apr::with_ldap = yes michael@684: %endif michael@684: %if "%{with_mod_ssl}" == "yes" michael@684: BuildPreReq: openssl >= 0.9.8 michael@684: PreReq: openssl >= 0.9.8 michael@684: PreReq: x509 michael@684: %endif michael@684: %if "%{with_mod_deflate}" == "yes" michael@684: BuildPreReq: zlib michael@684: PreReq: zlib michael@684: %endif michael@684: michael@684: %description michael@684: The Apache Project is a collaborative software development effort michael@684: aimed at creating a robust, commercial-grade, featureful, and michael@684: freely-available source code implementation of an HTTP (Web) server. michael@684: The project is jointly managed by a group of volunteers located michael@684: around the world, using the Internet and the Web to communicate, michael@684: plan, and develop the server and its related documentation. These michael@684: volunteers are known as the Apache Group. In addition, hundreds michael@684: of users have contributed ideas, code, and documentation to the michael@684: project. michael@684: michael@684: %track michael@684: prog apache = { michael@684: version = %{version} michael@684: url = http://www.apache.org/dist/httpd/ michael@684: regex = httpd-(2\.\d*[02468]\.\d+)\.tar\.(bz2|gz) michael@684: } michael@684: michael@684: %prep michael@684: # unpack Apache distribution michael@684: %setup -q -n httpd-%{version} michael@684: %patch -p0 michael@685: %patch -p0 -P 1 michael@684: %{l_shtool} subst \ michael@684: -e 's;(" PLATFORM ");(%{l_openpkg_release -F "OpenPKG/%%t"});g' \ michael@684: server/core.c michael@684: michael@684: %build michael@684: # configure package michael@684: ( echo "ac_cv_func_uuid_create=no" michael@684: ) >config.cache michael@684: export CC="%{l_cc}" michael@684: export CFLAGS="%{l_cflags -O}" michael@684: export CPPFLAGS="%{l_cppflags}" michael@684: export LDFLAGS="%{l_ldflags}" michael@684: export LIBS="" michael@684: case "%{l_platform -t}" in michael@684: *-sunos* ) LIBS="$LIBS -lrt" ;; michael@684: esac michael@684: %if "%{with_mod_ldap}" == "yes" michael@684: LIBS="$LIBS -lssl -lcrypto" michael@684: %endif michael@684: ./configure \ michael@684: --cache-file=./config.cache \ michael@684: --enable-layout=GNU \ michael@684: --prefix=%{l_prefix} \ michael@684: --with-program-name=apache \ michael@684: --sysconfdir=%{l_prefix}/etc/apache \ michael@684: --libexecdir=%{l_prefix}/libexec/apache \ michael@684: --includedir=%{l_prefix}/include/apache \ michael@684: --datadir=%{l_prefix}/share/apache \ michael@684: --localstatedir=%{l_prefix}/var/apache \ michael@684: --with-apr=%{l_prefix}/bin/apr-1-config \ michael@684: --with-apr-util=%{l_prefix}/bin/apu-1-config \ michael@684: --with-pcre=%{l_prefix} \ michael@684: %if "%{with_mpm_prefork}" == "yes" michael@684: --with-mpm="prefork" \ michael@684: %endif michael@684: %if "%{with_mpm_worker}" == "yes" michael@684: --with-mpm="worker" \ michael@684: %endif michael@684: %if "%{with_mpm_event}" == "yes" michael@684: --with-mpm="event" \ michael@684: %endif michael@684: %if "%{with_mpm_worker}" == "yes" || "%{with_mpm_event}" == "yes" || "%{with_mod_memcache}" == "yes" michael@684: --enable-threads \ michael@684: %else michael@684: --disable-threads \ michael@684: %endif michael@684: %if "%{with_suexec}" == "yes" michael@684: --enable-suexec \ michael@684: --with-suexec-bin=%{l_prefix}/sbin/suexec \ michael@684: --with-suexec-caller=%{with_suexec_caller} \ michael@684: --with-suexec-userdir=%{with_suexec_userdir} \ michael@684: --with-suexec-logfile=%{l_prefix}/var/apache/log/suexec.log \ michael@684: %endif michael@684: %if "%{with_mod_deflate}" == "yes" michael@684: --enable-deflate \ michael@684: --with-z=%{l_prefix} \ michael@684: %endif michael@684: %if "%{with_mod_ext_filter}" == "yes" michael@684: --enable-ext-filter \ michael@684: %endif michael@684: %if "%{with_mod_substitute}" == "yes" michael@684: --enable-substitute \ michael@684: %endif michael@684: %if "%{with_mod_ssl}" == "yes" michael@684: --enable-ssl \ michael@684: --with-ssl=%{l_prefix} \ michael@684: %endif michael@684: %if "%{with_mod_dav}" == "yes" michael@684: --enable-dav \ michael@684: --enable-dav-fs \ michael@684: --enable-dav-lock \ michael@684: %endif michael@684: %if "%{with_mod_ldap}" == "yes" michael@684: --enable-ldap \ michael@684: --enable-authnz-ldap \ michael@684: %endif michael@684: %if "%{with_mod_dbd}" == "yes" michael@684: --enable-dbd \ michael@684: --enable-authn-dbd \ michael@684: %endif michael@684: %if "%{with_mod_proxy}" == "yes" michael@684: --enable-proxy \ michael@684: --enable-proxy-connect \ michael@684: --enable-proxy-http \ michael@684: --enable-proxy-ftp \ michael@684: --enable-proxy-ajp \ michael@684: --enable-proxy-balancer \ michael@684: %endif michael@684: %if "%{with_mod_cache}" == "yes" michael@684: --enable-cache \ michael@684: %if "%{with_mod_diskcache}" == "yes" michael@684: --enable-disk-cache \ michael@684: %endif michael@684: %if "%{with_mod_memcache}" == "yes" michael@684: --enable-mem-cache \ michael@684: %endif michael@684: %endif michael@684: %if "%{with_mod_filecache}" == "yes" michael@684: --enable-file-cache \ michael@684: %endif michael@684: %if "%{with_mod_authn_alias}" == "yes" michael@684: --enable-authn-alias \ michael@684: %endif michael@684: --enable-filter \ michael@684: --enable-reqtimeout \ michael@684: --enable-usertrack \ michael@684: --enable-expires \ michael@684: --enable-so \ michael@684: --enable-speling \ michael@684: --enable-rewrite \ michael@684: --enable-headers \ michael@684: --enable-info \ michael@684: --enable-mime-magic \ michael@684: --enable-vhost-alias \ michael@684: --enable-auth-digest \ michael@684: --enable-auth-dbm \ michael@684: --enable-authz-dbm \ michael@684: --enable-authz-owner \ michael@684: --enable-unique-id \ michael@684: --enable-logio \ michael@684: --disable-shared michael@684: michael@684: # build package michael@684: %{l_make} %{l_mflags} michael@684: michael@684: %install michael@684: # install package michael@684: %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT michael@684: michael@684: # create additional directories michael@684: %{l_shtool} mkdir -f -p -m 755 \ michael@684: $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ michael@684: $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d \ michael@684: $RPM_BUILD_ROOT%{l_prefix}/var/apache/run/apache.dav \ michael@684: $RPM_BUILD_ROOT%{l_prefix}/var/apache/run/apache.cache michael@684: michael@684: # adjust GNU libtool configuration for apxs(1) runtime michael@684: %{l_shtool} install -c -m 755 \ michael@684: -e 's;^build_libtool_libs=no;build_libtool_libs=yes;' \ michael@684: %{l_prefix}/share/apr/build-1/libtool \ michael@684: $RPM_BUILD_ROOT%{l_prefix}/share/apache/build/libtool michael@684: michael@684: # install shell environment script michael@684: %{l_shtool} install -c -m 644 %{l_value -s -a} \ michael@684: -e 's;@l_path@;%{l_build_path};' \ michael@684: -e 's;@l_ld_library_path@;%{l_build_ldlp};' \ michael@684: %{SOURCE apache.sh} \ michael@684: $RPM_BUILD_ROOT%{l_prefix}/etc/apache/ michael@684: michael@684: # create default configuration michael@684: l_hostname=`%{l_shtool} echo -e %h` michael@684: l_domainname=`%{l_shtool} echo -e %d | cut -c2-` michael@684: %{l_shtool} install -c -m 644 %{l_value -s -a} \ michael@684: -e "s;@l_hostname@;$l_hostname;g" \ michael@684: -e "s;@l_domainname@;$l_domainname;g" \ michael@684: %{SOURCE apache.base} \ michael@684: %{SOURCE apache.conf} \ michael@684: $RPM_BUILD_ROOT%{l_prefix}/etc/apache/ michael@684: mv $RPM_BUILD_ROOT%{l_prefix}/etc/apache/magic \ michael@684: $RPM_BUILD_ROOT%{l_prefix}/etc/apache/mime.magic michael@684: michael@684: # install run-command script michael@684: %{l_shtool} install -c -m 755 %{l_value -s -a} \ michael@684: -e 's;@with_mod_filecache@;%{with_mod_filecache};g' \ michael@684: %{SOURCE rc.apache} \ michael@684: $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ michael@684: michael@684: # strip down installation michael@684: find $RPM_BUILD_ROOT%{l_prefix}/share/apache -name "*.orig" -print | xargs rm -f michael@684: rm -f $RPM_BUILD_ROOT%{l_prefix}/share/apache/htdocs/apache_pb* michael@684: rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/apache/{extra,original} michael@684: rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/apache michael@684: rm -f $RPM_BUILD_ROOT%{l_prefix}/cgi/test-cgi michael@684: strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true michael@684: strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true michael@684: ( cd $RPM_BUILD_ROOT%{l_prefix}/share/apache/manual michael@684: find . -name "*.xml" -print | xargs rm -f michael@684: find . -name "*.xml.*" -print | xargs rm -f michael@684: find . -name "*.xsl" -print | xargs rm -f michael@684: rm -rf style/xsl michael@684: rm -rf style/latex michael@684: ) || exit $? michael@684: michael@684: # determine installation files michael@684: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@684: %{l_files_std} \ michael@684: %if "%{with_suexec}" == "yes" michael@684: '%attr(4755,%{l_susr},%{l_mgrp}) %{l_prefix}/sbin/suexec' \ michael@684: %endif michael@684: '%config %{l_prefix}/etc/apache/*' \ michael@684: '%config %attr(444,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/apache/apache.base' \ michael@684: '%dir %attr(750,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/apache/run/apache.dav' \ michael@684: '%dir %attr(750,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/apache/run/apache.cache' michael@684: michael@684: %files -f files michael@684: michael@684: %clean michael@684: michael@684: %post michael@684: # after upgrade, restart service michael@684: [ $1 -eq 2 ] || exit 0 michael@684: eval `%{l_rc} apache status 2>/dev/null` michael@684: [ ".$apache_active" = .yes ] && %{l_rc} apache restart michael@684: exit 0 michael@684: michael@684: %preun michael@684: # before erase, stop service and remove log files michael@684: [ $1 -eq 0 ] || exit 0 michael@684: %{l_rc} apache stop 2>/dev/null michael@684: rm -f $RPM_INSTALL_PREFIX/var/apache/log/* >/dev/null 2>&1 || true michael@684: rm -f $RPM_INSTALL_PREFIX/var/apache/run/*/* >/dev/null 2>&1 || true michael@684: rm -f $RPM_INSTALL_PREFIX/var/apache/run/* >/dev/null 2>&1 || true michael@684: exit 0 michael@684: