summaryrefslogtreecommitdiff
path: root/pcr
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2013-12-12 03:48:35 -0200
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2013-12-12 03:48:35 -0200
commit76afcfaaa93dee10bb3c372bb1b4a96948e45974 (patch)
tree8582394dd2e8952d516c5d30507872d6c41f8aa7 /pcr
parent85a382cc1a220a2c65172fabab76a021d1dcd8e6 (diff)
cherokee: add new package to pcr repo
Diffstat (limited to 'pcr')
-rw-r--r--pcr/cherokee/PKGBUILD100
-rw-r--r--pcr/cherokee/cherokee.logrotate9
-rw-r--r--pcr/cherokee/cherokee.rc65
-rw-r--r--pcr/cherokee/cherokee.service9
4 files changed, 183 insertions, 0 deletions
diff --git a/pcr/cherokee/PKGBUILD b/pcr/cherokee/PKGBUILD
new file mode 100644
index 000000000..1d3b3d941
--- /dev/null
+++ b/pcr/cherokee/PKGBUILD
@@ -0,0 +1,100 @@
+# $Id: PKGBUILD 63849 2012-02-06 06:17:28Z foutrelis $
+# Maintainer: Fernando Jiménez Solano <fjim@sdfeu.org>
+# Contributor: Evangelos Foutras <evangelos@foutrelis.com>
+# Contributor: Link Dupont <link@subpop.net>
+# Contributor: Pierre Bourdin <pierre@pi3rrot.net>
+
+pkgname=cherokee
+pkgver=1.2.103
+pkgrel=1
+pkgdesc="A very fast, flexible and easy to configure Web Server (Parabola rebranded)"
+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=(https://github.com/cherokee/webserver/archive/v1.2.103.zip
+ cherokee.rc
+ cherokee.logrotate
+# fix-ctk-path-handler-match.patch
+# cherokee-1.2.101-ffmpeg0.11.patch
+ cherokee.service)
+
+sha256sums=('0e125cba2ad2d0dc48ecca3af4894b92ec5fab422a9d7d27fd0c7a74751e5f35'
+ '4c06cebfab8b68edd4967c020bfb41b077cfff10d76596d1ed192d0b6cedbd86'
+ '20e26d633f8c1cd90eb21f41dd163b73a83846e405b1ce995e072c4efefc522e'
+# '2bd05e0181024c9bd02d828e8329d4d96a779e4870b1fc4f18aa8667d8c6a630'
+# '6bcdcb8eaccb5516478a0c36960fbacc3d68f8bc326b9b526c388e0607a65116'
+ '415a2e4cd7d04afe21e502dd0ad76301f85a7087cadbfdab5566bec469679a68')
+
+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"
+ # Fix this bug : https://bugs.mageia.org/show_bug.cgi?id=6145
+# patch -Np1 -i "$srcdir/cherokee-1.2.101-ffmpeg0.11.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="Parabola GNU/Linux-libre"
+ 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"
+ install -Dm644 "$srcdir/$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service"
+
+ # Cleanup
+ rm -rf "$pkgdir/srv"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/pcr/cherokee/cherokee.logrotate b/pcr/cherokee/cherokee.logrotate
new file mode 100644
index 000000000..19207fd02
--- /dev/null
+++ b/pcr/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/pcr/cherokee/cherokee.rc b/pcr/cherokee/cherokee.rc
new file mode 100644
index 000000000..2d413dc13
--- /dev/null
+++ b/pcr/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
diff --git a/pcr/cherokee/cherokee.service b/pcr/cherokee/cherokee.service
new file mode 100644
index 000000000..7a5b95e43
--- /dev/null
+++ b/pcr/cherokee/cherokee.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Cherokee web server
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/cherokee
+
+[Install]
+WantedBy=multi-user.target