ports/116773: [PATCH] security/stunnel: new style of startup script install
Alexander Logvinov
ports at logvinov.com
Mon Oct 1 01:00:06 UTC 2007
>Number: 116773
>Category: ports
>Synopsis: [PATCH] security/stunnel: new style of startup script install
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Mon Oct 01 01:00:05 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Alexander Logvinov
>Release: FreeBSD 6.2-RELEASE-p7 i386
>Organization:
>Environment:
>Description:
Use new style of startup script install
Utilize ETCDIR for Makefile and pkg-plist
>How-To-Repeat:
>Fix:
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/security/stunnel/Makefile,v
retrieving revision 1.79
diff -u -r1.79 Makefile
--- Makefile 28 Aug 2007 10:01:00 -0000 1.79
+++ Makefile 1 Oct 2007 00:52:57 -0000
@@ -7,7 +7,7 @@
PORTNAME= stunnel
PORTVERSION= 4.20
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= http://www.stunnel.org/download/stunnel/src/ \
ftp://stunnel.mirt.net/stunnel/ \
@@ -19,7 +19,7 @@
USE_AUTOTOOLS= libtool:15
USE_OPENSSL= YES
-USE_RC_SUBR= YES
+USE_RC_SUBR= stunnel
GNU_CONFIGURE= yes
CONFIGURE_TARGET= --target=${MACHINE_ARCH}-portbld-freebsd${OSREL}
@@ -77,9 +77,6 @@
.endif
post-install:
- ${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} ""
@@ -100,7 +97,7 @@
cert:
@${ECHO} ""
@${ECHO} "**************************************************************************"
- @${ECHO} "The new certificate will be saved into ${PREFIX}/etc/stunnel/stunnel.pem"
+ @${ECHO} "The new certificate will be saved into ${ETCDIR}/stunnel.pem"
@${ECHO} "**************************************************************************"
@${ECHO} ""
@(cd ${WRKSRC}/tools/; make install-data-local)
Index: pkg-plist
===================================================================
RCS file: /home/pcvs/ports/security/stunnel/pkg-plist,v
retrieving revision 1.12
diff -u -r1.12 pkg-plist
--- pkg-plist 21 Apr 2006 10:51:49 -0000 1.12
+++ pkg-plist 1 Oct 2007 00:52:57 -0000
@@ -1,5 +1,4 @@
-etc/rc.d/stunnel.sh
-etc/stunnel/stunnel.conf-sample
+%%ETCDIR%%/stunnel.conf-sample
lib/libstunnel.a
lib/libstunnel.la
lib/libstunnel.so
@@ -30,4 +29,4 @@
%%PORTDOCS%%%%DOCSDIR%%/TODO
%%PORTDOCS%%@dirrm %%DOCSDIR%%/examples
%%PORTDOCS%%@dirrm %%DOCSDIR%%
- at unexec rmdir %D/etc/stunnel 2>/dev/null || echo "If you are permanently removing this port, you should do a ``rm -rf ${PKG_PREFIX}/etc/stunnel`` to remove any configuration files left." | fmt
+ at unexec rmdir %D/%%ETCDIR%% 2>/dev/null || echo "If you are permanently removing this port, you should do a ``rm -rf ${PKG_PREFIX}/%%ETCDIR%%`` to remove any configuration files left." | fmt
Index: files/stunnel.in
===================================================================
RCS file: files/stunnel.in
diff -N files/stunnel.in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/stunnel.in 1 Oct 2007 00:52:57 -0000
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# $FreeBSD: ports/security/stunnel/files/stunnel.sh,v 1.6 2006/04/21 10:51:49 roam Exp $
+#
+
+# PROVIDE: stunnel
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+
+#
+# Add some of the following variables to /etc/rc.conf to configure stunnel:
+# 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 'pid' in
+# the stunnel.conf file.
+#
+
+. %%RC_SUBR%%
+
+name="stunnel"
+rcvar=`set_rcvar`
+stunnel_config="%%ETCDIR%%/${name}.conf"
+stunnel_pidfile="/var/run/${name}.pid"
+command="%%PREFIX%%/sbin/stunnel"
+
+[ -z "$stunnel_enable" ] && stunnel_enable="NO"
+
+load_rc_config $name
+
+command_args=${stunnel_config}
+pidfile=${stunnel_pidfile}
+
+required_files="${stunnel_config}"
+
+run_rc_command "$1"
Index: files/stunnel.sh
===================================================================
RCS file: files/stunnel.sh
diff -N files/stunnel.sh
--- files/stunnel.sh 21 Apr 2006 10:51:49 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,41 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: ports/security/stunnel/files/stunnel.sh,v 1.6 2006/04/21 10:51:49 roam Exp $
-#
-
-# PROVIDE: stunnel
-# REQUIRE: NETWORKING SERVERS
-# BEFORE: DAEMON
-# KEYWORD: shutdown
-
-#
-# Add some of the following variables to /etc/rc.conf to configure stunnel:
-# 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 'pid' in
-# the stunnel.conf file.
-#
-
-. !!RC_SUBR!!
-
-name="stunnel"
-rcvar=`set_rcvar`
-stunnel_config="!!PREFIX!!/etc/stunnel/${name}.conf"
-stunnel_pidfile="/var/run/${name}.pid"
-command="!!PREFIX!!/sbin/stunnel"
-
-[ -z "$stunnel_enable" ] && stunnel_enable="NO"
-
-load_rc_config $name
-
-command_args=${stunnel_config}
-pidfile=${stunnel_pidfile}
-
-required_files="${stunnel_config}"
-
-run_rc_command "$1"
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list