aboutsummaryrefslogtreecommitdiff
path: root/www/fcgiwrap
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2010-08-17 19:40:36 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2010-08-17 19:40:36 +0000
commit7e7ceec3eb176d1effcdaed6b1ace228f2452e21 (patch)
tree76333275e79e5442493b0930d58e6e210dbe8cfb /www/fcgiwrap
parente3bea4f57f6ad5d7f145ebbfd6444c1fc6d71464 (diff)
downloadports-7e7ceec3eb176d1effcdaed6b1ace228f2452e21.tar.gz
ports-7e7ceec3eb176d1effcdaed6b1ace228f2452e21.zip
Notes
Diffstat (limited to 'www/fcgiwrap')
-rw-r--r--www/fcgiwrap/Makefile3
-rw-r--r--www/fcgiwrap/files/fcgiwrap.in75
2 files changed, 78 insertions, 0 deletions
diff --git a/www/fcgiwrap/Makefile b/www/fcgiwrap/Makefile
index d16ccf582c54..d934fd6585e0 100644
--- a/www/fcgiwrap/Makefile
+++ b/www/fcgiwrap/Makefile
@@ -7,6 +7,7 @@
PORTNAME= fcgiwrap
PORTVERSION= 1.0.3
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= http://cloud.github.com/downloads/gnosek/fcgiwrap/
@@ -18,6 +19,8 @@ LIB_DEPENDS= fcgi.0:${PORTSDIR}/www/fcgi
WRKSRC= ${WRKDIR}/gnosek-fcgiwrap-2e301c8
LICENSE= MIT
+USE_RC_SUBR= fcgiwrap
+
USE_AUTOTOOLS= autoconf:262:env autoheader:262
CFLAGS+= -I${LOCALBASE}/include -L${LOCALBASE}/lib
diff --git a/www/fcgiwrap/files/fcgiwrap.in b/www/fcgiwrap/files/fcgiwrap.in
new file mode 100644
index 000000000000..f4c04eaae5b9
--- /dev/null
+++ b/www/fcgiwrap/files/fcgiwrap.in
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# fcgiwrap startup script
+#
+# PROVIDE: fcgiwrap
+# REQUIRE: login
+# KEYWORD: shutdown
+
+#
+# Add the following to /etc/rc.conf[.local] to enable this service
+#
+# fcgiwrap_enable="YES"
+#
+# You can fine tune others variables too:
+# fcgiwrap_fib="NONE"
+# fcgiwrap_socket="unix:/var/run/fcgiwrap.sock"
+# this could also be:
+# - tcp:[ipv4_addr]:port (for ipv4)
+# - tcp6:[ipv6_addr]:port (for ipv6)
+# fcgiwrap_flags=""
+# Use fcgiwrap_user to run fcgiwrap as user
+
+fcgiwrap_setfib() {
+ sysctl net.fibs >/dev/null 2>&1 || return 0
+
+ case "$fcgiwrap_fib" in
+ [Nn][Oo][Nn][Ee])
+ ;;
+ *)
+ command="setfib -F ${fcgiwrap_fib} ${command}"
+ ;;
+ esac
+}
+
+fcgiwrap_precmd() {
+ fcgiwrap_setfib
+
+ test -d /var/run/fcgiwrap || mkdir -p /var/run/fcgiwrap
+ if [ -n ${fcgiwrap_user} ]; then
+ chown -R ${fcgiwrap_user} /var/run/fcgiwrap
+ fi
+}
+
+fcgiwrap_cleansocket() {
+ # Workaround the fact that fcgiwrap doesn't cleanup his socket at stopping
+ case ${fcgiwrap_socket} in
+ unix*)
+ test -S ${fcgiwrap_socket#unix:} && rm -f ${fcgiwrap_socket#unix:}
+ ;;
+ esac
+
+}
+
+. /etc/rc.subr
+
+pidfile="/var/run/fcgiwrap/fcgiwrap.pid"
+name="fcgiwrap"
+rcvar=`set_rcvar`
+
+procname="%%PREFIX%%/sbin/${name}"
+command="/usr/sbin/daemon"
+start_precmd="fcgiwrap_precmd"
+stop_postcmd="fcgiwrap_cleansocket"
+
+load_rc_config $name
+
+fcgiwrap_enable=${fcgiwrap_enable:-"NO"}
+fcgiwrap_fib=${fcgiwrap_fib:-"NONE"}
+fcgiwrap_socket=${fcgiwrap_port:-"unix:/var/run/fcgiwrap/fcgiwrap.sock"}
+
+command_args="-f -p ${pidfile} ${procname} -s ${fcgiwrap_socket} ${fcgiwrap_flags}"
+
+run_rc_command "$1"