rng-tools-vl.spec 2.8 KB

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