]> git.pld-linux.org Git - packages/stunnel.git/commitdiff
- added subpackages stunnel-{standalone,inetd} and related %post,
authortwittner <twittner@pld-linux.org>
Sun, 9 May 2004 01:15:31 +0000 (01:15 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
  %pre... stuff.
- fixed %files:
  - stunnel.conf-sample -> stunnel.conf (but all is commented out by
    -config.patch).
  - added missing French docs, fixed names of Polish and French manpages.
- added uid=130/gid=130 stunnel - killed nobody, nogroup from %files
- rel. 1.1

Changed files:
    stunnel.spec -> 1.72

stunnel.spec

index e8484c7477cff53a9e4625f83f180e0bf368c74b..a092772f61b9c31f32dca98a7203b013c281ad03 100644 (file)
@@ -1,22 +1,22 @@
-# TODO:
-# - fix /var/run/stunnel ownership (nobody must NOT own any files!)
 Summary:       Universal SSL tunnel
 Summary(pl):   Uniwersalne narzêdzie do bezpiecznego tunelowania
 Name:          stunnel
 Version:       4.05
-Release:       1
+Release:       1.1
 License:       GPL v2
 Group:         Networking/Daemons
 Source0:       ftp://stunnel.mirt.net/stunnel/%{name}-%{version}.tar.gz
 # Source0-md5: e28a03cf694a43a7f144ec3d5c064456
 Source1:       %{name}.init
 Source2:       %{name}.sysconfig
+Source3:       %{name}.inet
 Patch0:                %{name}-gethostbyname_is_in_libc_aka_no_libnsl.patch
 Patch1:                %{name}-authpriv.patch
 Patch2:                %{name}-ac_fixes.patch
 Patch3:                %{name}-am.patch
 Patch4:                %{name}-getgrnam.patch
 Patch5:                %{name}-libwrap_srv_name_log.patch
+Patch6:                %{name}-config.patch
 URL:           http://www.stunnel.org/
 BuildRequires: autoconf
 BuildRequires: automake
@@ -24,6 +24,15 @@ BuildRequires:       libtool
 BuildRequires: openssl-devel >= 0.9.7d
 BuildRequires: openssl-tools >= 0.9.7d
 BuildRequires: libwrap-devel
+PreReq:                rc-scripts
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
+Requires(postun):      /usr/sbin/userdel
+Requires(postun):      /usr/sbin/groupdel
+Requires(post,preun):  /sbin/chkconfig
+Requires(post,postun): /sbin/ldconfig
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -40,6 +49,32 @@ Stunnel umo
 a komputerem klienta. Przy jego u¿yciu mo¿na ³atwo zrealizowaæ us³ugi
 pop3s lub https.
 
+%package standalone
+Summary:       stunnel acts as standalone server 
+Summary(pl):   stunnel dzia³aj±cy jako samodzielny serwer
+Group:         Networking/Daemons
+Requires:      %{name} = %{version}-%{release}
+Obsoletes:     %{name}-inetd
+
+%description standalone
+stunnel acts as standalone server.
+
+%description standalone -l pl
+stunnel dzia³aj±cy jako samodzielny serwer.
+
+%package inetd 
+Summary:       stunnel acts as inetd service
+Summary(pl):   stunnel dzia³aj±cy jako us³uga inetd
+Group:         Networking/Daemons
+Requires:      %{name} = %{version}-%{release}
+Obsoletes:     %{name}-standalone
+
+%description inetd
+stunnel acts as inetd service.
+
+%description standalone -l pl
+stunnel dzia³aj±cy jako us³uga inetd.
+
 %prep
 %setup -q
 %patch0 -p1
@@ -48,6 +83,7 @@ pop3s lub https.
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
 
 %build
 %{__libtoolize}
@@ -59,34 +95,98 @@ pop3s lub https.
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},%{_mandir}/pl/man8,%{_var}/run/stunnel}
+install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig/rc-inetd},%{_mandir}/{pl,fr}/man8,%{_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
+mv -f $RPM_BUILD_ROOT%{_mandir}/man8/stunnel.fr.8 $RPM_BUILD_ROOT%{_mandir}/fr/man8/stunnel.8
+mv -f $RPM_BUILD_ROOT%{_mandir}/man8/stunnel.pl.8 $RPM_BUILD_ROOT%{_mandir}/pl/man8/stunnel.8
+mv -f $RPM_BUILD_ROOT/etc/stunnel/stunnel.conf-sample $RPM_BUILD_ROOT/etc/stunnel/stunnel.conf
 
 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/stunnel
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/stunnel
+install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/stunnel
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post   -p /sbin/ldconfig
-%postun -p /sbin/ldconfig
+
+%pre
+if [ -n "`getgid stunnel`" ]; then
+       if [ "`getgid stunnel`" != "130" ]; then
+               echo "Error: group stunnel doesn't have gid=130. Correct this before installing stunnel." 1>&2
+               exit 1
+       fi
+else
+       /usr/sbin/groupadd -g 130 -r -f stunnel
+fi
+if [ -n "`id -u stunnel 2>/dev/null`" ]; then
+       if [ "`id -u stunnel`" != "130" ]; then
+               echo "Error: user stunnel doesn't have uid=130. Correct this before installing stunnel." 1>&2
+               exit 1
+       fi
+else
+       /usr/sbin/useradd -u 130 -r -d /var/run/stunnel -s /bin/false -c "stunnel User" -g stunnel stunnel 1>&2
+fi
+
+%postun 
+/sbin/ldconfig
+if [ "$1" = "0" ]; then
+       /usr/sbin/userdel stunnel
+       /usr/sbin/groupdel stunnel
+fi
+
+%post standalone
+/sbin/chkconfig --add stunnel
+if [ -f /var/lock/subsys/stunnel ]; then
+       /etc/rc.d/init.d/stunnel restart 1>&2
+else
+       echo "Run \"/etc/rc.d/init.d/stunnel start\" to start stunnel daemon."
+fi
+
+%preun standalone
+if [ "$1" = "0" ]; then
+       if [ -f /var/lock/subsys/stunnel ]; then
+               /etc/rc.d/init.d/stunnel stop 1>&2
+       fi
+       /sbin/chkconfig --del stunnel
+fi
+
+%post inetd
+if [ -f /var/lock/subsys/rc-inetd ]; then
+        /etc/rc.d/init.d/rc-inetd restart 1>&2
+else
+        echo "Type \"/etc/rc.d/init.d/rc-inetd start\" to start inet server" 1>&2
+fi
+
+%postun inetd
+if [ "$1" = "0" -a -f /var/lock/subsys/rc-inetd ]; then
+       /etc/rc.d/init.d/rc-inetd reload 1>&2
+fi
 
 %files
 %defattr(644,root,root,755)
 # note: this COPYING contains general information not GPL text
 %doc AUTHORS BUGS COPYING CREDITS ChangeLog NEWS PORTS README TODO doc/en/* doc/stunnel.html
 %doc src/stunnel.exe  tools/{ca.*,importCA.*}
+%doc %lang(fr) doc/stunnel.fr.html
 %doc %lang(pl) doc/pl/* doc/stunnel.pl.html
+%attr(750,stunnel,stunnel) %{_var}/run/stunnel
 %dir /etc/stunnel
-%attr(754,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}/*
 %{_mandir}/man8/*
+%lang(fr) %{_mandir}/fr/man8/*
 %lang(pl) %{_mandir}/pl/man8/*
+
+%files standalone
+%defattr(644,root,root,755)
+%attr(754,root,root) /etc/rc.d/init.d/stunnel
+/etc/sysconfig/stunnel
+
+%files inetd
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not size mtime md5) /etc/sysconfig/rc-inetd/stunnel
This page took 0.112083 seconds and 4 git commands to generate.