Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/rng-tools/, sys-apps/rng-tools/files/
Date: Sun, 13 Jun 2021 08:41:17
Message-Id: 1623573651.01f3fe8d243477a650529bb734a452d8887394e3.soap@gentoo
1 commit: 01f3fe8d243477a650529bb734a452d8887394e3
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 13 08:40:51 2021 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 13 08:40:51 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01f3fe8d
7
8 sys-apps/rng-tools: add 6.13
9
10 Closes: https://github.com/gentoo/gentoo/pull/21210
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12 Signed-off-by: David Seifert <soap <AT> gentoo.org>
13
14 sys-apps/rng-tools/Manifest | 1 +
15 .../rng-tools-6.13-various-autotools-fixups.patch | 78 ++++++++++++++++++++++
16 sys-apps/rng-tools/rng-tools-6.13.ebuild | 73 ++++++++++++++++++++
17 3 files changed, 152 insertions(+)
18
19 diff --git a/sys-apps/rng-tools/Manifest b/sys-apps/rng-tools/Manifest
20 index 426e7b32088..684eb563631 100644
21 --- a/sys-apps/rng-tools/Manifest
22 +++ b/sys-apps/rng-tools/Manifest
23 @@ -1,2 +1,3 @@
24 DIST rng-tools-6.11.tar.gz 57366 BLAKE2B d613502bcb24560638c0abc956987e57ec54b6594bed414ce2b70086716f73a9a9eec4800c86097c4a14b91401f0f28be62f5182ee01c328c9a32cd79eaec561 SHA512 0058ca5d0c1ddb554284fe8e6b9c0b85f130e0b9e0b9f0f0219f434302766e07c321d4fc0c01bdeb59053d5cd14dab67dc1c306422ef35a62a267af9fbdf7deb
25 DIST rng-tools-6.12.tar.gz 57309 BLAKE2B d7a12b50889065f885cb15cda9686d63950fcc1ac9099893ed9c9236a9a930627c9541980c410318b40104637df688f5622681ce1d80eee7d4aaaf696c6bc3c5 SHA512 56dd334b65dcec1456f8dbdbee5d83590de27cb6ee1b7715828b5316a913557fd178e264139dc92a82e09635ca15b1eb5f6169bfb4412fbe1b06ea28a5064c64
26 +DIST rng-tools-6.13.tar.gz 59311 BLAKE2B e4601a2fa8158775a8ef7188edbe61a5eb1df35dccc9e1a0ab6b31b559f2f11dd67b682cf9995f0a67834690417e283d443ae6fa54e99ab6462a1185f9b9e09b SHA512 def5f2dcdd1771e8fe5af9476de866ff89a225065416672165af6019cbb166f874fae936b3705221aa47dc13ae99fa63d054d7d49b612f3151cd922a0a129490
27
28 diff --git a/sys-apps/rng-tools/files/rng-tools-6.13-various-autotools-fixups.patch b/sys-apps/rng-tools/files/rng-tools-6.13-various-autotools-fixups.patch
29 new file mode 100644
30 index 00000000000..4ad2348dad9
31 --- /dev/null
32 +++ b/sys-apps/rng-tools/files/rng-tools-6.13-various-autotools-fixups.patch
33 @@ -0,0 +1,78 @@
34 +https://github.com/nhorman/rng-tools/pull/132
35 +
36 +From 16b728f9a5bb138386fa770de817ec244a158be5 Mon Sep 17 00:00:00 2001
37 +From: David Seifert <soap@g.o>
38 +Date: Sat, 12 Jun 2021 22:15:06 +0200
39 +Subject: [PATCH 1/3] Use `AM_PROG_AR` over `AC_CHECK_TOOLS`
40 +
41 +* `AM_PROG_AR` is the canonical way to detect the archiver
42 + and includes workarounds for Cygwin.
43 +--- a/configure.ac
44 ++++ b/configure.ac
45 +@@ -62,10 +62,9 @@ AM_PROG_AS
46 + dnl Checks for programs
47 + AC_PROG_CC
48 + AC_PROG_RANLIB
49 ++AM_PROG_AR
50 + AC_PROG_GCC_TRADITIONAL
51 +
52 +-AC_CHECK_TOOLS([AR], [ar gar], :)
53 +-
54 + AX_PTHREAD
55 +
56 + AM_CONDITIONAL([RDRAND], [test $target_cpu = x86_64 -o $target_cpu = i686])
57 +
58 +From 2ce93190cb0111fcab2f622a539689d70960643a Mon Sep 17 00:00:00 2001
59 +From: David Seifert <soap@g.o>
60 +Date: Sat, 12 Jun 2021 22:15:09 +0200
61 +Subject: [PATCH 2/3] Build `randstat` binary
62 +--- a/contrib/Makefile.am
63 ++++ b/contrib/Makefile.am
64 +@@ -1,3 +1,2 @@
65 +-
66 +-EXTRA_DIST = randstat.c
67 +-
68 ++bin_PROGRAMS = randstat
69 ++randstat_SOURCES = randstat.c
70 +
71 +From 3adf2613e262efbda0a3455e59c8cb3390271563 Mon Sep 17 00:00:00 2001
72 +From: David Seifert <soap@g.o>
73 +Date: Sat, 12 Jun 2021 22:15:12 +0200
74 +Subject: [PATCH 3/3] `AC_CANONICAL_TARGET` -> `AC_CANONICAL_HOST`
75 +
76 +* `AC_CANONICAL_TARGET` is the type of system for which code
77 + will be produced, not on which it will run. This is a common
78 + confusion with Autoconf's target triplet.
79 +--- a/configure.ac
80 ++++ b/configure.ac
81 +@@ -20,7 +20,8 @@ dnl Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
82 + AC_INIT(rng-tools, 6.13, [Neil Horman <nhorman@×××××××××.com>])
83 + AC_PREREQ(2.52)
84 + AC_CONFIG_SRCDIR([rngd.c])
85 +-AC_CANONICAL_TARGET
86 ++AC_CANONICAL_HOST
87 ++AC_CANONICAL_TARGET dnl required for broken AX_PTHREAD
88 + AM_INIT_AUTOMAKE([foreign])
89 + AC_CONFIG_HEADERS([rng-tools-config.h])
90 + AC_CONFIG_MACRO_DIRS([m4])
91 +@@ -67,14 +68,14 @@ AC_PROG_GCC_TRADITIONAL
92 +
93 + AX_PTHREAD
94 +
95 +-AM_CONDITIONAL([RDRAND], [test $target_cpu = x86_64 -o $target_cpu = i686])
96 +-AS_IF([test $target_cpu = x86_64 -o $target_cpu = i686], [AC_DEFINE([HAVE_RDRAND],1,[Enable RDRAND])],[])
97 ++AM_CONDITIONAL([RDRAND], [test $host_cpu = x86_64 || $host_cpu = i686])
98 ++AS_IF([test $host_cpu = x86_64 || $host_cpu = i686], [AC_DEFINE([HAVE_RDRAND],1,[Enable RDRAND])],[])
99 +
100 +-AM_CONDITIONAL([DARN], [test $target_cpu = powerpc64le])
101 +-AS_IF([test $target_cpu = powerpc64le], [AC_DEFINE([HAVE_DARN],1,[Enable DARN])],[])
102 ++AM_CONDITIONAL([DARN], [test $host_cpu = powerpc64le])
103 ++AS_IF([test $host_cpu = powerpc64le], [AC_DEFINE([HAVE_DARN],1,[Enable DARN])],[])
104 +
105 +-AM_CONDITIONAL([RNDR], [test $target_cpu = aarch64])
106 +-AS_IF([test $target_cpu = aarch64], [AC_DEFINE([HAVE_RNDR],1,[Enable RNDR])],[])
107 ++AM_CONDITIONAL([RNDR], [test $host_cpu = aarch64])
108 ++AS_IF([test $host_cpu = aarch64], [AC_DEFINE([HAVE_RNDR],1,[Enable RNDR])],[])
109 + AM_CONDITIONAL([JITTER], [false])
110 +
111 + AC_ARG_ENABLE(jitterentropy,
112
113 diff --git a/sys-apps/rng-tools/rng-tools-6.13.ebuild b/sys-apps/rng-tools/rng-tools-6.13.ebuild
114 new file mode 100644
115 index 00000000000..b4a1ee5c700
116 --- /dev/null
117 +++ b/sys-apps/rng-tools/rng-tools-6.13.ebuild
118 @@ -0,0 +1,73 @@
119 +# Copyright 1999-2021 Gentoo Authors
120 +# Distributed under the terms of the GNU General Public License v2
121 +
122 +EAPI=7
123 +
124 +inherit autotools systemd readme.gentoo-r1 toolchain-funcs
125 +
126 +DESCRIPTION="Daemon to use hardware random number generators"
127 +HOMEPAGE="https://github.com/nhorman/rng-tools"
128 +SRC_URI="https://github.com/nhorman/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
129 +
130 +LICENSE="GPL-2"
131 +SLOT="0"
132 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~riscv ~x86"
133 +IUSE="jitterentropy nistbeacon pkcs11 selinux"
134 +
135 +DEPEND="
136 + dev-libs/openssl:0=
137 + jitterentropy? ( app-crypt/jitterentropy:= )
138 + nistbeacon? (
139 + dev-libs/jansson
140 + dev-libs/libxml2:2=
141 + net-misc/curl[ssl]
142 + )
143 + pkcs11? ( dev-libs/libp11:= )
144 + elibc_musl? ( sys-libs/argp-standalone )"
145 +RDEPEND="${DEPEND}
146 + selinux? ( sec-policy/selinux-rngd )"
147 +BDEPEND="virtual/pkgconfig"
148 +
149 +PATCHES=(
150 + # backport, remove on bump
151 + "${FILESDIR}"/${P}-various-autotools-fixups.patch
152 +)
153 +
154 +src_prepare() {
155 + default
156 + eautoreconf
157 +}
158 +
159 +src_configure() {
160 + local myeconfargs=(
161 + $(use_enable jitterentropy)
162 + $(use_with nistbeacon)
163 + $(use_with pkcs11)
164 + --without-rtlsdr # no librtlsdr in the tree
165 + )
166 +
167 + econf "${myeconfargs[@]}"
168 +}
169 +
170 +src_install() {
171 + default
172 +
173 + newinitd "${FILESDIR}"/rngd-initd-6.11 rngd
174 + newconfd "${FILESDIR}"/rngd-confd-6.11 rngd
175 + systemd_dounit rngd.service
176 +
177 + if use pkcs11; then
178 + local DISABLE_AUTOFORMATTING=1
179 + local DOC_CONTENTS="
180 +The PKCS11 entropy source may require extra packages (e.g. 'dev-libs/opensc')
181 +to support various smartcard readers. Make sure 'PKCS11_OPTIONS' in:
182 + '${EPREFIX}/etc/conf.d/rngd'
183 +reflects the correct PKCS11 engine path to be used by rngd.
184 +"
185 + readme.gentoo_create_doc
186 + fi
187 +}
188 +
189 +pkg_postinst() {
190 + use pkcs11 && readme.gentoo_print_elog
191 +}