2006-06-23 10:15:07 +00:00
|
|
|
#
|
2014-09-18 09:28:24 +00:00
|
|
|
# spec file for package stunnel
|
2006-06-23 10:15:07 +00:00
|
|
|
#
|
2014-09-18 09:28:24 +00:00
|
|
|
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2006-06-23 10:15:07 +00:00
|
|
|
#
|
2014-09-18 09:28:24 +00:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2006-06-23 10:15:07 +00:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
Name: stunnel
|
2017-01-02 15:42:49 +00:00
|
|
|
Version: 5.39
|
2011-11-25 09:53:07 +00:00
|
|
|
Release: 0
|
2014-09-18 09:28:24 +00:00
|
|
|
Summary: Universal SSL Tunnel
|
|
|
|
License: GPL-2.0+
|
2006-06-23 10:15:07 +00:00
|
|
|
Group: Productivity/Networking/Security
|
2014-09-18 09:28:24 +00:00
|
|
|
Url: http://www.stunnel.org/
|
2006-06-23 10:15:07 +00:00
|
|
|
PreReq: /usr/sbin/useradd fileutils textutils %insserv_prereq %fillup_prereq
|
2016-10-14 08:06:04 +00:00
|
|
|
Source: ftp://ftp.stunnel.org/stunnel/%{name}-%{version}.tar.gz
|
2006-06-23 10:15:07 +00:00
|
|
|
Source1: stunnel.conf
|
|
|
|
Source2: stunnel.README
|
|
|
|
Source3: sysconfig.syslog-stunnel
|
|
|
|
Source4: stunnel.rc
|
2014-01-29 16:56:32 +00:00
|
|
|
Source5: stunnel.service
|
2011-06-16 12:04:07 +00:00
|
|
|
Patch0: stunnel-listenqueue-option.patch
|
2006-06-23 10:15:07 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2014-01-29 16:56:32 +00:00
|
|
|
%define VENDOR openSUSE
|
2014-09-18 09:28:24 +00:00
|
|
|
BuildRequires: tcpd-devel zlib-devel
|
|
|
|
BuildRequires: libopenssl-devel
|
|
|
|
|
2014-01-29 16:56:32 +00:00
|
|
|
%if 0%{?suse_version} >= 1210
|
|
|
|
BuildRequires: systemd
|
|
|
|
%{?systemd_requires}
|
|
|
|
%define has_systemd 1
|
|
|
|
%endif
|
2006-06-23 10:15:07 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
The stunnel program is designed to work as an SSL encryption wrapper
|
2014-09-18 09:28:24 +00:00
|
|
|
between remote clients and local (inetd-startable) or remote
|
2016-10-25 08:47:46 +00:00
|
|
|
servers. The concept is that, while having non-SSL aware daemons running on
|
|
|
|
your system, you can set them to communicate with clients over a
|
2014-09-18 09:28:24 +00:00
|
|
|
secure SSL channels. Stunnel can be used to add SSL functionality to
|
2016-10-25 08:47:46 +00:00
|
|
|
commonly used inetd daemons, such as POP-2, POP-3, and IMAP servers
|
2006-06-23 10:15:07 +00:00
|
|
|
without any changes to the program code.
|
|
|
|
|
2011-06-29 13:07:51 +00:00
|
|
|
%package doc
|
|
|
|
Summary: Documentation for the universal SSL Tunnel
|
2016-10-25 08:47:46 +00:00
|
|
|
Group: Documentation/Other
|
2011-06-29 13:07:51 +00:00
|
|
|
Requires: stunnel = %{version}
|
2016-10-25 08:47:46 +00:00
|
|
|
%if 0%{?suse_version} >= 1210
|
|
|
|
BuildArch: noarch
|
|
|
|
%endif
|
2006-06-23 10:15:07 +00:00
|
|
|
|
2011-06-29 13:07:51 +00:00
|
|
|
%description doc
|
2016-10-25 08:47:46 +00:00
|
|
|
This package contains additional documentation for the stunnel program.
|
2006-06-23 10:15:07 +00:00
|
|
|
|
|
|
|
%prep
|
2014-04-29 07:57:02 +00:00
|
|
|
%setup -q -n stunnel-%{version}
|
2014-01-29 16:56:32 +00:00
|
|
|
%patch0 -p0
|
2015-07-31 06:20:54 +00:00
|
|
|
chmod -x $RPM_BUILD_DIR/stunnel-%{version}/tools/ca.*
|
|
|
|
chmod -x $RPM_BUILD_DIR/stunnel-%{version}/tools/importCA.*
|
2006-06-23 10:15:07 +00:00
|
|
|
|
|
|
|
%build
|
2006-06-23 13:24:33 +00:00
|
|
|
sed -i 's/-m 1770 -g nogroup//g' tools/Makefile.in
|
2014-09-18 09:28:24 +00:00
|
|
|
%if 0%{?suse_version} == 1110
|
|
|
|
%configure --disable-static --disable-fips --bindir=%{_sbindir}
|
|
|
|
%else
|
|
|
|
%configure --disable-static --bindir=%{_sbindir}
|
2006-06-23 10:15:07 +00:00
|
|
|
%endif
|
2014-09-18 09:28:24 +00:00
|
|
|
make %{?_smp_mflags} LDADD="-pie -Wl,-z,defs,-z,relro"
|
2006-06-23 10:15:07 +00:00
|
|
|
|
|
|
|
%install
|
2014-09-18 09:28:24 +00:00
|
|
|
make install DESTDIR=$RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
cp -p %{S:1} tools/stunnel.conf-sample.%VENDOR
|
2006-06-23 10:15:07 +00:00
|
|
|
cp -p %{S:2} README.%VENDOR
|
2014-09-18 09:28:24 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
|
2006-06-23 10:15:07 +00:00
|
|
|
cp -p %{S:3} $RPM_BUILD_ROOT/var/adm/fillup-templates/
|
2014-01-29 16:56:32 +00:00
|
|
|
%if 0%{?has_systemd}
|
|
|
|
install -D -m 0644 $RPM_SOURCE_DIR/stunnel.service $RPM_BUILD_ROOT/%_unitdir/stunnel.service
|
2016-01-21 20:09:15 +00:00
|
|
|
ln -s service $RPM_BUILD_ROOT/usr/sbin/rcstunnel
|
2014-01-29 16:56:32 +00:00
|
|
|
%else
|
2014-09-18 09:28:24 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
|
2006-06-23 10:15:07 +00:00
|
|
|
install -m 744 $RPM_SOURCE_DIR/stunnel.rc $RPM_BUILD_ROOT/etc/init.d/stunnel
|
|
|
|
ln -s ../../etc/init.d/stunnel $RPM_BUILD_ROOT/usr/sbin/rcstunnel
|
2014-01-29 16:56:32 +00:00
|
|
|
%endif
|
2014-09-18 09:28:24 +00:00
|
|
|
mv $RPM_BUILD_ROOT/%{_sysconfdir}/stunnel/stunnel.conf-sample tools/stunnel.conf-sample
|
2014-01-29 16:56:32 +00:00
|
|
|
rm $RPM_BUILD_ROOT/%{_libdir}/stunnel/*.la
|
|
|
|
rm -rf $RPM_BUILD_ROOT/usr/share/doc/packages/stunnel/INSTALL
|
|
|
|
rm -rf $RPM_BUILD_ROOT/usr/share/doc/packages/stunnel/INSTALL.WCE
|
|
|
|
rm -rf $RPM_BUILD_ROOT/usr/share/doc/packages/stunnel/INSTALL.W32
|
2014-09-18 09:28:24 +00:00
|
|
|
rm -rf $RPM_BUILD_ROOT/usr/share/doc/packages/stunnel/tools/stunnel.cnf
|
2006-09-27 13:12:11 +00:00
|
|
|
rm -rf $RPM_BUILD_ROOT/usr/share/doc/stunnel
|
2014-09-18 09:28:24 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/lib/stunnel/{bin,etc,dev,%_lib,sbin,var/run}
|
2006-06-23 10:15:07 +00:00
|
|
|
|
|
|
|
%pre
|
2014-01-29 16:56:32 +00:00
|
|
|
if ! /usr/bin/getent passwd stunnel >/dev/null; then
|
|
|
|
%{_sbindir}/useradd -r -c "Daemon user for stunnel (universal SSL tunnel)" -g nogroup -s /bin/false \
|
2016-10-25 08:47:46 +00:00
|
|
|
-d /var/lib/stunnel stunnel || :
|
2014-01-29 16:56:32 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
%if 0%{?has_systemd}
|
|
|
|
%service_add_pre %{name}.service
|
2006-06-23 10:15:07 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%post
|
2014-01-29 16:56:32 +00:00
|
|
|
%if 0%{?has_systemd}
|
|
|
|
%service_add_post %{name}.service
|
|
|
|
%else
|
2006-06-23 10:15:07 +00:00
|
|
|
%{fillup_and_insserv -f}
|
2014-01-29 16:56:32 +00:00
|
|
|
%endif
|
2006-06-23 10:15:07 +00:00
|
|
|
%{fillup_only -ans syslog stunnel}
|
|
|
|
if ! test -s etc/stunnel/stunnel.conf; then
|
2014-01-29 16:56:32 +00:00
|
|
|
cp -p usr/share/doc/packages/stunnel/stunnel.conf-sample etc/stunnel/stunnel.conf
|
|
|
|
echo copying default config file to /etc/stunnel/stunnel.conf
|
2006-06-23 10:15:07 +00:00
|
|
|
fi
|
|
|
|
# first installation?
|
|
|
|
if [ ${FIRST_ARG:-0} = 1 ]; then
|
|
|
|
if ! test -f etc/stunnel/stunnel.pem; then
|
2014-01-29 16:56:32 +00:00
|
|
|
cat usr/share/doc/packages/stunnel/README.%VENDOR
|
2006-06-23 10:15:07 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-01-29 16:56:32 +00:00
|
|
|
|
|
|
|
|
2006-06-23 10:15:07 +00:00
|
|
|
%preun
|
2014-01-29 16:56:32 +00:00
|
|
|
%if 0%{?has_systemd}
|
|
|
|
%service_del_preun %{name}.service
|
|
|
|
%else
|
2006-06-23 10:15:07 +00:00
|
|
|
%stop_on_removal stunnel
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%postun
|
2014-01-29 16:56:32 +00:00
|
|
|
%if 0%{?has_systemd}
|
|
|
|
%service_del_postun %{name}.service
|
|
|
|
%else
|
2006-06-23 10:15:07 +00:00
|
|
|
%restart_on_update stunnel
|
|
|
|
%insserv_cleanup
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-, root, root)
|
2011-06-29 13:07:51 +00:00
|
|
|
%doc COPYING COPYRIGHT.GPL CREDITS
|
2011-06-29 13:54:37 +00:00
|
|
|
%doc README.%VENDOR
|
2006-06-23 10:15:07 +00:00
|
|
|
%doc tools/ca.*
|
|
|
|
%doc tools/importCA.*
|
|
|
|
%doc tools/stunnel.conf-sample
|
|
|
|
%{_sbindir}/*
|
2008-01-28 10:57:40 +00:00
|
|
|
%{_libdir}/stunnel
|
2006-06-23 10:15:07 +00:00
|
|
|
%{_mandir}/man8/*
|
|
|
|
%dir %attr(700,root,root) %{_sysconfdir}/stunnel
|
|
|
|
%dir %attr(755,root,root) /var/lib/stunnel
|
|
|
|
%dir %attr(755,root,root) /var/lib/stunnel/bin
|
|
|
|
%dir %attr(755,root,root) /var/lib/stunnel/etc
|
|
|
|
%dir %attr(755,root,root) /var/lib/stunnel/dev
|
|
|
|
%dir %attr(755,root,root) /var/lib/stunnel/%_lib
|
|
|
|
%dir %attr(755,root,root) /var/lib/stunnel/sbin
|
2008-02-05 14:43:02 +00:00
|
|
|
%dir %attr(755,root,root) /var/lib/stunnel/var
|
2009-02-18 20:38:11 +00:00
|
|
|
%dir %attr(755,stunnel,root) /var/lib/stunnel/var/run
|
2006-06-23 10:15:07 +00:00
|
|
|
/var/adm/fillup-templates/sysconfig.syslog-stunnel
|
2014-01-29 16:56:32 +00:00
|
|
|
%if 0%{?has_systemd}
|
|
|
|
%_unitdir/stunnel.service
|
|
|
|
%else
|
2006-06-23 10:15:07 +00:00
|
|
|
%config /etc/init.d/*
|
2014-01-29 16:56:32 +00:00
|
|
|
%endif
|
2006-06-23 10:15:07 +00:00
|
|
|
|
2011-06-29 13:07:51 +00:00
|
|
|
%files doc
|
|
|
|
%defattr(-,root,root)
|
2014-01-29 16:56:32 +00:00
|
|
|
%doc AUTHORS BUGS COPYING COPYRIGHT.GPL CREDITS ChangeLog NEWS PORTS
|
2011-06-29 13:07:51 +00:00
|
|
|
%doc README TODO
|
|
|
|
%doc doc/stunnel.html
|
|
|
|
%doc doc/stunnel.*.html
|
|
|
|
%doc doc/en/*
|
|
|
|
%doc doc/pl
|