diff options
author | André Fabian Silva Delgado <emulatorman@lavabit.com> | 2012-10-21 14:15:36 -0200 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@lavabit.com> | 2012-10-21 14:15:36 -0200 |
commit | fda67fdea09fccb1ff9875ae2d87cdc8520ca742 (patch) | |
tree | f1426a6efebbe0268ff7b97f0836af0611252e0e | |
parent | 2193dcedd86bbecfbd200f4109f261a374d28f84 (diff) | |
parent | 95b6d407fca371873eae870c3d2b185c72002263 (diff) |
Merge branch 'master' of ssh://parabolagnulinux.org:1863/srv/git/abslibre
-rw-r--r-- | libre/parabolaweb-utils/PKGBUILD | 27 | ||||
-rw-r--r-- | libre/parabolaweb-utils/helper.sh | 16 | ||||
-rw-r--r-- | libre/parabolaweb-utils/parabolaweb-fcgi | 12 | ||||
-rw-r--r-- | libre/parabolaweb-utils/parabolaweb-update (renamed from libre/parabolaweb-utils/update-parabolaweb) | 0 | ||||
-rw-r--r-- | libre/parabolaweb-utils/parabolaweb.conf | 3 | ||||
-rw-r--r-- | libre/parabolaweb-utils/parabolaweb.rc (renamed from libre/parabolaweb-utils/parabolaweb.init.sh) | 12 | ||||
-rw-r--r-- | libre/parabolaweb-utils/parabolaweb.service | 10 |
7 files changed, 54 insertions, 26 deletions
diff --git a/libre/parabolaweb-utils/PKGBUILD b/libre/parabolaweb-utils/PKGBUILD index 3b57c5d13..cfb39d703 100644 --- a/libre/parabolaweb-utils/PKGBUILD +++ b/libre/parabolaweb-utils/PKGBUILD @@ -8,18 +8,22 @@ pkgname=parabolaweb-utils pkgver=`_get_pkgver` -pkgrel=1 +pkgrel=2 pkgdesc="Utils for the Parabola website" arch=('any') url="https://projects.parabolagnulinux.org/parabolaweb.git/" license=('GPL2') -depends=('python2' 'git' 'libretools' `_get_depends`) +depends=('python2' 'python2-flup' 'git' 'libretools' `_get_depends`) +backup=('etc/conf.d/parabolaweb') export pkgver source=(git://parabolagnulinux.org/parabolaweb.git - parabolaweb.init.sh - update-parabolaweb) + parabolaweb-update + parabolaweb-fcgi + parabolaweb.rc + parabolaweb.service + parabolaweb.conf) build() { : @@ -27,11 +31,16 @@ build() { package() { cd "${srcdir}" - install -d "${pkgdir}/${_install_dir}" - install -Dm755 parabolaweb.init.sh "${pkgdir}/etc/rc.d/parabolaweb" - install -Dm755 update-parabolaweb "${pkgdir}/usrls/sbin/update-parabolaweb" + install -Dm755 parabolaweb-update "${pkgdir}/usr/sbin/parabolaweb-update" + install -Dm755 parabolaweb-fcgi "${pkgdir}/usr/sbin/parabolaweb-fcgi" + install -Dm755 parabolaweb.rc "${pkgdir}/etc/rc.d/parabolaweb" + install -Dm644 parabolaweb.service "${pkgdir}/usr/lib/systemd/system/parabolaweb.service" + install -Dm644 parabolaweb.conf "${pkgdir}/etc/conf.d/parabolaweb" } md5sums=('SKIP' - 'f52aebbedaa61f688fb2bc626a783003' - 'dd05d6a4ea7cff7fdd789f59aeb9059a') + 'dd05d6a4ea7cff7fdd789f59aeb9059a' + '520e20b8bbca64042b3afa76b0bec55f' + '1bce8fb832ad9e61cf8b96426ce843b5' + 'c7e292d2d1c3e846e5cfcd7283de0fe4' + 'fb291168d3f57a85f82216c4e74c9ccf') diff --git a/libre/parabolaweb-utils/helper.sh b/libre/parabolaweb-utils/helper.sh index d00f83f7f..5ce4182b3 100644 --- a/libre/parabolaweb-utils/helper.sh +++ b/libre/parabolaweb-utils/helper.sh @@ -23,13 +23,15 @@ _get_pkgver() { _get_depends() { _mksource 1>&2 - pushd "${srcdir:-src}" >/dev/null - python2_packages='markdown|psycopg2|pyinotify|pytz|south' - < parabolaweb/requirements_prod.txt sed -r \ - -e 's/.*/\L&/' -e 's/==/=/' \ - -e 's/^python-memcached/python2-memcached/' \ - -e "s/^(${python2_packages})/python2-&/" - popd >/dev/null + if [[ -f "${srcdir:-src}/parabolaweb/requirements_prod.txt" ]]; then + pushd "${srcdir:-src}" >/dev/null + python2_packages='markdown|psycopg2|pyinotify|pytz|south' + < parabolaweb/requirements_prod.txt sed -r \ + -e 's/.*/\L&/' -e 's/==/=/' \ + -e 's/^python-memcached/python2-memcached/' \ + -e "s/^(${python2_packages})/python2-&/" + popd >/dev/null + fi } _get_depends_nover() { diff --git a/libre/parabolaweb-utils/parabolaweb-fcgi b/libre/parabolaweb-utils/parabolaweb-fcgi new file mode 100644 index 000000000..3dec02e10 --- /dev/null +++ b/libre/parabolaweb-utils/parabolaweb-fcgi @@ -0,0 +1,12 @@ +#!/bin/sh +set -e + +. /etc/conf.d/parabolaweb + +[[ -e /srv/http/web/manage.py ]] + +sudo -u "${WEBUSER:-$USER}" python2 /srv/http/web/manage.py runfcgi \ + host=${HOST} \ + port=${PORT} \ + --settings=settings \ + "$@" diff --git a/libre/parabolaweb-utils/update-parabolaweb b/libre/parabolaweb-utils/parabolaweb-update index e4d65c2d9..e4d65c2d9 100644 --- a/libre/parabolaweb-utils/update-parabolaweb +++ b/libre/parabolaweb-utils/parabolaweb-update diff --git a/libre/parabolaweb-utils/parabolaweb.conf b/libre/parabolaweb-utils/parabolaweb.conf new file mode 100644 index 000000000..c53b19cb8 --- /dev/null +++ b/libre/parabolaweb-utils/parabolaweb.conf @@ -0,0 +1,3 @@ +HOST=127.0.0.1 +PORT=8090 # 80 is nginx +WEBUSER=nobody diff --git a/libre/parabolaweb-utils/parabolaweb.init.sh b/libre/parabolaweb-utils/parabolaweb.rc index 0ff8ecd7c..087a3fcb0 100644 --- a/libre/parabolaweb-utils/parabolaweb.init.sh +++ b/libre/parabolaweb-utils/parabolaweb.rc @@ -3,20 +3,12 @@ . /etc/rc.conf . /etc/rc.d/functions -HOST=127.0.0.1 -PORT=8090 # 80 is nginx -PIDFILE=/var/run/web/fcgi.pid +PIDFILE=/run/web/parabolaweb.pid case $1 in start) stat_busy "Starting ParabolaWeb" - if [[ -e /srv/http/web/manage.py ]]; then - sudo -u nobody \ - python2 /srv/http/web/manage.py runfcgi \ - host=${HOST} \ - port=${PORT} \ - pidfile=${PIDFILE} \ - --settings=settings + if parabolaweb-fcgi pidfile=${PIDFILE}; then add_daemon parabolaweb stat_done exit 0 diff --git a/libre/parabolaweb-utils/parabolaweb.service b/libre/parabolaweb-utils/parabolaweb.service new file mode 100644 index 000000000..d145e53d8 --- /dev/null +++ b/libre/parabolaweb-utils/parabolaweb.service @@ -0,0 +1,10 @@ +[Unit] +Description=ParabolaWeb + +[Service] +Type=forking +ExecStart=/usr/sbin/parabolaweb-fcgi pidfile=/run/web/parabolaweb.pid +PIDFile=/run/web/parabolaweb.pid + +[Install] +WantedBy=multi-user.target |