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
|
|
|
#
|
2018-02-01 09:12:11 +00:00
|
|
|
# Copyright (c) 2018 SUSE LINUX 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/
|
|
|
|
#
|
|
|
|
|
2017-02-10 22:14:21 +00:00
|
|
|
|
2018-02-07 09:38:42 +00:00
|
|
|
%define VENDORAFFIX openSUSE
|
|
|
|
|
2018-02-01 09:12:11 +00:00
|
|
|
%if 0%{?suse_version} >= 1210
|
2018-02-07 09:38:42 +00:00
|
|
|
|
2018-02-01 09:12:11 +00:00
|
|
|
%define has_systemd 1
|
|
|
|
BuildRequires: systemd
|
|
|
|
%{?systemd_requires}
|
2018-02-07 09:38:42 +00:00
|
|
|
|
2018-02-01 09:12:11 +00:00
|
|
|
%else
|
2018-02-07 09:38:42 +00:00
|
|
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
Requires(pre): %insserv_prereq
|
|
|
|
Requires(pre): /usr/sbin/useradd
|
|
|
|
# %{_sbindir} does not work here!
|
|
|
|
|
2018-02-01 09:12:11 +00:00
|
|
|
%endif
|
2018-02-07 09:38:42 +00:00
|
|
|
|
2017-12-02 21:58:07 +00:00
|
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
|
|
%if ! %{defined _fillupdir}
|
2018-02-01 09:12:11 +00:00
|
|
|
%define _fillupdir %{_localstatedir}/adm/fillup-templates
|
2017-12-02 21:58:07 +00:00
|
|
|
%endif
|
2006-06-23 10:15:07 +00:00
|
|
|
Name: stunnel
|
2018-02-01 09:12:11 +00:00
|
|
|
Version: 5.44
|
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/
|
2017-08-01 06:15:55 +00:00
|
|
|
Source: https://www.stunnel.org/downloads/%{name}-%{version}.tar.gz
|
|
|
|
Source1: https://www.stunnel.org/downloads/%{name}-%{version}.tar.gz.asc
|
|
|
|
Source2: stunnel.keyring
|
2006-06-23 10:15:07 +00:00
|
|
|
Source3: sysconfig.syslog-stunnel
|
|
|
|
Source4: stunnel.rc
|
2014-01-29 16:56:32 +00:00
|
|
|
Source5: stunnel.service
|
2017-08-01 06:15:55 +00:00
|
|
|
Source6: stunnel.conf
|
|
|
|
Source7: stunnel.README
|
2011-06-16 12:04:07 +00:00
|
|
|
Patch0: stunnel-listenqueue-option.patch
|
2014-09-18 09:28:24 +00:00
|
|
|
BuildRequires: libopenssl-devel
|
2017-02-10 22:14:21 +00:00
|
|
|
BuildRequires: tcpd-devel
|
|
|
|
BuildRequires: zlib-devel
|
2018-02-07 09:38:42 +00:00
|
|
|
Requires(pre): %fillup_prereq
|
|
|
|
Requires(pre): %{_sbindir}/useradd
|
|
|
|
Requires(pre): fileutils
|
|
|
|
Requires(pre): textutils
|
2018-02-06 09:19:14 +00:00
|
|
|
%if 0%{?suse_version} >= 1500
|
|
|
|
Requires(pre): group(nogroup)
|
|
|
|
%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}
|
2018-02-01 09:12:11 +00:00
|
|
|
%patch0 -p1
|
2018-02-06 09:19:14 +00:00
|
|
|
chmod -x %{_builddir}/stunnel-%{version}/tools/ca.*
|
|
|
|
chmod -x %{_builddir}/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
|
2018-02-01 09:12:11 +00:00
|
|
|
%configure \
|
2014-09-18 09:28:24 +00:00
|
|
|
%if 0%{?suse_version} == 1110
|
2018-02-01 09:12:11 +00:00
|
|
|
--disable-fips \
|
2006-06-23 10:15:07 +00:00
|
|
|
%endif
|
2018-02-01 09:12:11 +00:00
|
|
|
--disable-static \
|
|
|
|
--bindir=%{_sbindir}
|
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
|
|
|
|
2018-02-01 09:12:11 +00:00
|
|
|
%check
|
|
|
|
make %{?_smp_mflags} check
|
|
|
|
|
2006-06-23 10:15:07 +00:00
|
|
|
%install
|
2018-02-07 09:38:42 +00:00
|
|
|
%if 0%{?suse_version} >= 1210
|
|
|
|
%make_install
|
|
|
|
%else
|
|
|
|
make install DESTDIR=$RPM_BUILD_ROOT
|
|
|
|
%endif
|
2014-09-18 09:28:24 +00:00
|
|
|
|
2018-02-07 09:38:42 +00:00
|
|
|
cp -p %{SOURCE1} tools/stunnel.conf-sample.%{VENDORAFFIX}
|
|
|
|
cp -p %{SOURCE2} README.%{VENDORAFFIX}
|
2018-02-01 09:12:11 +00:00
|
|
|
mkdir -p %{buildroot}%{_fillupdir}
|
|
|
|
cp -p %{SOURCE3} %{buildroot}%{_fillupdir}/
|
2014-01-29 16:56:32 +00:00
|
|
|
%if 0%{?has_systemd}
|
2018-02-06 09:19:14 +00:00
|
|
|
install -D -m 0644 %{_sourcedir}/stunnel.service %{buildroot}/%{_unitdir}/stunnel.service
|
2018-02-01 09:12:11 +00:00
|
|
|
ln -s service %{buildroot}%{_sbindir}/rcstunnel
|
2014-01-29 16:56:32 +00:00
|
|
|
%else
|
2018-02-01 09:12:11 +00:00
|
|
|
mkdir -p %{buildroot}%{_initddir}/
|
2018-02-06 09:19:14 +00:00
|
|
|
install -m 744 %{_sourcedir}/stunnel.rc %{buildroot}/%{_initddir}/stunnel
|
2018-02-01 09:12:11 +00:00
|
|
|
ln -s ../..%{_initddir}/stunnel %{buildroot}%{_sbindir}/rcstunnel
|
2014-01-29 16:56:32 +00:00
|
|
|
%endif
|
2018-02-01 09:12:11 +00:00
|
|
|
mv %{buildroot}/%{_sysconfdir}/stunnel/stunnel.conf-sample tools/stunnel.conf-sample
|
|
|
|
find %{buildroot} -type f -name "*.la" -delete -print
|
|
|
|
rm -rf %{buildroot}%{_docdir}/stunnel/INSTALL
|
|
|
|
rm -rf %{buildroot}%{_docdir}/stunnel/INSTALL.WCE
|
|
|
|
rm -rf %{buildroot}%{_docdir}/stunnel/INSTALL.W32
|
|
|
|
rm -rf %{buildroot}%{_docdir}/stunnel/tools/stunnel.cnf
|
|
|
|
rm -rf %{buildroot}%{_datadir}/doc/stunnel
|
|
|
|
mkdir -p %{buildroot}%{_localstatedir}/lib/stunnel/{bin,etc,dev,%{_lib},sbin,var/run}
|
2006-06-23 10:15:07 +00:00
|
|
|
|
|
|
|
%pre
|
2018-02-01 09:12:11 +00:00
|
|
|
if ! %{_bindir}/getent passwd stunnel >/dev/null; then
|
2014-01-29 16:56:32 +00:00
|
|
|
%{_sbindir}/useradd -r -c "Daemon user for stunnel (universal SSL tunnel)" -g nogroup -s /bin/false \
|
2018-02-06 09:19:14 +00:00
|
|
|
-d %{_localstatedir}/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}
|
2018-02-01 09:12:11 +00:00
|
|
|
if ! test -s etc/stunnel/stunnel.conf; then
|
|
|
|
cp -p usr/share/doc/packages/stunnel/stunnel.conf-sample etc/stunnel/stunnel.conf
|
|
|
|
echo copying default config file to %{_sysconfdir}/stunnel/stunnel.conf
|
2006-06-23 10:15:07 +00:00
|
|
|
fi
|
2018-02-01 09:12:11 +00:00
|
|
|
# first installation?
|
2018-02-06 09:19:14 +00:00
|
|
|
if [ ${FIRST_ARG:-0} = 1 ] && [ ! -f etc/stunnel/stunnel.pem ]; then
|
2018-02-07 09:38:42 +00:00
|
|
|
cat usr/share/doc/packages/stunnel/README.%{VENDORAFFIX}
|
2006-06-23 10:15:07 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
%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
|
2018-02-07 09:38:42 +00:00
|
|
|
%defattr(-,root,root)
|
2011-06-29 13:07:51 +00:00
|
|
|
%doc COPYING COPYRIGHT.GPL CREDITS
|
2018-02-07 09:38:42 +00:00
|
|
|
%doc README.%{VENDORAFFIX}
|
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
|
2018-02-01 09:12:11 +00:00
|
|
|
%dir %attr(755,root,root) %{_localstatedir}/lib/stunnel
|
|
|
|
%dir %attr(755,root,root) %{_localstatedir}/lib/stunnel/bin
|
|
|
|
%dir %attr(755,root,root) %{_localstatedir}/lib/stunnel%{_sysconfdir}
|
|
|
|
%dir %attr(755,root,root) %{_localstatedir}/lib/stunnel/dev
|
|
|
|
%dir %attr(755,root,root) %{_localstatedir}/lib/stunnel/%{_lib}
|
|
|
|
%dir %attr(755,root,root) %{_localstatedir}/lib/stunnel/sbin
|
|
|
|
%dir %attr(755,root,root) %{_localstatedir}/lib/stunnel%{_localstatedir}
|
|
|
|
%dir %attr(755,stunnel,root) %{_localstatedir}/lib/stunnel%{_localstatedir}/run
|
2017-12-02 21:58:07 +00:00
|
|
|
%{_fillupdir}/sysconfig.syslog-stunnel
|
2014-01-29 16:56:32 +00:00
|
|
|
%if 0%{?has_systemd}
|
2018-02-01 09:12:11 +00:00
|
|
|
%{_unitdir}/stunnel.service
|
2014-01-29 16:56:32 +00:00
|
|
|
%else
|
2018-02-01 09:12:11 +00:00
|
|
|
%config %{_initddir}/*
|
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
|
2018-02-07 09:38:42 +00:00
|
|
|
%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
|
2017-02-10 22:14:21 +00:00
|
|
|
|
|
|
|
%changelog
|