Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | SUMMARY = "The basic file, shell and text manipulation utilities" |
| 2 | DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \ |
| 3 | manipulation utilities. These are the core utilities which are expected to exist on \ |
| 4 | every system." |
| 5 | HOMEPAGE = "http://www.gnu.org/software/coreutils/" |
| 6 | BUGTRACKER = "http://debbugs.gnu.org/coreutils" |
| 7 | LICENSE = "GPLv3+" |
| 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\ |
| 9 | file://src/ls.c;beginline=1;endline=15;md5=dbe356a88b09c29232b083d1ff8ac82a" |
| 10 | DEPENDS = "gmp libcap" |
| 11 | DEPENDS_class-native = "" |
| 12 | |
| 13 | inherit autotools gettext texinfo |
| 14 | |
| 15 | SRC_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 | |
| 23 | SRC_URI[md5sum] = "ab06d68949758971fe744db66b572816" |
| 24 | SRC_URI[sha256sum] = "e831b3a86091496cdba720411f9748de81507798f6130adeaef872d206e1b057" |
| 25 | |
| 26 | EXTRA_OECONF_class-native = "--without-gmp" |
| 27 | EXTRA_OECONF_class-target = "--enable-install-program=arch,hostname --libexecdir=${libdir}" |
| 28 | EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch,hostname" |
| 29 | |
| 30 | # acl and xattr are not default features |
| 31 | # |
| 32 | PACKAGECONFIG_class-target ??= "\ |
| 33 | ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \ |
| 34 | " |
| 35 | |
| 36 | # The lib/oe/path.py requires xattr |
| 37 | PACKAGECONFIG_class-native ??= "xattr" |
| 38 | |
| 39 | # with, without, depends, rdepends |
| 40 | # |
| 41 | PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl," |
| 42 | PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr," |
| 43 | PACKAGECONFIG[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 |
| 46 | bindir_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 |
| 54 | base_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 | |
| 57 | sbindir_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. |
| 63 | acpaths = "-I ./m4" |
| 64 | |
| 65 | # Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h |
| 66 | do_compile_prepend () { |
| 67 | mkdir -p ${B}/src |
| 68 | } |
| 69 | |
| 70 | do_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 | |
| 79 | do_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 | |
| 94 | inherit update-alternatives |
| 95 | |
| 96 | ALTERNATIVE_PRIORITY = "100" |
| 97 | # Make hostname's priority higher than busybox but lower than net-tools |
| 98 | ALTERNATIVE_PRIORITY[hostname] = "90" |
| 99 | ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 nice printenv mktemp df" |
| 100 | ALTERNATIVE_${PN}-doc = "base64.1 nice.1 mktemp.1 df.1 groups.1 kill.1 uptime.1 stat.1 hostname.1" |
| 101 | |
| 102 | ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1" |
| 103 | |
| 104 | ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64" |
| 105 | ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}" |
| 106 | ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1" |
| 107 | |
| 108 | ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp" |
| 109 | ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}" |
| 110 | ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1" |
| 111 | |
| 112 | ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df" |
| 113 | ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}" |
| 114 | ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1" |
| 115 | |
| 116 | ALTERNATIVE_LINK_NAME[nice] = "${base_bindir}/nice" |
| 117 | ALTERNATIVE_TARGET[nice] = "${bindir}/nice.${BPN}" |
| 118 | ALTERNATIVE_LINK_NAME[nice.1] = "${mandir}/man1/nice.1" |
| 119 | |
| 120 | ALTERNATIVE_LINK_NAME[printenv] = "${base_bindir}/printenv" |
| 121 | ALTERNATIVE_TARGET[printenv] = "${bindir}/printenv.${BPN}" |
| 122 | |
| 123 | ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/[" |
| 124 | ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}" |
| 125 | |
| 126 | ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1" |
| 127 | ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1" |
| 128 | ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" |
| 129 | ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1" |
| 130 | |
| 131 | python __anonymous() { |
Brad Bishop | a5c52ff | 2018-11-23 10:55:50 +1300 | [diff] [blame] | 132 | for prog in d.getVar('base_bindir_progs').split(): |
| 133 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 134 | |
Brad Bishop | a5c52ff | 2018-11-23 10:55:50 +1300 | [diff] [blame] | 135 | for prog in d.getVar('sbindir_progs').split(): |
| 136 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog)) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | BBCLASSEXTEND = "native nativesdk" |