rng-tools-vl.spec 2.6 KB

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