--- /dev/null
+#!/bin/sh
+#
+# stunnel stunnel (Universal SSL tunnel)
+#
+# chkconfig: 345 14 91
+#
+# description: stunnel (Universal SSL tunnel)
+#
+# id: $Id$
+#
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/stunnel ] && . /etc/sysconfig/stunnel
+
+# Check that networking is up.
+if is_no "${NETWORKING}"; then
+ msg_network_down stunnel
+ exit 1
+fi
+
+# Daemon doesn't die if config doesn't exist
+if [ ! -f $STUNNEL_CONFIG ]; then
+ echo "Stunnel config $STUNNEL_CONFIG does not exist."
+ exit 1
+fi
+
+# See how we were called.
+case "$1" in
+ start)
+ # Check if the service is already running?
+ if [ ! -f /var/lock/subsys/stunnel ]; then
+ msg_starting stunnel; busy
+ daemon stunnel $STUNNEL_CONFIG
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/stunnel
+ else
+ msg_already_running stunnel
+ exit 1
+ fi
+ ;;
+ stop)
+ if [ -f /var/lock/subsys/stunnel ]; then
+ msg_stopping stunnel
+ killproc stunnel
+ rm -f /var/run/stunnel/stunnel.pid /var/lock/subsys/stunnel >/dev/null 2>&1
+ else
+ msg_not_running stunnel
+ exit 1
+ fi
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ status)
+ status stunnel
+ exit $?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|status|restart}"
+ exit 1
+esac
+
+exit $RETVAL
Summary(pl): Uniwersalne narzêdzie do bezpiecznego tunelowania
Name: stunnel
Version: 4.04
-Release: 0.2
+Release: 0.9
License: GPL v2
Group: Networking/Daemons
Source0: ftp://stunnel.mirt.net/stunnel/%{name}-%{version}.tar.gz
+Source1: %{name}.init
+Source2: %{name}.sysconfig
Patch0: %{name}-gethostbyname_is_in_libc_aka_no_libnsl.patch
Patch1: %{name}-authpriv.patch
Patch2: %{name}-ac_fixes.patch
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_mandir}/pl/man8
+install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
+ -d $RPM_BUILD_ROOT%{_mandir}/pl/man8 \
+ -d $RPM_BUILD_ROOT%{_var}/run/stunnel
%{__make} install DESTDIR=$RPM_BUILD_ROOT
mv -f $RPM_BUILD_ROOT/%{_mandir}/man8/stunnel.pl.8* $RPM_BUILD_ROOT/%{_mandir}/pl/man8/
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/stunnel
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/stunnel
+
%clean
rm -rf $RPM_BUILD_ROOT
%doc $RPM_BUILD_ROOT%{_datadir}/doc/stunnel/examples/{c*,i*,stunnel.init}
%doc %lang(pl) doc/pl/* doc/stunnel.pl.html
%dir /etc/stunnel
+%attr(755,root,root) /etc/rc.d/init.d/stunnel
+%attr(600,root,root) /etc/sysconfig/stunnel
+%attr(700,nobody,nobody) %{_var}/run/stunnel
%config(noreplace) %verify(not size mtime md5) /etc/stunnel/*
%attr(755,root,root) %{_sbindir}/*
%attr(755,root,root) %{_libdir}/*
--- /dev/null
+# Customized settings for stunnel
+
+# Define nice level for stunnel
+SERVICE_RUN_NICE_LEVEL="+0"
+
+# Where is stunnel config?
+STUNNEL_CONFIG="/etc/stunnel/stunnel.conf"