# Maintainer: Natanael Copa pkgname=apache2 pkgver=2.2.23 pkgrel=0 pkgdesc="A high performance Unix-based HTTP server" url="http://httpd.apache.org/" license="APACHE" depends="" pkgusers="apache" pkggroups="apache" makedepends="openssl-dev zlib-dev apr-util-dev apr-dev pcre-dev sed autoconf automake" subpackages="$pkgname-dev $pkgname-doc $pkgname-utils $pkgname-ssl $pkgname-ldap" # see http://lists.err.no/pipermail/mpm-itk/2011-August/000432.html for # the 03-add-mpm-to-build-system.patch source="http://archive.apache.org/dist/httpd/httpd-$pkgver.tar.bz2 http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.17-01/02-rename-prefork-to-itk.patch 03-add-mpm-to-build-system.patch http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.17-01/04-correct-output-makefile-location.patch http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.17-01/05-add-copyright.patch http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.17-01/06-hook-just-after-merging-perdir-config.patch http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.17-01/07-base-functionality.patch http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.17-01/08-max-clients-per-vhost.patch http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.17-01/09-capabilities.patch http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.17-01/10-nice.patch http://mpm-itk.sesse.net/apache2.2-mpm-itk-2.2.17-01/11-fix-htaccess-reads-for-persistent-connections.patch apache2.confd apache2.logrotate apache2.initd httpd.conf ssl.conf ldap.conf alpine.layout" prepare() { cd "$srcdir" cat "$srcdir/alpine.layout" >> httpd-$pkgver/config.layout # create symlinks to soruces for prefork and worker ln -s httpd-$pkgver prefork ln -s httpd-$pkgver worker # make a patched clone of itk sources cp -ra httpd-$pkgver itk cd itk mkdir -p server/mpm/experimental/itk cp -r server/mpm/prefork/* \ server/mpm/experimental/itk/ || return 1 mv server/mpm/experimental/itk/prefork.c \ server/mpm/experimental/itk/itk.c || return 1 for i in $source; do case $i in *.patch) msg ${i##*/}; patch -p1 -i "$srcdir"/${i##*/} || return 1;; esac done autoconf || return 1 } _buildmpm() { local mpm=$1 shift mkdir "$srcdir"/build-${mpm} cd "$srcdir"/build-${mpm} "$srcdir"/$mpm/configure --prefix=/usr \ --enable-layout=Alpine \ --enable-so \ --enable-suexec \ --with-suexec-caller=http \ --with-suexec-docroot=/var/www/localhost/htdocs \ --with-suexec-logfile=/var/log/httpd/suexec.log \ --with-suexec-bin=/usr/sbin/suexec \ --with-suexec-uidmin=99 \ --with-suexec-gidmin=99 \ --with-apr=/usr/bin/apr-1-config \ --with-apr-util=/usr/bin/apu-1-config \ --with-pcre=/usr \ --with-mpm=${mpm} \ $@ \ || return 1 make || return 1 } build () { local mpm #build the mpms for mpm in prefork worker itk; do _buildmpm $mpm \ --enable-mods-shared=all \ --enable-ssl --with-ssl \ --enable-proxy \ --enable-cache \ --enable-disk-cache \ --enable-mem-cache \ --enable-file-cache \ --enable-ldap --enable-authnz-ldap \ --enable-cgid \ --enable-authn-anon --enable-authn-alias \ --disable-imagemap \ --enable-proxy-connect \ --enable-proxy-http \ --enable-proxy-ftp \ --enable-deflate \ --enable-dbd \ || return 1 done } package() { cd "$srcdir"/build-prefork make -j1 DESTDIR="$pkgdir" install || return 1 for mpm in worker itk; do install -m755 "$srcdir"/build-$mpm/httpd \ "$pkgdir/usr/sbin/httpd.${mpm}" || return 1 done # config rm -r "$pkgdir"/etc/apache2/httpd.conf \ "$pkgdir"/etc/apache2/extra install -D -m644 "$srcdir"/httpd.conf "$pkgdir"/etc/apache2/httpd.conf install -d "$pkgdir"/etc/apache2/conf.d # init scripts and logrotate install -D -m755 "$srcdir/apache2.initd" \ "$pkgdir/etc/init.d/apache2" || return 1 install -D -m644 "$srcdir/apache2.logrotate" \ "$pkgdir/etc/logrotate.d/apache2" || return 1 install -D -m644 "$srcdir/apache2.confd" \ "$pkgdir/etc/conf.d/apache2" || return 1 install -d "$pkgdir"/var/www ln -fs /var/log/apache2 "$pkgdir/var/www/logs" ln -fs /var/run/apache2 "$pkgdir/var/www/run" ln -fs /usr/lib/apache2 "$pkgdir/var/www/modules" ln -fs /etc/apache2/conf.d "$pkgdir/var/www/conf.d" } # include the builddir and apxs in -dev package dev() { default_dev depends="$depends perl apr-util-dev" install -d "$subpkgdir"/usr/share/apache2/ \ "$subpkgdir"/usr/sbin mv "$pkgdir"/usr/sbin/apxs "$subpkgdir"/usr/sbin/ || return 1 mv "$pkgdir"/usr/share/apache2/build "$subpkgdir"/usr/share/apache2/ } utils() { pkgdesc="Apache utility programs for webservers" install -d "$subpkgdir"/usr/bin "$subpkgdir"/usr/sbin cd "$pkgdir"/usr/sbin mv ab dbmmanage htdbm htdigest htpasswd logresolve "$subpkgdir"/usr/bin mv checkgid htcacheclean rotatelogs "$subpkgdir"/usr/sbin } ssl() { pkgdesc="SSL/TLS module for the Apache HTTP Server" install="apache2-ssl.post-install" depends="apache2 openssl" install -d "$subpkgdir"/usr/lib/apache2 \ "$subpkgdir"/etc/ssl/apache2 mv "$pkgdir"/usr/lib/apache2/mod_ssl.so "$subpkgdir"/usr/lib/apache2/ \ || return 1 install -m644 -D "$srcdir"/ssl.conf "$subpkgdir"/etc/apache2/conf.d/ssl.conf } ldap() { pkgdesc="LDAP authentication/authorization module for the Apache HTTP Server" url="http://httpd.apache.org/docs/2.2/mod/mod_authnz_ldap.html" depends="apache2" install -d "$subpkgdir"/usr/lib/apache2 mv "$pkgdir"/usr/lib/apache2/mod_*ldap*.so "$subpkgdir"/usr/lib/apache2 install -m644 -D "$srcdir"/ldap.conf "$subpkgdir"/etc/apache2/conf.d/ldap.conf } md5sums="ca133de0e4b4b15316990a97186b9993 httpd-2.2.23.tar.bz2 f1d9d41360908ceb2374da55ae99197a 02-rename-prefork-to-itk.patch 72817bd3eddc56fd886ca4739c536261 03-add-mpm-to-build-system.patch 0930d2d0612eb0a53a0d00aea7e8687f 04-correct-output-makefile-location.patch 3a0c29bb91442c33ea73ebbe072af922 05-add-copyright.patch 0ef4729a6f1ffc848ad0e9b440a66f66 06-hook-just-after-merging-perdir-config.patch 940944caa948340b11ddae56adaef89b 07-base-functionality.patch ce09a987523884de8838f73dc8ec0d19 08-max-clients-per-vhost.patch e75b7dd8d8afcd299ba4ab2ab81c11e4 09-capabilities.patch ce1ccc21f3ad8625169c8f62913450ac 10-nice.patch 1e5b222edcfbf99a3edc56fcb2074fbe 11-fix-htaccess-reads-for-persistent-connections.patch e322b5211e49511cac6e40c86af1b1da apache2.confd 75fe4138b98fcffd01b8c8c077b944f3 apache2.logrotate 0261136ff734c3ae8dcf878a46ed5830 apache2.initd 2df3891a45abcdc4083a2699ff7f26fc httpd.conf 5d0d024ca43571b863874ab871b2c109 ssl.conf b70fe826486043e3953cfe21f9e6fa16 ldap.conf c66ff5f70260d5266e6803a59b39bd7f alpine.layout"