This time with the SLE11 line back in action OBS-URL: https://build.opensuse.org/request/show/569418 OBS-URL: https://build.opensuse.org/package/show/security:Stunnel/stunnel?expand=0&rev=97
197 lines
6.1 KiB
RPMSpec
197 lines
6.1 KiB
RPMSpec
#
|
|
# spec file for package stunnel
|
|
#
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
|
#
|
|
# 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.
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%define VENDOR openSUSE
|
|
%if 0%{?suse_version} >= 1210
|
|
%define has_systemd 1
|
|
BuildRequires: systemd
|
|
%{?systemd_requires}
|
|
%else
|
|
PreReq: %insserv_prereq
|
|
%endif
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
%if ! %{defined _fillupdir}
|
|
%define _fillupdir %{_localstatedir}/adm/fillup-templates
|
|
%endif
|
|
Name: stunnel
|
|
Version: 5.44
|
|
Release: 0
|
|
Summary: Universal SSL Tunnel
|
|
License: GPL-2.0+
|
|
Group: Productivity/Networking/Security
|
|
Url: http://www.stunnel.org/
|
|
Source: https://www.stunnel.org/downloads/%{name}-%{version}.tar.gz
|
|
Source1: https://www.stunnel.org/downloads/%{name}-%{version}.tar.gz.asc
|
|
Source2: stunnel.keyring
|
|
Source3: sysconfig.syslog-stunnel
|
|
Source4: stunnel.rc
|
|
Source5: stunnel.service
|
|
Source6: stunnel.conf
|
|
Source7: stunnel.README
|
|
Patch0: stunnel-listenqueue-option.patch
|
|
BuildRequires: libopenssl-devel
|
|
BuildRequires: pkgconfig
|
|
BuildRequires: tcpd-devel
|
|
BuildRequires: zlib-devel
|
|
BuildRequires: pkgconfig(libsystemd)
|
|
PreReq: %fillup_prereq
|
|
PreReq: %{_sbindir}/useradd
|
|
PreReq: fileutils
|
|
PreReq: textutils
|
|
|
|
%description
|
|
The stunnel program is designed to work as an SSL encryption wrapper
|
|
between remote clients and local (inetd-startable) or remote
|
|
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
|
|
secure SSL channels. Stunnel can be used to add SSL functionality to
|
|
commonly used inetd daemons, such as POP-2, POP-3, and IMAP servers
|
|
without any changes to the program code.
|
|
|
|
%package doc
|
|
Summary: Documentation for the universal SSL Tunnel
|
|
Group: Documentation/Other
|
|
Requires: stunnel = %{version}
|
|
%if 0%{?suse_version} >= 1210
|
|
BuildArch: noarch
|
|
%endif
|
|
|
|
%description doc
|
|
This package contains additional documentation for the stunnel program.
|
|
|
|
%prep
|
|
%setup -q -n stunnel-%{version}
|
|
%patch0 -p1
|
|
chmod -x $RPM_BUILD_DIR/stunnel-%{version}/tools/ca.*
|
|
chmod -x $RPM_BUILD_DIR/stunnel-%{version}/tools/importCA.*
|
|
|
|
%build
|
|
sed -i 's/-m 1770 -g nogroup//g' tools/Makefile.in
|
|
%configure \
|
|
%if 0%{?suse_version} == 1110
|
|
--disable-fips \
|
|
%endif
|
|
--disable-static \
|
|
--bindir=%{_sbindir}
|
|
make %{?_smp_mflags} LDADD="-pie -Wl,-z,defs,-z,relro"
|
|
|
|
%check
|
|
make %{?_smp_mflags} check
|
|
|
|
%install
|
|
%make_install
|
|
|
|
cp -p %{SOURCE1} tools/stunnel.conf-sample.%{VENDOR}
|
|
cp -p %{SOURCE2} README.%{VENDOR}
|
|
mkdir -p %{buildroot}%{_fillupdir}
|
|
cp -p %{SOURCE3} %{buildroot}%{_fillupdir}/
|
|
%if 0%{?has_systemd}
|
|
install -D -m 0644 $RPM_SOURCE_DIR/stunnel.service %{buildroot}/%{_unitdir}/stunnel.service
|
|
ln -s service %{buildroot}%{_sbindir}/rcstunnel
|
|
%else
|
|
mkdir -p %{buildroot}%{_initddir}/
|
|
install -m 744 $RPM_SOURCE_DIR/stunnel.rc %{buildroot}%{_initddir}/stunnel
|
|
ln -s ../..%{_initddir}/stunnel %{buildroot}%{_sbindir}/rcstunnel
|
|
%endif
|
|
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}
|
|
|
|
%pre
|
|
if ! %{_bindir}/getent passwd stunnel >/dev/null; then
|
|
%{_sbindir}/useradd -r -c "Daemon user for stunnel (universal SSL tunnel)" -g nogroup -s /bin/false \
|
|
-d %{_localstatedir}/lib/stunnel stunnel || :
|
|
fi
|
|
|
|
%if 0%{?has_systemd}
|
|
%service_add_pre %{name}.service
|
|
%endif
|
|
|
|
%post
|
|
%if 0%{?has_systemd}
|
|
%service_add_post %{name}.service
|
|
%else
|
|
%{fillup_and_insserv -f}
|
|
%endif
|
|
%{fillup_only -ans syslog stunnel}
|
|
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
|
|
fi
|
|
# first installation?
|
|
if [ ${FIRST_ARG:-0} = 1 ]; then
|
|
if ! test -f etc/stunnel/stunnel.pem; then
|
|
cat usr/share/doc/packages/stunnel/README.%{VENDOR}
|
|
fi
|
|
fi
|
|
|
|
%preun
|
|
%if 0%{?has_systemd}
|
|
%service_del_preun %{name}.service
|
|
%else
|
|
%stop_on_removal stunnel
|
|
%endif
|
|
|
|
%postun
|
|
%if 0%{?has_systemd}
|
|
%service_del_postun %{name}.service
|
|
%else
|
|
%restart_on_update stunnel
|
|
%insserv_cleanup
|
|
%endif
|
|
|
|
%files
|
|
%doc COPYING COPYRIGHT.GPL CREDITS
|
|
%doc README.%{VENDOR}
|
|
%doc tools/ca.*
|
|
%doc tools/importCA.*
|
|
%doc tools/stunnel.conf-sample
|
|
%{_sbindir}/*
|
|
%{_libdir}/stunnel
|
|
%{_mandir}/man8/*
|
|
%dir %attr(700,root,root) %{_sysconfdir}/stunnel
|
|
%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
|
|
%{_fillupdir}/sysconfig.syslog-stunnel
|
|
%if 0%{?has_systemd}
|
|
%{_unitdir}/stunnel.service
|
|
%else
|
|
%config %{_initddir}/*
|
|
%endif
|
|
|
|
%files doc
|
|
%doc AUTHORS BUGS COPYING COPYRIGHT.GPL CREDITS ChangeLog NEWS PORTS
|
|
%doc README TODO
|
|
%doc doc/stunnel.html
|
|
%doc doc/stunnel.*.html
|
|
%doc doc/en/*
|
|
%doc doc/pl
|
|
|
|
%changelog
|