blob: 8f4ee557120d92ef6f58f03ffea20bdd9fcb4920 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "The basic file, shell and text manipulation utilities"
2DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \
3manipulation utilities. These are the core utilities which are expected to exist on \
4every system."
5HOMEPAGE = "http://www.gnu.org/software/coreutils/"
6BUGTRACKER = "http://debbugs.gnu.org/coreutils"
7LICENSE = "GPLv3+"
8LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
9 file://src/ls.c;beginline=1;endline=15;md5=dbe356a88b09c29232b083d1ff8ac82a"
10DEPENDS = "gmp libcap"
11DEPENDS_class-native = ""
12
13inherit autotools gettext texinfo
14
15SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
16 file://remove-usr-local-lib-from-m4.patch \
17 file://fix-selinux-flask.patch \
18 file://0001-uname-report-processor-and-hardware-correctly.patch \
19 file://disable-ls-output-quoting.patch \
20 file://0001-local.mk-fix-cross-compiling-problem.patch \
21 "
22
23SRC_URI[md5sum] = "ab06d68949758971fe744db66b572816"
24SRC_URI[sha256sum] = "e831b3a86091496cdba720411f9748de81507798f6130adeaef872d206e1b057"
25
26EXTRA_OECONF_class-native = "--without-gmp"
27EXTRA_OECONF_class-target = "--enable-install-program=arch,hostname --libexecdir=${libdir}"
28EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch,hostname"
29
30# acl and xattr are not default features
31#
32PACKAGECONFIG_class-target ??= "\
33 ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \
34"
35
36# The lib/oe/path.py requires xattr
37PACKAGECONFIG_class-native ??= "xattr"
38
39# with, without, depends, rdepends
40#
41PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
42PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
43PACKAGECONFIG[single-binary] = "--enable-single-binary,--disable-single-binary,,"
44
45# [ df mktemp nice printenv base64 gets a special treatment and is not included in this
46bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \
47 env expand expr factor fmt fold groups head hostid id install \
48 join link logname md5sum mkfifo nl nohup nproc od paste pathchk \
49 pinky pr printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \
50 sha384sum sha512sum shred shuf sort split stdbuf sum tac tail tee test timeout \
51 tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
52
53# hostname gets a special treatment and is not included in this
54base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \
55 mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
56
57sbindir_progs= "chroot"
58
59# Let aclocal use the relative path for the m4 file rather than the
60# absolute since coreutils has a lot of m4 files, otherwise there might
61# be an "Argument list too long" error when it is built in a long/deep
62# directory.
63acpaths = "-I ./m4"
64
65# Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h
66do_compile_prepend () {
67 mkdir -p ${B}/src
68}
69
70do_install_class-native() {
71 autotools_do_install
72 # remove groups to fix conflict with shadow-native
73 rm -f ${D}${STAGING_BINDIR_NATIVE}/groups
74 # The return is a must since native doesn't need the
75 # do_install_append() in the below.
76 return
77}
78
79do_install_append() {
80 for i in df mktemp nice printenv base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
81
82 install -d ${D}${base_bindir}
83 [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done
84
85 install -d ${D}${sbindir}
86 [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done
87
88 # [ requires special handling because [.coreutils will cause the sed stuff
89 # in update-alternatives to fail, therefore use lbracket - the name used
90 # for the actual source file.
91 mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
92}
93
94inherit update-alternatives
95
96ALTERNATIVE_PRIORITY = "100"
97# Make hostname's priority higher than busybox but lower than net-tools
98ALTERNATIVE_PRIORITY[hostname] = "90"
99ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 nice printenv mktemp df"
100ALTERNATIVE_${PN}-doc = "base64.1 nice.1 mktemp.1 df.1 groups.1 kill.1 uptime.1 stat.1 hostname.1"
101
102ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
103
104ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64"
105ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}"
106ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1"
107
108ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
109ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}"
110ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
111
112ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df"
113ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}"
114ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1"
115
116ALTERNATIVE_LINK_NAME[nice] = "${base_bindir}/nice"
117ALTERNATIVE_TARGET[nice] = "${bindir}/nice.${BPN}"
118ALTERNATIVE_LINK_NAME[nice.1] = "${mandir}/man1/nice.1"
119
120ALTERNATIVE_LINK_NAME[printenv] = "${base_bindir}/printenv"
121ALTERNATIVE_TARGET[printenv] = "${bindir}/printenv.${BPN}"
122
123ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
124ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
125
126ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
127ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
128ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
129ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
130
131python __anonymous() {
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300132 for prog in d.getVar('base_bindir_progs').split():
133 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800134
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300135 for prog in d.getVar('sbindir_progs').split():
136 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog))
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800137}
138
139BBCLASSEXTEND = "native nativesdk"