blob: 419a693372c9bc817503ebfbc8fd35a38f5c9b67 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001SUMMARY = "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=5;endline=16;md5=38b79785ca88537b75871782a2a3c6b8"
10DEPENDS = "gmp libcap"
11DEPENDS_class-native = ""
12
13inherit autotools gettext texinfo
14
15SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz;name=tarball \
16 http://distfiles.gentoo.org/distfiles/${BP}-man.tar.xz;name=manpages \
17 file://man-decouple-manpages-from-build.patch \
18 file://remove-usr-local-lib-from-m4.patch \
19 file://fix-selinux-flask.patch \
20 file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
21 file://0001-uname-report-processor-and-hardware-correctly.patch \
22 "
23
24SRC_URI[tarball.md5sum] = "070e43ba7f618d747414ef56ab248a48"
25SRC_URI[tarball.sha256sum] = "31e67c057a5b32a582f26408c789e11c2e8d676593324849dcf5779296cdce87"
26SRC_URI[manpages.md5sum] = "415cc0552bc4e480b27ce8b2aebfdeb5"
27SRC_URI[manpages.sha256sum] = "2ee31c3a6d2276f49c5515375d4a0c1047580da6ac10536898e0f0de81707f29"
28
29EXTRA_OECONF_class-native = "--without-gmp"
30EXTRA_OECONF_class-target = "--enable-install-program=arch --libexecdir=${libdir}"
31EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch"
32
33# acl and xattr are not default features
34#
35PACKAGECONFIG_class-target ??= "\
36 ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
37 ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)} \
38"
39
40PACKAGECONFIG_class-native ??= ""
41
42# with, without, depends, rdepends
43#
44PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
45PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
46
47# [ df mktemp 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 nice nl nohup nproc od paste pathchk \
51 pinky pr printenv 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 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_append() {
73 for i in df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
74
75 install -d ${D}${base_bindir}
76 [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done
77
78 install -d ${D}${sbindir}
79 [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done
80
81 # [ requires special handling because [.coreutils will cause the sed stuff
82 # in update-alternatives to fail, therefore use lbracket - the name used
83 # for the actual source file.
84 mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
85
86 # prebuilt man pages
87 install -d ${D}/${mandir}/man1
88 install -t ${D}/${mandir}/man1 ${S}/man/*.1
89 # prebuilt man pages don't do a separate man page for [ vs test.
90 # see comment above r.e. sed and update-alternatives
91 cp -a ${D}${mandir}/man1/test.1 ${D}${mandir}/man1/lbracket.1.${BPN}
92}
93
94do_install_append_class-native(){
95 # remove groups to fix conflict with shadow-native
96 rm -f ${D}${STAGING_BINDIR_NATIVE}/groups
97}
98
99inherit update-alternatives
100
101ALTERNATIVE_PRIORITY = "100"
102ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 mktemp df"
103ALTERNATIVE_${PN}-doc = "base64.1 mktemp.1 df.1 lbracket.1 groups.1 kill.1 uptime.1 stat.1"
104
105ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64"
106ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}"
107ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1"
108
109ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
110ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}"
111ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
112
113ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df"
114ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}"
115ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1"
116
117ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
118ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
119ALTERNATIVE_LINK_NAME[lbracket.1] = "${mandir}/man1/lbracket.1"
120
121ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
122ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
123ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
124ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
125
126python __anonymous() {
127 for prog in d.getVar('base_bindir_progs', True).split():
128 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
129
130 for prog in d.getVar('sbindir_progs', True).split():
131 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog))
132}
133
134BBCLASSEXTEND = "native nativesdk"