File apache2-mod_auth_mellon.spec of Package apache2-mod_auth_mellon

# 
# spec file for package apache2-mod_auth_mellon
#
# Copyright (c) 2013-2020 Red Hat, Inc.
# Copyright (c) 2020 Stasiek Michalski <stasiek@michalski.cc>.
#
# 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/
#


# Compatibility macros for SLE 12
%{!?make_build: %global make_build %{__make} %{?_smp_mflags}}


%define upstream_name mod_auth_mellon
%define version_path $(sed 's|\\.|_|g' <<< %{version})

Name:           apache2-%{upstream_name}
Version:        0.17.0
Release:        0
Summary:        A SAML 2.0 authentication module for the Apache Server
License:        GPL-2.0-or-later
Group:          Productivity/Networking/Web/Servers
URL:            https://github.com/latchset/%{upstream_name}
Source0:        https://github.com/latchset/%{upstream_name}/releases/download/v%{version_path}/%{upstream_name}-%{version}.tar.gz
Source1:        %{upstream_name}.conf
Source2:        %{name}.conf
Source3:        README.diagnostics
BuildRequires:  apache-rpm-macros
BuildRequires:  apache2-devel
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  curl-devel
BuildRequires:  openssl-devel
BuildRequires:  pkgconfig
BuildRequires:  xmlsec1-devel
BuildRequires:  pkgconfig(lasso) >= 2.5.1
BuildRequires:  rubygem(asciidoctor)

%description
The mod_auth_mellon module is an authentication service that implements the
SAML 2.0 federation protocol. It grants access based on the attributes
received in assertions generated by a IdP server.

%package doc
Summary:        Documentation for mod_auth_mellon module
Requires:       %{name} = %{version}

%description doc
This package contains a documentation for mod_auth_mellon module.

%prep
%autosetup -n %{upstream_name}-%{version}

%build
./autogen.sh
%configure --enable-diagnostics
%make_build clean
%make_build
cp .libs/%{upstream_name}.so %{upstream_name}-diagnostics.so

%configure
%make_build clean
%make_build
pushd doc/user_guide
asciidoctor -a data-uri mellon_user_guide.adoc
popd

%install
# install module
mkdir -p %{buildroot}/%{apache_libexecdir}
install -m 755 .libs/%{upstream_name}.so %{buildroot}%{apache_libexecdir}
install -m 755 %{upstream_name}-diagnostics.so %{buildroot}%{apache_libexecdir}

# install module configuration
mkdir -p %{buildroot}%{_sysconfdir}/apache2/conf.d
install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/apache2/conf.d

install -d -m 0755 %{buildroot}%{_tmpfilesdir}
install -m 0644 %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf

# install script to generate metadata
mkdir -p %{buildroot}/%{_libexecdir}/%{name}
cp mellon_create_metadata.sh %{buildroot}/%{_libexecdir}/%{name}

# install user guide
mkdir -p %{buildroot}/%{_docdir}
cp -r doc/user_guide %{buildroot}/%{_docdir}

# install diagnostics README
install -m 0644  %{SOURCE3} %{buildroot}/%{_docdir}

%package diagnostics
Summary:        Build of mod_auth_mellon with diagnostic logging
Requires:       %{name} = %{version}-%{release}

%description diagnostics
Build of mod_auth_mellon with diagnostic logging. See README.diagnostics
in the doc directory for instructions on using the diagnostics build.

%post
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf

%files diagnostics
%defattr(-,root,root)
%{apache_libexecdir}/%{upstream_name}-diagnostics.so

%files
%defattr(-,root,root)
%license COPYING
%doc README.md NEWS ECP.rst
%config(noreplace) %{_sysconfdir}/apache2/conf.d/mod_auth_mellon.conf
%{apache_libexecdir}/mod_auth_mellon.so
%{_tmpfilesdir}/%{name}.conf
%{_libexecdir}/%{name}

%files doc
%defattr(-,root,root)
%doc %{_docdir}/README.diagnostics
%doc %{_docdir}/user_guide

%changelog
openSUSE Build Service is sponsored by