# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils confutils URI_ROOT="http://www.lighttpd.net/download/" DESCRIPTION="lightweight high-performance web server" HOMEPAGE="http://www.lighttpd.net/" SRC_URI="$URI_ROOT/${P}.tar.gz" LICENSE="QPL-1.0" SLOT="0" KEYWORDS="x86 ~ppc" IUSE="mysql ssl php modchat modcache modlocalizer xattr ldap ipv6" DEPEND="virtual/libc >=dev-libs/libpcre-3.1 >=sys-libs/zlib-1.1 >=sys-devel/libtool-1.4 modlocalizer? ( >=dev-libs/localizer-0.3.3 ) mysql? ( >=dev-db/mysql-4.0.0 ) ssl? ( >=dev-libs/openssl-0.9.7 ) php? ( >=dev-php/php-cgi-4.3.0 )" RDEPEND=">=sys-libs/zlib-1.1 >=sys-devel/libtool-1.4 mysql? ( >=dev-db/mysql-4.0.0 ) ssl? ( >=dev-libs/openssl-0.9.7 )" S=${WORKDIR}/${P} LIGHTTPD_DIR="/var/www/localhost/htdocs/" LOG_DIR="/var/log/lighttpd/" pkg_setup() { enewgroup lighttpd enewuser lighttpd -1 /bin/false "${LIGHTTPD_DIR}" lighttpd } src_unpack() { unpack ${A} cd ${S} epatch ${FILESDIR}/${PN}-1.1.8-gentoo.diff if useq php; then epatch ${FILESDIR}/${PN}-1.3.7-php.patch fi } src_compile() { local my_conf my_conf="--libdir=/usr/lib/${PN}" # extension USE flag shared? # ----------------------------------------------------------------- enable_extension_enable mod-chat modchat 0 enable_extension_enable mod-cache modcache 0 enable_extension_enable mod-localizer modlocalizer 0 enable_extension_enable attr xattr 0 enable_extension_enable ldap ldap 0 enable_extension_enable openssl ssl 0 enable_extension_enable mysql mysql 0 enable_extension_enable ipv6 ipv6 0 # ----------------------------------------------------------------- # extension USE flag shared? econf $my_conf || die "econf failed" emake || die "emake failed" } src_install() { make DESTDIR=${D} install || die dodoc README COPYING newdoc doc/lighttpd.conf lighttpd.conf.example dodoc doc/fastcgi.txt doc/authentification.txt insinto /etc; doins doc/lighttpd.conf sed -i -e 's:^#server.username.*:server.username = "lighttpd":1' ${D}/etc/lighttpd.conf sed -i -e 's:^#server.groupname.*:server.groupname = "lighttpd":1' ${D}/etc/lighttpd.conf exeinto /etc/init.d; newexe ${FILESDIR}/${PN}-${PV}.initd ${PN} if useq php; then insinto /etc/conf.d; newins ${FILESDIR}/spawn-fcgi-1.3.7.conf spawn-fcgi.conf exeinto /etc/init.d; newexe ${FILESDIR}/spawn-fcgi-1.3.7.initd spawn-fcgi sed -i -e 's:need\ net:need\ net\ spawn-fcgi:g' ${D}/etc/init.d/${PN} fi dodir ${LIGHTTPD_DIR}; keepdir ${LIGHTTPD_DIR} dodir ${LOG_DIR}; keepdir ${LOG_DIR} chown lighttpd:root ${D}/${LOG_DIR} }