summaryrefslogtreecommitdiff
path: root/libre/parabolaweb-utils
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-10-21 01:07:09 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-10-21 01:07:09 -0400
commitacf31d3f7569b7db4c14a6011aab88b0ce48a696 (patch)
tree3f532f4ae06e8de6c5f3aff4a720d2c0d75619f9 /libre/parabolaweb-utils
parent53b785c979542521ba7bd7135246f1f9ba51757b (diff)
downloadabslibre-acf31d3f7569b7db4c14a6011aab88b0ce48a696.tar.gz
abslibre-acf31d3f7569b7db4c14a6011aab88b0ce48a696.tar.bz2
abslibre-acf31d3f7569b7db4c14a6011aab88b0ce48a696.zip
improve libre/parabolaweb-utils
meta: * add `python2-flup` as a dependency (needed for fcgi) filesystem: * mv `/usr/sbin/{update-parabolaweb,parabolaweb-update}` * pull `/usr/sbin/parabolaweb-fgci` out of `/etc/rc.d/parabolaweb` * pull `/etc/conf.d/parabolaweb` out of `/etc/rc.d/parabolaweb` * add `/usr/lib/systemd/system/parabolaweb.service`
Diffstat (limited to 'libre/parabolaweb-utils')
-rw-r--r--libre/parabolaweb-utils/PKGBUILD27
-rw-r--r--libre/parabolaweb-utils/helper.sh16
-rw-r--r--libre/parabolaweb-utils/parabolaweb-fcgi12
-rw-r--r--libre/parabolaweb-utils/parabolaweb-update (renamed from libre/parabolaweb-utils/update-parabolaweb)0
-rw-r--r--libre/parabolaweb-utils/parabolaweb.conf3
-rw-r--r--libre/parabolaweb-utils/parabolaweb.rc (renamed from libre/parabolaweb-utils/parabolaweb.init.sh)12
-rw-r--r--libre/parabolaweb-utils/parabolaweb.service10
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