| 1 |
# Copyright 1999-2008 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.11.6.ebuild,v 1.1 2008/12/26 09:04:43 bass Exp $
|
| 4 |
|
| 5 |
WANT_AUTOCONF="latest"
|
| 6 |
WANT_AUTOMAKE="latest"
|
| 7 |
|
| 8 |
inherit eutils pam versionator libtool autotools
|
| 9 |
|
| 10 |
DESCRIPTION="An extremely fast and tiny web server."
|
| 11 |
SRC_URI="http://www.cherokee-project.com/download/$(get_version_component_range 1-2)/${PV}/${P}.tar.gz"
|
| 12 |
HOMEPAGE="http://www.cherokee-project.com/"
|
| 13 |
|
| 14 |
LICENSE="GPL-2"
|
| 15 |
SLOT="0"
|
| 16 |
KEYWORDS="~amd64 ~ppc ~sparc ~x86"
|
| 17 |
IUSE="ipv6 ssl static pam coverpage threads kernel_linux admin"
|
| 18 |
|
| 19 |
RDEPEND=">=sys-libs/zlib-1.1.4-r1
|
| 20 |
ssl? ( dev-libs/openssl )
|
| 21 |
pam? ( virtual/pam )
|
| 22 |
admin? ( dev-lang/python )"
|
| 23 |
DEPEND="${RDEPEND}"
|
| 24 |
|
| 25 |
src_compile() {
|
| 26 |
local myconf
|
| 27 |
|
| 28 |
if use ssl ; then
|
| 29 |
myconf="${myconf} --enable-tls=openssl"
|
| 30 |
else
|
| 31 |
myconf="${myconf} --disable-tls"
|
| 32 |
fi
|
| 33 |
|
| 34 |
if use static ; then
|
| 35 |
myconf="${myconf} --enable-static --enable-static-module=all"
|
| 36 |
else
|
| 37 |
myconf="${myconf} --disable-static"
|
| 38 |
fi
|
| 39 |
|
| 40 |
local os="Unknown"
|
| 41 |
case "${CHOST}" in
|
| 42 |
*-freebsd*)
|
| 43 |
os="FreeBSD" ;;
|
| 44 |
*-netbsd*)
|
| 45 |
os="NetBSD" ;;
|
| 46 |
*-openbsd*)
|
| 47 |
os="OpenBSD" ;;
|
| 48 |
*)
|
| 49 |
os="Linux" ;;
|
| 50 |
esac
|
| 51 |
|
| 52 |
econf \
|
| 53 |
${myconf} \
|
| 54 |
$(use_enable pam) \
|
| 55 |
$(use_enable ipv6) \
|
| 56 |
$(use_enable threads pthread) \
|
| 57 |
$(use_enable kernel_linux epoll) \
|
| 58 |
--disable-dependency-tracking \
|
| 59 |
--enable-os-string="Gentoo ${os}" \
|
| 60 |
--with-wwwroot=/var/www/localhost/htdocs \
|
| 61 |
--prefix=/usr \
|
| 62 |
--sysconfdir=/etc \
|
| 63 |
--localstatedir=/var \
|
| 64 |
|| die "configure failed"
|
| 65 |
|
| 66 |
emake || die "emake failed"
|
| 67 |
}
|
| 68 |
|
| 69 |
src_install () {
|
| 70 |
emake -j1 DESTDIR="${D}" docdir="/usr/share/doc/${PF}/html" install || die "make install failed"
|
| 71 |
dodoc AUTHORS ChangeLog TODO
|
| 72 |
|
| 73 |
newpamd pam.d_cherokee ${PN} || die "newpamd failed"
|
| 74 |
newinitd "${FILESDIR}/${PN}-initd-0.11" ${PN} || die "newinitd failed"
|
| 75 |
|
| 76 |
dodir /usr/share/doc/${PF}/contrib
|
| 77 |
insinto /usr/share/${PF}/contrib
|
| 78 |
doins contrib/05to06.py
|
| 79 |
doins contrib/06to07.py
|
| 80 |
doins contrib/07to08.py
|
| 81 |
doins contrib/08to09.py
|
| 82 |
doins contrib/09to10.py
|
| 83 |
|
| 84 |
keepdir /etc/cherokee/mods-enabled /etc/cherokee/sites-enabled /var/www/localhost/htdocs
|
| 85 |
|
| 86 |
use coverpage || rm -rf "${D}"/var/www/localhost/htdocs/{index.html,images}
|
| 87 |
use admin || rm -rf "${D}"/usr/sbin/admin "${D}"/usr/share/cherokee/admin
|
| 88 |
|
| 89 |
}
|
| 90 |
|
| 91 |
pkg_postinst() {
|
| 92 |
enewgroup cherokee
|
| 93 |
enewuser cherokee -1 -1 /var/www/localhost cherokee
|
| 94 |
|
| 95 |
if use admin ; then
|
| 96 |
echo ""
|
| 97 |
elog "Just run 'cherokee-admin' and go to: http://localhost:9090"
|
| 98 |
echo ""
|
| 99 |
else
|
| 100 |
echo ""
|
| 101 |
elog "Try USE=admin if you want a easy way to configure cherokee."
|
| 102 |
echo ""
|
| 103 |
fi
|
| 104 |
}
|