[arch-commits] Commit in apache/trunk (PKGBUILD arch.layout httpd.install)

Pierre Schmitz pierre at archlinux.org
Sun Jun 22 09:28:20 UTC 2008


    Date: Sunday, June 22, 2008 @ 05:28:19
  Author: pierre
Revision: 3337

use /srv/http as docroot
added http user/group
added ldap support
some cleanups

should fix the following bugs:

http://bugs.archlinux.org/task/9027
http://bugs.archlinux.org/task/9378
http://bugs.archlinux.org/task/1857
http://bugs.archlinux.org/task/6028

Added:
  apache/trunk/httpd.install
Modified:
  apache/trunk/PKGBUILD
  apache/trunk/arch.layout

---------------+
 PKGBUILD      |   48 ++++++++++++++++++++++++++++++------------------
 arch.layout   |   12 ++++++------
 httpd.install |   17 +++++++++++++++++
 3 files changed, 53 insertions(+), 24 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2008-06-22 08:26:15 UTC (rev 3336)
+++ PKGBUILD	2008-06-22 09:28:19 UTC (rev 3337)
@@ -3,7 +3,7 @@
 
 pkgname=apache
 pkgver=2.2.9
-pkgrel=1
+pkgrel=2
 pkgdesc="A high performance Unix-based HTTP server"
 arch=('i686' 'x86_64')
 options=('!libtool')
@@ -14,39 +14,42 @@
         etc/httpd/conf/extra/httpd-{manual,mpm,multilang-errordoc}.conf
         etc/httpd/conf/extra/httpd-{ssl,userdir,vhosts}.conf)
 depends=('openssl>=0.9.8b' 'zlib' 'apr-util>=1.3.0' 'db>=4.6' 'pcre')
+install='httpd.install'
 source=("http://www.apache.org/dist/httpd/httpd-${pkgver}.tar.bz2"
         'httpd.logrotate' 'httpd' 'arch.layout')
 md5sums=('3afa8137dc1999be695a20b62fdf032b'
          'a13925eef67108cf22f6bd1b2b8decb1'
          'fb6baeced65b7cf5b80083f278adebba'
-         '0816f63f1dc68f39e08d57fedd53b95e')
+         '2247f19a9fcfb73394c2a6221c4cb92c')
 
 build() {
 	cd ${srcdir}/httpd-${pkgver}
-	# fix the suexec user
-	sed -i 's|^#define AP_HTTPD_USER.*$|#define AP_HTTPD_USER "nobody"|' \
-		support/suexec.h || return 1i
-	sed -e 's#User daemon#User nobody#' \
-	    -e 's#Group daemon#Group nobody#' \
+
+	# set default user
+	sed -e 's#User daemon#User http#' \
+	    -e 's#Group daemon#Group http#' \
 	    -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-ssl \
 		--enable-so \
-		--enable-proxy \
-		--enable-proxy-connect \
-		--enable-proxy-ftp \
-		--enable-proxy-http \
 		--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 \
-		--enable-cache \
-		--enable-disk-cache \
-		--enable-mem-cache \
-		--with-apr=/usr \
-		--with-apr-util=/usr \
+		--with-apr=/usr/bin/apr-1-config \
+		--with-apr-util=/usr/bin/apu-1-config \
 		--with-pcre=/usr || return 1
 
 	make || return 1
@@ -54,6 +57,15 @@
 	make DESTDIR=${pkgdir} install || return 1
 	install -D -m755 ${srcdir}/httpd ${pkgdir}/etc/rc.d/httpd
 	install -D -m644 ${srcdir}/httpd.logrotate ${pkgdir}/etc/logrotate.d/httpd
-	# remove the manual
+
+	# 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
+
+	# cleanup
 	rm -rf ${pkgdir}/usr/share/httpd/manual
+	rm -rf ${pkgdir}/srv/http/*
+	rmdir ${pkgdir}/usr/bin
 }
\ No newline at end of file

Modified: arch.layout
===================================================================
--- arch.layout	2008-06-22 08:26:15 UTC (rev 3336)
+++ arch.layout	2008-06-22 09:28:19 UTC (rev 3337)
@@ -3,17 +3,17 @@
 	exec_prefix:   ${prefix}
 	bindir:        ${exec_prefix}/bin
 	sbindir:       ${exec_prefix}/sbin
-	libdir:        ${exec_prefix}/lib
-	libexecdir:    ${exec_prefix}/libexec
+	libdir:        ${exec_prefix}/lib/httpd
+	libexecdir:    ${libdir}/modules
 	mandir:        ${prefix}/share/man
-	sysconfdir:    /etc/httpd
+	sysconfdir:    /etc/httpd/conf
 	datadir:       ${prefix}/share/httpd
-	installbuilddir: ${datadir}/build
+	installbuilddir: ${libdir}/build
 	errordir:      ${datadir}/error
 	iconsdir:      ${datadir}/icons
-	htdocsdir:     ${datadir}/htdocs
+	htdocsdir:     /srv/http
 	manualdir:     ${datadir}/manual
-	cgidir:        ${datadir}/cgi-bin
+	cgidir:        ${htdocsdir}/cgi-bin
 	includedir:    ${prefix}/include/httpd
 	localstatedir: /var
 	runtimedir:    /var/run/httpd

Added: httpd.install
===================================================================
--- httpd.install	                        (rev 0)
+++ httpd.install	2008-06-22 09:28:19 UTC (rev 3337)
@@ -0,0 +1,17 @@
+post_install() {
+	if [ -z "`grep '^http::' /etc/group`" ]; then
+		groupadd -g 33 http >& /dev/null
+	fi
+	if [ -z "`grep '^http:' /etc/passwd`" ]; then
+		useradd -u 33 -d /srv/http -g http -s /bin/false http &>/dev/null
+	fi
+}
+
+post_upgrade() {
+	post_install
+}
+
+pre_remove() {
+	userdel http &> /dev/null
+	groupdel http &> /dev/null
+}
\ No newline at end of file





More information about the arch-commits mailing list