Name: libmceliece Version: 20250507 Release: 2%{?dist} Summary: Classic McEliece key encapsulation library License: LicenseRef-Fedora-Public-Domain OR 0BSD OR MIT-0 OR MIT URL: https://lib.mceliece.org/ Source: https://lib.mceliece.org/libmceliece-%{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 %description libmceliece is a microlibrary for the Classic McEliece post-quantum key encapsulation mechanism, with command-line tools for each parameter set. %package devel Summary: Development files for libmceliece Requires: %{name}%{?_isa} = %{version}-%{release} Requires: librandombytes-devel%{?_isa} %description devel libmceliece headers and other development files. %package static Summary: Static version of the libmceliece library Requires: %{name}-devel%{?_isa} = %{version}-%{release} %description static Statically linkable version of the libmceliece 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/libmceliece.so.1 lib/libmceliece.so lib/libmceliece.a %{buildroot}%{_libdir}/ chmod 755 %{buildroot}%{_libdir}/libmceliece.so.1 install -m 644 include/mceliece.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/mceliece-test %files %license doc/license.md %doc doc/readme.md %{_libdir}/libmceliece.so.1 %{_bindir}/mceliece* %{_mandir}/man1/mceliece*.1* %files devel %{_includedir}/mceliece.h %{_libdir}/libmceliece.so %{_mandir}/man3/mceliece*.3* %files static %{_libdir}/libmceliece.a %changelog * Sat Oct 03 2026 Sheldon Knuth - 20250507-2 - Rebuild against Fedora's librandombytes packaging (soname librandombytes.so.1) * Sat Oct 03 2026 Sheldon Knuth - 20250507-1 - Package libmceliece for the PQConnect COPR, following Fedora's libcpucycles