[12363] | 1 | %bcond_with systemd |
---|
| 2 | |
---|
| 3 | %global _hardened_build 1 |
---|
| 4 | %global _sbindir /sbin |
---|
| 5 | |
---|
| 6 | Summary: Random number generator related utilities |
---|
[12458] | 7 | Summary(ja): 乱数生成器関連のユーティリティ |
---|
[12363] | 8 | Name: rng-tools |
---|
| 9 | Version: 6.10 |
---|
[12458] | 10 | Release: 5%{?_dist_release}%{?with_systemd:.systemd} |
---|
| 11 | Group: system |
---|
[12363] | 12 | Vendor: Project Vine |
---|
| 13 | Distribution: Vine Linux |
---|
[12458] | 14 | |
---|
[12363] | 15 | License: GPLv2+ |
---|
| 16 | URL: https://github.com/nhorman/rng-tools |
---|
| 17 | Source0: https://github.com/nhorman/rng-tools/archive/rng-tools-%{version}.tar.gz |
---|
| 18 | Source1: rngd.service |
---|
| 19 | Source100: rngd.init |
---|
| 20 | Source101: rngd.sysconfig |
---|
| 21 | Source1000: Changelog.fedora |
---|
| 22 | |
---|
| 23 | # https://sourceforge.net/p/gkernel/patches/111/ |
---|
| 24 | |
---|
| 25 | BuildRequires: gcc make |
---|
| 26 | BuildRequires: gettext |
---|
| 27 | BuildRequires: libgcrypt-devel |
---|
| 28 | BuildRequires: autoconf automake |
---|
| 29 | BuildRequires: libsysfs-devel curl-devel |
---|
| 30 | BuildRequires: libxml2-devel openssl-devel |
---|
| 31 | BuildRequires: jansson-devel |
---|
| 32 | BuildRequires: jitterentropy-devel |
---|
| 33 | #BuildRequires: libp11-devel |
---|
| 34 | #BuildRequires: rtl-sdr-devel |
---|
| 35 | Provides: jitterentropy-rngd |
---|
| 36 | |
---|
| 37 | %if %{with systemd} |
---|
| 38 | BuildRequires: systemd-units |
---|
| 39 | Requires(post): systemd-units |
---|
| 40 | Requires(preun): systemd-units |
---|
| 41 | Requires(postun): systemd-units |
---|
| 42 | %else |
---|
| 43 | Requires(post): chkconfig |
---|
| 44 | Requires(preun): chkconfig |
---|
| 45 | Requires(postun): chkconfig |
---|
| 46 | %endif |
---|
| 47 | |
---|
| 48 | %description |
---|
| 49 | Hardware random number generation tools. |
---|
| 50 | |
---|
[12458] | 51 | |
---|
[12363] | 52 | %prep |
---|
| 53 | %autosetup |
---|
| 54 | |
---|
[12458] | 55 | |
---|
[12363] | 56 | %build |
---|
| 57 | ./autogen.sh |
---|
| 58 | %configure \ |
---|
| 59 | --without-pkcs11 \ |
---|
| 60 | --without-rtlsdr \ |
---|
| 61 | %{nil} |
---|
| 62 | |
---|
| 63 | %make_build |
---|
| 64 | |
---|
[12458] | 65 | |
---|
[12363] | 66 | %install |
---|
| 67 | %make_install |
---|
| 68 | |
---|
| 69 | %if %{with systemd} |
---|
| 70 | # install systemd unit file |
---|
| 71 | install -Dt %{buildroot}%{_unitdir} -m0644 %{SOURCE1} |
---|
| 72 | %else |
---|
| 73 | mkdir -p %{buildroot}%{_initdir} |
---|
| 74 | mkdir -p %{buildroot}%{_sysconfdir}/sysconfig |
---|
| 75 | install -m755 %{SOURCE100} %{buildroot}%{_initdir}/rngd |
---|
| 76 | install -m644 %{SOURCE101} %{buildroot}%{_sysconfdir}/sysconfig/rngd |
---|
| 77 | %endif |
---|
| 78 | |
---|
[12458] | 79 | |
---|
[12363] | 80 | %post |
---|
| 81 | %if %{with systemd} |
---|
| 82 | %systemd_post rngd.service |
---|
| 83 | %else |
---|
| 84 | /sbin/chkconfig --add rngd |
---|
| 85 | %endif |
---|
| 86 | |
---|
| 87 | %preun |
---|
| 88 | %if %{with systemd} |
---|
| 89 | %systemd_preun rngd.service |
---|
| 90 | %else |
---|
[12458] | 91 | if [ "$1" = 0 -o -x /bin/systemctl ]; then |
---|
[12363] | 92 | /sbin/service stop rngd >/dev/null 2>&1 ||: |
---|
| 93 | /sbin/chkconfig --del rngd |
---|
| 94 | fi |
---|
| 95 | %endif |
---|
| 96 | |
---|
| 97 | %postun |
---|
| 98 | %if %{with systemd} |
---|
| 99 | %systemd_postun_with_restart rngd.service |
---|
| 100 | %else |
---|
| 101 | if [ "$1" != 0 ]; then |
---|
| 102 | /sbin/service stop condrestart >/dev/null 2>&1 ||: |
---|
| 103 | fi |
---|
| 104 | %endif |
---|
| 105 | |
---|
[12458] | 106 | |
---|
[12363] | 107 | %files |
---|
| 108 | %{!?_licensedir:%global license %%doc} |
---|
| 109 | %license COPYING |
---|
| 110 | %doc AUTHORS NEWS README |
---|
| 111 | %{_bindir}/rngtest |
---|
| 112 | %{_sbindir}/rngd |
---|
| 113 | %{_mandir}/man1/rngtest.1.* |
---|
| 114 | %{_mandir}/man8/rngd.8.* |
---|
| 115 | %if %{with systemd} |
---|
| 116 | %attr(0644,root,root) %{_unitdir}/rngd.service |
---|
| 117 | %else |
---|
| 118 | %attr(0755,root,root) %{_initdir}/rngd |
---|
| 119 | %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/rngd |
---|
| 120 | %endif |
---|
| 121 | |
---|
[12458] | 122 | |
---|
[12363] | 123 | %changelog |
---|
[12458] | 124 | * Sun Aug 09 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 6.10-5 |
---|
| 125 | * added suffix to %%release with systemd build. |
---|
| 126 | |
---|
[12363] | 127 | * Thu Apr 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 6.10-4 |
---|
| 128 | - initial build for Vine Linux. |
---|