$ git diff --patch-with-stat --summary 65974ff5a59ca7af816e80487cf608aeeab75127..43470c9baf710592ca722f4989172186427ad962
.abf.yml | 2 +-
check-update.sh | 4 +-
...cryptoengine-5.2.94-cmake-config-location.patch | 11 +++++
...ryptoengine-5.2.94_fix_sizeof_declaration.patch | 12 +++++
postquantumcryptoengine.spec | 52 +++++++++++++---------
5 files changed, 58 insertions(+), 23 deletions(-)
create mode 100644 postquantumcryptoengine-5.2.94-cmake-config-location.patch
create mode 100644 postquantumcryptoengine-5.2.94_fix_sizeof_declaration.patch
diff --git a/.abf.yml b/.abf.yml
index fa3bb2e..283e4d2 100644
--- a/.abf.yml
+++ b/.abf.yml
@@ -1,2 +1,2 @@
sources:
- postquantumcryptoengine-5.2.0.tar.bz2: 65e278f7764348c645117bb81fb4d46794436f79
+ postquantumcryptoengine-5.3.94.tar.bz2: f97165ba870bb3c0913485957e91223860d3f1f4
diff --git a/check-update.sh b/check-update.sh
index fb53c65..e0a8cda 100755
--- a/check-update.sh
+++ b/check-update.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-#curl "https://github.com/BelledonneCommunications/postquantumcryptoengine/tags" 2>/dev/null |grep "tag/" |sed -e 's,.*tag/,,;s,\".*,,;' |grep -E '^[0-9.]+$' |grep -v '[0-9][0-9][0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]' |sort -V |tail -n1
-curl -s "https://gitlab.linphone.org/BC/public/postquantumcryptoengine/-/tags" |grep "tags/" |sed -e 's,.*tags/,,;s,\".*,,;' |grep -E '^[0-9.]+$' |grep -v '[0-9][0-9][0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]' |sort -V |tail -n1
+#curl -s "https://github.com/BelledonneCommunications/postquantumcryptoengine/tags" |grep "tag/" |sed -e 's,.*tag/,,;s,\".*,,;' |grep -E '^[0-9.]+$' |grep -v '[0-9][0-9][0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]' |sort -V |tail -n1
+curl -s "https://gitlab.linphone.org/BC/public/postquantumcryptoengine/-/tags" |grep "tags/" |sed -e 's,.*tags/,,;s,\".*,,;' |grep -E '^[0-9.]+$' |grep -v '[0-9][0-9][0-9][0-9]\.[0-9][0-9]\.[0-9][0-9]' |sort -V |tail -n1
diff --git a/postquantumcryptoengine-5.2.94-cmake-config-location.patch b/postquantumcryptoengine-5.2.94-cmake-config-location.patch
new file mode 100644
index 0000000..9d7e6c2
--- /dev/null
+++ b/postquantumcryptoengine-5.2.94-cmake-config-location.patch
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -74,7 +74,7 @@ if(ENABLE_UNIT_TESTS AND NOT ANDROID AND
+ endif()
+
+ include(CMakePackageConfigHelpers)
+-set(CMAKE_MODULES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake")
++set(CMAKE_MODULES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}/")
+ configure_package_config_file("${PROJECT_NAME}Config.cmake.in" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
+ INSTALL_DESTINATION "${CMAKE_MODULES_INSTALL_DIR}"
+ NO_SET_AND_CHECK_MACRO
diff --git a/postquantumcryptoengine-5.2.94_fix_sizeof_declaration.patch b/postquantumcryptoengine-5.2.94_fix_sizeof_declaration.patch
new file mode 100644
index 0000000..3b74fb5
--- /dev/null
+++ b/postquantumcryptoengine-5.2.94_fix_sizeof_declaration.patch
@@ -0,0 +1,12 @@
+From ea086ea0aa9ec3b5cfb5be7d73fd6da579e1dce9 Mon Sep 17 00:00:00 2001
+From: Julien Wadel <julien.wadel@belledonne-communications.com>
+--- a/tester/crypto.cc
++++ b/tester/crypto.cc
+@@ -546,4 +546,4 @@ static test_t crypto_tests[] = {
+ };
+
+ test_suite_t crypto_test_suite = {"Crypto", NULL, NULL, NULL, NULL,
+- sizeof(crypto_tests) / sizeof(crypto_tests[0]), crypto_tests, 0};
++ sizeof(crypto_tests) / sizeof(crypto_tests[0]), crypto_tests};
+
+--
diff --git a/postquantumcryptoengine.spec b/postquantumcryptoengine.spec
index fd9cb16..484d54f 100644
--- a/postquantumcryptoengine.spec
+++ b/postquantumcryptoengine.spec
@@ -1,25 +1,27 @@
-%define major 1
-%define libname %mklibname %{name}
-%define devname %mklibname %{name} -d
+%global major 1
+%global libname %mklibname %{name}
+%global devname %mklibname %{name} -d
-%bcond_with static
-%bcond_without strict
-%bcond_without tests
+# exclude unwanted cmake requires
+%global __provides_exclude_from ^%{_datadir}/cmake/.*/Find.*cmake$
-# NOTE: use commit if the last release is still in beta
-#%%global commit 8bdb9c1d3988a389af462c793189d11165733d2a
+%bcond strict 1
+%bcond unit_tests 1
+%bcond unit_tests_install 0
Summary: Post Quantum algorithm integration to bctoolbox
Name: postquantumcryptoengine
-Version: 5.2.0
+Version: 5.3.94
Release: 2
License: GPLv3
Group: System/Libraries
URL: https://linphone.org/
-Source0: https://gitlab.linphone.org/BC/public/%{name}/-/archive/%{?commit:%{commit}}%{!?commit:%{version}}/%{name}-%{?commit:%{commit}}%{!?commit:%{version}}.tar.bz2
+Source0: https://gitlab.linphone.org/BC/public/%{name}/-/archive/%{version}/%{name}-%{version}.tar.bz2
+Patch0: postquantumcryptoengine-5.2.94-cmake-config-location.patch
+Patch100: postquantumcryptoengine-5.2.94_fix_sizeof_declaration.patch
+
BuildRequires: cmake
BuildRequires: ninja
-BuildRequires: bctoolbox-static-devel
BuildRequires: cmake(bctoolbox)
BuildRequires: cmake(liboqs)
@@ -32,6 +34,11 @@ Quantum Cryptography.
* X25519 and X448 in KEM version and a way to combine two or more of
theses.
+%if %{with unit_tests} && %{with unit_tests_install}
+%files
+%{_bindir}/pqcrypto-tester
+%endif
+
#---------------------------------------------------------------------------
%package -n %{libname}
@@ -65,28 +72,33 @@ This package contains development files for %{name}
%license LICENSE.txt
%{_includedir}/%{name}/
%{_libdir}/lib%{name}.so
-%{_libdir}/cmake/%{name}
+%{_datadir}/cmake/PostQuantumCryptoEngine
#---------------------------------------------------------------------------
%prep
-#%%autosetup -p1 -n %{name}-%{version}-beta-%{commit}
%autosetup -p1 -n %{name}-%{?commit:%{commit}}%{!?commit:%{version}}
%build
%cmake \
- -DENABLE_STATIC:BOOL=%{?with_static:ON}%{?!with_static:OFF} \
-DENABLE_STRICT:BOOL=%{?with_strict:ON}%{?!with_strict:OFF} \
- -DENABLE_TESTS:BOOL=%{?with_tests:ON}%{?!with_tests:OFF} \
- -DCONFIG_PACKAGE_LOCATION:PATH=%{_libdir}/cmake/%{name} \
+ -DENABLE_UNIT_TESTS:BOOL=%{?with_unit_tests:ON}%{?!with_unit_tests:OFF} \
-G Ninja
%ninja_build
%install
%ninja_install -C build
-# fix cmake stuff path
-install -dm 0755 %{buildroot}%{_libdir}/cmake
-mv %{buildroot}%{_datadir}/%{name}/cmake %{buildroot}%{_libdir}/cmake/%{name}
-rmdir %{buildroot}%{_datadir}/%{name}
+# don't install unit tester
+%if %{with unit_tests} && ! %{with unit_tests_install}
+rm -f %{buildroot}%{_bindir}/pqcrypto-tester
+%endif
+
+%check
+%if %{with unit_tests}
+pushd build
+#FIXME: some tests may fail at ABF
+ctest || true
+popd
+%endif