Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/coreutils/
Date: Wed, 30 May 2018 23:28:40
Message-Id: 1527722905.a098327060445fe41e3eeec3bc95cc7c91b7324a.whissi@gentoo
1 commit: a098327060445fe41e3eeec3bc95cc7c91b7324a
2 Author: Matija Skala <mskala <AT> gmx <DOT> com>
3 AuthorDate: Wed May 30 23:28:04 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed May 30 23:28:25 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0983270
7
8 sys-apps/coreutils: revision bump
9
10 - move hostname to /bin per FHS
11 - add support for /usr merge
12
13 Closes: https://github.com/gentoo/gentoo/pull/8545
14 Closes: https://github.com/gentoo/gentoo/pull/8546
15 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
16
17 sys-apps/coreutils/coreutils-8.29-r1.ebuild | 205 ++++++++++++++++++++++++++++
18 sys-apps/coreutils/metadata.xml | 1 +
19 2 files changed, 206 insertions(+)
20
21 diff --git a/sys-apps/coreutils/coreutils-8.29-r1.ebuild b/sys-apps/coreutils/coreutils-8.29-r1.ebuild
22 new file mode 100644
23 index 00000000000..36ef844453e
24 --- /dev/null
25 +++ b/sys-apps/coreutils/coreutils-8.29-r1.ebuild
26 @@ -0,0 +1,205 @@
27 +# Copyright 1999-2017 Gentoo Foundation
28 +# Distributed under the terms of the GNU General Public License v2
29 +
30 +EAPI="6"
31 +
32 +PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
33 +
34 +inherit eutils flag-o-matic python-any-r1 toolchain-funcs
35 +
36 +PATCH_VER="1.0"
37 +DESCRIPTION="Standard GNU utilities (chmod, cp, dd, ls, sort, tr, head, wc, who,...)"
38 +HOMEPAGE="https://www.gnu.org/software/coreutils/"
39 +SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
40 + mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz
41 + https://dev.gentoo.org/~whissi/dist/${PN}/${P}-patches-${PATCH_VER}.tar.xz"
42 +
43 +LICENSE="GPL-3"
44 +SLOT="0"
45 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~arm-linux ~x86-linux"
46 +IUSE="acl caps gmp hostname kill multicall nls selinux +split-usr static test userland_BSD vanilla xattr"
47 +
48 +LIB_DEPEND="acl? ( sys-apps/acl[static-libs] )
49 + caps? ( sys-libs/libcap )
50 + gmp? ( dev-libs/gmp:=[static-libs] )
51 + xattr? ( !userland_BSD? ( sys-apps/attr[static-libs] ) )"
52 +RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs]} )
53 + selinux? ( sys-libs/libselinux )
54 + nls? ( virtual/libintl )"
55 +DEPEND="${RDEPEND}
56 + static? ( ${LIB_DEPEND} )
57 + app-arch/xz-utils
58 + test? (
59 + dev-lang/perl
60 + dev-perl/Expect
61 + !userland_BSD? (
62 + dev-util/strace
63 + )
64 + ${PYTHON_DEPS}
65 + $(python_gen_any_dep 'dev-python/pyinotify[${PYTHON_USEDEP}]')
66 + )"
67 +RDEPEND+="
68 + hostname? ( !sys-apps/net-tools[hostname] )
69 + kill? (
70 + !sys-apps/util-linux[kill]
71 + !sys-process/procps[kill]
72 + )
73 + !app-misc/realpath
74 + !<sys-apps/util-linux-2.13
75 + !<sys-apps/sandbox-2.10-r4
76 + !sys-apps/stat
77 + !net-mail/base64
78 + !sys-apps/mktemp
79 + !<app-forensics/tct-1.18-r1
80 + !<net-fs/netatalk-2.0.3-r4"
81 +
82 +pkg_setup() {
83 + if use test ; then
84 + python-any-r1_pkg_setup
85 + fi
86 +}
87 +
88 +src_prepare() {
89 + if ! use vanilla ; then
90 + eapply "${WORKDIR}"/patch/*.patch
91 + fi
92 +
93 + eapply_user
94 +
95 + # Since we've patched many .c files, the make process will try to
96 + # re-build the manpages by running `./bin --help`. When doing a
97 + # cross-compile, we can't do that since 'bin' isn't a native bin.
98 + # Also, it's not like we changed the usage on any of these things,
99 + # so let's just update the timestamps and skip the help2man step.
100 + set -- man/*.x
101 + touch ${@/%x/1}
102 +
103 + # Avoid perl dep for compiled in dircolors default #348642
104 + if ! has_version dev-lang/perl ; then
105 + touch src/dircolors.h
106 + touch ${@/%x/1}
107 + fi
108 +}
109 +
110 +src_configure() {
111 + local myconf=(
112 + --with-packager="Gentoo"
113 + --with-packager-version="${PVR} (p${PATCH_VER:-0})"
114 + --with-packager-bug-reports="https://bugs.gentoo.org/"
115 + --enable-install-program="arch,$(usev hostname),$(usev kill)"
116 + --enable-no-install-program="groups,$(usev !hostname),$(usev !kill),su,uptime"
117 + --enable-largefile
118 + $(use caps || echo --disable-libcap)
119 + $(use_enable nls)
120 + $(use_enable acl)
121 + $(use_enable multicall single-binary)
122 + $(use_enable xattr)
123 + $(use_with gmp)
124 + )
125 + if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
126 + export fu_cv_sys_stat_statfs2_bsize=yes #311569
127 + export gl_cv_func_realpath_works=yes #416629
128 + fi
129 +
130 + export gl_cv_func_mknod_works=yes #409919
131 + use static && append-ldflags -static && sed -i '/elf_sys=yes/s:yes:no:' configure #321821
132 + use selinux || export ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no #301782
133 + use userland_BSD && myconf+=( -program-prefix=g --program-transform-name=s/stat/nustat/ )
134 + # kill/uptime - procps
135 + # groups/su - shadow
136 + # hostname - net-tools
137 + econf "${myconf[@]}"
138 +}
139 +
140 +src_test() {
141 + # Known to fail with FEATURES=usersandbox (bug #439574):
142 + # - tests/du/long-from-unreadable.sh} (bug #413621)
143 + # - tests/rm/deep-2.sh (bug #413621)
144 + # - tests/dd/no-allocate.sh (bug #629660)
145 + if has usersandbox $FEATURES ; then
146 + ewarn "You are emerging ${P} with 'usersandbox' enabled." \
147 + "Expect some test failures or emerge with 'FEATURES=-usersandbox'!"
148 + fi
149 +
150 + # Non-root tests will fail if the full path isn't
151 + # accessible to non-root users
152 + chmod -R go-w "${WORKDIR}"
153 + chmod a+rx "${WORKDIR}"
154 +
155 + # coreutils tests like to do `mount` and such with temp dirs
156 + # so make sure /etc/mtab is writable #265725
157 + # make sure /dev/loop* can be mounted #269758
158 + mkdir -p "${T}"/mount-wrappers
159 + mkwrap() {
160 + local w ww
161 + for w in "$@" ; do
162 + ww="${T}/mount-wrappers/${w}"
163 + cat <<-EOF > "${ww}"
164 + #!${EPREFIX}/bin/sh
165 + exec env SANDBOX_WRITE="\${SANDBOX_WRITE}:/etc/mtab:/dev/loop" $(type -P $w) "\$@"
166 + EOF
167 + chmod a+rx "${ww}"
168 + done
169 + }
170 + mkwrap mount umount
171 +
172 + addwrite /dev/full
173 + #export RUN_EXPENSIVE_TESTS="yes"
174 + #export FETISH_GROUPS="portage wheel"
175 + env PATH="${T}/mount-wrappers:${PATH}" \
176 + emake -j1 -k check
177 +}
178 +
179 +src_install() {
180 + default
181 +
182 + insinto /etc
183 + newins src/dircolors.hin DIR_COLORS
184 +
185 + if [[ ${USERLAND} == "GNU" ]] ; then
186 + cd "${ED%/}"/usr/bin || die
187 + dodir /bin
188 + # move critical binaries into /bin (required by FHS)
189 + local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
190 + mkdir mknod mv pwd rm rmdir stty sync true uname"
191 + mv ${fhs} ../../bin/ || die "could not move fhs bins"
192 + if use hostname; then
193 + mv hostname ../../bin/ || die
194 + fi
195 + if use kill; then
196 + mv kill ../../bin/ || die
197 + fi
198 + if use split-usr ; then
199 + # move critical binaries into /bin (common scripts)
200 + local com="basename chroot cut dir dirname du env expr head mkfifo
201 + mktemp readlink seq sleep sort tail touch tr tty vdir wc yes"
202 + mv ${com} ../../bin/ || die "could not move common bins"
203 + # create a symlink for uname in /usr/bin/ since autotools require it
204 + local x
205 + for x in ${com} uname ; do
206 + dosym ../../bin/${x} /usr/bin/${x}
207 + done
208 + fi
209 + else
210 + # For now, drop the man pages, collides with the ones of the system.
211 + rm -rf "${ED%/}"/usr/share/man
212 + fi
213 +
214 +}
215 +
216 +pkg_postinst() {
217 + ewarn "Make sure you run 'hash -r' in your active shells."
218 + ewarn "You should also re-source your shell settings for LS_COLORS"
219 + ewarn " changes, such as: source /etc/profile"
220 +
221 + # Help out users using experimental filesystems
222 + if grep -qs btrfs "${EROOT%/}"/etc/fstab /proc/mounts ; then
223 + case $(uname -r) in
224 + 2.6.[12][0-9]|2.6.3[0-7]*)
225 + ewarn "You are running a system with a buggy btrfs driver."
226 + ewarn "Please upgrade your kernel to avoid silent corruption."
227 + ewarn "See: https://bugs.gentoo.org/353907"
228 + ;;
229 + esac
230 + fi
231 +}
232
233 diff --git a/sys-apps/coreutils/metadata.xml b/sys-apps/coreutils/metadata.xml
234 index 9241968a469..4e46af051b3 100644
235 --- a/sys-apps/coreutils/metadata.xml
236 +++ b/sys-apps/coreutils/metadata.xml
237 @@ -12,6 +12,7 @@
238 <flag name="hostname">Build the hostname program</flag>
239 <flag name="kill">Build the kill program</flag>
240 <flag name="multicall">Build all tools into a single `coreutils` program akin to busybox to save space</flag>
241 + <flag name="split-usr">Enable this if /bin and /usr/bin are separate directories</flag>
242 </use>
243 <upstream>
244 <remote-id type="cpe">cpe:/a:gnu:coreutils</remote-id>