blob: b0572afdc00116c7405ff38a424b8e7447a20c3d [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001SUMMARY = "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=1c3f9411e1842a062ce5ce9210beee0e"
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-Unset-need_charset_alias-when-building-for-musl.patch \
19 file://0001-uname-report-processor-and-hardware-correctly.patch \
20 file://disable-ls-output-quoting.patch \
21 file://0001-local.mk-fix-cross-compiling-problem.patch \
Brad Bishop220d5532018-08-14 00:59:39 +010022 file://CVE-2017-18018-1.patch \
23 file://CVE-2017-18018-2.patch \
Brad Bishop316dfdd2018-06-25 12:45:53 -040024 "
25
26SRC_URI[md5sum] = "960cfe75a42c9907c71439f8eb436303"
27SRC_URI[sha256sum] = "92d0fa1c311cacefa89853bdb53c62f4110cdfda3820346b59cbd098f40f955e"
28
29EXTRA_OECONF_class-native = "--without-gmp"
30EXTRA_OECONF_class-target = "--enable-install-program=arch,hostname --libexecdir=${libdir}"
Brad Bishopd5ae7d92018-06-14 09:52:03 -070031EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch,hostname"
Brad Bishop316dfdd2018-06-25 12:45:53 -040032
33# acl and xattr are not default features
34#
35PACKAGECONFIG_class-target ??= "\
36 ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \
37"
38
39# The lib/oe/path.py requires xattr
40PACKAGECONFIG_class-native ??= "xattr"
41
42# with, without, depends, rdepends
43#
44PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
45PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
46PACKAGECONFIG[single-binary] = "--enable-single-binary,--disable-single-binary,,"
47
48# [ df mktemp base64 gets a special treatment and is not included in this
49bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \
50 env expand expr factor fmt fold groups head hostid id install \
51 join link logname md5sum mkfifo nice nl nohup nproc od paste pathchk \
52 pinky pr printenv printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \
53 sha384sum sha512sum shred shuf sort split stdbuf sum tac tail tee test timeout\
54 tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
55
56# hostname gets a special treatment and is not included in this
57base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \
58 mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
59
60sbindir_progs= "chroot"
61
62# Let aclocal use the relative path for the m4 file rather than the
63# absolute since coreutils has a lot of m4 files, otherwise there might
64# be an "Argument list too long" error when it is built in a long/deep
65# directory.
66acpaths = "-I ./m4"
67
68# Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h
69do_compile_prepend () {
70 mkdir -p ${B}/src
71}
72
73do_install_class-native() {
74 autotools_do_install
75 # remove groups to fix conflict with shadow-native
76 rm -f ${D}${STAGING_BINDIR_NATIVE}/groups
77 # The return is a must since native doesn't need the
78 # do_install_append() in the below.
79 return
80}
81
82do_install_append() {
83 for i in df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
84
85 install -d ${D}${base_bindir}
86 [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done
87
88 install -d ${D}${sbindir}
89 [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done
90
91 # [ requires special handling because [.coreutils will cause the sed stuff
92 # in update-alternatives to fail, therefore use lbracket - the name used
93 # for the actual source file.
94 mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
95}
96
97inherit update-alternatives
98
99ALTERNATIVE_PRIORITY = "100"
100# Make hostname's priority higher than busybox but lower than net-tools
101ALTERNATIVE_PRIORITY[hostname] = "90"
102ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 mktemp df"
103ALTERNATIVE_${PN}-doc = "base64.1 mktemp.1 df.1 groups.1 kill.1 uptime.1 stat.1 hostname.1"
104
105ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
106
107ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64"
108ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}"
109ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1"
110
111ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
112ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}"
113ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
114
115ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df"
116ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}"
117ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1"
118
119ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
120ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
121
122ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
123ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
124ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
125ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
126
127python __anonymous() {
128 for prog in d.getVar('base_bindir_progs').split():
129 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
130
131 for prog in d.getVar('sbindir_progs').split():
132 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog))
133}
134
135BBCLASSEXTEND = "native nativesdk"