# ChangeLog for www-servers/cherokee
# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/www-servers/cherokee/ChangeLog,v 1.30 2006/12/27 01:46:45 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-servers/cherokee/ChangeLog,v 1.31 2006/12/27 02:37:08 flameeyes Exp $
+
+*cherokee-0.5.6 (27 Dec 2006)
+
+ 27 Dec 2006; Diego Pettenò <flameeyes@gentoo.org>
+ -files/cherokee-0.4.5-Makefile.am.patch,
+ -files/cherokee-0.4.5-cherokee.conf, -files/cherokee-0.4.5-init.d,
+ -files/cherokee-0.4.17-cherokee.conf, -files/cherokee-0.4.17-init.d,
+ -files/cherokee-0.4.21-no-handler_admin.diff,
+ -files/cherokee-0.4.25-fix-static.diff, +files/cherokee-initd-0.5.6,
+ -cherokee-0.5.2.ebuild, -cherokee-0.5.4.ebuild, -cherokee-0.5.5.ebuild,
+ +cherokee-0.5.6.ebuild:
+ Big new-maintainer cleanup. Bump to latest 0.5.6, remove old versions,
+ remove dead files in $FILESDIR, add new init.d file that leave to cherokee
+ to get into background.
27 Dec 2006; Diego Pettenò <flameeyes@gentoo.org> metadata.xml:
Metadata update, I'll take over maintainership (leaving www-servers as herd).
--- /dev/null
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-servers/cherokee/cherokee-0.5.6.ebuild,v 1.1 2006/12/27 02:37:08 flameeyes Exp $
+
+inherit eutils pam versionator
+
+DESCRIPTION="An extremely fast and tiny web server."
+SRC_URI="http://www.cherokee-project.com/download/$(get_version_component_range 1-2)/${PV}/${P}.tar.gz"
+HOMEPAGE="http://www.cherokee-project.com/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE="ipv6 ssl gnutls static pam"
+
+RDEPEND=">=sys-libs/zlib-1.1.4-r1
+ gnutls? ( net-libs/gnutls )
+ ssl? ( dev-libs/openssl )
+ pam? ( virtual/pam )"
+
+src_unpack() {
+ unpack ${A}
+
+ # use cherokee user/group
+ sed -i -e 's|^#\(User \).*$|\1cherokee|' \
+ -e 's|^#\(Group \).*$|\1cherokee|' "${S}/cherokee.conf.sample.pre" || \
+ die "sed cherokee.conf failed"
+}
+
+src_compile() {
+ local myconf
+
+ if use ssl && use gnutls ; then
+ myconf="${myconf} --enable-tls=gnutls"
+ elif use ssl && ! use gnutls ; then
+ myconf="${myconf} --enable-tls=openssl"
+ else
+ myconf="${myconf} --disable-tls"
+ fi
+
+ if use static ; then
+ myconf="${myconf} --enable-static --enable-static-module=all"
+ else
+ myconf="${myconf} --disable-static"
+ fi
+
+ local os="Unknown"
+ case "${CHOST}" in
+ *-freebsd*)
+ os="FreeBSD" ;;
+ *-netbsd*)
+ os="NetBSD" ;;
+ *-openbsd*)
+ os="OpenBSD" ;;
+ *)
+ os="Linux" ;;
+ esac
+
+ econf \
+ ${myconf} \
+ $(use_enable pam) \
+ $(use_enable ipv6) \
+ --enable-os-string="Gentoo ${os}" \
+ --with-wwwroot=/var/www/localhost/htdocs \
+ || die "configure failed"
+
+ emake || die "emake failed"
+}
+
+src_install () {
+ emake DESTDIR="${D}" docdir="/usr/share/doc/${PF}/html" install || die "make install failed"
+ dodoc AUTHORS ChangeLog TODO
+
+ newpamd pam.d_cherokee ${PN} || die "newpamd failed"
+ newinitd "${FILESDIR}/${PN}-initd-0.5.6" ${PN} || die "newinitd failed"
+
+ keepdir /etc/cherokee/mods-enabled /etc/cherokee/sites-enabled
+
+ # be nice and don't overwrite a user's pre-existing index.html
+ # (unless they're the same).
+ if [[ -f "${ROOT}"/var/www/localhost/htdocs/index.html ]] ; then
+ diff "${ROOT}"/var/www/localhost/htdocs/index.html \
+ "${D}"/var/www/localhost/htdocs/index.html &>/dev/null || \
+ mv "${D}"/var/www/localhost/htdocs/{,cherokee-}index.html
+ fi
+}
+
+pkg_postinst() {
+ enewgroup cherokee
+ enewuser cherokee -1 -1 /var/www/localhost cherokee
+}
--- /dev/null
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-servers/cherokee/files/cherokee-initd-0.5.6,v 1.1 2006/12/27 02:37:08 flameeyes Exp $
+
+PIDFILE=/var/run/cherokee.pid
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting Cherokee Web Server"
+ start-stop-daemon --start --pidfile ${PIDFILE} \
+ --exec /usr/sbin/cherokee -- -b
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Cherokee Web Server"
+ start-stop-daemon --stop --pidfile ${PIDFILE} \
+ --exec /usr/sbin/cherokee
+ eend $?
+}