Skip to content

Commit d15e79c

Browse files
committed
coreutils: prefix binaries, add alternatives
1 parent b79f4b9 commit d15e79c

1 file changed

Lines changed: 19 additions & 8 deletions

File tree

srcpkgs/coreutils/template

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Template file for 'coreutils'
22
pkgname=coreutils
33
version=9.4
4-
revision=3
4+
revision=4
55
bootstrap=yes
66
makedepends="gmp-devel acl-devel libcap-devel"
77
short_desc="GNU core utilities"
@@ -11,11 +11,22 @@ homepage="https://www.gnu.org/software/coreutils"
1111
changelog="https://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob_plain;f=NEWS;hb=HEAD"
1212
distfiles="${GNU_SITE}/coreutils/coreutils-${version}.tar.xz"
1313
checksum=ea613a4cf44612326e917201bbbcdfbd301de21ffc3b59b6e5c07e040b275e52
14-
alternatives="
15-
hostname:hostname:/usr/bin/hostname-coreutils
16-
hostname:hostname.1:/usr/share/man/man1/hostname-coreutils.1"
1714
replaces="chroot-coreutils>=0 coreutils-doc>=0 b2sum>=0"
1815

16+
_utils="[ arch b2sum base32 base64 basename basenc cat chcon chgrp chmod chown
17+
chroot cksum comm cp csplit cut date dd df dir dircolors dirname du
18+
echo env expand expr factor false fmt fold groups head hostid hostname
19+
id install join link ln logname ls md5sum mkdir mkfifo mknod mktemp mv
20+
nice nl nohup nproc numfmt od paste pathchk pinky pr printenv printf
21+
ptx pwd readlink realpath rm rmdir runcon seq sha1sum sha224sum sha256sum
22+
sha384sum sha512sum shred shuf sleep sort split stat stdbuf stty sum
23+
sync tac tail tee test timeout touch tr true truncate tsort tty uname
24+
unexpand uniq unlink users vdir wc who whoami yes"
25+
26+
for _u in $_utils; do
27+
alternatives+=" ${_u}:${_u}:/usr/bin/g${_u} ${_u}:${_u}.1:/usr/share/man/man1/g${_u}.1"
28+
done
29+
1930
if [ "$CHROOT_READY" ]; then
2031
hostmakedepends+=" perl"
2132
# allow run ./configure by root in ethereal chroot
@@ -37,6 +48,7 @@ pre_configure() {
3748
CFLAGS=-Os CXXFLAGS=-Os LDFLAGS= \
3849
$_force_unsafe_configure \
3950
./configure --prefix=${wrksrc}/coreutils-${XBPS_MACHINE} \
51+
--program-prefix=g \
4052
--enable-install-program=arch,hostname \
4153
--enable-no-install-program=kill,uptime
4254
make ${makejobs}
@@ -66,6 +78,7 @@ do_configure() {
6678
# Do not install uptime: provided by procps-ng.
6779
#
6880
env $_force_unsafe_configure ./configure ${configure_args} \
81+
--program-prefix=g \
6982
--enable-install-program=arch,hostname \
7083
--enable-no-install-program=kill,uptime \
7184
--disable-rpath
@@ -116,10 +129,8 @@ do_install() {
116129
mv ${wrksrc}/coreutils-${XBPS_MACHINE}/share/man \
117130
${DESTDIR}/usr/share
118131
# provided by procps-ng
119-
rm -f ${DESTDIR}/usr/share/man/man1/{kill,uptime}.1
132+
rm -f ${DESTDIR}/usr/share/man/man1/{gkill,guptime}.1
120133
fi
121-
mv ${DESTDIR}/usr/bin/hostname ${DESTDIR}/usr/bin/hostname-coreutils
122-
mv ${DESTDIR}/usr/share/man/man1/hostname.1 ${DESTDIR}/usr/share/man/man1/hostname-coreutils.1
123134

124-
ln -s test.1 "${DESTDIR}/usr/share/man/man1/[.1"
135+
ln -s gtest.1 "${DESTDIR}/usr/share/man/man1/g[.1"
125136
}

0 commit comments

Comments
 (0)