Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/util-linux/
Date: Fri, 06 Apr 2018 11:44:23
Message-Id: 1523015004.70b464ed8fc9e9fef8725d02e8a9466fc77c104b.mgorny@gentoo
1 commit: 70b464ed8fc9e9fef8725d02e8a9466fc77c104b
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 6 09:06:01 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 6 11:43:24 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=70b464ed
7
8 sys-apps/util-linux: Backport changes from 9999 to 2.32-r1
9
10 sys-apps/util-linux/util-linux-2.32-r1.ebuild | 225 ++++++++++++++++++++++++++
11 1 file changed, 225 insertions(+)
12
13 diff --git a/sys-apps/util-linux/util-linux-2.32-r1.ebuild b/sys-apps/util-linux/util-linux-2.32-r1.ebuild
14 new file mode 100644
15 index 00000000000..76ee8160737
16 --- /dev/null
17 +++ b/sys-apps/util-linux/util-linux-2.32-r1.ebuild
18 @@ -0,0 +1,225 @@
19 +# Copyright 1999-2018 Gentoo Foundation
20 +# Distributed under the terms of the GNU General Public License v2
21 +
22 +EAPI=6
23 +
24 +PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
25 +
26 +inherit toolchain-funcs libtool flag-o-matic bash-completion-r1 \
27 + pam python-single-r1 multilib-minimal multiprocessing systemd
28 +
29 +MY_PV="${PV/_/-}"
30 +MY_P="${PN}-${MY_PV}"
31 +
32 +if [[ ${PV} == 9999 ]] ; then
33 + inherit git-r3 autotools
34 + EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
35 +else
36 + [[ "${PV}" = *_rc* ]] || \
37 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
38 + SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
39 +fi
40 +
41 +DESCRIPTION="Various useful Linux utilities"
42 +HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/"
43 +
44 +LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
45 +SLOT="0"
46 +IUSE="build caps +cramfs fdformat kill ncurses nls pam python +readline selinux slang static-libs +suid systemd test tty-helpers udev unicode userland_GNU"
47 +
48 +# Most lib deps here are related to programs rather than our libs,
49 +# so we rarely need to specify ${MULTILIB_USEDEP}.
50 +RDEPEND="caps? ( sys-libs/libcap-ng )
51 + cramfs? ( sys-libs/zlib:= )
52 + ncurses? ( >=sys-libs/ncurses-5.2-r2:0=[unicode?] )
53 + pam? ( sys-libs/pam )
54 + python? ( ${PYTHON_DEPS} )
55 + readline? ( sys-libs/readline:0= )
56 + selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
57 + slang? ( sys-libs/slang )
58 + !build? ( systemd? ( sys-apps/systemd ) )
59 + udev? ( virtual/libudev:= )"
60 +DEPEND="${RDEPEND}
61 + virtual/pkgconfig
62 + nls? ( sys-devel/gettext )
63 + test? ( sys-devel/bc )
64 + virtual/os-headers"
65 +RDEPEND+="
66 + kill? (
67 + !sys-apps/coreutils[kill]
68 + !sys-process/procps[kill]
69 + )
70 + !net-wireless/rfkill
71 + !sys-process/schedutils
72 + !sys-apps/setarch
73 + !<sys-apps/sysvinit-2.88-r7
74 + !<sys-libs/e2fsprogs-libs-1.41.8
75 + !<sys-fs/e2fsprogs-1.41.8
76 + !<app-shells/bash-completion-2.7-r1"
77 +
78 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
79 +
80 +S="${WORKDIR}/${MY_P}"
81 +
82 +pkg_setup() {
83 + use python && python-single-r1_pkg_setup
84 +}
85 +
86 +src_prepare() {
87 + default
88 +
89 + # Prevent uuidd test failure due to socket path limit. #593304
90 + sed -i \
91 + -e "s|UUIDD_SOCKET=\"\$(mktemp -u \"\${TS_OUTDIR}/uuiddXXXXXXXXXXXXX\")\"|UUIDD_SOCKET=\"\$(mktemp -u \"${T}/uuiddXXXXXXXXXXXXX.sock\")\"|g" \
92 + tests/ts/uuid/uuidd || die "Failed to fix uuidd test"
93 +
94 + if ! use userland_GNU; then
95 + # test runner is using GNU-specific xargs call
96 + sed -i -e 's:xargs:gxargs:' tests/run.sh || die
97 + # test requires util-linux uuidgen (which we don't build)
98 + rm tests/ts/uuid/oids || die
99 + fi
100 +
101 + if [[ ${PV} == 9999 ]] ; then
102 + po/update-potfiles
103 + eautoreconf
104 + fi
105 +
106 + # Undo bad ncurses handling by upstream. #601530
107 + sed -i -E \
108 + -e '/NCURSES_/s:(ncursesw?)[56]-config:$PKG_CONFIG \1:' \
109 + -e 's:(ncursesw?)[56]-config --version:$PKG_CONFIG --exists --print-errors \1:' \
110 + configure || die
111 +
112 + elibtoolize
113 +}
114 +
115 +lfs_fallocate_test() {
116 + # Make sure we can use fallocate with LFS #300307
117 + cat <<-EOF > "${T}"/fallocate.${ABI}.c
118 + #define _GNU_SOURCE
119 + #include <fcntl.h>
120 + main() { return fallocate(0, 0, 0, 0); }
121 + EOF
122 + append-lfs-flags
123 + $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
124 + || export ac_cv_func_fallocate=no
125 + rm -f "${T}"/fallocate.${ABI}.c
126 +}
127 +
128 +multilib_src_configure() {
129 + lfs_fallocate_test
130 + # The scanf test in a run-time test which fails while cross-compiling.
131 + # Blindly assume a POSIX setup since we require libmount, and libmount
132 + # itself fails when the scanf test fails. #531856
133 + tc-is-cross-compiler && export scanf_cv_alloc_modifier=ms
134 + export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
135 + export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam) #545042
136 +
137 + local myeconfargs=(
138 + --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
139 + --with-bashcompletiondir="$(get_bashcompdir)"
140 + $(multilib_native_use_enable nls)
141 + $(multilib_native_use_enable suid makeinstall-chown)
142 + $(multilib_native_use_enable suid makeinstall-setuid)
143 + $(multilib_native_use_with python)
144 + $(multilib_native_use_with readline)
145 + $(multilib_native_use_with slang)
146 + $(multilib_native_use_with systemd)
147 + $(multilib_native_use_with udev)
148 + $(multilib_native_usex ncurses "$(use_with unicode ncursesw)" '--without-ncursesw')
149 + $(multilib_native_usex ncurses "$(use_with !unicode ncurses)" '--without-ncurses')
150 + $(tc-has-tls || echo --disable-tls)
151 + $(use_enable unicode widechar)
152 + $(use_enable static-libs static)
153 + $(use_with selinux)
154 + $(usex ncurses '' '--without-tinfo')
155 + )
156 + # build programs only on GNU, on *BSD we want libraries only
157 + if multilib_is_native_abi && use userland_GNU; then
158 + myeconfargs+=(
159 + --disable-chfn-chsh
160 + --disable-login
161 + --disable-nologin
162 + --disable-su
163 + --enable-agetty
164 + --enable-bash-completion
165 + --enable-line
166 + --enable-partx
167 + --enable-raw
168 + --enable-rename
169 + --enable-rfkill
170 + --enable-schedutils
171 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
172 + $(use_enable caps setpriv)
173 + $(use_enable cramfs)
174 + $(use_enable fdformat)
175 + $(use_enable tty-helpers mesg)
176 + $(use_enable tty-helpers wall)
177 + $(use_enable tty-helpers write)
178 + $(use_enable kill)
179 + )
180 + else
181 + myeconfargs+=(
182 + --disable-all-programs
183 + --disable-bash-completion
184 + --without-systemdsystemunitdir
185 + # build libraries
186 + --enable-libuuid
187 + --enable-libblkid
188 + --enable-libsmartcols
189 + --enable-libfdisk
190 + )
191 + if use userland_GNU; then
192 + # those libraries don't work on *BSD
193 + myeconfargs+=(
194 + --enable-libmount
195 + )
196 + fi
197 + fi
198 + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
199 +}
200 +
201 +multilib_src_test() {
202 + emake check TS_OPTS="--parallel=$(makeopts_jobs) --nonroot"
203 +}
204 +
205 +multilib_src_install() {
206 + emake DESTDIR="${D}" install
207 +
208 + if multilib_is_native_abi && use userland_GNU; then
209 + # need the libs in /
210 + gen_usr_ldscript -a blkid mount smartcols uuid
211 +
212 + use python && python_optimize
213 + fi
214 +}
215 +
216 +multilib_src_install_all() {
217 + dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
218 +
219 + # e2fsprogs-libs didnt install .la files, and .pc work fine
220 + find "${ED}" -name "*.la" -delete || die
221 +
222 + if ! use userland_GNU; then
223 + # manpage collisions
224 + # TODO: figure out a good way to keep them
225 + rm "${ED%/}"/usr/share/man/man3/uuid* || die
226 + fi
227 +
228 + if use pam; then
229 + newpamd "${FILESDIR}/runuser.pamd" runuser
230 + newpamd "${FILESDIR}/runuser-l.pamd" runuser-l
231 + fi
232 +}
233 +
234 +pkg_postinst() {
235 + if ! use tty-helpers; then
236 + elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
237 + fi
238 +
239 + if [[ -z ${REPLACING_VERSIONS} ]]; then
240 + elog "The agetty util now clears the terminal by default. You"
241 + elog "might want to add --noclear to your /etc/inittab lines."
242 + fi
243 +}