Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/util-linux/
Date: Fri, 16 Apr 2021 12:37:44
Message-Id: 1618576645.aa1e037908fd5a41f69ee28775eae1aace149e98.polynomial-c@gentoo
1 commit: aa1e037908fd5a41f69ee28775eae1aace149e98
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 16 12:36:14 2021 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 16 12:37:25 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa1e0379
7
8 sys-apps/util-linux: Synced live ebuild
9
10 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
11
12 sys-apps/util-linux/util-linux-9999.ebuild | 73 +++++++++++++++++++++++-------
13 1 file changed, 56 insertions(+), 17 deletions(-)
14
15 diff --git a/sys-apps/util-linux/util-linux-9999.ebuild b/sys-apps/util-linux/util-linux-9999.ebuild
16 index 1a657d941ca..a4c2dbb25ac 100644
17 --- a/sys-apps/util-linux/util-linux-9999.ebuild
18 +++ b/sys-apps/util-linux/util-linux-9999.ebuild
19 @@ -1,9 +1,9 @@
20 -# Copyright 1999-2020 Gentoo Authors
21 +# Copyright 1999-2021 Gentoo Authors
22 # Distributed under the terms of the GNU General Public License v2
23
24 EAPI=7
25
26 -PYTHON_COMPAT=( python3_{7,8,9} )
27 +PYTHON_COMPAT=( python3_{7..9} )
28
29 inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 usr-ldscript \
30 pam python-r1 multilib-minimal multiprocessing systemd
31 @@ -17,7 +17,8 @@ if [[ ${PV} == 9999 ]] ; then
32 else
33 [[ "${PV}" = *_rc* ]] || \
34 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
35 - SRC_URI="https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
36 + SRC_URI="https://www.kernel.org/pub/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz
37 + https://dev.gentoo.org/~polynomial-c/${MY_P}-manpages.tar.xz"
38 fi
39
40 DESCRIPTION="Various useful Linux utilities"
41 @@ -68,7 +69,15 @@ RDEPEND+="
42 !>=sys-apps/shadow-4.7-r2[su]
43 )
44 !net-wireless/rfkill
45 - !<app-shells/bash-completion-2.7-r1"
46 + !<app-shells/bash-completion-2.7-r1
47 +"
48 +
49 +# Required for man-page generation
50 +if [[ "${PV}" == 9999 ]] ; then
51 + BDEPEND+="
52 + dev-ruby/asciidoctor
53 + "
54 +fi
55
56 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
57 RESTRICT="!test? ( test )"
58 @@ -78,6 +87,15 @@ S="${WORKDIR}/${MY_P}"
59 PATCHES=(
60 )
61
62 +rm_man() {
63 + [[ -n $1 ]] || die
64 + local el
65 + for el in $1 ; do
66 + find "${WORKDIR}/man" -type f -name "${el}.?" -delete \
67 + || die
68 + done
69 +}
70 +
71 src_prepare() {
72 default
73
74 @@ -86,7 +104,7 @@ src_prepare() {
75 -e "s|UUIDD_SOCKET=\"\$(mktemp -u \"\${TS_OUTDIR}/uuiddXXXXXXXXXXXXX\")\"|UUIDD_SOCKET=\"\$(mktemp -u \"${T}/uuiddXXXXXXXXXXXXX.sock\")\"|g" \
76 tests/ts/uuid/uuidd || die "Failed to fix uuidd test"
77
78 - if ! use userland_GNU; then
79 + if ! use userland_GNU ; then
80 # test runner is using GNU-specific xargs call
81 sed -i -e 's:xargs:gxargs:' tests/run.sh || die
82 # test requires util-linux uuidgen (which we don't build)
83 @@ -96,6 +114,14 @@ src_prepare() {
84 if [[ ${PV} == 9999 ]] ; then
85 po/update-potfiles
86 eautoreconf
87 + else
88 + # Conditionally remove some man-pages
89 + use hardlink || rm_man "hardlink"
90 + use kill || rm_man "kill"
91 + use logger || rm_man "logger"
92 + use ncurses || rm_man "pg"
93 + use su || rm_man "su"
94 + use tty-helpers || rm_man "mesg wall write"
95 fi
96
97 elibtoolize
98 @@ -122,7 +148,7 @@ python_configure() {
99 --without-systemdsystemunitdir
100 --with-python
101 )
102 - if use userland_GNU; then
103 + if use userland_GNU ; then
104 myeconfargs+=(
105 --enable-libblkid
106 --enable-libmount
107 @@ -174,12 +200,14 @@ multilib_src_configure() {
108 $(use_with selinux)
109 )
110 # build programs only on GNU, on *BSD we want libraries only
111 - if multilib_is_native_abi && use userland_GNU; then
112 + if multilib_is_native_abi && use userland_GNU ; then
113 myeconfargs+=(
114 --disable-chfn-chsh
115 --disable-login
116 + --disable-newgrp
117 --disable-nologin
118 --disable-pylibmount
119 + --disable-vipw
120 --enable-agetty
121 --enable-bash-completion
122 --enable-line
123 @@ -202,9 +230,16 @@ multilib_src_configure() {
124 $(use_enable tty-helpers write)
125 $(use_with cryptsetup)
126 )
127 + if [[ ${PV} == *9999 ]] ; then
128 + myeconfargs+=( --enable-asciidoc )
129 + else
130 + # We ship pre-generated man-pages for releases
131 + myeconfargs+=( --disable-asciidoc )
132 + fi
133 else
134 myeconfargs+=(
135 --disable-all-programs
136 + --disable-asciidoc
137 --disable-bash-completion
138 --without-systemdsystemunitdir
139 # build libraries
140 @@ -213,7 +248,7 @@ multilib_src_configure() {
141 --enable-libsmartcols
142 --enable-libfdisk
143 )
144 - if use userland_GNU; then
145 + if use userland_GNU ; then
146 # those libraries don't work on *BSD
147 myeconfargs+=(
148 --enable-libmount
149 @@ -222,7 +257,7 @@ multilib_src_configure() {
150 fi
151 ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
152
153 - if multilib_is_native_abi && use python; then
154 + if multilib_is_native_abi && use python ; then
155 python_foreach_impl python_configure
156 fi
157 }
158 @@ -236,7 +271,7 @@ python_compile() {
159 multilib_src_compile() {
160 emake all
161
162 - if multilib_is_native_abi && use python; then
163 + if multilib_is_native_abi && use python ; then
164 python_foreach_impl python_compile
165 fi
166 }
167 @@ -249,7 +284,7 @@ python_test() {
168
169 multilib_src_test() {
170 emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
171 - if multilib_is_native_abi && use python; then
172 + if multilib_is_native_abi && use python ; then
173 python_foreach_impl python_test
174 fi
175 }
176 @@ -262,14 +297,14 @@ python_install() {
177 }
178
179 multilib_src_install() {
180 - if multilib_is_native_abi && use python; then
181 + if multilib_is_native_abi && use python ; then
182 python_foreach_impl python_install
183 fi
184
185 # This needs to be called AFTER python_install call (#689190)
186 emake DESTDIR="${D}" install
187
188 - if multilib_is_native_abi && use userland_GNU; then
189 + if multilib_is_native_abi && use userland_GNU ; then
190 # need the libs in /
191 gen_usr_ldscript -a blkid fdisk mount smartcols uuid
192 fi
193 @@ -281,13 +316,17 @@ multilib_src_install_all() {
194 # e2fsprogs-libs didnt install .la files, and .pc work fine
195 find "${ED}" -name "*.la" -delete || die
196
197 - if ! use userland_GNU; then
198 + if [[ ${PV} != 9999 ]] ; then
199 + doman "${WORKDIR}"/man/man*/*
200 + fi
201 +
202 + if ! use userland_GNU ; then
203 # manpage collisions
204 # TODO: figure out a good way to keep them
205 rm "${ED}"/usr/share/man/man3/uuid* || die
206 fi
207
208 - if use pam; then
209 + if use pam ; then
210 newpamd "${FILESDIR}/runuser.pamd" runuser
211 newpamd "${FILESDIR}/runuser-l.pamd" runuser-l
212 fi
213 @@ -302,11 +341,11 @@ multilib_src_install_all() {
214 }
215
216 pkg_postinst() {
217 - if ! use tty-helpers; then
218 + if ! use tty-helpers ; then
219 elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
220 fi
221
222 - if [[ -z ${REPLACING_VERSIONS} ]]; then
223 + if [[ -z ${REPLACING_VERSIONS} ]] ; then
224 elog "The agetty util now clears the terminal by default. You"
225 elog "might want to add --noclear to your /etc/inittab lines."
226 fi