Name: libntruprime Version: 20241021 Release: 1%{?dist} Summary: Streamlined NTRU Prime key encapsulation library License: LicenseRef-Fedora-Public-Domain OR 0BSD OR MIT-0 OR MIT URL: https://libntruprime.cr.yp.to/ Source: https://libntruprime.cr.yp.to/libntruprime-%{version}.tar.gz BuildRequires: gcc BuildRequires: make BuildRequires: python3 BuildRequires: libcpucycles-devel BuildRequires: librandombytes-devel # Builds the constant-time checks and runs the tests under valgrind where it is available. %ifarch %{valgrind_arches} BuildRequires: valgrind BuildRequires: valgrind-devel %else %global no_valgrind --no-valgrind %endif # Its tests check the compiled machine instructions. BuildRequires: python3-capstone %description libntruprime is a microlibrary for the Streamlined NTRU Prime post-quantum key encapsulation mechanism, with command-line tools for each parameter set. %package devel Summary: Development files for libntruprime Requires: %{name}%{?_isa} = %{version}-%{release} Requires: librandombytes-devel%{?_isa} %description devel libntruprime headers and other development files. %package static Summary: Static version of the libntruprime library Requires: %{name}-devel%{?_isa} = %{version}-%{release} %description static Statically linkable version of the libntruprime library. %prep %autosetup %build # The build tries every compiler in compilers/ (one per CPU feature level); pass Fedora's flags to # all of them through a gcc wrapper, and disable clang, as the Debian packaging does. mkdir -p .rpm-cc printf '#!/bin/sh\nexec /usr/bin/gcc %s "$@"\n' '%{build_cflags} %{build_ldflags}' > .rpm-cc/gcc printf '#!/bin/sh\nexit 1\n' > .rpm-cc/clang chmod +x .rpm-cc/* export PATH=$PWD/.rpm-cc:$PATH ./configure --prefix=%{_prefix} %{?no_valgrind} %make_build %install cd build/0/package install -d %{buildroot}{%{_libdir},%{_includedir},%{_bindir},%{_mandir}/man1,%{_mandir}/man3} cp -P lib/libntruprime.so.1 lib/libntruprime.so lib/libntruprime.a %{buildroot}%{_libdir}/ chmod 755 %{buildroot}%{_libdir}/libntruprime.so.1 install -m 644 include/ntruprime.h %{buildroot}%{_includedir}/ install -m 755 bin/* %{buildroot}%{_bindir}/ install -m 644 man/man1/*.1 %{buildroot}%{_mandir}/man1/ install -m 644 man/man3/*.3 %{buildroot}%{_mandir}/man3/ %check # Upstream supports a compiled library only if it passes its test suite. LD_LIBRARY_PATH=$PWD/build/0/package/lib ./build/0/package/bin/ntruprime-test %files %license doc/license.md %doc doc/readme.md %{_libdir}/libntruprime.so.1 %{_bindir}/ntruprime-* %{_bindir}/sntrup* %{_mandir}/man1/ntruprime-*.1* %{_mandir}/man1/sntrup*.1* %files devel %{_includedir}/ntruprime.h %{_libdir}/libntruprime.so %{_mandir}/man3/*.3* %files static %{_libdir}/libntruprime.a %changelog * Sat Oct 03 2026 Sheldon Knuth - 20241021-1 - Package libntruprime for the PQConnect COPR, following Fedora's libcpucycles