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: Sun, 19 Mar 2023 06:07:12
Message-Id: 1679204258.5c2b7ece52f33330db0658d46932834381a8bf29.sam@gentoo
1 commit: 5c2b7ece52f33330db0658d46932834381a8bf29
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 19 05:37:38 2023 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 19 05:37:38 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c2b7ece
7
8 sys-apps/util-linux: add 2.39_rc1 (unkeyworded)
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 sys-apps/util-linux/Manifest | 3 +
13 .../files/util-linux-2.39_rc1-test-build.patch | 33 ++
14 sys-apps/util-linux/util-linux-2.39_rc1.ebuild | 391 +++++++++++++++++++++
15 3 files changed, 427 insertions(+)
16
17 diff --git a/sys-apps/util-linux/Manifest b/sys-apps/util-linux/Manifest
18 index 0748d8f9a93e..8026f61fcccc 100644
19 --- a/sys-apps/util-linux/Manifest
20 +++ b/sys-apps/util-linux/Manifest
21 @@ -1,3 +1,6 @@
22 DIST util-linux-2.37.4.tar.xz 6114232 BLAKE2B 7f6cd12ec9bc68a6db787be78c1ee19fdfbb37710df36d4278d869676ba531afd414097e57e5287efed6c7c80d6b6ef36d5812ff2bea611080d3ce5bf5ad4ac5 SHA512 ada2629b0a8e83ea83513e04f7b1ccceb3b8ab82acd119c5d8389d1abc48c92d0b591f39fb34b1fd65db3ab630f03a672a9f3dacf1a6e4f124bdb083fc1be6d7
23 DIST util-linux-2.38.1.tar.sign 833 BLAKE2B 2468c6b8c881d7a17666aac954edfd421085111937f5d0daada37a679e9bbfe61fc98bb57cca9bf7bea20be483f38e2a758039f9baf5b1a901852e2b5dd014d8 SHA512 d8b3e936065ae1dc105b8ce773c874bb037ebf84ee571676509543f79c39950180e7f252c6b0d4500119568ed4ac3aa7117793de839f983e9287f26649e91dad
24 DIST util-linux-2.38.1.tar.xz 7495904 BLAKE2B a0e86ca62f82adaccc01ad6ec5a058dac429b81c310989cbad136f96c2770c60bbd4287067817520e8e0653146a10f13128e0af32122402bab416e1c2d6680b8 SHA512 07f11147f67dfc6c8bc766dfc83266054e6ede776feada0566b447d13276b6882ee85c6fe53e8d94a17c03332106fc0549deca3cf5f2e92dda554e9bc0551957
25 +DIST util-linux-2.39-rc1.tar.sign 833 BLAKE2B d540ee98c09879b26a1175b00145872b518d30edc91a1d4c625da502d8fffa8a5fb7ec7f36151e5da4a0c215cc1e53acf6134d5d5842e73f43a7ad8d05d5c0c3 SHA512 00c4e573513941fcf7f254b31bdc0747df24bcfee071f27b66ebd8b30680b098ea63c0590a139bf2b29ac02033c3b1cfae126d9ac0d5829c4e85acb348a643b7
26 +DIST util-linux-2.39-rc1.tar.xz 8083996 BLAKE2B a74d3b40540cd31c34c37caca20a2cd6691cfdf664da0a4a5b6c04201204d2cd6d357861f15dd41532aceb1adf3def7422f2c987ea79875330ca7c09039f03e8 SHA512 e9981d7c65eed7cd3f96f590e2190c7c804b1767464c821cd9277c72aaf38b8407f324cf9e8f3b96eb96359a0746f21a01dfb6baa504f49c8c7e1aff2dc956b3
27 +DIST util-linux-2.39_rc1-autotools-regenerate.patch.xz 17616 BLAKE2B 8bf56506f915b7c24bb47c6591b93bc132c3a4bbee9bd8bb78df03b08723cd1103b7ea34b6e53042aa38a1822007628c26f97e8aa8efae170765cbf9e710276b SHA512 e73e5b11a52a0e8ad0bda83fa5a5b41c06f452d6f34a42ad8714968261e0990ba2afda04f9bb3389c61a5fc67182701b9d44c4ead69cae6d268083f94191a977
28
29 diff --git a/sys-apps/util-linux/files/util-linux-2.39_rc1-test-build.patch b/sys-apps/util-linux/files/util-linux-2.39_rc1-test-build.patch
30 new file mode 100644
31 index 000000000000..5fdb5a51bb9e
32 --- /dev/null
33 +++ b/sys-apps/util-linux/files/util-linux-2.39_rc1-test-build.patch
34 @@ -0,0 +1,33 @@
35 +https://github.com/util-linux/util-linux/issues/2119
36 +https://github.com/util-linux/util-linux/commit/bccae5d85831c4cfa6b5d147acec739bd3c148b9
37 +
38 +From bccae5d85831c4cfa6b5d147acec739bd3c148b9 Mon Sep 17 00:00:00 2001
39 +From: Karel Zak <kzak@××××××.com>
40 +Date: Fri, 17 Mar 2023 13:11:50 +0100
41 +Subject: [PATCH] build-sys: fix libblkid fuzz sample test if-endif
42 +
43 +All tests have to be covered by BUILD_LIBBLKID_TESTS otherwise
44 +proper CFLAGS ($blkid_tests_cflags) are undefined.
45 +
46 +Fixes: https://github.com/util-linux/util-linux/issues/2119
47 +Signed-off-by: Karel Zak <kzak@××××××.com>
48 +--- a/libblkid/src/Makemodule.am
49 ++++ b/libblkid/src/Makemodule.am
50 +@@ -224,8 +224,6 @@ test_blkid_fuzz_LDFLAGS = $(blkid_tests_ldflags) -lpthread
51 + test_blkid_fuzz_LDADD = $(blkid_tests_ldadd) $(LIB_FUZZING_ENGINE)
52 + endif
53 +
54 +-endif # BUILD_LIBBLKID_TESTS
55 +-
56 + check_PROGRAMS += test_blkid_fuzz_sample
57 +
58 + test_blkid_fuzz_sample_SOURCES = libblkid/src/fuzz.c
59 +@@ -234,6 +232,7 @@ test_blkid_fuzz_sample_CFLAGS = $(blkid_tests_cflags)
60 + test_blkid_fuzz_sample_LDFLAGS = $(blkid_tests_ldflags)
61 + test_blkid_fuzz_sample_LDADD = $(blkid_tests_ldadd)
62 +
63 ++endif # BUILD_LIBBLKID_TESTS
64 +
65 + # move lib from $(usrlib_execdir) to $(libdir) if needed
66 + install-exec-hook-libblkid:
67 +
68
69 diff --git a/sys-apps/util-linux/util-linux-2.39_rc1.ebuild b/sys-apps/util-linux/util-linux-2.39_rc1.ebuild
70 new file mode 100644
71 index 000000000000..0e42fe563e2b
72 --- /dev/null
73 +++ b/sys-apps/util-linux/util-linux-2.39_rc1.ebuild
74 @@ -0,0 +1,391 @@
75 +# Copyright 1999-2023 Gentoo Authors
76 +# Distributed under the terms of the GNU General Public License v2
77 +
78 +EAPI=8
79 +
80 +PYTHON_COMPAT=( python3_{9..11} )
81 +
82 +inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 usr-ldscript \
83 + pam python-r1 multilib-minimal multiprocessing systemd
84 +
85 +MY_PV="${PV/_/-}"
86 +MY_P="${PN}-${MY_PV}"
87 +
88 +if [[ ${PV} == 9999 ]] ; then
89 + EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
90 + inherit autotools git-r3
91 +else
92 + VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/karelzak.asc
93 + inherit verify-sig
94 +
95 + if [[ ${PV} != *_rc* ]] ; then
96 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
97 + fi
98 +
99 + SRC_URI="https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
100 + SRC_URI+=" verify-sig? ( https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.sign )"
101 +
102 + # Drop on next release, it's just here for ${P}-test-build.patch
103 + SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-autotools-regenerate.patch.xz"
104 +fi
105 +
106 +S="${WORKDIR}/${MY_P}"
107 +
108 +DESCRIPTION="Various useful Linux utilities"
109 +HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/ https://github.com/util-linux/util-linux"
110 +
111 +LICENSE="GPL-2 GPL-3 LGPL-2.1 BSD-4 MIT public-domain"
112 +SLOT="0"
113 +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"
114 +
115 +# Most lib deps here are related to programs rather than our libs,
116 +# so we rarely need to specify ${MULTILIB_USEDEP}.
117 +RDEPEND="
118 + virtual/libcrypt:=
119 + audit? ( >=sys-process/audit-2.6:= )
120 + caps? ( sys-libs/libcap-ng )
121 + cramfs? ( sys-libs/zlib:= )
122 + cryptsetup? ( >=sys-fs/cryptsetup-2.1.0 )
123 + hardlink? ( dev-libs/libpcre2:= )
124 + ncurses? (
125 + sys-libs/ncurses:=[unicode(+)?]
126 + magic? ( sys-apps/file:0= )
127 + )
128 + nls? ( virtual/libintl[${MULTILIB_USEDEP}] )
129 + pam? ( sys-libs/pam )
130 + python? ( ${PYTHON_DEPS} )
131 + readline? ( sys-libs/readline:0= )
132 + rtas? ( sys-libs/librtas )
133 + selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
134 + slang? ( sys-libs/slang )
135 + !build? ( systemd? ( sys-apps/systemd ) )
136 + udev? ( virtual/libudev:= )"
137 +BDEPEND="
138 + virtual/pkgconfig
139 + nls? ( sys-devel/gettext )
140 + test? ( sys-devel/bc )
141 +"
142 +DEPEND="
143 + ${RDEPEND}
144 + virtual/os-headers
145 + acct-group/root
146 +"
147 +RDEPEND+="
148 + hardlink? ( !app-arch/hardlink )
149 + logger? ( !>=app-admin/sysklogd-2.0[logger] )
150 + kill? (
151 + !sys-apps/coreutils[kill]
152 + !sys-process/procps[kill]
153 + )
154 + su? (
155 + !<sys-apps/shadow-4.7-r2
156 + !>=sys-apps/shadow-4.7-r2[su]
157 + )
158 + !net-wireless/rfkill
159 +"
160 +
161 +if [[ ${PV} == 9999 ]] ; then
162 + # Required for man-page generation
163 + BDEPEND+=" dev-ruby/asciidoctor"
164 +else
165 + BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-karelzak )"
166 +fi
167 +
168 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) su? ( pam )"
169 +RESTRICT="!test? ( test )"
170 +
171 +PATCHES=(
172 + "${FILESDIR}"/${P}-test-build.patch
173 + "${WORKDIR}"/${P}-autotools-regenerate.patch
174 +)
175 +
176 +pkg_pretend() {
177 + if use su && ! use suid ; then
178 + elog "su will be installed as suid despite USE=-suid (bug #832092)"
179 + elog "To use su without suid, see e.g. Portage's suidctl feature."
180 + fi
181 +}
182 +
183 +src_unpack() {
184 + if [[ ${PV} == 9999 ]] ; then
185 + git-r3_src_unpack
186 + return
187 + fi
188 +
189 + if use verify-sig ; then
190 + mkdir "${T}"/verify-sig || die
191 + pushd "${T}"/verify-sig &>/dev/null || die
192 +
193 + # Upstream sign the decompressed .tar
194 + # Let's do it separately in ${T} then cleanup to avoid external
195 + # effects on normal unpack.
196 + cp "${DISTDIR}"/${MY_P}.tar.xz . || die
197 + xz -d ${MY_P}.tar.xz || die
198 + verify-sig_verify_detached ${MY_P}.tar "${DISTDIR}"/${MY_P}.tar.sign
199 +
200 + popd &>/dev/null || die
201 + rm -r "${T}"/verify-sig || die
202 + fi
203 +
204 + default
205 +}
206 +
207 +src_prepare() {
208 + default
209 +
210 + if use test ; then
211 + # Prevent uuidd test failure due to socket path limit, bug #593304
212 + sed -i \
213 + -e "s|UUIDD_SOCKET=\"\$(mktemp -u \"\${TS_OUTDIR}/uuiddXXXXXXXXXXXXX\")\"|UUIDD_SOCKET=\"\$(mktemp -u \"${T}/uuiddXXXXXXXXXXXXX.sock\")\"|g" \
214 + tests/ts/uuid/uuidd || die "Failed to fix uuidd test"
215 +
216 + # Known-failing tests
217 + # TODO: investigate these
218 + local known_failing_tests=(
219 + # Subtest 'options-maximum-size-8192' fails
220 + hardlink/options
221 +
222 + lsfd/mkfds-symlink
223 + lsfd/mkfds-rw-character-device
224 + )
225 +
226 + local known_failing_test
227 + for known_failing_test in "${known_failing_tests[@]}" ; do
228 + einfo "Removing known-failing test: ${known_failing_test}"
229 + rm tests/ts/${known_failing_test} || die
230 + done
231 +
232 + fi
233 +
234 + if [[ ${PV} == 9999 ]] ; then
235 + po/update-potfiles
236 + eautoreconf
237 + else
238 + elibtoolize
239 + fi
240 +}
241 +
242 +python_configure() {
243 + local myeconfargs=(
244 + "${commonargs[@]}"
245 + --disable-all-programs
246 + --disable-bash-completion
247 + --without-systemdsystemunitdir
248 + --with-python
249 + --enable-libblkid
250 + --enable-libmount
251 + --enable-pylibmount
252 + )
253 +
254 + mkdir "${BUILD_DIR}" || die
255 + pushd "${BUILD_DIR}" >/dev/null || die
256 + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
257 + popd >/dev/null || die
258 +}
259 +
260 +multilib_src_configure() {
261 + # The scanf test in a run-time test which fails while cross-compiling.
262 + # Blindly assume a POSIX setup since we require libmount, and libmount
263 + # itself fails when the scanf test fails. bug #531856
264 + tc-is-cross-compiler && export scanf_cv_alloc_modifier=ms
265 +
266 + # bug #485486
267 + export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam)
268 + # bug #545042
269 + export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam)
270 +
271 + # Undo bad ncurses handling by upstream. Fall back to pkg-config.
272 + # bug #601530
273 + export NCURSES6_CONFIG=false NCURSES5_CONFIG=false
274 + export NCURSESW6_CONFIG=false NCURSESW5_CONFIG=false
275 +
276 + # Avoid automagic dependency on ppc*
277 + export ac_cv_lib_rtas_rtas_get_sysparm=$(usex rtas)
278 +
279 + # configure args shared by python and non-python builds
280 + local commonargs=(
281 + --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
282 + )
283 +
284 + local myeconfargs=(
285 + "${commonargs[@]}"
286 + --with-bashcompletiondir="$(get_bashcompdir)"
287 + --without-python
288 + $(multilib_native_use_enable suid makeinstall-chown)
289 + $(multilib_native_use_enable suid makeinstall-setuid)
290 + $(multilib_native_use_with readline)
291 + $(multilib_native_use_with slang)
292 + $(multilib_native_use_with systemd)
293 + $(multilib_native_use_with udev)
294 + $(multilib_native_usex ncurses "$(use_with magic libmagic)" '--without-libmagic')
295 + $(multilib_native_usex ncurses "$(use_with unicode ncursesw)" '--without-ncursesw')
296 + $(multilib_native_usex ncurses "$(use_with !unicode ncurses)" '--without-ncurses')
297 + $(multilib_native_use_with audit)
298 + $(tc-has-tls || echo --disable-tls)
299 + $(use_enable nls)
300 + $(use_enable unicode widechar)
301 + $(use_enable static-libs static)
302 + $(use_with ncurses tinfo)
303 + $(use_with selinux)
304 + )
305 +
306 + if multilib_is_native_abi ; then
307 + myeconfargs+=(
308 + --disable-chfn-chsh
309 + --disable-login
310 + --disable-newgrp
311 + --disable-nologin
312 + --disable-pylibmount
313 + --disable-raw
314 + --disable-vipw
315 + --enable-agetty
316 + --enable-bash-completion
317 + --enable-line
318 + --enable-partx
319 + --enable-rename
320 + --enable-rfkill
321 + --enable-schedutils
322 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
323 + $(use_enable caps setpriv)
324 + $(use_enable cramfs)
325 + $(use_enable fdformat)
326 + $(use_enable hardlink)
327 + $(use_enable kill)
328 + $(use_enable logger)
329 + $(use_enable ncurses pg)
330 + $(use_enable su)
331 + $(use_enable tty-helpers mesg)
332 + $(use_enable tty-helpers wall)
333 + $(use_enable tty-helpers write)
334 + $(use_with cryptsetup)
335 + )
336 + if [[ ${PV} == *9999 ]] ; then
337 + myeconfargs+=( --enable-asciidoc )
338 + else
339 + # Upstream is shipping pre-generated man-pages for releases
340 + myeconfargs+=( --disable-asciidoc )
341 + fi
342 + else
343 + myeconfargs+=(
344 + --disable-all-programs
345 + --disable-asciidoc
346 + --disable-bash-completion
347 + --without-systemdsystemunitdir
348 +
349 + # build libraries
350 + --enable-libuuid
351 + --enable-libblkid
352 + --enable-libsmartcols
353 + --enable-libfdisk
354 + --enable-libmount
355 + )
356 + fi
357 +
358 + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
359 +
360 + if multilib_is_native_abi && use python ; then
361 + python_foreach_impl python_configure
362 + fi
363 +}
364 +
365 +src_configure() {
366 + append-lfs-flags
367 + multilib-minimal_src_configure
368 +}
369 +
370 +python_compile() {
371 + pushd "${BUILD_DIR}" >/dev/null || die
372 + emake all
373 + popd >/dev/null || die
374 +}
375 +
376 +multilib_src_compile() {
377 + emake all
378 +
379 + if multilib_is_native_abi && use python ; then
380 + python_foreach_impl python_compile
381 + fi
382 +}
383 +
384 +python_test() {
385 + pushd "${BUILD_DIR}" >/dev/null || die
386 + emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
387 + popd >/dev/null || die
388 +}
389 +
390 +multilib_src_test() {
391 + emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
392 + if multilib_is_native_abi && use python ; then
393 + python_foreach_impl python_test
394 + fi
395 +}
396 +
397 +python_install() {
398 + pushd "${BUILD_DIR}" >/dev/null || die
399 + emake DESTDIR="${D}" install
400 + python_optimize
401 + popd >/dev/null || die
402 +}
403 +
404 +multilib_src_install() {
405 + if multilib_is_native_abi && use python ; then
406 + python_foreach_impl python_install
407 + fi
408 +
409 + # This needs to be called AFTER python_install call, bug #689190
410 + emake DESTDIR="${D}" install
411 +
412 + if multilib_is_native_abi ; then
413 + # Need the libs in /
414 + gen_usr_ldscript -a blkid fdisk mount smartcols uuid
415 + fi
416 +}
417 +
418 +multilib_src_install_all() {
419 + dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
420 +
421 + # e2fsprogs-libs didn't install .la files, and .pc work fine
422 + find "${ED}" -name "*.la" -delete || die
423 +
424 + if use pam ; then
425 + # See https://github.com/util-linux/util-linux/blob/master/Documentation/PAM-configuration.txt
426 + newpamd "${FILESDIR}/runuser.pamd" runuser
427 + newpamd "${FILESDIR}/runuser-l.pamd" runuser-l
428 +
429 + newpamd "${FILESDIR}/su-l.pamd" su-l
430 + fi
431 +
432 + if use su && ! use suid ; then
433 + # Always force suid su, even when USE=-suid, as su is useless
434 + # for the overwhelming-majority case without suid.
435 + # Users who wish to truly have a no-suid su can strip it out
436 + # via e.g. Portage's suidctl or some other hook.
437 + # See bug #832092
438 + fperms u+s /bin/su
439 + fi
440 +
441 + # Note:
442 + # Bash completion for "runuser" command is provided by same file which
443 + # would also provide bash completion for "su" command. However, we don't
444 + # use "su" command from this package.
445 + # This triggers a known QA warning which we ignore for now to magically
446 + # keep bash completion for "su" command which shadow package does not
447 + # provide.
448 +
449 + local ver=$(tools/git-version-gen .tarballversion)
450 + local major=$(ver_cut 1 ${ver})
451 + local minor=$(ver_cut 2 ${ver})
452 + local release=$(ver_cut 3 ${ver})
453 + export QA_PKGCONFIG_VERSION="${major}.${minor}.${release:-0}"
454 +}
455 +
456 +pkg_postinst() {
457 + if ! use tty-helpers ; then
458 + elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
459 + fi
460 +
461 + if [[ -z ${REPLACING_VERSIONS} ]] ; then
462 + elog "The agetty util now clears the terminal by default. You"
463 + elog "might want to add --noclear to your /etc/inittab lines."
464 + fi
465 +}