| 1 |
# Copyright 1999-2009 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.99.9.ebuild,v 1.2 2009/04/22 21:09:03 maekke Exp $
|
| 4 |
|
| 5 |
inherit eutils pam versionator libtool
|
| 6 |
|
| 7 |
DESCRIPTION="An extremely fast and tiny web server."
|
| 8 |
SRC_URI="http://www.cherokee-project.com/download/$(get_version_component_range 1-2)/${PV}/${P}.tar.gz"
|
| 9 |
HOMEPAGE="http://www.cherokee-project.com/"
|
| 10 |
|
| 11 |
LICENSE="GPL-2"
|
| 12 |
SLOT="0"
|
| 13 |
KEYWORDS="~amd64 ~x86"
|
| 14 |
IUSE="ipv6 ssl static pam coverpage threads kernel_linux admin debug geoip ldap mysql ffmpeg"
|
| 15 |
|
| 16 |
RDEPEND="
|
| 17 |
>=sys-libs/zlib-1.1.4-r1
|
| 18 |
ssl? ( dev-libs/openssl )
|
| 19 |
pam? ( virtual/pam )
|
| 20 |
admin? ( dev-lang/python )
|
| 21 |
geoip? ( dev-libs/geoip )
|
| 22 |
ldap? ( net-nds/openldap )
|
| 23 |
mysql? ( virtual/mysql )
|
| 24 |
ffmpeg? ( media-video/ffmpeg )"
|
| 25 |
DEPEND="${RDEPEND}"
|
| 26 |
|
| 27 |
src_compile() {
|
| 28 |
local myconf
|
| 29 |
|
| 30 |
if use static ; then
|
| 31 |
myconf="${myconf} --enable-static --enable-static-module=all"
|
| 32 |
else
|
| 33 |
myconf="${myconf} --disable-static"
|
| 34 |
fi
|
| 35 |
|
| 36 |
if use debug ; then
|
| 37 |
myconf="${myconf} --enable-trace"
|
| 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 |
# No options to enable or disable ssl since Cherokee 0.11
|
| 53 |
econf \
|
| 54 |
${myconf} \
|
| 55 |
$(use_enable pam) \
|
| 56 |
$(use_enable ipv6) \
|
| 57 |
$(use_enable threads pthread) \
|
| 58 |
$(use_enable kernel_linux epoll) \
|
| 59 |
$(use_with geoip) \
|
| 60 |
$(use_with ldap) \
|
| 61 |
$(use_with mysql) \
|
| 62 |
$(use_with ffmpeg) \
|
| 63 |
--disable-dependency-tracking \
|
| 64 |
--enable-os-string="Gentoo ${os}" \
|
| 65 |
--with-wwwroot=/var/www/localhost/htdocs \
|
| 66 |
--prefix=/usr \
|
| 67 |
--sysconfdir=/etc \
|
| 68 |
--localstatedir=/var \
|
| 69 |
|| die "configure failed"
|
| 70 |
|
| 71 |
emake || die "emake failed"
|
| 72 |
}
|
| 73 |
|
| 74 |
src_install () {
|
| 75 |
emake -j1 DESTDIR="${D}" docdir="/usr/share/doc/${PF}/html" install || die "make install failed"
|
| 76 |
dodoc AUTHORS ChangeLog
|
| 77 |
|
| 78 |
use pam && pamd_mimic system-auth cherokee auth account session
|
| 79 |
newinitd "${FILESDIR}/${PN}-initd-0.11" ${PN} || die "newinitd failed"
|
| 80 |
|
| 81 |
dodir /usr/share/doc/${PF}/contrib
|
| 82 |
insinto /usr/share/${PF}/contrib
|
| 83 |
doins contrib/07to08.py
|
| 84 |
doins contrib/08to09.py
|
| 85 |
doins contrib/09to010.py
|
| 86 |
doins contrib/011to098.py
|
| 87 |
|
| 88 |
keepdir /etc/cherokee/mods-enabled /etc/cherokee/sites-enabled /var/www/localhost/htdocs
|
| 89 |
|
| 90 |
use coverpage || rm -rf "${D}"/var/www/localhost/htdocs/{index.html,images}
|
| 91 |
use admin || rm -rf "${D}"/usr/sbin/admin "${D}"/usr/share/cherokee/admin
|
| 92 |
|
| 93 |
}
|
| 94 |
|
| 95 |
pkg_postinst() {
|
| 96 |
enewgroup cherokee
|
| 97 |
enewuser cherokee -1 -1 /var/www/localhost cherokee
|
| 98 |
|
| 99 |
# check if user/group was defined if not add it
|
| 100 |
gr="/bin/grep -q"
|
| 101 |
ec="/bin/echo"
|
| 102 |
$gr server\!user /etc/cherokee/cherokee.conf ; rtu=$?
|
| 103 |
$gr server\!group /etc/cherokee/cherokee.conf ; rtg=$?
|
| 104 |
|
| 105 |
[[ "x$rtu" == "x1" ]] && $ec server\!user = cherokee >> /etc/cherokee/cherokee.conf
|
| 106 |
[[ "x$rtg" == "x1" ]] && $ec server\!group = cherokee >> /etc/cherokee/cherokee.conf
|
| 107 |
|
| 108 |
if use admin ; then
|
| 109 |
echo ""
|
| 110 |
elog "Just run 'cherokee-admin' and go to: http://localhost:9090"
|
| 111 |
echo ""
|
| 112 |
else
|
| 113 |
echo ""
|
| 114 |
elog "Try USE=admin if you want an easy way to configure cherokee."
|
| 115 |
echo ""
|
| 116 |
fi
|
| 117 |
}
|