[csw-devel] SF.net SVN: gar:[5118] csw/mgar/pkg/stunnel/trunk

skayser at users.sourceforge.net skayser at users.sourceforge.net
Mon Jun 1 02:29:20 CEST 2009


Revision: 5118
          http://gar.svn.sourceforge.net/gar/?rev=5118&view=rev
Author:   skayser
Date:     2009-06-01 00:29:19 +0000 (Mon, 01 Jun 2009)

Log Message:
-----------
stunnel: added init script, fixed chroot dir ownership

Modified Paths:
--------------
    csw/mgar/pkg/stunnel/trunk/Makefile
    csw/mgar/pkg/stunnel/trunk/checksums
    csw/mgar/pkg/stunnel/trunk/files/gar-base.diff

Added Paths:
-----------
    csw/mgar/pkg/stunnel/trunk/files/CSWstunnel.cswstunnel

Modified: csw/mgar/pkg/stunnel/trunk/Makefile
===================================================================
--- csw/mgar/pkg/stunnel/trunk/Makefile	2009-05-31 20:58:10 UTC (rev 5117)
+++ csw/mgar/pkg/stunnel/trunk/Makefile	2009-06-01 00:29:19 UTC (rev 5118)
@@ -1,6 +1,9 @@
 # Todo:
 # * postinstall mknod not possible within zone (mknod fails with "not owner")
 #   Work around this or provide README.CSW with instructions for chroot
+#   --> Why should /dev/zero be required at all? google suggests relation
+#       to pthreads .. truss doesn't show /dev/zero usage on Solaris 10
+#       Test on Solaris 8 / 9 for comparison
 GARNAME = stunnel
 GARVERSION = 4.27
 CATEGORIES = net
@@ -16,11 +19,12 @@
 
 MASTER_SITES = http://www.stunnel.org/download/stunnel/src/
 DISTFILES  = $(GARNAME)-$(GARVERSION).tar.gz
-DISTFILES += CSWstunnel.postinstall
+#DISTFILES += CSWstunnel.postinstall
 
 SPKG_SOURCEURL = http://www.stunnel.org
+SPKG_CLASSES = none cswcpsampleconf cswinitsmf
 
-REQUIRED_PKGS = CSWzlib CSWosslrt CSWtcpwrap
+REQUIRED_PKGS = CSWzlib CSWosslrt CSWtcpwrap CSWcswclassutils
 
 # We define upstream file regex so we can be notifed of new upstream software release
 UFILES_REGEX = $(GARNAME)-(\d+(?:\.\d+)*).tar.gz
@@ -37,6 +41,12 @@
 # No test target available
 TEST_SCRIPTS =
 
+PROTOTYPE_FILTER  = awk '\
+	$$$$3 ~ /cswstunnel$$$$/ { $$$$2 = "cswinitsmf" } \
+	$$$$3 ~ /stunnel.pem$$$$/ { $$$$2 = "cswcpsampleconf" } \
+	$$$$3 ~ /\/var\/opt\/csw\/lib\/stunnel/ { $$$$5 = "nobody"; $$$$6 = "nogroup" } \
+	{ print }'
+
 include gar/category.mk
 
 # 1) Suppress prompts for openssl sample cert generation (-batch)
@@ -52,6 +62,10 @@
 post-install-modulated: DOCS=AUTHORS BUGS CREDITS ChangeLog TODO
 post-install-modulated: DOCS+= doc/stunnel.*html
 post-install-modulated:
+	@ginstall -d $(DESTDIR)/etc/opt/csw/init.d
+	@ginstall -m 755 $(FILEDIR)/CSWstunnel.cswstunnel \
+		$(DESTDIR)/etc/opt/csw/init.d/cswstunnel
+
 	# create pidfile directory
 	@ginstall -d $(DESTDIR)/var/opt/csw/run/stunnel
 

Modified: csw/mgar/pkg/stunnel/trunk/checksums
===================================================================
--- csw/mgar/pkg/stunnel/trunk/checksums	2009-05-31 20:58:10 UTC (rev 5117)
+++ csw/mgar/pkg/stunnel/trunk/checksums	2009-06-01 00:29:19 UTC (rev 5118)
@@ -1,3 +1,2 @@
-b3f085499896129ad6813b1bda46113c  download/CSWstunnel.postinstall
-b73143a6ffa7d55f4dffcd3d6fa0544a  download/gar-base.diff
+8d6730bd87af222c3ff66547e82d8d7f  download/gar-base.diff
 3c655d815576f50046a1c28744b88681  download/stunnel-4.27.tar.gz

