File opensaml.spec of Package opensaml

#
# spec file for package opensaml
#
# Copyright (c) 2019 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 libvers 10
%define pkgdocdir %{_docdir}/%{name}
Name:           opensaml
Version:        3.0.1
Release:        0
Summary:        Security Assertion Markup Language library
License:        Apache-2.0
Group:          Development/Libraries/C and C++
URL:            http://www.opensaml.org/
Source0:        https://shibboleth.net/downloads/c++-opensaml/%{version}/%{name}-%{version}.tar.bz2
Source1:        https://shibboleth.net/downloads/c++-opensaml/%{version}/%{name}-%{version}.tar.bz2.asc
Source2:        %{name}.keyring
Patch0:         opensaml-2.5.5-doxygen_timestamp.patch
BuildRequires:  doxygen
BuildRequires:  gcc-c++
BuildRequires:  liblog4shib-devel >= 1.0.4
BuildRequires:  libxerces-c-devel >= 3.2
BuildRequires:  libxml-security-c-devel >= 2.0.0
BuildRequires:  libxmltooling-devel >= 3.0.1
BuildRequires:  pkgconfig
%if 0%{?suse_version} > 1325
BuildRequires:  libboost_headers-devel
%else
BuildRequires:  boost-devel >= 1.32.0
%endif

%description
OpenSAML is an open source implementation of the OASIS Security Assertion
Markup Language Specification. It contains a set of open source C++ classes
that support the SAML 1.0, 1.1, and 2.0 specifications.

%package -n opensaml-bin
Summary:        Utilities for OpenSAML library
Group:          Development/Libraries/C and C++

%description -n opensaml-bin
OpenSAML is an open source implementation of the OASIS Security Assertion
Markup Language Specification. It contains a set of open source C++ classes
that support the SAML 1.0, 1.1, and 2.0 specifications.

This package contains the utility programs.

%package -n libsaml%{libvers}
Summary:        Security Assertion Markup Language library
Group:          System/Libraries
Provides:       opensaml = %{version}-%{release}
Obsoletes:      opensaml < %{version}-%{release}

%description -n libsaml%{libvers}
OpenSAML is an open source implementation of the OASIS Security Assertion
Markup Language Specification. It contains a set of open source C++ classes
that support the SAML 1.0, 1.1, and 2.0 specifications.

This package contains just the shared library.

%package -n libsaml-devel
Summary:        OpenSAML development Headers
Group:          Development/Libraries/C and C++
Requires:       liblog4shib-devel >= 1.0.4
Requires:       libsaml%{libvers} = %{version}-%{release}
Requires:       libxerces-c-devel >= 3.2
Requires:       libxml-security-c-devel >= 2.0.0
Requires:       libxmltooling-devel >= 3.0.1
Provides:       opensaml-devel = %{version}-%{release}
Obsoletes:      opensaml-devel < %{version}-%{release}

%description -n libsaml-devel
OpenSAML is an open source implementation of the OASIS Security Assertion
Markup Language Specification. It contains a set of open source C++ classes
that support the SAML 1.0, 1.1, and 2.0 specifications.

This package includes files needed for development with OpenSAML.

%package -n opensaml-schemas
Summary:        OpenSAML schemas and catalog
Group:          Development/Libraries/C and C++

%description -n opensaml-schemas
OpenSAML is an open source implementation of the OASIS Security Assertion
Markup Language Specification. It contains a set of open source C++ classes
that support the SAML 1.0, 1.1, and 2.0 specifications.

This package includes XML schemas and related files.

%prep
%setup -q
%patch0 -p1

%build
%configure
make %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot} pkgdocdir=%{pkgdocdir}
# Don't package unit tester if present.
rm -f %{buildroot}/%{_bindir}/samltest
rm -f %{buildroot}/%{_libdir}/libsaml.la

%check
make %{?_smp_mflags} check

%post -n libsaml%{libvers} -p /sbin/ldconfig
%postun -n libsaml%{libvers} -p /sbin/ldconfig

%files -n opensaml-bin
%{_bindir}/samlsign

%files -n libsaml%{libvers}
%{_libdir}/libsaml.so.*

%files -n opensaml-schemas
%dir %{_datadir}/xml/opensaml
%{_datadir}/xml/opensaml/*

%files -n libsaml-devel
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/opensaml.pc
%doc %{pkgdocdir}

%changelog