OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 13-Apr-2005 17:03:51
Branch: HEAD Handle: 2005041316035000
Added files:
openpkg-src/stunnel stunnel.conf
Modified files:
openpkg-src/stunnel rc.stunnel stunnel.spec
Log:
work off package by adding an out-of-the-box server/daemon support
Summary:
Revision Changes Path
1.8 +38 -0 openpkg-src/stunnel/rc.stunnel
1.1 +43 -0 openpkg-src/stunnel/stunnel.conf
1.57 +7 -3 openpkg-src/stunnel/stunnel.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/stunnel/rc.stunnel
============================================================================
$ cvs diff -u -r1.7 -r1.8 rc.stunnel
--- openpkg-src/stunnel/rc.stunnel 20 Sep 2004 14:33:38 -0000 1.7
+++ openpkg-src/stunnel/rc.stunnel 13 Apr 2005 15:03:50 -0000 1.8
@@ -5,12 +5,50 @@
%config
stunnel_enable="$openpkg_rc_def"
+ stunnel_daemon="no"
+ stunnel_flags=""
stunnel_log_prolog="true"
stunnel_log_epilog="true"
stunnel_log_numfiles="10"
stunnel_log_minsize="1M"
stunnel_log_complevel="9"
+%common
+ stunnel_logfile="@l_prefix@/var/stunnel/stunnel.log"
+ stunnel_pidfile="@l_prefix@/var/stunnel/stunnel.pid"
+ stunnel_signal () {
+ [ -f $stunnel_pidfile ] && kill -$1 `cat $stunnel_pidfile`
+ }
+
+%status -u @l_susr@ -o
+ stunnel_usable="unknown"
+ stunnel_active="no"
+ rcService stunnel enable yes && \
+ stunnel_signal 0 && stunnel_active="yes"
+ echo "stunnel_enable=\"$stunnel_enable\""
+ echo "stunnel_usable=\"$stunnel_usable\""
+ echo "stunnel_active=\"$stunnel_active\""
+
+%start -u @l_susr@
+ rcService stunnel enable yes || exit 0
+ rcService stunnel active yes && exit 0
+ rcVarIsYes stunnel_daemon || exit 0
+ @l_prefix@/sbin/stunnel $stunnel_flags
+
+%stop -u @l_susr@
+ rcService stunnel enable yes || exit 0
+ rcService stunnel active no && exit 0
+ rcVarIsYes stunnel_daemon || exit 0
+ stunnel_signal TERM
+ sleep 2
+ rm -f $stunnel_pidfile >/dev/null 2>&1 || true
+
+%restart -u @l_susr@
+ rcService stunnel enable yes || exit 0
+ rcService stunnel active no && exit 0
+ rcVarIsYes stunnel_daemon || exit 0
+ rc stunnel stop start
+
%daily -u @l_susr@
rcService stunnel enable yes || exit 0
shtool rotate -f \
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/stunnel/stunnel.conf
============================================================================
$ cvs diff -u -r0 -r1.1 stunnel.conf
--- /dev/null 2005-04-13 17:00:11 +0200
+++ stunnel.conf 2005-04-13 17:03:51 +0200
@@ -0,0 +1,43 @@
+;;
+;; stunnel.conf -- SSL Tunnel Daemon Configuration
+;;
+
+; process parameters
+debug = 5
+output = @l_prefix@/var/stunnel/stunnel.log
+pid = @l_prefix@/var/stunnel/stunnel.pid
+setuid = @l_nusr@
+setgid = @l_ngrp@
+
+; network parameters
+socket = l:TCP_NODELAY=1
+socket = r:TCP_NODELAY=1
+
+; SSL certificate/key
+cert = @l_prefix@/etc/stunnel/stunnel.pem
+key = @l_prefix@/etc/stunnel/stunnel.pem
+
+;;
+;; Tunneling Services
+;;
+
+[https]
+accept = 443
+connect = 80
+
+;[pop3s]
+;accept = 995
+;connect = 110
+
+;[imaps]
+;accept = 993
+;connect = 143
+
+;[ssmtp]
+;accept = 465
+;connect = 25
+
+;[ircs]
+;accept = 994
+;connect = 6667
+
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/stunnel/stunnel.spec
============================================================================
$ cvs diff -u -r1.56 -r1.57 stunnel.spec
--- openpkg-src/stunnel/stunnel.spec 13 Apr 2005 14:00:19 -0000 1.56
+++ openpkg-src/stunnel/stunnel.spec 13 Apr 2005 15:03:50 -0000 1.57
@@ -43,6 +43,7 @@
Source1: stunnel.pem
Source2: rc.stunnel
Source3: fsl.stunnel
+Source4: stunnel.conf
# build information
Prefix: %{l_prefix}
@@ -101,10 +102,12 @@
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/var/stunnel
%{l_make} %{l_mflags} install prefix=$RPM_BUILD_ROOT%{l_prefix}
+ rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib
rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/stunnel.*.8
- mv $RPM_BUILD_ROOT%{l_prefix}/etc/stunnel/stunnel.conf-sample \
- $RPM_BUILD_ROOT%{l_prefix}/etc/stunnel/stunnel.conf
+ rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/stunnel/stunnel.conf-sample
+ %{l_shtool} install -c -m 644 %{l_value -s -a} \
+ %{SOURCE stunnel.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/stunnel/
strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
# install run-command script
@@ -126,7 +129,8 @@
%{l_files_std} \
'%not %dir %{l_prefix}/etc/fsl' \
'%config %{l_prefix}/etc/stunnel/stunnel.*' \
- '%config %{l_prefix}/etc/fsl/fsl.stunnel'
+ '%config %{l_prefix}/etc/fsl/fsl.stunnel' \
+ '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/stunnel'
%files -f files
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]