Added: csw/mgar/pkg/stunnel/trunk/files/CSWstunnel.cswstunnel
===================================================================
--- csw/mgar/pkg/stunnel/trunk/files/CSWstunnel.cswstunnel	                        (rev 0)
+++ csw/mgar/pkg/stunnel/trunk/files/CSWstunnel.cswstunnel	2009-06-01 00:29:19 UTC (rev 5118)
@@ -0,0 +1,54 @@
+#!/bin/sh
+# Based on Sample stunnel SysV startup file
+# Copyright by Michal Trojnara 2002,2007,2008
+#
+# Modified for CSW by Sebastian Kayser
+#
+# Don't enable SMF service right away
+#AUTOENABLE=no
+
+PATH=/opt/csw/sbin:/opt/csw/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/opt/csw/bin/stunnel
+DEFAULTPIDFILE=/var/opt/csw/run/stunnel/stunnel.pid
+
+CONFIG=/opt/csw/etc/stunnel/stunnel.conf
+CONFIG_LOCAL=/etc/opt/csw/stunnel/stunnel.conf
+test -r $CONFIG_LOCAL && CONFIG=$CONFIG_LOCAL
+
+test -f $DAEMON || exit 0
+test -f $CONFIG || exit 0
+
+CHROOT=`grep ^chroot $CONFIG | sed 's/.*= *//'`
+PIDFILE=`grep ^pid $CONFIG | sed 's/.*= *//'`
+
+test -z "$DEFAULTPIDFILE" && PIDFILE = $DEFAULTPIDFILE
+
+case "$1" in
+    start)
+        printf "Starting universal SSL tunnel: stunnel"
+        $DAEMON $CONFIG || printf " failed"
+        echo "."
+        ;;
+    stop)
+        printf "Stopping universal SSL tunnel: stunnel"
+        if test -r $CHROOT/$PIDFILE; then
+            kill `cat $CHROOT/$PIDFILE` 2> /dev/null || printf " failed"
+        else
+            printf " no PID file"
+        fi
+        echo "."
+        ;;
+     restart|force-reload)
+        echo "Restarting universal SSL tunnel"
+        $0 stop
+        sleep 1
+        $0 start
+        echo "done."
+        ;;
+    *)
+        echo "Usage: /etc/opt/csw/init.d/cswstunnel {start|stop|restart|force-reload}" >&2
+        exit 1
+        ;;
+esac
+
+exit 0

Modified: csw/mgar/pkg/stunnel/trunk/files/gar-base.diff
===================================================================
--- csw/mgar/pkg/stunnel/trunk/files/gar-base.diff	2009-05-31 20:58:10 UTC (rev 5117)
+++ csw/mgar/pkg/stunnel/trunk/files/gar-base.diff	2009-06-01 00:29:19 UTC (rev 5118)
@@ -24,7 +24,7 @@
  ;CApath = /certs
  ; It's often easier to use CAfile
 -;CAfile = @prefix@/etc/stunnel/certs.pem
-+;CAfile = @sysconfdir/stunnel/certs.pem
++;CAfile = @sysconfdir@/stunnel/certs.pem
  ; Don't forget to c_rehash CRLpath
  ; CRLpath is located inside chroot jail
  ;CRLpath = /crls
@@ -34,19 +34,3 @@
  
  ; Some debugging stuff useful for troubleshooting
  ;debug = 7
-diff --speed-large-files --minimal -Nru stunnel-4.27.orig/tools/stunnel.init.in stunnel-4.27/tools/stunnel.init.in
---- stunnel-4.27.orig/tools/stunnel.init.in	2008-09-17 20:53:46.000000000 +0200
-+++ stunnel-4.27/tools/stunnel.init.in	2009-05-17 12:21:18.360927513 +0200
-@@ -2,9 +2,9 @@
- # Sample stunnel SysV startup file
- # Copyright by Michal Trojnara 2002,2007,2008
- 
--PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
--DAEMON=@prefix@/bin/stunnel
--PIDFILE=@prefix@/var/run/stunnel/stunnel.pid
-+PATH=@sbindir@:@bindir@:/sbin:/bin:/usr/sbin:/usr/bin
-+DAEMON=@bindir@/stunnel
-+PIDFILE=@localstatedir@/run/stunnel/stunnel.pid
- 
- test -f $DAEMON || exit 0
- 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list