%global debug_package %{nil} %global version 0.3.3 %global release 2 Name: infnoise Version: %{version} Release: %{release}%{?dist} Summary: Infinite Noise TRNG (True Random Number Generator) License: CC0-1.0 URL: https://github.com/13-37-org/infnoise # cd infnoise && ~/bin/git-archive-all.sh --format=tar.gz --prefix=infnoise/ --recursive --o ../infnoise-0.3.3.tar.gz Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz BuildRequires: libftdi-devel BuildRequires: libusbx-devel BuildRequires: gcc Requires: systemd-udev %description The Infinite Noise TRNG is a USB key hardware true random number generator. %prep %autosetup -p1 -n %{name} pushd software # fix prefix sed -i -e's|/usr/local|%{_prefix}|' Makefile.linux # install the proper systemd service sed -i -e's|install -m 0644 init_scripts/infnoise.service $(PREFIX)/lib/systemd/system|install -D -m 0644 init_scripts/infnoise.service.sbin $(PREFIX)/lib/systemd/system/infnoise.service|' Makefile.linux # fix rundir in the systemd service sed -i -e's|/var/run/|%{_rundir}/|' init_scripts/infnoise.service.sbin # remove brew logic in software/tools/Makefile sed -i -e's|$(shell brew --prefix libftdi \|\| echo /usr)|/usr|' tools/Makefile popd %build pushd software %make_build -f Makefile.linux popd # build the tools pushd software/tools %make_build all popd %install pushd software %make_install -f Makefile.linux # install the systemd config file install -D -m0644 init_scripts/infnoise.conf.systemd %{buildroot}%{_sysconfdir}/infnoise.conf # install the infnoise manpage install -d -m0755 %{buildroot}%{_mandir}/man8 install -D -m0644 infnoise.8 %{buildroot}%{_mandir}/man8/ # install the healthcheck manpage install -d -m0755 %{buildroot}%{_mandir}/man1 install -D -m0644 healthcheck.1 %{buildroot}%{_mandir}/man1/ popd # install the tools and their manpages pushd software/tools install -d -m0755 %{buildroot}%{_bindir} install -D -m0755 passgen %{buildroot}%{_bindir}/infnoise-passgen install -D -m0755 dice %{buildroot}%{_bindir}/infnoise-dice install -D -m0755 healthcheck %{buildroot}%{_bindir}/infnoise-entcheck install -D -m0755 entcheck %{buildroot}%{_bindir}/infnoise-healthcheck install -D -m0755 hex2bin %{buildroot}%{_bindir}/infnoise-hex2bin install -D -m0755 bin2hex %{buildroot}%{_bindir}/infnoise-bin2hex install -D -m0755 findlongest %{buildroot}%{_bindir}/infnoise-findlongest install -D -m0755 flipbits %{buildroot}%{_bindir}/infnoise-flipbits install -D -m0644 *.1 %{buildroot}%{_mandir}/man1/ popd %post udevadm control --reload systemctl enable infnoise.service systemctl daemon-reload %preun systemctl stop infnoise.service >/dev/null 2>&1 systemctl disable infnoise.service systemctl daemon-reload %files %license LICENSE %doc README.md %{_bindir}/infnoise-* %{_sbindir}/infnoise %{_sysconfdir}/infnoise.conf %{_udevrulesdir}/75-infnoise.rules %{_unitdir}/infnoise.service %{_mandir}/man1/*.1* %{_mandir}/man8/infnoise* %changelog * Wed Oct 30 2024 Patrick Laimbock - 0.3.3-2 - rebuild for Fedora 41 * Sat May 06 2023 Patrick Laimbock - 0.3.3-1 - update to version 0.3.3 * Tue Nov 09 2021 Patrick Laimbock - 0.3.2-1 - update to version 0.3.2 * Thu Mar 11 2021 Patrick Laimbock - 0.3.1-1 - initial release for Fedora 33