Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/util-linux/, sys-apps/util-linux/files/
Date: Mon, 24 Jan 2022 16:02:53
Message-Id: 1643039909.d5f5f2e564e448f86dee8c0271152c0dc47754d4.sam@gentoo
1 commit: d5f5f2e564e448f86dee8c0271152c0dc47754d4
2 Author: Mathieu Tortuyaux <mtortuyaux <AT> microsoft <DOT> com>
3 AuthorDate: Mon Jan 24 15:50:45 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 24 15:58:29 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5f5f2e5
7
8 sys-apps/util-linux: bump to version 2.37.3
9
10 Bug: https://bugs.gentoo.org/831978
11 Package-Manager: Portage-3.0.28, Repoman-3.0.3
12 Signed-off-by: Mathieu Tortuyaux <mtortuyaux <AT> microsoft.com>
13 Closes: https://github.com/gentoo/gentoo/pull/23940
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 sys-apps/util-linux/Manifest | 1 +
17 .../util-linux-2.37.3-ioctl_ns-test-hang.patch | 37 +++
18 sys-apps/util-linux/util-linux-2.37.3.ebuild | 317 +++++++++++++++++++++
19 3 files changed, 355 insertions(+)
20
21 diff --git a/sys-apps/util-linux/Manifest b/sys-apps/util-linux/Manifest
22 index 89d96ed01375..827106be8db1 100644
23 --- a/sys-apps/util-linux/Manifest
24 +++ b/sys-apps/util-linux/Manifest
25 @@ -1 +1,2 @@
26 DIST util-linux-2.37.2.tar.xz 5621624 BLAKE2B 40ab80485781dfc58e6d0e98dae115b96f11ee0cc370524e1e13d3c4a4dfed3a5a4a248311f8ca645f6f84bbaf4785412ca8282b840af4e37a01312764885abe SHA512 38f0fe820445e3bfa79550e6581c230f98c7661566ccc4daa51c7208a5f972c61b4e57dfc86bed074fdbc7c40bc79f856be8f6a05a8860c1c0cecc4208e8b81d
27 +DIST util-linux-2.37.3.tar.xz 6126260 BLAKE2B 6a541dd1f243f0fc303cd813b50be3e0edd8dc7377734aed90fe0af03321bf03fd727285e406b95a1db176572742245220f2e6e7f4d35e508e948816ec4b6345 SHA512 2303b5c55b1fd932c73b0a079d37e56e10b6a20270b72d0b7e81ec7a6b715b42ebaa336714c3e1722d05e5aa4499f8be17ceaf61bb1341532bf9697c9a2174e9
28
29 diff --git a/sys-apps/util-linux/files/util-linux-2.37.3-ioctl_ns-test-hang.patch b/sys-apps/util-linux/files/util-linux-2.37.3-ioctl_ns-test-hang.patch
30 new file mode 100644
31 index 000000000000..73dc0b40a049
32 --- /dev/null
33 +++ b/sys-apps/util-linux/files/util-linux-2.37.3-ioctl_ns-test-hang.patch
34 @@ -0,0 +1,37 @@
35 +https://github.com/karelzak/util-linux/commit/597ccb7bf564f65bb059bfe420224cab0fba46ac.patch
36 +
37 +From 597ccb7bf564f65bb059bfe420224cab0fba46ac Mon Sep 17 00:00:00 2001
38 +From: Chris Hofstaedtler <zeha@××××××.org>
39 +Date: Fri, 20 Aug 2021 10:30:50 +0000
40 +Subject: [PATCH] tests: Skip lsns/ioctl_ns test if unshare fails
41 +
42 +Some parts of the Debian build infrastructure uses unshare to run the
43 +package build, and that appears to cause a "nested" unshare in the
44 +lsns/ioctl_ns test to fail. Unfortunately the tests then hang at this
45 +point.
46 +
47 +Try running unshare before the actual test, and skip the test if unshare
48 +already fails.
49 +
50 +[kzak@××××××.com: - add --fork to the test
51 + - don't write to stdout/err]
52 +
53 +Signed-off-by: Chris Hofstaedtler <zeha@××××××.org>
54 +Signed-off-by: Karel Zak <kzak@××××××.com>
55 +---
56 + tests/ts/lsns/ioctl_ns | 2 ++
57 + 1 file changed, 2 insertions(+)
58 +
59 +diff --git a/tests/ts/lsns/ioctl_ns b/tests/ts/lsns/ioctl_ns
60 +index ef6360607..fa626bfda 100755
61 +--- a/tests/ts/lsns/ioctl_ns
62 ++++ b/tests/ts/lsns/ioctl_ns
63 +@@ -34,6 +34,8 @@ ts_check_prog "mkfifo"
64 + ts_check_prog "touch"
65 + ts_check_prog "uniq"
66 +
67 ++$TS_CMD_UNSHARE --user --pid --mount-proc --fork true &> /dev/null || ts_skip "no namespace support"
68 ++
69 + ts_cd "$TS_OUTDIR"
70 +
71 + # The parent process receives namespaces ids via FIFO_DATA from bash
72
73 diff --git a/sys-apps/util-linux/util-linux-2.37.3.ebuild b/sys-apps/util-linux/util-linux-2.37.3.ebuild
74 new file mode 100644
75 index 000000000000..29ca2387ed7a
76 --- /dev/null
77 +++ b/sys-apps/util-linux/util-linux-2.37.3.ebuild
78 @@ -0,0 +1,317 @@
79 +# Copyright 1999-2022 Gentoo Authors
80 +# Distributed under the terms of the GNU General Public License v2
81 +
82 +EAPI=7
83 +
84 +PYTHON_COMPAT=( python3_{8,9,10} )
85 +
86 +inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 usr-ldscript \
87 + pam python-r1 multilib-minimal multiprocessing systemd
88 +
89 +MY_PV="${PV/_/-}"
90 +MY_P="${PN}-${MY_PV}"
91 +
92 +if [[ ${PV} == 9999 ]] ; then
93 + inherit git-r3 autotools
94 + EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
95 +else
96 + [[ "${PV}" = *_rc* ]] || \
97 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
98 + SRC_URI="https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
99 +fi
100 +
101 +DESCRIPTION="Various useful Linux utilities"
102 +HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/ https://github.com/karelzak/util-linux"
103 +
104 +LICENSE="GPL-2 GPL-3 LGPL-2.1 BSD-4 MIT public-domain"
105 +SLOT="0"
106 +IUSE="audit build caps +cramfs cryptsetup fdformat +hardlink kill +logger magic ncurses nls pam python +readline rtas selinux slang static-libs +su +suid systemd test tty-helpers udev unicode"
107 +
108 +# Most lib deps here are related to programs rather than our libs,
109 +# so we rarely need to specify ${MULTILIB_USEDEP}.
110 +RDEPEND="
111 + virtual/libcrypt:=
112 + audit? ( >=sys-process/audit-2.6:= )
113 + caps? ( sys-libs/libcap-ng )
114 + cramfs? ( sys-libs/zlib:= )
115 + cryptsetup? ( >=sys-fs/cryptsetup-2.1.0 )
116 + hardlink? ( dev-libs/libpcre2:= )
117 + ncurses? (
118 + sys-libs/ncurses:=[unicode(+)?]
119 + magic? ( sys-apps/file:0= )
120 + )
121 + nls? ( virtual/libintl[${MULTILIB_USEDEP}] )
122 + pam? ( sys-libs/pam )
123 + python? ( ${PYTHON_DEPS} )
124 + readline? ( sys-libs/readline:0= )
125 + rtas? ( sys-libs/librtas )
126 + selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
127 + slang? ( sys-libs/slang )
128 + !build? ( systemd? ( sys-apps/systemd ) )
129 + udev? ( virtual/libudev:= )"
130 +BDEPEND="
131 + virtual/pkgconfig
132 + nls? ( sys-devel/gettext )
133 + test? ( sys-devel/bc )
134 +"
135 +DEPEND="
136 + ${RDEPEND}
137 + virtual/os-headers
138 +"
139 +RDEPEND+="
140 + hardlink? ( !app-arch/hardlink )
141 + logger? ( !>=app-admin/sysklogd-2.0[logger] )
142 + kill? (
143 + !sys-apps/coreutils[kill]
144 + !sys-process/procps[kill]
145 + )
146 + su? (
147 + !<sys-apps/shadow-4.7-r2
148 + !>=sys-apps/shadow-4.7-r2[su]
149 + )
150 + !net-wireless/rfkill
151 +"
152 +
153 +# Required for man-page generation
154 +if [[ "${PV}" == 9999 ]] ; then
155 + BDEPEND+="
156 + dev-ruby/asciidoctor
157 + "
158 +fi
159 +
160 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) su? ( pam )"
161 +RESTRICT="!test? ( test )"
162 +
163 +S="${WORKDIR}/${MY_P}"
164 +
165 +PATCHES=(
166 + "${FILESDIR}"/${PN}-2.37.1-agetty_ctrl-c_erase.patch #804972
167 + "${FILESDIR}"/${P}-ioctl_ns-test-hang.patch # upstream test hang patch
168 +)
169 +
170 +src_prepare() {
171 + default
172 +
173 + # Prevent uuidd test failure due to socket path limit. #593304
174 + sed -i \
175 + -e "s|UUIDD_SOCKET=\"\$(mktemp -u \"\${TS_OUTDIR}/uuiddXXXXXXXXXXXXX\")\"|UUIDD_SOCKET=\"\$(mktemp -u \"${T}/uuiddXXXXXXXXXXXXX.sock\")\"|g" \
176 + tests/ts/uuid/uuidd || die "Failed to fix uuidd test"
177 +
178 + if [[ ${PV} == 9999 ]] ; then
179 + po/update-potfiles
180 + eautoreconf
181 + fi
182 +
183 + elibtoolize
184 +}
185 +
186 +lfs_fallocate_test() {
187 + # Make sure we can use fallocate with LFS #300307
188 + cat <<-EOF > "${T}"/fallocate.${ABI}.c
189 + #define _GNU_SOURCE
190 + #include <fcntl.h>
191 + main() { return fallocate(0, 0, 0, 0); }
192 + EOF
193 + append-lfs-flags
194 + $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
195 + || export ac_cv_func_fallocate=no
196 + rm -f "${T}"/fallocate.${ABI}.c
197 +}
198 +
199 +python_configure() {
200 + local myeconfargs=(
201 + "${commonargs[@]}"
202 + --disable-all-programs
203 + --disable-bash-completion
204 + --without-systemdsystemunitdir
205 + --with-python
206 + --enable-libblkid
207 + --enable-libmount
208 + --enable-pylibmount
209 + )
210 + mkdir "${BUILD_DIR}" || die
211 + pushd "${BUILD_DIR}" >/dev/null || die
212 + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
213 + popd >/dev/null || die
214 +}
215 +
216 +multilib_src_configure() {
217 + lfs_fallocate_test
218 + # The scanf test in a run-time test which fails while cross-compiling.
219 + # Blindly assume a POSIX setup since we require libmount, and libmount
220 + # itself fails when the scanf test fails. #531856
221 + tc-is-cross-compiler && export scanf_cv_alloc_modifier=ms
222 + export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
223 + export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam) #545042
224 +
225 + # Undo bad ncurses handling by upstream. Fall back to pkg-config. #601530
226 + export NCURSES6_CONFIG=false NCURSES5_CONFIG=false
227 + export NCURSESW6_CONFIG=false NCURSESW5_CONFIG=false
228 +
229 + # Avoid automagic dependency on ppc*
230 + export ac_cv_lib_rtas_rtas_get_sysparm=$(usex rtas)
231 +
232 + # configure args shared by python and non-python builds
233 + local commonargs=(
234 + --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
235 + )
236 +
237 + local myeconfargs=(
238 + "${commonargs[@]}"
239 + --with-bashcompletiondir="$(get_bashcompdir)"
240 + --without-python
241 + $(multilib_native_use_enable suid makeinstall-chown)
242 + $(multilib_native_use_enable suid makeinstall-setuid)
243 + $(multilib_native_use_with readline)
244 + $(multilib_native_use_with slang)
245 + $(multilib_native_use_with systemd)
246 + $(multilib_native_use_with udev)
247 + $(multilib_native_usex ncurses "$(use_with magic libmagic)" '--without-libmagic')
248 + $(multilib_native_usex ncurses "$(use_with unicode ncursesw)" '--without-ncursesw')
249 + $(multilib_native_usex ncurses "$(use_with !unicode ncurses)" '--without-ncurses')
250 + $(multilib_native_use_with audit)
251 + $(tc-has-tls || echo --disable-tls)
252 + $(use_enable nls)
253 + $(use_enable unicode widechar)
254 + $(use_enable static-libs static)
255 + $(use_with ncurses tinfo)
256 + $(use_with selinux)
257 + )
258 + if multilib_is_native_abi ; then
259 + myeconfargs+=(
260 + --disable-chfn-chsh
261 + --disable-login
262 + --disable-newgrp
263 + --disable-nologin
264 + --disable-pylibmount
265 + --disable-raw
266 + --disable-vipw
267 + --enable-agetty
268 + --enable-bash-completion
269 + --enable-line
270 + --enable-partx
271 + --enable-rename
272 + --enable-rfkill
273 + --enable-schedutils
274 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
275 + $(use_enable caps setpriv)
276 + $(use_enable cramfs)
277 + $(use_enable fdformat)
278 + $(use_enable hardlink)
279 + $(use_enable kill)
280 + $(use_enable logger)
281 + $(use_enable ncurses pg)
282 + $(use_enable su)
283 + $(use_enable tty-helpers mesg)
284 + $(use_enable tty-helpers wall)
285 + $(use_enable tty-helpers write)
286 + $(use_with cryptsetup)
287 + )
288 + if [[ ${PV} == *9999 ]] ; then
289 + myeconfargs+=( --enable-asciidoc )
290 + else
291 + # Upstream is shipping pre-generated man-pages for releases
292 + myeconfargs+=( --disable-asciidoc )
293 + fi
294 + else
295 + myeconfargs+=(
296 + --disable-all-programs
297 + --disable-asciidoc
298 + --disable-bash-completion
299 + --without-systemdsystemunitdir
300 + # build libraries
301 + --enable-libuuid
302 + --enable-libblkid
303 + --enable-libsmartcols
304 + --enable-libfdisk
305 + --enable-libmount
306 + )
307 + fi
308 + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
309 +
310 + if multilib_is_native_abi && use python ; then
311 + python_foreach_impl python_configure
312 + fi
313 +}
314 +
315 +python_compile() {
316 + pushd "${BUILD_DIR}" >/dev/null || die
317 + emake all
318 + popd >/dev/null || die
319 +}
320 +
321 +multilib_src_compile() {
322 + emake all
323 +
324 + if multilib_is_native_abi && use python ; then
325 + python_foreach_impl python_compile
326 + fi
327 +}
328 +
329 +python_test() {
330 + pushd "${BUILD_DIR}" >/dev/null || die
331 + emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
332 + popd >/dev/null || die
333 +}
334 +
335 +multilib_src_test() {
336 + emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
337 + if multilib_is_native_abi && use python ; then
338 + python_foreach_impl python_test
339 + fi
340 +}
341 +
342 +python_install() {
343 + pushd "${BUILD_DIR}" >/dev/null || die
344 + emake DESTDIR="${D}" install
345 + python_optimize
346 + popd >/dev/null || die
347 +}
348 +
349 +multilib_src_install() {
350 + if multilib_is_native_abi && use python ; then
351 + python_foreach_impl python_install
352 + fi
353 +
354 + # This needs to be called AFTER python_install call (#689190)
355 + emake DESTDIR="${D}" install
356 +
357 + if multilib_is_native_abi ; then
358 + # need the libs in /
359 + gen_usr_ldscript -a blkid fdisk mount smartcols uuid
360 + fi
361 +}
362 +
363 +multilib_src_install_all() {
364 + dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
365 +
366 + # e2fsprogs-libs didnt install .la files, and .pc work fine
367 + find "${ED}" -name "*.la" -delete || die
368 +
369 + if use pam ; then
370 + # See https://github.com/util-linux/util-linux/blob/master/Documentation/PAM-configuration.txt
371 + newpamd "${FILESDIR}/runuser.pamd" runuser
372 + newpamd "${FILESDIR}/runuser-l.pamd" runuser-l
373 +
374 + newpamd "${FILESDIR}/su-l.pamd" su-l
375 + fi
376 +
377 + # Note:
378 + # Bash completion for "runuser" command is provided by same file which
379 + # would also provide bash completion for "su" command. However, we don't
380 + # use "su" command from this package.
381 + # This triggers a known QA warning which we ignore for now to magically
382 + # keep bash completion for "su" command which shadow package does not
383 + # provide.
384 +}
385 +
386 +pkg_postinst() {
387 + if ! use tty-helpers ; then
388 + elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
389 + fi
390 +
391 + if [[ -z ${REPLACING_VERSIONS} ]] ; then
392 + elog "The agetty util now clears the terminal by default. You"
393 + elog "might want to add --noclear to your /etc/inittab lines."
394 + fi
395 +}