2017-03-20 16:55:23 +00:00
|
|
|
# Do not generate provides for private libraries
|
|
|
|
%global __provides_exclude_from ^%{_libdir}/stunnel/.*$
|
|
|
|
|
2022-07-23 20:36:16 +00:00
|
|
|
%if 0%{?fedora} || 0%{?rhel} > 7
|
2018-01-15 15:03:15 +00:00
|
|
|
%bcond_with libwrap
|
|
|
|
%else
|
|
|
|
%bcond_without libwrap
|
|
|
|
%endif
|
|
|
|
|
2024-07-01 17:22:09 +00:00
|
|
|
%if 0%{?rhel} >= 10
|
|
|
|
%bcond_without openssl_engine
|
|
|
|
%else
|
|
|
|
%bcond_without openssl_engine
|
|
|
|
%endif
|
|
|
|
|
2017-03-20 16:55:23 +00:00
|
|
|
Summary: A TLS-encrypting socket wrapper
|
2004-09-09 12:45:04 +00:00
|
|
|
Name: stunnel
|
2024-02-05 13:41:05 +00:00
|
|
|
Version: 5.72
|
2023-08-30 15:21:42 +00:00
|
|
|
Release: %autorelease
|
|
|
|
License: GPL-2.0-or-later WITH stunnel-exception AND MIT
|
2022-01-12 11:09:33 +00:00
|
|
|
URL: https://www.stunnel.org/
|
2014-12-11 20:49:58 +00:00
|
|
|
Source0: https://www.stunnel.org/downloads/stunnel-%{version}.tar.gz
|
|
|
|
Source1: https://www.stunnel.org/downloads/stunnel-%{version}.tar.gz.asc
|
2006-10-25 00:47:56 +00:00
|
|
|
Source2: Certificate-Creation
|
|
|
|
Source3: sfinger.xinetd
|
|
|
|
Source4: stunnel-sfinger.conf
|
|
|
|
Source5: pop3-redirect.xinetd
|
|
|
|
Source6: stunnel-pop3s-client.conf
|
2016-02-03 16:32:45 +00:00
|
|
|
Source7: stunnel@.service
|
2022-07-23 19:12:17 +00:00
|
|
|
# Upstream release signing key
|
2023-10-05 09:05:56 +00:00
|
|
|
# Upstream source is https://www.stunnel.org/pgp.asc; using a local URL because
|
|
|
|
# the remote one makes packit source-git choke.
|
|
|
|
Source99: pgp.asc
|
2022-09-12 10:11:10 +00:00
|
|
|
# Apply patch stunnel-5.50-authpriv.patch
|
|
|
|
Patch0: stunnel-5.50-authpriv.patch
|
|
|
|
# Apply patch stunnel-5.61-systemd-service.patch
|
|
|
|
Patch1: stunnel-5.61-systemd-service.patch
|
2023-03-06 10:45:56 +00:00
|
|
|
# Use cipher configuration from crypto-policies
|
|
|
|
#
|
|
|
|
# On Fedora, CentOS and RHEL, the system's crypto policies are the best
|
|
|
|
# source to determine which cipher suites to accept in TLS. On these
|
|
|
|
# platforms, OpenSSL supports the PROFILE=SYSTEM setting to use those
|
|
|
|
# policies. Change stunnel to default to this setting.
|
|
|
|
Patch3: stunnel-5.69-system-ciphers.patch
|
2024-02-05 13:41:05 +00:00
|
|
|
# Use TLS version f/crypto-policies unless specified
|
|
|
|
#
|
|
|
|
# Do not explicitly set the TLS version and rely on the defaults from
|
|
|
|
# crypto-policies unless a TLS minimum or maximum version are explicitly
|
|
|
|
# specified in the stunnel configuration.
|
|
|
|
Patch5: stunnel-5.72-default-tls-version.patch
|
2022-09-12 10:11:10 +00:00
|
|
|
# Apply patch stunnel-5.56-curves-doc-update.patch
|
|
|
|
Patch6: stunnel-5.56-curves-doc-update.patch
|
2005-04-26 20:42:22 +00:00
|
|
|
# util-linux is needed for rename
|
2021-01-08 22:02:37 +00:00
|
|
|
BuildRequires: make
|
2018-03-02 14:54:00 +00:00
|
|
|
BuildRequires: gcc
|
2022-07-23 19:12:17 +00:00
|
|
|
BuildRequires: gnupg2
|
2018-01-11 17:29:57 +00:00
|
|
|
BuildRequires: openssl-devel, pkgconfig, util-linux
|
2017-03-20 16:55:23 +00:00
|
|
|
BuildRequires: autoconf automake libtool
|
2018-01-15 15:03:15 +00:00
|
|
|
%if %{with libwrap}
|
|
|
|
Buildrequires: tcp_wrappers-devel
|
|
|
|
%endif
|
2016-07-13 16:38:17 +00:00
|
|
|
BuildRequires: /usr/bin/pod2man
|
|
|
|
BuildRequires: /usr/bin/pod2html
|
2018-07-24 14:13:42 +00:00
|
|
|
# build test requirements
|
|
|
|
BuildRequires: /usr/bin/nc, /usr/bin/lsof, /usr/bin/ps
|
2023-10-05 09:05:56 +00:00
|
|
|
BuildRequires: python3 python3-cryptography openssl
|
2023-05-12 18:24:07 +00:00
|
|
|
BuildRequires: systemd systemd-devel
|
2018-01-25 14:44:32 +00:00
|
|
|
%{?systemd_requires}
|
2004-09-09 12:45:04 +00:00
|
|
|
|
|
|
|
%description
|
2017-03-20 16:55:23 +00:00
|
|
|
Stunnel is a socket wrapper which can provide TLS/SSL
|
|
|
|
(Transport Layer Security/Secure Sockets Layer) support
|
|
|
|
to ordinary applications. For example, it can be used in
|
|
|
|
conjunction with imapd to create a TLS secure IMAP server.
|
2004-09-09 12:45:04 +00:00
|
|
|
|
|
|
|
%prep
|
2022-07-23 19:12:17 +00:00
|
|
|
%{gpgverify} --keyring='%{SOURCE99}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
|
2022-09-12 09:05:43 +00:00
|
|
|
%autosetup -S gendiff -p1
|
2017-08-22 12:47:22 +00:00
|
|
|
|
2022-01-12 11:09:33 +00:00
|
|
|
# Fix the stack protector flag
|
|
|
|
sed -i 's/-fstack-protector/-fstack-protector-strong/' configure
|
2018-07-24 14:13:42 +00:00
|
|
|
|
2004-09-09 12:45:04 +00:00
|
|
|
%build
|
2017-08-22 12:47:22 +00:00
|
|
|
#autoreconf -v
|
2005-03-16 20:54:45 +00:00
|
|
|
CFLAGS="$RPM_OPT_FLAGS -fPIC"; export CFLAGS
|
2007-10-16 12:08:51 +00:00
|
|
|
if pkg-config openssl ; then
|
|
|
|
CFLAGS="$CFLAGS `pkg-config --cflags openssl`";
|
|
|
|
LDFLAGS="`pkg-config --libs-only-L openssl`"; export LDFLAGS
|
|
|
|
fi
|
2024-07-01 17:22:09 +00:00
|
|
|
|
|
|
|
CPPFLAGS_NO_ENGINE=""
|
|
|
|
%if !%{with openssl_engine}
|
|
|
|
CPPFLAGS_NO_ENGINE="-DOPENSSL_NO_ENGINE"
|
|
|
|
%endif
|
2018-01-15 15:03:15 +00:00
|
|
|
%configure --enable-fips --enable-ipv6 --with-ssl=%{_prefix} \
|
|
|
|
%if %{with libwrap}
|
|
|
|
--enable-libwrap \
|
|
|
|
%else
|
|
|
|
--disable-libwrap \
|
|
|
|
%endif
|
2022-09-12 10:11:10 +00:00
|
|
|
--with-bashcompdir=%{_datadir}/bash-completion/completions \
|
2024-07-01 17:22:09 +00:00
|
|
|
CPPFLAGS="-UPIDFILE -DPIDFILE='\"%{_localstatedir}/run/stunnel.pid\"' $CPPFLAGS_NO_ENGINE"
|
2016-07-13 15:02:24 +00:00
|
|
|
make V=1 LDADD="-pie -Wl,-z,defs,-z,relro,-z,now"
|
2004-09-09 12:45:04 +00:00
|
|
|
|
|
|
|
%install
|
2017-03-20 16:55:23 +00:00
|
|
|
make install DESTDIR=%{buildroot}
|
2004-09-09 12:51:11 +00:00
|
|
|
# Move the translated man pages to the right subdirectories, and strip off the
|
|
|
|
# language suffixes.
|
2015-01-08 23:26:35 +00:00
|
|
|
#for lang in fr pl ; do
|
|
|
|
for lang in pl ; do
|
2017-03-20 16:55:23 +00:00
|
|
|
mkdir -p %{buildroot}/%{_mandir}/${lang}/man8
|
|
|
|
mv %{buildroot}/%{_mandir}/man8/*.${lang}.8* %{buildroot}/%{_mandir}/${lang}/man8/
|
|
|
|
rename ".${lang}" "" %{buildroot}/%{_mandir}/${lang}/man8/*
|
2004-09-09 12:51:11 +00:00
|
|
|
done
|
2006-10-25 00:47:56 +00:00
|
|
|
mkdir srpm-docs
|
2007-10-16 12:08:51 +00:00
|
|
|
cp %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} srpm-docs
|
2017-03-20 16:55:23 +00:00
|
|
|
mkdir -p %{buildroot}%{_unitdir}
|
|
|
|
cp %{buildroot}%{_datadir}/doc/stunnel/examples/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
|
|
|
|
cp %{SOURCE7} %{buildroot}%{_unitdir}/%{name}@.service
|
2006-10-25 00:47:56 +00:00
|
|
|
|
2018-03-02 14:54:00 +00:00
|
|
|
%check
|
2022-02-07 10:03:39 +00:00
|
|
|
if ! make test; then
|
|
|
|
for i in tests/logs/*.log; do
|
|
|
|
echo "$i":
|
|
|
|
cat "$i"
|
|
|
|
done
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-03-02 14:54:00 +00:00
|
|
|
|
2004-09-09 12:45:04 +00:00
|
|
|
%files
|
2017-03-20 16:55:23 +00:00
|
|
|
%{!?_licensedir:%global license %%doc}
|
2020-01-07 22:08:25 +00:00
|
|
|
%doc AUTHORS.md BUGS.md CREDITS.md PORTS.md README.md TODO.md
|
2004-09-09 12:51:17 +00:00
|
|
|
%doc tools/stunnel.conf-sample
|
2006-10-25 00:47:56 +00:00
|
|
|
%doc srpm-docs/*
|
2017-03-20 16:55:23 +00:00
|
|
|
%license COPY*
|
2004-09-09 12:48:46 +00:00
|
|
|
%lang(en) %doc doc/en/*
|
2017-03-20 16:55:23 +00:00
|
|
|
%lang(pl) %doc doc/pl/*
|
2008-03-28 13:45:52 +00:00
|
|
|
%{_bindir}/stunnel
|
2008-05-19 22:25:07 +00:00
|
|
|
%exclude %{_bindir}/stunnel3
|
2005-06-01 11:49:11 +00:00
|
|
|
%exclude %{_datadir}/doc/stunnel
|
2008-03-28 13:45:52 +00:00
|
|
|
%{_libdir}/stunnel
|
|
|
|
%exclude %{_libdir}/stunnel/libstunnel.la
|
2004-09-09 12:45:04 +00:00
|
|
|
%{_mandir}/man8/stunnel.8*
|
2007-10-16 12:08:51 +00:00
|
|
|
%lang(pl) %{_mandir}/pl/man8/stunnel.8*
|
2004-09-09 12:51:17 +00:00
|
|
|
%dir %{_sysconfdir}/%{name}
|
2005-06-01 11:49:11 +00:00
|
|
|
%exclude %{_sysconfdir}/stunnel/*
|
2016-02-03 16:32:45 +00:00
|
|
|
%{_unitdir}/%{name}*.service
|
2022-01-18 11:01:03 +00:00
|
|
|
%{_datadir}/bash-completion/completions/%{name}.bash
|
2014-04-29 03:16:53 +00:00
|
|
|
|
|
|
|
%post
|
|
|
|
/sbin/ldconfig
|
|
|
|
%systemd_post %{name}.service
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%systemd_preun %{name}.service
|
|
|
|
|
|
|
|
%postun
|
|
|
|
/sbin/ldconfig
|
|
|
|
%systemd_postun_with_restart %{name}.service
|
2004-09-09 12:45:04 +00:00
|
|
|
|
|
|
|
%changelog
|
2023-08-30 15:21:42 +00:00
|
|
|
%autochangelog
|