Commit 5cdd5f78 authored by Natanael Copa's avatar Natanael Copa

testing/lighttpd: new aport

parent 31d8a8bc
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"
# /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"
#!/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
}
#!/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
# $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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment