summaryrefslogtreecommitdiff
path: root/community/cherokee
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/cherokee
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/cherokee')
-rw-r--r--community/cherokee/PKGBUILD76
-rw-r--r--community/cherokee/cherokee.logrotate9
-rwxr-xr-xcommunity/cherokee/cherokee.rc65
3 files changed, 150 insertions, 0 deletions
diff --git a/community/cherokee/PKGBUILD b/community/cherokee/PKGBUILD
new file mode 100644
index 000000000..0ee02bf51
--- /dev/null
+++ b/community/cherokee/PKGBUILD
@@ -0,0 +1,76 @@
+# $Id: PKGBUILD 42879 2011-03-22 02:06:35Z foutrelis $
+# Maintainer: Evangelos Foutras <foutrelis@gmail.com>
+# Contributor: Link Dupont <link@subpop.net>
+
+pkgname=cherokee
+pkgver=1.2.2
+pkgrel=2
+pkgdesc="A very fast, flexible and easy to configure Web Server"
+arch=('i686' 'x86_64')
+url="http://www.cherokee-project.com/"
+license=('GPL2')
+depends=('openssl' 'pcre')
+makedepends=('python2' 'gettext' 'libldap' 'pam' 'libmysqlclient'
+ 'ffmpeg' 'geoip')
+optdepends=('python2: cherokee-admin (administrative web interface)'
+ 'libldap: ldap validator'
+ 'pam: pam validator'
+ 'libmysqlclient: mysql validator'
+ 'ffmpeg: Audio/Video streaming handler'
+ 'geoip: GeoIP rule module'
+ 'rrdtool: RRDtool based information collector')
+backup=('etc/cherokee/cherokee.conf'
+ 'etc/logrotate.d/cherokee')
+options=('!libtool')
+source=(http://www.cherokee-project.com/download/1.2/$pkgver/cherokee-$pkgver.tar.gz
+ cherokee.rc
+ cherokee.logrotate)
+md5sums=('6450f0aa116966227c477a1930292e53'
+ 'a2d2b69c6220fab57cda4f531b680f9f'
+ '8d69341bd4002bffd69c6e82ff6c905f')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ # Use subdirectory for logs
+ sed -i -r 's|(%localstatedir%/log)|\1/cherokee|' cherokee.conf.sample.pre
+
+ # Use Python 2 in cherokee-admin
+ sed -i 's/"python"/"python2"/' cherokee/main_admin.c
+
+ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
+ --with-wwwroot=/srv/http --disable-static \
+ --with-wwwuser=http --with-wwwgroup=http \
+ --enable-os-string="Arch Linux"
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ make -j1 DESTDIR="$pkgdir" install
+
+ # PAM configuration file for cherokee
+ install -D -m644 pam.d_cherokee "$pkgdir/etc/pam.d/$pkgname"
+
+ # Fix ownership of /var/lib/cherokee/graphs
+ chown -R http:http "$pkgdir/var/lib/$pkgname/graphs"
+
+ # Use Python 2
+ sed -i 's/env python$/\02/' \
+ "$pkgdir/usr/share/cherokee/admin/"{server,upgrade_config}.py \
+ "$pkgdir/usr/bin/"{CTK-run,cherokee-{admin-launcher,tweak}}
+
+ # Compile Python scripts
+ python2 -m compileall "$pkgdir"
+ python2 -O -m compileall "$pkgdir"
+
+ install -d -o http -g http "$pkgdir/var/log/$pkgname"
+ install -D "$srcdir/$pkgname.rc" "$pkgdir/etc/rc.d/$pkgname"
+ install -Dm644 "$srcdir/$pkgname.logrotate" "$pkgdir/etc/logrotate.d/$pkgname"
+
+ # Cleanup
+ rm -rf "$pkgdir/srv"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/community/cherokee/cherokee.logrotate b/community/cherokee/cherokee.logrotate
new file mode 100644
index 000000000..19207fd02
--- /dev/null
+++ b/community/cherokee/cherokee.logrotate
@@ -0,0 +1,9 @@
+/var/log/cherokee/*.error /var/log/cherokee/*.access {
+ daily
+ rotate 14
+ compress
+ sharedscripts
+ postrotate
+ /bin/kill -HUP `cat /var/run/cherokee.pid 2>/dev/null` 2>/dev/null || true
+ endscript
+}
diff --git a/community/cherokee/cherokee.rc b/community/cherokee/cherokee.rc
new file mode 100755
index 000000000..2d413dc13
--- /dev/null
+++ b/community/cherokee/cherokee.rc
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+daemon_name=cherokee
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Starting $daemon_name daemon"
+ if [ ! -f /var/run/$daemon_name.pid ] && $daemon_name -d &>/dev/null; then
+ add_daemon $daemon_name
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ stop)
+ stat_busy "Stopping $daemon_name daemon"
+ [ -f /var/run/$daemon_name.pid ] && read PID </var/run/$daemon_name.pid
+ if kill $PID &>/dev/null; then
+ rm_daemon $daemon_name
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ reload)
+ stat_busy "Reloading $daemon_name daemon"
+ [ -f /var/run/$daemon_name.pid ] && read PID </var/run/$daemon_name.pid
+ if kill -HUP $PID &>/dev/null; then
+ add_daemon $daemon_name
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ restart)
+ stat_busy "Restarting $daemon_name daemon"
+ [ -f /var/run/$daemon_name.pid ] && read PID </var/run/$daemon_name.pid
+ if kill -USR1 $PID &>/dev/null; then
+ add_daemon $daemon_name
+ stat_done
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ status)
+ stat_busy "Checking $daemon_name status";
+ ck_status $daemon_name
+ ;;
+
+ *)
+ echo "usage: $0 {start|stop|reload|restart|status}"
+esac
+
+exit 0