ports/158944: www/hiawatha -- add rc file for php-fcgi

C-S c-s at c-s.li
Fri Jul 15 11:50:10 UTC 2011


>Number:         158944
>Category:       ports
>Synopsis:       www/hiawatha -- add rc file for php-fcgi
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 15 11:50:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     C-S
>Release:        
>Organization:
>Environment:
>Description:
Fix the rc files for hiawatha and add rc file for php-fcgi.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN hiawatha.orig/Makefile hiawatha/Makefile
--- hiawatha.orig/Makefile	2011-07-15 13:25:55.589944903 +0200
+++ hiawatha/Makefile	2011-07-15 13:31:39.598404104 +0200
@@ -7,6 +7,7 @@
 
 PORTNAME=	hiawatha
 PORTVERSION=	7.5
+PORTREVISION=	1
 CATEGORIES=	www
 MASTER_SITES=	http://www.hiawatha-webserver.org/files/ \
 		http://www.c-s.li/ports/
@@ -21,7 +22,7 @@
 CONFIG_FILES=	hiawatha.conf mimetype.conf cgi-wrapper.conf php-fcgi.conf
 MAN1=		cgi-wrapper.1 hiawatha.1 newroot.1 php-fcgi.1 ssi-cgi.1 wigwam.1
 
-USE_RC_SUBR=	hiawatha
+USE_RC_SUBR=	hiawatha php-fcgi
 SUB_FILES=	pkg-message
 WANT_GNOME=	yes
 
@@ -86,6 +87,8 @@
 CPPFLAGS+=	-I${LOCALBASE}/include/libxml2
 .endif
 
+SUB_LIST+=	REQUIRE="DAEMON"
+
 post-install:
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
diff -ruN hiawatha.orig/files/hiawatha.in hiawatha/files/hiawatha.in
--- hiawatha.orig/files/hiawatha.in	2011-07-15 13:25:55.589944903 +0200
+++ hiawatha/files/hiawatha.in	2011-07-15 13:31:39.582401646 +0200
@@ -1,11 +1,12 @@
 #!/bin/sh
 #
-# $FreeBSD: ports/www/hiawatha/files/hiawatha.in,v 1.2 2010/03/27 00:15:13 dougb Exp $
+# $FreeBSD$
 #
 
-# PROVIDE: httpd
-# REQUIRE: NETWORKING SERVERS
-# BEFORE: DAEMON
+# PROVIDE: hiawatha
+# REQUIRE: LOGIN cleanvar
+# BEFORE:  DAEMON
+# KEYWORD: shutdown
 
 # Add the following line(s) to /etc/rc.conf:
 # hiawatha_enable (bool): Set to "NO" by default, set it to "YES" to enable hiawatha
@@ -14,9 +15,20 @@
 
 name="hiawatha"
 rcvar=`set_rcvar`
-command="%%PREFIX%%/sbin/${name}"
-pidfile="/var/run/${name}.pid"
 
 load_rc_config $name
+
 : ${hiawatha_enable="NO"}
+: ${hiawatha_pidfile="/var/run/hiawatha.pid"}
+
+command="%%PREFIX%%/sbin/${name}"
+pidfile=${hiawatha_pidfile}
+
+stop_postcmd="${name}_stop_postcmd"
+
+hiawatha_stop_postcmd()
+{
+    rm -f ${pidfile}
+}
+
 run_rc_command "$1"
diff -ruN hiawatha.orig/files/php-fcgi.in hiawatha/files/php-fcgi.in
--- hiawatha.orig/files/php-fcgi.in	1970-01-01 01:00:00.000000000 +0100
+++ hiawatha/files/php-fcgi.in	2011-07-15 13:31:39.582401646 +0200
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: php_fcgi
+# REQUIRE: %%REQUIRE%%
+# BEFORE:  LOGIN
+# KEYWORD: shutdown
+
+# Add the following line(s) to /etc/rc.conf:
+# php_fcgi_enable (bool): Set to "NO" by default, set it to "YES" to enable php_fcgi
+
+. /etc/rc.subr
+
+name="php_fcgi"
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+: ${php_fcgi_enable="NO"}
+: ${php_fcgi_app="%%LOCALBASE%%/bin/php-cgi"}
+: ${php_fcgi_pidfile="/var/run/php-fcgi.pid"}
+
+command="%%PREFIX%%/sbin/php-fcgi"
+pidfile=${php_fcgi_pidfile}
+procname=${php_fcgi_app}
+
+stop_postcmd="${name}_stop_postcmd"
+
+php_fcgi_stop_postcmd()
+{
+    rm -f ${pidfile}
+}
+
+run_rc_command "$1"
diff -ruN hiawatha.orig/files/pkg-message.in hiawatha/files/pkg-message.in
--- hiawatha.orig/files/pkg-message.in	2011-07-15 13:25:55.589944903 +0200
+++ hiawatha/files/pkg-message.in	2011-07-15 13:31:39.582401646 +0200
@@ -7,6 +7,9 @@
 Add hiawatha_enable="YES" to rc.conf and start Hiawatha by running:
 %%PREFIX%%/etc/rc.d/hiawatha start
 
+To use php-fcgi, add php_fcgi_enable="YES" to rc.conf and start it by running:
+%%PREFIX%%/etc/rc.d/php-fcgi start
+
 If you configured Hiawatha with Monitor, download and install the respective
 files needed to monitor your webserver:
 http://www.hiawatha-webserver.org/monitor


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list