pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/www/fcgiwrap



Module Name:    pkgsrc
Committed By:   ryoon
Date:           Tue Oct  1 03:21:03 UTC 2024

Modified Files:
        pkgsrc/www/fcgiwrap: Makefile
Added Files:
        pkgsrc/www/fcgiwrap/files: fcgiwrap.sh

Log Message:
www/fcgiwrap: Add rc.d script

* Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 pkgsrc/www/fcgiwrap/Makefile
cvs rdiff -u -r0 -r1.1 pkgsrc/www/fcgiwrap/files/fcgiwrap.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/www/fcgiwrap/Makefile
diff -u pkgsrc/www/fcgiwrap/Makefile:1.2 pkgsrc/www/fcgiwrap/Makefile:1.3
--- pkgsrc/www/fcgiwrap/Makefile:1.2    Wed Aug 16 20:45:46 2017
+++ pkgsrc/www/fcgiwrap/Makefile        Tue Oct  1 03:21:03 2024
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.2 2017/08/16 20:45:46 wiz Exp $
+# $NetBSD: Makefile,v 1.3 2024/10/01 03:21:03 ryoon Exp $
 
 DISTNAME=      fcgiwrap-1.1.0
+PKGREVISION=   1
 CATEGORIES=    www
 
 COMMENT=       FastCGI wrapper for plain CGI scripts
@@ -18,6 +19,18 @@ USE_TOOLS+=  automake autoreconf pkg-conf
 
 LDFLAGS.SunOS+=        -lsocket -lnsl
 
+FCGIWRAP_USER?=                nginx
+FCGIWRAP_GROUP?=       nginx
+PKG_USERS_VARS+=       FCGIWRAP_USER
+PKG_GROUPS_VARS+=      FCGIWRAP_GROUP
+PKG_GROUPS=            ${FCGIWRAP_GROUP}
+PKG_USERS=             ${FCGIWRAP_USER}:${FCGIWRAP_GROUP}
+
+FILES_SUBST+=          FCGIWRAP_USER=${FCGIWRAP_USER}
+FILES_SUBST+=          FCGIWRAP_GROUP=${FCGIWRAP_GROUP}
+
+RCD_SCRIPTS+=          fcgiwrap
+
 pre-configure:
        cd ${WRKSRC} && autoreconf -i
 

Added files:

Index: pkgsrc/www/fcgiwrap/files/fcgiwrap.sh
diff -u /dev/null pkgsrc/www/fcgiwrap/files/fcgiwrap.sh:1.1
--- /dev/null   Tue Oct  1 03:21:03 2024
+++ pkgsrc/www/fcgiwrap/files/fcgiwrap.sh       Tue Oct  1 03:21:03 2024
@@ -0,0 +1,52 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: fcgiwrap.sh,v 1.1 2024/10/01 03:21:03 ryoon Exp $
+#
+# PROVIDE: fcgiwrap
+# REQUIRE: DAEMON
+#
+# You will need to set some variables in @SYSCONFBASE@/rc.conf to start fcgiwrap:
+#
+# fcgiwrap=YES
+
+$_rc_subr_loaded . @SYSCONFBASE@/rc.subr
+
+name="fcgiwrap"
+rcvar=${name}
+command="@PREFIX@/sbin/${name}"
+pidfile="@VARBASE@/run/${name}/${name}.pid"
+fcgiwrap_user="@FCGIWRAP_USER@"
+fcgiwrap_group="@FCGIWRAP_GROUP@"
+start_precmd="fcgiwrap_precmd"
+start_cmd="fcgiwrap_start"
+start_postcmd="fcgiwrap_poststart"
+fcgiwrap_socket="@VARBASE@/run/${name}/${name}.sock"
+
+fcgiwrap_precmd()
+{
+       if [ ! -d @VARBASE@/run/${name} ]; then
+               @MKDIR@ @VARBASE@/run/${name}
+               @CHOWN@ ${fcgiwrap_user}:${fcgiwrap_group} @VARBASE@/run/${name}
+       fi
+
+       if [ -e ${fcgiwrap_socket} ]; then
+               @RM@ -f ${fcgiwrap_socket}
+       fi
+}
+
+fcgiwrap_start()
+{
+       @SU@ -m ${fcgiwrap_user} -c "${command} -s unix:${fcgiwrap_socket}" &
+}
+
+fcgiwrap_poststart() {
+       echo $! > ${pidfile}
+}
+
+fcgiwrap_stop()
+{
+       kill -HUP $(check_pidfile $pidfile $name)
+}
+
+load_rc_config $name
+run_rc_command "$1"



Home | Main Index | Thread Index | Old Index