| 1 |
# Copyright 1999-2005 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/www-servers/cherokee/cherokee-0.4.25.ebuild,v 1.4 2005/12/27 09:19:48 bass Exp $
|
| 4 |
|
| 5 |
inherit eutils pam
|
| 6 |
|
| 7 |
DESCRIPTION="An extremely fast and tiny web server."
|
| 8 |
SRC_URI="http://www.0x50.org/download/${PV%.*}/${PV}/${P}.tar.gz"
|
| 9 |
HOMEPAGE="http://www.0x50.org/"
|
| 10 |
|
| 11 |
LICENSE="GPL-2"
|
| 12 |
SLOT="0"
|
| 13 |
KEYWORDS="~x86 ~ppc ~sparc"
|
| 14 |
IUSE="ipv6 ssl gnutls static doc pam"
|
| 15 |
|
| 16 |
RDEPEND=">=sys-libs/zlib-1.1.4-r1
|
| 17 |
gnutls? ( net-libs/gnutls )
|
| 18 |
ssl? ( dev-libs/openssl )
|
| 19 |
pam? ( virtual/pam )"
|
| 20 |
|
| 21 |
DEPEND="${RDEPEND}
|
| 22 |
>=sys-devel/automake-1.7.5"
|
| 23 |
|
| 24 |
src_unpack() {
|
| 25 |
unpack ${A}
|
| 26 |
cd ${S}
|
| 27 |
|
| 28 |
if use static ; then
|
| 29 |
epatch ${FILESDIR}/${P}-fix-static.diff
|
| 30 |
|
| 31 |
einfo "Regenerating automake/autoconf files"
|
| 32 |
libtoolize --copy --force --automake || die "libtoolize failed"
|
| 33 |
aclocal -I ${S}/m4 || die "aclocal failed"
|
| 34 |
autoheader || die "autoheader failed"
|
| 35 |
automake -a || die "automake failed"
|
| 36 |
autoconf || die "autoconf failed"
|
| 37 |
fi
|
| 38 |
|
| 39 |
# remove "doc" from SUBDIRS so that html docs don't get installed
|
| 40 |
# to the wrong place (/usr/share/doc/cherokee) and we can install
|
| 41 |
# them conditionally via dohtml in src_install.
|
| 42 |
sed -i -e 's|\(SUBDIRS =.*\)doc\(.*\)$|\1\2|' Makefile.in || \
|
| 43 |
die "sed Makefile.in failed"
|
| 44 |
|
| 45 |
# use cherokee user/group
|
| 46 |
sed -i -e 's|^#\(User \).*$|\1cherokee|' \
|
| 47 |
-e 's|^#\(Group \).*$|\1cherokee|' cherokee.conf.sample.pre || \
|
| 48 |
die "sed cherokee.conf failed"
|
| 49 |
}
|
| 50 |
|
| 51 |
src_compile() {
|
| 52 |
local myconf
|
| 53 |
|
| 54 |
if use ssl && use gnutls ; then
|
| 55 |
myconf="${myconf} --enable-tls=gnutls"
|
| 56 |
elif use ssl && ! use gnutls ; then
|
| 57 |
myconf="${myconf} --enable-tls=openssl"
|
| 58 |
else
|
| 59 |
myconf="${myconf} --disable-tls"
|
| 60 |
fi
|
| 61 |
|
| 62 |
if use static ; then
|
| 63 |
myconf="${myconf} --enable-static --enable-static-module=all"
|
| 64 |
else
|
| 65 |
myconf="${myconf} --disable-static"
|
| 66 |
fi
|
| 67 |
|
| 68 |
econf \
|
| 69 |
${myconf} \
|
| 70 |
$(use_enable pam) \
|
| 71 |
$(use_enable ipv6) \
|
| 72 |
--enable-os-string="Gentoo Linux" \
|
| 73 |
--with-wwwroot=/var/www/localhost/htdocs \
|
| 74 |
|| die "configure failed"
|
| 75 |
|
| 76 |
emake || die "emake failed"
|
| 77 |
}
|
| 78 |
|
| 79 |
src_install () {
|
| 80 |
make DESTDIR="${D}" install || die "make install failed"
|
| 81 |
dodoc AUTHORS ChangeLog INSTALL README TODO
|
| 82 |
use doc && dohtml -r doc/*
|
| 83 |
|
| 84 |
newpamd pam.d_cherokee ${PN} || die "newpamd failed"
|
| 85 |
newinitd ${FILESDIR}/${PN}-0.4.17-init.d ${PN} || die "newinitd failed"
|
| 86 |
|
| 87 |
# be nice and don't overwrite a user's pre-existing index.html
|
| 88 |
# (unless they're the same).
|
| 89 |
if [[ -f ${ROOT}/var/www/localhost/htdocs/index.html ]] ; then
|
| 90 |
diff ${ROOT}/var/www/localhost/htdocs/index.html \
|
| 91 |
${D}/var/www/localhost/htdocs/index.html &>/dev/null || \
|
| 92 |
mv ${D}/var/www/localhost/htdocs/{,cherokee-}index.html
|
| 93 |
fi
|
| 94 |
}
|
| 95 |
|
| 96 |
pkg_postinst() {
|
| 97 |
enewgroup cherokee
|
| 98 |
enewuser cherokee -1 -1 /var/www/localhost cherokee
|
| 99 |
}
|