File apache2-mod_gnutls.spec of Package apache2-mod_gnutls

#
# spec file for package apache2-mod_gnutls
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2010 invis-server.org Schotten 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 https://bugs.opensuse.org/
#


%if 0%{suse_version} >= 1599
%define test 1
%else
%define test 0
%endif
%define modname mod_gnutls
Name:           apache2-mod_gnutls
Version:        0.12.2
Release:        0
Summary:        Apache2 Module GnuTLS
License:        Apache-2.0
Group:          Productivity/Networking/Web/Utilities
URL:            https://github.com/airtower-luna/mod_gnutls
Source0:        https://github.com/airtower-luna/mod_gnutls/archive/refs/tags/mod_gnutls/%{version}.tar.gz#/%{modname}-%{version}.tar.bz2
Source2:        mod_gnutls.conf
Source3:        README.invis
Source4:        mod_gnutls.html
Source100:      test-server.crt
Source101:      test-server.key
BuildRequires:  apache-rpm-macros
BuildRequires:  apache2-devel
BuildRequires:  autoconf
BuildRequires:  automake
# for testing
BuildRequires:  curl
BuildRequires:  libgnutls-devel >= 3.3.0
BuildRequires:  libmemcache-devel
BuildRequires:  libtool
BuildRequires:  pkgconfig
Requires:       %{apache_mmn}
Requires:       %{apache_suse_maintenance_mmn}
Requires:       apache2
# SECTION test requirements
# and thus we do not need prefork MPM
#BuildRequires:  -apache2-prefork
# worker MPM is assumed by the testsuite
BuildRequires:  apache2-worker
BuildRequires:  gnutls
BuildRequires:  python3-pyaml
# /SECTION

%description
mod_gnutls uses the GnuTLS library to provide SSL 3.0, TLS 1.0
and TLS 1.1 encryption for Apache HTTPD.
It is similar to mod_ssl in purpose, but does not use OpenSSL.
It supports SNI, so it can be used to encrypt multiple name based
virtual hosts, each with its own certificate.

To load the module into Apache, run the command "a2enmod gnutls" as root.

To learn about the configuration, refer to
%{_docdir}/apache2-mod_gnutls/README.

%prep
%autosetup -p1 -n %{modname}-%{modname}-%{version}

%build
autoreconf -fiv
%configure --with-apxs=%{apache_apxs}

# RPM_OPT_FLAGS come from apxs
%make_build OPT="$(%{apache_apxs} -q CFLAGS)"

%install
install -Dpm 755 src/.libs/%{modname}.so %{buildroot}%{apache_libexecdir}/%{modname}.so
install -Dpm 644 %{SOURCE2} %{buildroot}%{apache_sysconfdir}/%{modname}.conf
cp -a %{SOURCE3} README.invis
cp -a %{SOURCE4} mod_gnutls.html

%check
%if %{test} == 1
# https://lists.gnupg.org/pipermail/mod_gnutls-devel/2020-February/000214.html
# https://lists.gnupg.org/pipermail/mod_gnutls-devel/2020-June/000217.html
sed -i 's:test-27_OCSP_server.bash::' test/Makefile
sed -i 's:test-36_OCSP_server_nonce.bash::' test/Makefile
# ConnectionResetError: [Errno 104] Connection reset by peer
sed -i 's:test-29_OCSP_server_no_async.bash::' test/Makefile
# /usr/sbin/httpd points to /usr/sbin/httpd-worker; cgi module for worker
# is named mod_cgid.so and the entry point is cgid_module
sed -i -e 's:LoadModule.*cgi.*:LoadModule cgid_module %{_libdir}/apache2-worker/mod_cgid.so:' test/cgi_module.conf
%make_build check
%endif

%files
%license LICENSE
%doc README* *.html
%config(noreplace) %{apache_sysconfdir}/%{modname}.conf
%attr(755, root, root) %{apache_libexecdir}/%{modname}.so

%changelog
openSUSE Build Service is sponsored by