diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-01-20 15:44:22 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-01-20 15:44:22 +0000 |
commit | 5cdd5f785814bf3927ad574a1d8778496c159cad (patch) | |
tree | 97871c764544a4555cc5d74c1d269b256bafc7f2 | |
parent | 31d8a8bc389763f424f8142a6e2d4d8b14fc91ac (diff) | |
download | aports-5cdd5f785814bf3927ad574a1d8778496c159cad.tar.bz2 aports-5cdd5f785814bf3927ad574a1d8778496c159cad.tar.xz |
testing/lighttpd: new aport
-rw-r--r-- | testing/lighttpd/APKBUILD | 54 | ||||
-rw-r--r-- | testing/lighttpd/lighttpd.confd | 12 | ||||
-rw-r--r-- | testing/lighttpd/lighttpd.initd | 67 | ||||
-rw-r--r-- | testing/lighttpd/lighttpd.install | 14 | ||||
-rw-r--r-- | testing/lighttpd/lighttpd.logrotate | 17 |
5 files changed, 164 insertions, 0 deletions
diff --git a/testing/lighttpd/APKBUILD b/testing/lighttpd/APKBUILD new file mode 100644 index 0000000000..40f6194994 --- /dev/null +++ b/testing/lighttpd/APKBUILD @@ -0,0 +1,54 @@ +pkgname=lighttpd +pkgver=1.4.20 +pkgrel=1 +pkgdesc="a secure, fast, compliant and very flexible web-server" +url="http://www.lighttpd.net/" +license="custom" +install="$pkgname.install" +depends="pcre openssl zlib bzip2 lua" +makedepends="flex pcre-dev openssl-dev zlib-dev bzip2-dev lua-dev pkgconfig" +source="http://www.$pkgname.net/download/$pkgname-$pkgver.tar.bz2 + $pkgname.initd + $pkgname.confd + $pkgname.install + $pkgname.logrotate" +subpackages="$pkgname-dev $pkgname-doc" + +build () +{ + cd $srcdir/$pkgname-$pkgver + ./configure --prefix=/usr \ + --enable-lfs \ + --libdir=/usr/lib/lighttpd \ + --without-mysql \ + --without-ldap \ + --without-attr \ + --without-kerberos5 \ + --without-fam \ + --without-webdav-props \ + --without-webdav-locks \ + --without-gdbm \ + --without-memcache \ + --with-bzip2 \ + --with-openssl \ + --with-lua || return 1 + make || return 1 + make DESTDIR="$pkgdir" install || return 1 + install -D -m755 ../lighttpd.initd $pkgdir/etc/init.d/lighttpd + install -D -m644 ../lighttpd.logrotate $pkgdir/etc/logrotate.d/lighttpd + install -d -m755 $pkgdir/var/run/lighttpd/ + install -d -m755 $pkgdir/var/log/lighttpd/ + install -D -m644 doc/lighttpd.conf $pkgdir/etc/lighttpd/lighttpd.conf + sed -e 's|/srv/www/htdocs/|/srv/http/|' \ + -e 's|/srv/www/|/srv/http/|' \ + -e 's|#server.username.*|server.username = "lighttpd"|' \ + -e 's|#server.groupname.*|server.groupname = "lighttpd"|' \ + -e 's|#server.pid-file.*|server.pid-file = "/var/run/lighttpd/lighttpd.pid"|' \ + -e 's|/usr/local/bin/php-cgi|/usr/bin/php-cgi|' \ + -i ${pkgdir}/etc/lighttpd/lighttpd.conf || return 1 +} +md5sums="ed6ee0bb714f393219a32768d86984d8 lighttpd-1.4.20.tar.bz2 +6910842e8ba496e8aa984ab30a46eb72 lighttpd.initd +0dede109282bfe685bdec6b35f0e4b6b lighttpd.confd +43b7be0663ee373047f17ec14def5d21 lighttpd.install +ad091c9157134890499f26d170352c9f lighttpd.logrotate" diff --git a/testing/lighttpd/lighttpd.confd b/testing/lighttpd/lighttpd.confd new file mode 100644 index 0000000000..70d4170555 --- /dev/null +++ b/testing/lighttpd/lighttpd.confd @@ -0,0 +1,12 @@ +# /etc/conf.d/lighttpd + +# Location of a shell used by the 'include_shell' directive +# in the lighttpd's configuration file +#export SHELL="/bin/bash" + +# Location of the lighttpd configuration file +LIGHTTPD_CONF="/etc/lighttpd/lighttpd.conf" + +# Location of the lighttpd pid file +LIGHTTPD_PID="/var/run/lighttpd.pid" + diff --git a/testing/lighttpd/lighttpd.initd b/testing/lighttpd/lighttpd.initd new file mode 100644 index 0000000000..80aaacc5e5 --- /dev/null +++ b/testing/lighttpd/lighttpd.initd @@ -0,0 +1,67 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/lighttpd.initd-1.4.13-r3,v 1.2 2007/10/12 20:54:46 swegener Exp $ + +opts="reload graceful" + +depend() { + need net + use mysql logger spawn-fcgi ldap slapd + after famd + after sshd +} + +checkconfig() { + if [ ! -f "${LIGHTTPD_CONF}" ] ; then + ewarn "${LIGHTTPD_CONF} does not exist." + return 1 + fi + + /usr/sbin/lighttpd -t -f ${LIGHTTPD_CONF} >/dev/null +} + +start() { + checkconfig || return 1 + + ebegin "Starting lighttpd" + start-stop-daemon --start --quiet --exec /usr/sbin/lighttpd \ + --pidfile "${LIGHTTPD_PID}" -- -f "${LIGHTTPD_CONF}" + eend $? +} + +stop() { + local rv=0 + ebegin "Stopping lighttpd" + start-stop-daemon --stop --quiet --pidfile "${LIGHTTPD_PID}" + eend $? +} + +reload() { + if ! service_started "${SVCNAME}" ; then + eerror "${SVCNAME} isn't running" + return 1 + fi + checkconfig || return 1 + + ebegin "Re-opening lighttpd log files" + start-stop-daemon --stop --oknodo --quiet --pidfile "${LIGHTTPD_PID}" \ + --signal HUP + eend $? +} + +graceful() { + if ! service_started "${SVCNAME}" ; then + eerror "${SVCNAME} isn't running" + return 1 + fi + checkconfig || return 1 + + ebegin "Gracefully stopping lighttpd" + start-stop-daemon --stop --oknodo --quiet --pidfile "${LIGHTTPD_PID}" \ + --signal INT + if eend $? ; then + rm -f "${LIGHTTPD_PID}" + start + fi +} diff --git a/testing/lighttpd/lighttpd.install b/testing/lighttpd/lighttpd.install new file mode 100644 index 0000000000..a18563e303 --- /dev/null +++ b/testing/lighttpd/lighttpd.install @@ -0,0 +1,14 @@ +#!/bin/sh + + +case $1 in + pre_install) + adduser -H -h /var/www/localhost/htdocs -s /bin/false -D \ + lighttpd 2>/dev/null + ;; + post_install) + chown lighttpd:lighttp /var/*/lighttpd + ;; +esac + +exit 0 diff --git a/testing/lighttpd/lighttpd.logrotate b/testing/lighttpd/lighttpd.logrotate new file mode 100644 index 0000000000..76f0ef3ff5 --- /dev/null +++ b/testing/lighttpd/lighttpd.logrotate @@ -0,0 +1,17 @@ +# $Header: /var/cvsroot/gentoo-x86/www-servers/lighttpd/files/lighttpd.logrotate,v 1.2 2006/05/30 19:49:29 bangert Exp $ +# lighttpd logrotate script for Gentoo + +/var/log/lighttpd/*.log { + daily + missingok + copytruncate + rotate 7 + compress + notifempty + sharedscripts + postrotate + if [ -f /var/run/lighttpd.pid ]; then \ + /etc/init.d/lighttpd reload > /dev/null 2>&1 || true ; \ + fi; + endscript +} |