summaryrefslogtreecommitdiff
path: root/community/fcgiwrap
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/fcgiwrap
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/fcgiwrap')
-rw-r--r--community/fcgiwrap/LICENSE24
-rw-r--r--community/fcgiwrap/PKGBUILD35
-rw-r--r--community/fcgiwrap/fcgiwrap.conf.d13
-rw-r--r--community/fcgiwrap/fcgiwrap.rc.d74
4 files changed, 146 insertions, 0 deletions
diff --git a/community/fcgiwrap/LICENSE b/community/fcgiwrap/LICENSE
new file mode 100644
index 000000000..84eacbe12
--- /dev/null
+++ b/community/fcgiwrap/LICENSE
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2007-2010 Grzegorz Nosek
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
diff --git a/community/fcgiwrap/PKGBUILD b/community/fcgiwrap/PKGBUILD
new file mode 100644
index 000000000..7720ea652
--- /dev/null
+++ b/community/fcgiwrap/PKGBUILD
@@ -0,0 +1,35 @@
+# $Id: PKGBUILD 28017 2010-10-01 16:05:40Z aschaefer $
+# Maintainer: Aaron Bull Schaefer <aaron@elasticdog.com>
+# Contributor: Ron Huang <ronhuang+aur at gmail dot com>
+
+pkgname=fcgiwrap
+pkgver=1.0.3
+_gitrev='2e301c8'
+pkgrel=1
+pkgdesc='A simple server for running CGI applications over FastCGI'
+arch=('i686' 'x86_64')
+url='http://nginx.localdomain.pl/wiki/FcgiWrap'
+license=('MIT')
+depends=('fcgi' 'spawn-fcgi')
+backup=('etc/conf.d/fcgiwrap')
+source=("http://github.com/downloads/gnosek/fcgiwrap/$pkgname-$pkgver.tar.gz"
+ 'fcgiwrap.conf.d' 'fcgiwrap.rc.d' 'LICENSE')
+md5sums=('be73d90df7c4442084463e2815fc213d' '9fbb5b0e861ffea74e655143a4c1a8f9'
+ '71ea12f43aebca39f73ff2e0b684f361' '5aee62c27b4308f25ab32f05da387366')
+
+build() {
+ cd "$srcdir/gnosek-$pkgname-$_gitrev"
+
+ autoreconf --install
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "$srcdir/gnosek-$pkgname-$_gitrev"
+
+ make DESTDIR="$pkgdir" install
+ install -D -m644 ../fcgiwrap.conf.d "$pkgdir/etc/conf.d/$pkgname"
+ install -D -m755 ../fcgiwrap.rc.d "$pkgdir/etc/rc.d/$pkgname"
+ install -D -m644 ../LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
diff --git a/community/fcgiwrap/fcgiwrap.conf.d b/community/fcgiwrap/fcgiwrap.conf.d
new file mode 100644
index 000000000..906f597a0
--- /dev/null
+++ b/community/fcgiwrap/fcgiwrap.conf.d
@@ -0,0 +1,13 @@
+#
+# parameters for fcgiwrap daemon
+#
+
+SPAWNER='/usr/bin/spawn-fcgi'
+
+FCGI_ADDRESS='127.0.0.1'
+FCGI_PORT='9001'
+FCGI_USER='http'
+FCGI_GROUP='http'
+FCGI_EXTRA_OPTIONS=''
+
+SPAWNER_ARGS="-a $FCGI_ADDRESS -p $FCGI_PORT -u $FCGI_USER -g $FCGI_GROUP $FCGI_EXTRA_OPTIONS -- /usr/sbin/fcgiwrap"
diff --git a/community/fcgiwrap/fcgiwrap.rc.d b/community/fcgiwrap/fcgiwrap.rc.d
new file mode 100644
index 000000000..42787d149
--- /dev/null
+++ b/community/fcgiwrap/fcgiwrap.rc.d
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+DAEMON=fcgiwrap
+
+# source application-specific settings
+[ -f /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
+
+# set defaults if settings are missing
+[ -z "$SPAWNER" ] && SPAWNER='/usr/bin/spawn-fcgi'
+[ -z "$SPAWNER_ARGS" ] && SPAWNER_ARGS='-a 127.0.0.1 -p 9001 -u http -g http -- /usr/sbin/fcgiwrap'
+
+get_pid() {
+ pidof -o %PPID $DAEMON
+}
+
+case "$1" in
+ start)
+ stat_busy "Starting $DAEMON daemon"
+
+ PID=$(get_pid)
+ if [ -z "$PID" ]; then
+ [ -f /var/run/$DAEMON.pid ] && rm -f /var/run/$DAEMON.pid
+ # RUN
+ $SPAWNER $SPAWNER_ARGS &> /dev/null
+ #
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ echo $(get_pid) > /var/run/$DAEMON.pid
+ add_daemon $DAEMON
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ stop)
+ stat_busy "Stopping $DAEMON daemon"
+ PID=$(get_pid)
+ # KILL
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ #
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ rm -f /var/run/$DAEMON.pid &> /dev/null
+ rm_daemon $DAEMON
+ stat_done
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+
+ status)
+ stat_busy "Checking $DAEMON status";
+ ck_status $DAEMON
+ ;;
+
+ *)
+ echo "usage: $0 {start|stop|restart|status}"
+esac
+
+exit 0