forked from pool/stunnel
Accepting request 569418 from home:avindra
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
This commit is contained in:
118
stunnel.spec
118
stunnel.spec
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package stunnel
|
||||
#
|
||||
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# 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
|
||||
@@ -16,19 +16,25 @@
|
||||
#
|
||||
|
||||
|
||||
%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 /var/adm/fillup-templates
|
||||
%define _fillupdir %{_localstatedir}/adm/fillup-templates
|
||||
%endif
|
||||
|
||||
Name: stunnel
|
||||
Version: 5.42
|
||||
Version: 5.44
|
||||
Release: 0
|
||||
Summary: Universal SSL Tunnel
|
||||
License: GPL-2.0+
|
||||
Group: Productivity/Networking/Security
|
||||
Url: http://www.stunnel.org/
|
||||
PreReq: /usr/sbin/useradd fileutils textutils %fillup_prereq
|
||||
Source: https://www.stunnel.org/downloads/%{name}-%{version}.tar.gz
|
||||
Source1: https://www.stunnel.org/downloads/%{name}-%{version}.tar.gz.asc
|
||||
Source2: stunnel.keyring
|
||||
@@ -38,21 +44,15 @@ Source5: stunnel.service
|
||||
Source6: stunnel.conf
|
||||
Source7: stunnel.README
|
||||
Patch0: stunnel-listenqueue-option.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%define VENDOR openSUSE
|
||||
BuildRequires: libopenssl-devel
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: tcpd-devel
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: pkgconfig(libsystemd)
|
||||
|
||||
%if 0%{?suse_version} >= 1210
|
||||
BuildRequires: systemd
|
||||
%{?systemd_requires}
|
||||
%define has_systemd 1
|
||||
%else
|
||||
PreReq: %insserv_prereq
|
||||
%endif
|
||||
PreReq: %fillup_prereq
|
||||
PreReq: %{_sbindir}/useradd
|
||||
PreReq: fileutils
|
||||
PreReq: textutils
|
||||
|
||||
%description
|
||||
The stunnel program is designed to work as an SSL encryption wrapper
|
||||
@@ -76,47 +76,51 @@ This package contains additional documentation for the stunnel program.
|
||||
|
||||
%prep
|
||||
%setup -q -n stunnel-%{version}
|
||||
%patch0 -p0
|
||||
%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
|
||||
%configure --disable-static --disable-fips --bindir=%{_sbindir}
|
||||
%else
|
||||
%configure --disable-static --bindir=%{_sbindir}
|
||||
--disable-fips \
|
||||
%endif
|
||||
--disable-static \
|
||||
--bindir=%{_sbindir}
|
||||
make %{?_smp_mflags} LDADD="-pie -Wl,-z,defs,-z,relro"
|
||||
|
||||
%install
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
%check
|
||||
make %{?_smp_mflags} check
|
||||
|
||||
cp -p %{S:1} tools/stunnel.conf-sample.%VENDOR
|
||||
cp -p %{S:2} README.%VENDOR
|
||||
mkdir -p $RPM_BUILD_ROOT%{_fillupdir}
|
||||
cp -p %{S:3} $RPM_BUILD_ROOT%{_fillupdir}/
|
||||
%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 $RPM_BUILD_ROOT/%_unitdir/stunnel.service
|
||||
ln -s service $RPM_BUILD_ROOT/usr/sbin/rcstunnel
|
||||
install -D -m 0644 $RPM_SOURCE_DIR/stunnel.service %{buildroot}/%{_unitdir}/stunnel.service
|
||||
ln -s service %{buildroot}%{_sbindir}/rcstunnel
|
||||
%else
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
|
||||
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
|
||||
mkdir -p %{buildroot}%{_initddir}/
|
||||
install -m 744 $RPM_SOURCE_DIR/stunnel.rc %{buildroot}%{_initddir}/stunnel
|
||||
ln -s ../..%{_initddir}/stunnel %{buildroot}%{_sbindir}/rcstunnel
|
||||
%endif
|
||||
mv $RPM_BUILD_ROOT/%{_sysconfdir}/stunnel/stunnel.conf-sample tools/stunnel.conf-sample
|
||||
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
|
||||
rm -rf $RPM_BUILD_ROOT/usr/share/doc/packages/stunnel/tools/stunnel.cnf
|
||||
rm -rf $RPM_BUILD_ROOT/usr/share/doc/stunnel
|
||||
mkdir -p $RPM_BUILD_ROOT/var/lib/stunnel/{bin,etc,dev,%_lib,sbin,var/run}
|
||||
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 ! /usr/bin/getent passwd stunnel >/dev/null; then
|
||||
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 /var/lib/stunnel stunnel || :
|
||||
-d %{_localstatedir}/lib/stunnel stunnel || :
|
||||
fi
|
||||
|
||||
%if 0%{?has_systemd}
|
||||
@@ -130,14 +134,14 @@ fi
|
||||
%{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 /etc/stunnel/stunnel.conf
|
||||
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?
|
||||
# first installation?
|
||||
if [ ${FIRST_ARG:-0} = 1 ]; then
|
||||
if ! test -f etc/stunnel/stunnel.pem; then
|
||||
cat usr/share/doc/packages/stunnel/README.%VENDOR
|
||||
cat usr/share/doc/packages/stunnel/README.%{VENDOR}
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -157,9 +161,8 @@ fi
|
||||
%endif
|
||||
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
%doc COPYING COPYRIGHT.GPL CREDITS
|
||||
%doc README.%VENDOR
|
||||
%doc README.%{VENDOR}
|
||||
%doc tools/ca.*
|
||||
%doc tools/importCA.*
|
||||
%doc tools/stunnel.conf-sample
|
||||
@@ -167,23 +170,22 @@ fi
|
||||
%{_libdir}/stunnel
|
||||
%{_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
|
||||
%dir %attr(755,root,root) /var/lib/stunnel/var
|
||||
%dir %attr(755,stunnel,root) /var/lib/stunnel/var/run
|
||||
%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
|
||||
%{_unitdir}/stunnel.service
|
||||
%else
|
||||
%config /etc/init.d/*
|
||||
%config %{_initddir}/*
|
||||
%endif
|
||||
|
||||
%files doc
|
||||
%defattr(-,root,root)
|
||||
%doc AUTHORS BUGS COPYING COPYRIGHT.GPL CREDITS ChangeLog NEWS PORTS
|
||||
%doc README TODO
|
||||
%doc doc/stunnel.html
|
||||
|
Reference in New Issue
Block a user