# Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils SPAWN_P=spawn-fcgi-1.1.0 DESCRIPTION="lighttpd is intented to be a frontend for ad-servers which have to deliver small files concurrently to many connections." HOMEPAGE="http://jan.kneschke.de/projects/lighttpd" SRC_URI="http://jan.kneschke.de/projects/lighttpd/download/${P}.tar.gz php? ( http://jan.kneschke.de/projects/lighttpd/download/${SPAWN_P}.tar.gz )" LICENSE="QPL-1.0" SLOT="0" KEYWORDS="~x86" IUSE="mysql ssl php" DEPEND="virtual/glibc >=dev-libs/libpcre-3.1 >=sys-libs/zlib-1.1 >=sys-devel/libtool-1.4 mysql? ( >=dev-db/mysql-4.0.0 ) ssl? ( >=dev-libs/openssl-0.9.7 ) php? ( >=dev-php/php-cgi-4.3.0 )" S=${WORKDIR}/${P} SPAWN_S=${WORKDIR}/${SPAWN_P} LIGHTTPD_DIR="/var/www/localhost/htdocs/" LOG_DIR="/var/log/lighttpd/" pkg_setup() { enewuser lighttpd -1 /bin/false ${LIGHTTPD_DIR} \ || die "problem adding user lighttpd" } src_compile() { # lighttpd compile cd ${S} if [ `use php` ]; then epatch ${FILESDIR}/lighttpd-${PV}-gentoo-php.diff else epatch ${FILESDIR}/lighttpd-${PV}-gentoo.diff fi if [ `use ssl` ]; then USE_SSL="--with-openssl" fi econf --libdir=/usr/lib/${PN} \ `use_with mysql` \ ${USE_SSL} \ || die "econf lighttpd failed" emake || die "emake lighttpd failed" # spawn-fcgi compile if [ `use php` ]; then cd ${SPAWN_S} econf || die "econf spawn-fcgi failed" emake || die "emake spawn-fcgi failed" fi } src_install() { # lighttpd install cd ${S} make DESTDIR=${D} install || die "make install lighttpd failed" dodoc README COPYING newdoc doc/lighttpd.conf lighttpd.conf.example dodoc doc/fastcgi.txt doc/authentification.txt insinto /etc/; doins doc/lighttpd.conf exeinto /etc/init.d; newexe ${FILESDIR}/lighttpd-${PV}.initd lighttpd keepdir ${LIGHTTPD_DIR} ${LOG_DIR} chown lighttpd:root ${D}/${LOG_DIR} # spawn-fcgi install if [ `use php` ]; then insinto /etc/conf.d/; doins ${FILESDIR}/spawn-fcgi.conf cd ${SPAWN_S} einstall || "einstall spawn-fcgi failed" newdoc doc/handbook.txt spawn-fcgi.handbook.txt newdoc README spawn-fcgi.README newdoc COPYING spawn-fcgi.COPYING fi } pkg_postinst() { echo einfo "Please note that the lighttpd.conf moved from /etc/conf.d to /etc" echo }