# Tests require access to an actual smartcard to work %bcond_with check %global date 20230418 %global commit 2cbe462c62bacf537b9a9a427a1c053d8c2e4760 %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: pkcs11test Version: 0^%{date}git%{shortcommit} Release: 2%{?dist} Summary: PKCS#11 Test Suite # pkcs11test itself is Apache-2.0, the PKCS#11 headers are RSA License: Apache-2.0 AND LicenseRef-RSA URL: https://github.com/google/pkcs11test Source: %{url}/archive/%{commit}/%{name}-%{commit}.tar.gz BuildRequires: gcc-c++ BuildRequires: make BuildRequires: sed BuildRequires: gtest-devel %if %{with check} BuildRequires: opencryptoki-libs %endif # Originally imported in f5b35ef94742a86ad6c87587a9270a11e65da3fd Provides: bundled(pkcs11-headers) = 1.4 %description This package provides a test suite for PKCS#11. %prep %autosetup -n %{name}-%{commit} # Build system fixes # * Replace bundled gtest with the system one # * Switch to C++14 as now required by the system gtest package # * Fix library path for opencryptoki rm -r gtest-1.10.0 sed -i makefile \ -e 's:libgtest.a::' \ -e 's:-std=c++0x:-std=c++14:' \ -e 's:-lpthread:-lpthread -lgtest %{build_ldflags}:' \ -e 's:/usr/lib/opencryptoki:%{_libdir}/opencryptoki:g' # Rename license for bundled pkcs11 headers mv third_party/pkcs11/LICENSE third_party/pkcs11/LICENSE.pkcs11 %build %make_build \ GTEST_INC="-isystem %{_includedir}/gtest" \ GTEST_DIR="%{_includedir}/gtest" %install install -Dpm0755 -t %{buildroot}%{_bindir} %{name} %if %{with check} %check %make_build test_opencryptoki %endif %files %license LICENSE third_party/pkcs11/LICENSE.pkcs11 %doc README.md %{_bindir}/%{name} %changelog * Tue Jan 16 2024 Davide Cavalca - 0^20230418git2cbe462-2 - Update license tag to comply with SPDX - Fix several typos * Tue Jan 16 2024 Davide Cavalca - 0^20230418git2cbe462-1 - Update to git snapshot 2cbe462 - Switch to C++14 as now required by the system gtest package - Run the tests (disabled by default due to requirements) * Mon Oct 10 2022 Davide Cavalca - 0^20220308git56debd5-2 - Rename pkcs11 headers license file to avoid conflict * Fri Oct 07 2022 Davide Cavalca - 0^20220308git56debd5-1 - Update to git snapshot 56debd5 - Rework to comply with the Fedora packaging guidelines * Tue Dec 1 2020 Vijay Sai Krishnamoorthy - 20201123-1.gitbfc5bc1.fb1 - Initial packaging