Blob Blame History Raw
# remirepo/fedora spec file for rnp
# Copyright (c) 2022-2023 Remi Collet
# License: CC-BY-SA
# Please, preserve the changelog entries

%bcond_without      tests
%bcond_with         licensecheck

%if 0%{?rhel} == 8
# use openssl by default as botan2 is too old
%bcond_without      openssl
# use botan2 as openssl seems experimental/wip
%bcond_with         openssl

%global libname     librnp
%global soname      0

Name:          rnp
Summary:       OpenPGP (RFC4880) tools
Version:       0.16.3
Release:       1%{?dist}
# See rnp-files-by-license.txt and upstream LICENSE* files
License:       BSD-2-Clause AND BSD-3-Clause AND Apache-2.0 AND MIT

Source0:       %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Source1:       %{url}/releases/download/v%{version}/v%{version}.tar.gz.asc
# See
Source2:       %{name}-keyring.gpg
# Use --with licensecheck to generate
Source3:       %{name}-files-by-license.txt

# License clarification
Patch0:        %{name}-upstream.patch

BuildRequires:  cmake >= 3.14
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(zlib)
BuildRequires:  pkgconfig(bzip2) 
%if %{with openssl}
BuildRequires:  openssl-devel >= 1.1.1
BuildRequires:  json-c-devel >= 0.11
BuildRequires:  gtest-devel
BuildRequires:  pkgconfig(botan-2) >= 2.14
BuildRequires:  cmake(json-c) >= 0.11
BuildRequires:  cmake(GTest)
BuildRequires:  python3
BuildRequires:  gnupg2
BuildRequires:  rubygem-asciidoctor
%if %{with licensecheck}
BuildRequires:  licensecheck

Requires:       %{libname}%{?_isa} = %{version}-%{release}

RNP is a set of OpenPGP (RFC4880) tools.

%package -n %{libname}
Summary:    Library for all OpenPGP functions

%description -n %{libname}
%{libname} is the library used by RNP for all OpenPGP functions,
useful for developers to build against, different from GPGME.

%package -n %{libname}-devel
Summary:    Header files and development libraries for %{libname}
Requires:   %{libname}%{?_isa} = %{version}-%{release}

%description -n %{libname}-devel
This package contains the header files and development libraries
for %{libname}.

%setup -q
%{?gpgverify:%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'}
%patch0 -p1

%if %{with licensecheck}

licensecheck -r . | sed -e 's:^./::' >$LST
grep -v UNKNOWN $LST | sed -e 's/.*: //' | sort -u | while read lic
	echo -e "\n$lic\n------------"
	grep ": $lic\$" $LST | sed -e "s/: $lic//"
done  | tee %{SOURCE3}
rm $LST

%cmake . \
%if %{with openssl}



%if %{with tests}
# erratic results on koji

%if 0%{?rhel} == 8
%ifarch s390x
# to investigate

%ctest --exclude-regex $FILTER


%files -n %{libname}
%license LICENSE*

%files -n %{libname}-devel

* Thu Apr 13 2023 Remi Collet <> - 0.16.3-1
- update to 0.16.3

* Fri Nov  4 2022 Remi Collet <> - 0.16.2-4
- add upstream fix to clarify license and abandoned patent

* Wed Nov  2 2022 Remi Collet <> - 0.16.2-3
- add files by license list in package sources
- open missing MIT
- add man pages
- check archive signature

* Fri Oct 28 2022 Remi Collet <> - 0.16.2-2
- switch from botan-2 to openssl on EL-8

* Thu Oct 27 2022 Remi Collet <> - 0.16.2-1
- initial package