123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- %bcond_with systemd
- %global _hardened_build 1
- %global _sbindir /sbin
- Summary: Random number generator related utilities
- Name: rng-tools
- Version: 6.10
- Release: 4%{?_dist_release}
- Vendor: Project Vine
- Distribution: Vine Linux
- License: GPLv2+
- URL: https://github.com/nhorman/rng-tools
- Source0: https://github.com/nhorman/rng-tools/archive/rng-tools-%{version}.tar.gz
- Source1: rngd.service
- Source100: rngd.init
- Source101: rngd.sysconfig
- Source1000: Changelog.fedora
- # https://sourceforge.net/p/gkernel/patches/111/
- BuildRequires: gcc make
- BuildRequires: gettext
- BuildRequires: libgcrypt-devel
- BuildRequires: autoconf automake
- BuildRequires: libsysfs-devel curl-devel
- BuildRequires: libxml2-devel openssl-devel
- BuildRequires: jansson-devel
- BuildRequires: jitterentropy-devel
- #BuildRequires: libp11-devel
- #BuildRequires: rtl-sdr-devel
- Provides: jitterentropy-rngd
- %if %{with systemd}
- BuildRequires: systemd-units
- Requires(post): systemd-units
- Requires(preun): systemd-units
- Requires(postun): systemd-units
- %else
- Requires(post): chkconfig
- Requires(preun): chkconfig
- Requires(postun): chkconfig
- %endif
- %description
- Hardware random number generation tools.
- %prep
- %autosetup
- %build
- ./autogen.sh
- %configure \
- --without-pkcs11 \
- --without-rtlsdr \
- %{nil}
- %make_build
- %install
- %make_install
- %if %{with systemd}
- # install systemd unit file
- install -Dt %{buildroot}%{_unitdir} -m0644 %{SOURCE1}
- %else
- mkdir -p %{buildroot}%{_initdir}
- mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
- install -m755 %{SOURCE100} %{buildroot}%{_initdir}/rngd
- install -m644 %{SOURCE101} %{buildroot}%{_sysconfdir}/sysconfig/rngd
- %endif
- %post
- %if %{with systemd}
- %systemd_post rngd.service
- %else
- /sbin/chkconfig --add rngd
- %endif
- %preun
- %if %{with systemd}
- %systemd_preun rngd.service
- %else
- if [ "$1" = 0 ]; then
- /sbin/service stop rngd >/dev/null 2>&1 ||:
- /sbin/chkconfig --del rngd
- fi
- %endif
- %postun
- %if %{with systemd}
- %systemd_postun_with_restart rngd.service
- %else
- if [ "$1" != 0 ]; then
- /sbin/service stop condrestart >/dev/null 2>&1 ||:
- fi
- %endif
- %files
- %{!?_licensedir:%global license %%doc}
- %license COPYING
- %doc AUTHORS NEWS README
- %{_bindir}/rngtest
- %{_sbindir}/rngd
- %{_mandir}/man1/rngtest.1.*
- %{_mandir}/man8/rngd.8.*
- %if %{with systemd}
- %attr(0644,root,root) %{_unitdir}/rngd.service
- %else
- %attr(0755,root,root) %{_initdir}/rngd
- %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/rngd
- %endif
- %changelog
- * Thu Apr 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 6.10-4
- - initial build for Vine Linux.
|