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