From 0dee03071a0643c3ee5820afa3c694dcef71d385 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 7 Feb 2012 23:15:14 +0000 Subject: Tue Feb 7 23:15:14 UTC 2012 --- community-staging/cherokee/PKGBUILD | 90 ++++++++++++++++++++++ community-staging/cherokee/cherokee.logrotate | 9 +++ community-staging/cherokee/cherokee.rc | 65 ++++++++++++++++ .../cherokee/fix-ctk-path-handler-match.patch | 16 ++++ 4 files changed, 180 insertions(+) create mode 100644 community-staging/cherokee/PKGBUILD create mode 100644 community-staging/cherokee/cherokee.logrotate create mode 100644 community-staging/cherokee/cherokee.rc create mode 100644 community-staging/cherokee/fix-ctk-path-handler-match.patch (limited to 'community-staging/cherokee') diff --git a/community-staging/cherokee/PKGBUILD b/community-staging/cherokee/PKGBUILD new file mode 100644 index 000000000..8fd23f38a --- /dev/null +++ b/community-staging/cherokee/PKGBUILD @@ -0,0 +1,90 @@ +# $Id: PKGBUILD 63850 2012-02-06 06:17:53Z foutrelis $ +# Maintainer: Evangelos Foutras +# Contributor: Link Dupont + +pkgname=cherokee +pkgver=1.2.101 +pkgrel=3 +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' + 'etc/pam.d/cherokee') +options=('!libtool') +source=(http://www.cherokee-project.com/download/1.2/$pkgver/cherokee-$pkgver.tar.gz + cherokee.rc + cherokee.logrotate + fix-ctk-path-handler-match.patch) +sha256sums=('ca465ab3772479fc843b38ffc45113bf24d8bfae9185cdd5176b099d5a17feb8' + '4c06cebfab8b68edd4967c020bfb41b077cfff10d76596d1ed192d0b6cedbd86' + '20e26d633f8c1cd90eb21f41dd163b73a83846e405b1ce995e072c4efefc522e' + '2bd05e0181024c9bd02d828e8329d4d96a779e4870b1fc4f18aa8667d8c6a630') + +build() { + cd "$srcdir/$pkgname-$pkgver" + + # Fix path matching bug in CTK apps (e.g. market) + patch -Np1 -i "$srcdir/fix-ctk-path-handler-match.patch" + + # 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 \ + --disable-static \ + --with-wwwroot=/srv/http \ + --with-wwwuser=http \ + --with-wwwgroup=http \ + --with-python=python2 \ + --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$/&2/' \ + "$pkgdir/usr/share/cherokee/admin/"{server,upgrade_config}.py \ + "$pkgdir/usr/bin/"{CTK-run,cherokee-{admin-launcher,tweak}} + sed -i -r "s/['\"]python/&2/g" \ + "$pkgdir/usr/share/cherokee/admin/wizards/django.py" + + # 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-staging/cherokee/cherokee.logrotate b/community-staging/cherokee/cherokee.logrotate new file mode 100644 index 000000000..19207fd02 --- /dev/null +++ b/community-staging/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-staging/cherokee/cherokee.rc b/community-staging/cherokee/cherokee.rc new file mode 100644 index 000000000..2d413dc13 --- /dev/null +++ b/community-staging/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 /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 /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 /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 diff --git a/community-staging/cherokee/fix-ctk-path-handler-match.patch b/community-staging/cherokee/fix-ctk-path-handler-match.patch new file mode 100644 index 000000000..abd20c5ef --- /dev/null +++ b/community-staging/cherokee/fix-ctk-path-handler-match.patch @@ -0,0 +1,16 @@ +diff -upr cherokee-1.2.99.orig/admin/CTK/CTK/Server.py cherokee-1.2.99/admin/CTK/CTK/Server.py +--- cherokee-1.2.99.orig/admin/CTK/CTK/Server.py 2011-06-06 14:17:35.000000000 +0300 ++++ cherokee-1.2.99/admin/CTK/CTK/Server.py 2011-09-16 03:31:06.000000000 +0300 +@@ -121,8 +121,11 @@ class ServerHandler (pyscgi.SCGIHandler) + my_thread.scgi_conn = self + my_thread.request_url = url + ++ # Drop the query string before matching against the handlers ++ path = url.split('?', 1)[0] ++ + for published in server._web_paths: +- if re.match (published._regex, url): ++ if re.match (published._regex, path): + # POST + if published._method == 'POST': + post = self._process_post() -- cgit v1.2.3-54-g00ecf