[arch-commits] Commit in apache/trunk (PKGBUILD)

Jan de Groot jgc at archlinux.org
Wed Mar 3 11:02:49 EST 2010


    Date: Wednesday, March 3, 2010 @ 11:02:48
  Author: jgc
Revision: 71040

Add initial work for multi-MPM support. Needs more work

Modified:
  apache/trunk/PKGBUILD

----------+
 PKGBUILD |   99 +++++++++++++++++++++++++++++++++++--------------------------
 1 file changed, 58 insertions(+), 41 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-03-03 12:57:27 UTC (rev 71039)
+++ PKGBUILD	2010-03-03 16:02:48 UTC (rev 71040)
@@ -4,7 +4,8 @@
 
 pkgname=apache
 pkgver=2.2.14
-pkgrel=2
+pkgrel=3
+_itkver=20090414-00
 pkgdesc='A high performance Unix-based HTTP server'
 arch=('i686' 'x86_64')
 options=('!libtool')
@@ -17,56 +18,72 @@
         etc/logrotate.d/httpd)
 depends=('openssl' 'zlib' 'apr-util' 'pcre')
 optdepends=('lynx: apachectl status')
-source=("http://www.apache.org/dist/httpd/httpd-${pkgver}.tar.bz2"
-        'httpd.logrotate'
-	'httpd'
-	'arch.layout')
+source=(http://www.apache.org/dist/httpd/httpd-${pkgver}.tar.bz2
+        http://mpm-itk.sesse.net/apache2.2-mpm-itk-${_itkver}.patch
+        httpd.logrotate
+	httpd
+	arch.layout)
 md5sums=('a5226203aaf97e5b941c41a71c112704'
+         'e26cf8ad861e41877c0f0dda6e471ca9'
          'f4d627c64024c1b7b95efb5ffbaa625e'
          '9e001fbb082a08113e7f4bc431085c11'
          '3d659d41276ba3bfcb20c231eb254e0c')
 
 build() {
-	cd ${srcdir}/httpd-${pkgver}
+	cd "${srcdir}/httpd-${pkgver}"
 
 	# set default user
 	sed -e 's#User daemon#User http#' \
 	    -e 's#Group daemon#Group http#' \
-	    -i docs/conf/httpd.conf.in
+	    -i docs/conf/httpd.conf.in || return 1
 
-	cat ${srcdir}/arch.layout >> config.layout
-	./configure --enable-layout=Arch \
-		--enable-modules=all \
-		--enable-mods-shared=all \
-		--enable-so \
-		--enable-suexec \
-		--with-suexec-caller=http \
-		--with-suexec-docroot=/srv/http \
-		--with-suexec-logfile=/var/log/httpd/suexec.log \
-		--with-suexec-bin=/usr/sbin/suexec \
-		--with-suexec-uidmin=99 --with-suexec-gidmin=99 \
-		--enable-ldap --enable-authnz-ldap \
-		--enable-cache --enable-disk-cache --enable-mem-cache --enable-file-cache \
-		--enable-ssl --with-ssl \
-		--enable-deflate --enable-cgid \
-		--enable-proxy --enable-proxy-connect \
-		--enable-proxy-http --enable-proxy-ftp \
-		--enable-dbd \
-		--with-apr=/usr/bin/apr-1-config \
-		--with-apr-util=/usr/bin/apu-1-config \
-		--with-pcre=/usr
+	cat "${srcdir}/arch.layout" >> config.layout
 
-	make || return 1
+	for mpm in prefork worker itk; do
+		if [ "$mpm" = "itk" ]; then
+			patch -Np1 -i "${srcdir}/apache2.2-mpm-itk-${_itkver}.patch" || return 1
+			autoconf || return 1
+		fi
+		mkdir build-$mpm
+		pushd build-$mpm
+		../configure --enable-layout=Arch \
+			--enable-modules=all \
+			--enable-mods-shared=all \
+			--enable-so \
+			--enable-suexec \
+			--with-suexec-caller=http \
+			--with-suexec-docroot=/srv/http \
+			--with-suexec-logfile=/var/log/httpd/suexec.log \
+			--with-suexec-bin=/usr/sbin/suexec \
+			--with-suexec-uidmin=99 --with-suexec-gidmin=99 \
+			--enable-ldap --enable-authnz-ldap \
+			--enable-cache --enable-disk-cache --enable-mem-cache --enable-file-cache \
+			--enable-ssl --with-ssl \
+			--enable-deflate --enable-cgid \
+			--enable-proxy --enable-proxy-connect \
+			--enable-proxy-http --enable-proxy-ftp \
+			--enable-dbd \
+			--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
+		if [ "$mpm" = "prefork" ]; then
+			make DESTDIR="${pkgdir}" install || return 1
+		else
+			install -m755 httpd "${pkgdir}/usr/sbin/httpd.${mpm}"
+		fi
+		popd
+	done
 
-	make DESTDIR=${pkgdir} install
-	install -D -m755 ${srcdir}/httpd ${pkgdir}/etc/rc.d/httpd
-	install -D -m644 ${srcdir}/httpd.logrotate ${pkgdir}/etc/logrotate.d/httpd
+	install -D -m755 "${srcdir}/httpd" "${pkgdir}/etc/rc.d/httpd" || return 1
+	install -D -m644 "${srcdir}/httpd.logrotate" "${pkgdir}/etc/logrotate.d/httpd" || return 1
 
 	# symlinks for /etc/httpd
-	ln -fs /var/log/httpd ${pkgdir}/etc/httpd/logs
-	ln -fs /var/run/httpd ${pkgdir}/etc/httpd/run
-	ln -fs /usr/lib/httpd/modules ${pkgdir}/etc/httpd/modules
-	ln -fs /usr/lib/httpd/build ${pkgdir}/etc/httpd/build
+	ln -fs /var/log/httpd "${pkgdir}/etc/httpd/logs"
+	ln -fs /var/run/httpd "${pkgdir}/etc/httpd/run"
+	ln -fs /usr/lib/httpd/modules "${pkgdir}/etc/httpd/modules"
+	ln -fs /usr/lib/httpd/build "${pkgdir}/etc/httpd/build"
 
 	# set sane defaults
 	sed -e 's#/usr/lib/httpd/modules/#modules/#' \
@@ -75,11 +92,11 @@
 	    -e 's|#\(Include conf/extra/httpd-languages.conf\)|\1|' \
 	    -e 's|#\(Include conf/extra/httpd-userdir.conf\)|\1|' \
 	    -e 's|#\(Include conf/extra/httpd-default.conf\)|\1|' \
-	    -i ${pkgdir}/etc/httpd/conf/httpd.conf
+	    -i "${pkgdir}/etc/httpd/conf/httpd.conf" || return 1
 
 	# cleanup
-	rm -rf ${pkgdir}/usr/share/httpd/manual
-	rm -rf ${pkgdir}/etc/httpd/conf/original
-	rm -rf ${pkgdir}/srv/
-	rm -rf ${pkgdir}/usr/bin
+	rm -rf "${pkgdir}/usr/share/httpd/manual"
+	rm -rf "${pkgdir}/etc/httpd/conf/original"
+	rm -rf "${pkgdir}/srv/"
+	rm -rf "${pkgdir}/usr/bin"
 }



More information about the arch-commits mailing list