Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [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=c456f9896277a0543e3866777ccc0255" |
| 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_append_libc-musl = "file://strtod_fix_clash_with_strtold.patch" |
| 24 | |
| 25 | SRC_URI[md5sum] = "0009a224d8e288e8ec406ef0161f9293" |
| 26 | SRC_URI[sha256sum] = "ff7a9c918edce6b4f4b2725e3f9b37b0c4d193531cac49a48b56c4d0d3a9e9fd" |
| 27 | |
| 28 | EXTRA_OECONF_class-native = "--without-gmp" |
| 29 | EXTRA_OECONF_class-target = "--enable-install-program=arch,hostname --libexecdir=${libdir}" |
| 30 | EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch,hostname" |
| 31 | |
| 32 | # acl and xattr are not default features |
| 33 | # |
| 34 | PACKAGECONFIG_class-target ??= "\ |
| 35 | ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \ |
| 36 | " |
| 37 | |
| 38 | # The lib/oe/path.py requires xattr |
| 39 | PACKAGECONFIG_class-native ??= "xattr" |
| 40 | |
| 41 | # with, without, depends, rdepends |
| 42 | # |
| 43 | PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl," |
| 44 | PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr," |
| 45 | PACKAGECONFIG[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 |
| 48 | bindir_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 \ |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame^] | 52 | sha384sum sha512sum shred shuf sort split sum tac tail tee test timeout \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 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 |
| 56 | base_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 | |
| 59 | sbindir_progs= "chroot" |
| 60 | |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame^] | 61 | PACKAGE_BEFORE_PN_class-target += "coreutils-stdbuf" |
| 62 | FILES_coreutils-stdbuf = "${bindir}/stdbuf ${libdir}/coreutils/libstdbuf.so" |
| 63 | RDEPENDS_coreutils_class-target += "coreutils-stdbuf" |
| 64 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 65 | # Let aclocal use the relative path for the m4 file rather than the |
| 66 | # absolute since coreutils has a lot of m4 files, otherwise there might |
| 67 | # be an "Argument list too long" error when it is built in a long/deep |
| 68 | # directory. |
| 69 | acpaths = "-I ./m4" |
| 70 | |
| 71 | # Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h |
| 72 | do_compile_prepend () { |
| 73 | mkdir -p ${B}/src |
| 74 | } |
| 75 | |
| 76 | do_install_class-native() { |
| 77 | autotools_do_install |
| 78 | # remove groups to fix conflict with shadow-native |
| 79 | rm -f ${D}${STAGING_BINDIR_NATIVE}/groups |
| 80 | # The return is a must since native doesn't need the |
| 81 | # do_install_append() in the below. |
| 82 | return |
| 83 | } |
| 84 | |
| 85 | do_install_append() { |
| 86 | for i in df mktemp nice printenv base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done |
| 87 | |
| 88 | install -d ${D}${base_bindir} |
| 89 | [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done |
| 90 | |
| 91 | install -d ${D}${sbindir} |
| 92 | [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done |
| 93 | |
| 94 | # [ requires special handling because [.coreutils will cause the sed stuff |
| 95 | # in update-alternatives to fail, therefore use lbracket - the name used |
| 96 | # for the actual source file. |
| 97 | mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN} |
| 98 | } |
| 99 | |
| 100 | inherit update-alternatives |
| 101 | |
| 102 | ALTERNATIVE_PRIORITY = "100" |
| 103 | # Make hostname's priority higher than busybox but lower than net-tools |
| 104 | ALTERNATIVE_PRIORITY[hostname] = "90" |
| 105 | ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 nice printenv mktemp df" |
| 106 | ALTERNATIVE_${PN}-doc = "base64.1 nice.1 mktemp.1 df.1 groups.1 kill.1 uptime.1 stat.1 hostname.1" |
| 107 | |
| 108 | ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1" |
| 109 | |
| 110 | ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64" |
| 111 | ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}" |
| 112 | ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1" |
| 113 | |
| 114 | ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp" |
| 115 | ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}" |
| 116 | ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1" |
| 117 | |
| 118 | ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df" |
| 119 | ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}" |
| 120 | ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1" |
| 121 | |
| 122 | ALTERNATIVE_LINK_NAME[nice] = "${base_bindir}/nice" |
| 123 | ALTERNATIVE_TARGET[nice] = "${bindir}/nice.${BPN}" |
| 124 | ALTERNATIVE_LINK_NAME[nice.1] = "${mandir}/man1/nice.1" |
| 125 | |
| 126 | ALTERNATIVE_LINK_NAME[printenv] = "${base_bindir}/printenv" |
| 127 | ALTERNATIVE_TARGET[printenv] = "${bindir}/printenv.${BPN}" |
| 128 | |
| 129 | ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/[" |
| 130 | ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}" |
| 131 | |
| 132 | ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1" |
| 133 | ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1" |
| 134 | ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" |
| 135 | ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1" |
| 136 | |
| 137 | python __anonymous() { |
| 138 | for prog in d.getVar('base_bindir_progs').split(): |
| 139 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) |
| 140 | |
| 141 | for prog in d.getVar('sbindir_progs').split(): |
| 142 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog)) |
| 143 | } |
| 144 | |
| 145 | BBCLASSEXTEND = "native nativesdk" |