aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroam <roam@FreeBSD.org>2004-12-30 23:37:50 +0800
committerroam <roam@FreeBSD.org>2004-12-30 23:37:50 +0800
commitd0d4aeab21721439a29e92295bfe9b7f9e0c326d (patch)
treea774e1cd2734e8854bb57e2e8b7e337c555a13e0
parent5d91543d04a14a2ec5272fa331fef54f51b423f7 (diff)
downloadfreebsd-ports-gnome-d0d4aeab21721439a29e92295bfe9b7f9e0c326d.tar.gz
freebsd-ports-gnome-d0d4aeab21721439a29e92295bfe9b7f9e0c326d.tar.zst
freebsd-ports-gnome-d0d4aeab21721439a29e92295bfe9b7f9e0c326d.zip
The last update for this year, I hope :)
Make stunnel use the rc_subr framework, allowing for much cleaner startup and shutdown of multiple instances of stunnel.
-rw-r--r--security/stunnel/Makefile16
-rw-r--r--security/stunnel/files/stunnel.in50
-rw-r--r--security/stunnel/files/stunnel.sh50
-rw-r--r--security/stunnel/pkg-plist2
4 files changed, 79 insertions, 39 deletions
diff --git a/security/stunnel/Makefile b/security/stunnel/Makefile
index 26c91fff863f..bf61841b913c 100644
--- a/security/stunnel/Makefile
+++ b/security/stunnel/Makefile
@@ -7,7 +7,7 @@
PORTNAME= stunnel
PORTVERSION= 4.06
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= http://www.stunnel.org/download/stunnel/src/ \
ftp://stunnel.mirt.net/stunnel/OBSOLETE/ \
@@ -19,6 +19,7 @@ COMMENT= SSL encryption wrapper for standard network daemons
USE_OPENSSL= YES
USE_REINPLACE= YES
USE_LIBTOOL_VER= 15
+USE_RC_SUBR= YES
GNU_CONFIGURE= yes
CONFIGURE_TARGET= --target=${MACHINE_ARCH}-portbld-freebsd${OSREL}
@@ -50,9 +51,9 @@ post-patch:
.endif
post-install:
- @${SED} "s+!!PREFIX!!+${PREFIX}+g" < ${FILESDIR}/stunnel.sh \
- > ${PREFIX}/etc/rc.d/stunnel.sh.sample
- @${CHMOD} 755 ${PREFIX}/etc/rc.d/stunnel.sh.sample
+ ${SED} "s+!!PREFIX!!+${PREFIX}+g; s+!!RC_SUBR!!+${RC_SUBR}+g" \
+ < ${FILESDIR}/stunnel.sh > ${WRKDIR}/stunnel.sh
+ ${INSTALL_SCRIPT} ${WRKDIR}/stunnel.sh ${PREFIX}/etc/rc.d/
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} \
${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${ECHO} ""
@@ -62,6 +63,13 @@ post-install:
@${ECHO} "And don't forget to check out the FAQ at http://www.stunnel.org/"
@${ECHO} "**************************************************************************"
@${ECHO} ""
+ @${ECHO} "*********************** WARNING! WARNING! WARNING! ***********************"
+ @${ECHO} "The stunnel startup script has been converted to rc_subr"
+ @${ECHO} "format now. You have to set at least the stunnel_enable"
+ @${ECHO} "variable, and maybe also stunnel_config and stunnel_pidfile,"
+ @${ECHO} "if you want stunnel to be started automatically at boot time!"
+ @${ECHO} "**************************************************************************"
+ @${ECHO} ""
cert:
@${ECHO} ""
diff --git a/security/stunnel/files/stunnel.in b/security/stunnel/files/stunnel.in
index 8edeb0c175dc..23059f7e72a4 100644
--- a/security/stunnel/files/stunnel.in
+++ b/security/stunnel/files/stunnel.in
@@ -1,25 +1,41 @@
#!/bin/sh
#
-# A sample stunnel startup script written by martti.kuparinen@ericsson.com
-#
# $FreeBSD$
#
-# Where is the program
-STUNNEL="!!PREFIX!!/sbin/stunnel"
+# PROVIDE: stunnel
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable mysql:
+# stunnel_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable stunnel.
+# stunnel_config (str): Default "!!PREFIX!!/etc/stunnel/stunnel.conf"
+# Set it to the full path to the config file
+# that stunnel will use during the automated
+# start-up.
+# stunnel_pidfile (str): Default "!!PREFIX!!/var/stunnel/stunnel.pid"
+# Set it to the value of 'pidfile' in
+# the stunnel.conf file.
+#
+
+. !!RC_SUBR!!
+
+name="stunnel"
+rcvar=`set_rcvar`
+stunnel_config="!!PREFIX!!/etc/stunnel/${name}.conf"
+stunnel_pidfile="!!PREFIX!!/var/stunnel/${name}.pid"
+command="!!PREFIX!!/sbin/stunnel"
+
+[ -z "$stunnel_enable" ] && stunnel_enable="NO"
+
+load_rc_config $name
-case "$1" in
- start)
- ${STUNNEL} !!PREFIX!!/etc/stunnel/stunnel.conf
- ;;
+command_args=${stunnel_config}
+pidfile=${stunnel_pidfile}
- stop)
- killall `basename ${STUNNEL}`
- ;;
+required_files="${stunnel_config}"
- *)
- echo ""
- echo "Usage: `basename $0` { start | stop }"
- echo ""
- ;;
-esac
+run_rc_command "$1"
diff --git a/security/stunnel/files/stunnel.sh b/security/stunnel/files/stunnel.sh
index 8edeb0c175dc..23059f7e72a4 100644
--- a/security/stunnel/files/stunnel.sh
+++ b/security/stunnel/files/stunnel.sh
@@ -1,25 +1,41 @@
#!/bin/sh
#
-# A sample stunnel startup script written by martti.kuparinen@ericsson.com
-#
# $FreeBSD$
#
-# Where is the program
-STUNNEL="!!PREFIX!!/sbin/stunnel"
+# PROVIDE: stunnel
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+
+#
+# Add the following line to /etc/rc.conf to enable mysql:
+# stunnel_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable stunnel.
+# stunnel_config (str): Default "!!PREFIX!!/etc/stunnel/stunnel.conf"
+# Set it to the full path to the config file
+# that stunnel will use during the automated
+# start-up.
+# stunnel_pidfile (str): Default "!!PREFIX!!/var/stunnel/stunnel.pid"
+# Set it to the value of 'pidfile' in
+# the stunnel.conf file.
+#
+
+. !!RC_SUBR!!
+
+name="stunnel"
+rcvar=`set_rcvar`
+stunnel_config="!!PREFIX!!/etc/stunnel/${name}.conf"
+stunnel_pidfile="!!PREFIX!!/var/stunnel/${name}.pid"
+command="!!PREFIX!!/sbin/stunnel"
+
+[ -z "$stunnel_enable" ] && stunnel_enable="NO"
+
+load_rc_config $name
-case "$1" in
- start)
- ${STUNNEL} !!PREFIX!!/etc/stunnel/stunnel.conf
- ;;
+command_args=${stunnel_config}
+pidfile=${stunnel_pidfile}
- stop)
- killall `basename ${STUNNEL}`
- ;;
+required_files="${stunnel_config}"
- *)
- echo ""
- echo "Usage: `basename $0` { start | stop }"
- echo ""
- ;;
-esac
+run_rc_command "$1"
diff --git a/security/stunnel/pkg-plist b/security/stunnel/pkg-plist
index dc1e0639b529..5bcefb9da850 100644
--- a/security/stunnel/pkg-plist
+++ b/security/stunnel/pkg-plist
@@ -1,4 +1,4 @@
-etc/rc.d/stunnel.sh.sample
+etc/rc.d/stunnel.sh
etc/stunnel/stunnel.conf-sample
lib/libstunnel.so
lib/libstunnel.a