Name: librandombytes Version: 20240318 Release: 1%{?dist} Summary: Library for generating random bytes from the operating system License: LicenseRef-Fedora-Public-Domain OR 0BSD OR MIT-0 OR MIT URL: https://randombytes.cr.yp.to/ Source: https://randombytes.cr.yp.to/librandombytes-%{version}.tar.gz BuildRequires: gcc BuildRequires: make BuildRequires: python3 # The OpenSSL variant is built too, but not packaged (as in Debian), so the library does not # depend on OpenSSL. BuildRequires: openssl-devel %description librandombytes provides the randombytes() function, which fills a buffer with random bytes from the operating system's random number generator. lib25519, libmceliece and libntruprime use it. %package devel Summary: Development files for librandombytes Requires: %{name}%{?_isa} = %{version}-%{release} %description devel librandombytes headers and other development files. %package static Summary: Static version of the librandombytes library Requires: %{name}-devel%{?_isa} = %{version}-%{release} %description static Statically linkable version of the librandombytes library. %prep %autosetup %build # The build tries every compiler in compilers/; 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} %make_build %install cd build/0/package install -d %{buildroot}{%{_libdir},%{_includedir},%{_bindir},%{_mandir}/man1,%{_mandir}/man3} cp -P lib/librandombytes-kernel.so.1 lib/librandombytes.so.1 \ lib/librandombytes-kernel.so lib/librandombytes.so \ lib/librandombytes-kernel.a lib/librandombytes.a %{buildroot}%{_libdir}/ chmod 755 %{buildroot}%{_libdir}/librandombytes-kernel.so.1 install -m 644 include/randombytes.h %{buildroot}%{_includedir}/ install -m 755 bin/randombytes-info %{buildroot}%{_bindir}/ install -m 644 man/man1/*.1 %{buildroot}%{_mandir}/man1/ install -m 644 man/man3/*.3 %{buildroot}%{_mandir}/man3/ %check LD_LIBRARY_PATH=$PWD/build/0/package/lib ./build/0/package/bin/randombytes-info %files %license doc/license.md %doc doc/readme.md %{_libdir}/librandombytes-kernel.so.1 %{_libdir}/librandombytes.so.1 %{_bindir}/randombytes-info %{_mandir}/man1/randombytes-info.1* %files devel %{_includedir}/randombytes.h %{_libdir}/librandombytes-kernel.so %{_libdir}/librandombytes.so %{_mandir}/man3/randombytes.3* %files static %{_libdir}/librandombytes-kernel.a %{_libdir}/librandombytes.a %changelog * Sat Oct 03 2026 Sheldon Knuth - 20240318-1 - Package librandombytes for the PQConnect COPR, following Fedora's libcpucycles