Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [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=5;endline=16;md5=38b79785ca88537b75871782a2a3c6b8" |
| 10 | DEPENDS = "gmp libcap" |
| 11 | DEPENDS_class-native = "" |
| 12 | |
| 13 | inherit autotools gettext texinfo |
| 14 | |
| 15 | SRC_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 | " |
| 22 | |
| 23 | SRC_URI[tarball.md5sum] = "40efdbce865d2458d8da0a9dcee7c16c" |
| 24 | SRC_URI[tarball.sha256sum] = "a2d75286a4b9ef3a13039c2da3868a61be4ee9f17d8ae380a35a97e506972170" |
| 25 | SRC_URI[manpages.md5sum] = "728a91a5c1095a33cffb9959bb891963" |
| 26 | SRC_URI[manpages.sha256sum] = "cf0333b5f134a331e0b46e2ddf90666f8bdc3281c1ca2c7ccbb75b437589ce37" |
| 27 | |
| 28 | EXTRA_OECONF_class-native = "--without-gmp" |
| 29 | EXTRA_OECONF_class-target = "--enable-install-program=arch --libexecdir=${libdir}" |
| 30 | |
| 31 | # acl is not a default feature |
| 32 | # |
| 33 | PACKAGECONFIG_class-target ??= "${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}" |
| 34 | PACKAGECONFIG_class-native ??= "" |
| 35 | |
| 36 | # with, without, depends, rdepends |
| 37 | # |
| 38 | PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl," |
| 39 | |
| 40 | # [ df mktemp base64 gets a special treatment and is not included in this |
| 41 | bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \ |
| 42 | env expand expr factor fmt fold groups head hostid id install \ |
| 43 | join link logname md5sum mkfifo nice nl nohup nproc od paste pathchk \ |
| 44 | pinky pr printenv printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \ |
| 45 | sha384sum sha512sum shred shuf sort split stdbuf sum tac tail tee test timeout\ |
| 46 | tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes" |
| 47 | |
| 48 | # hostname gets a special treatment and is not included in this |
| 49 | base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \ |
| 50 | mknod mv pwd rm rmdir sleep stty sync touch true uname stat" |
| 51 | |
| 52 | sbindir_progs= "chroot" |
| 53 | |
| 54 | # Let aclocal use the relative path for the m4 file rather than the |
| 55 | # absolute since coreutils has a lot of m4 files, otherwise there might |
| 56 | # be an "Argument list too long" error when it is built in a long/deep |
| 57 | # directory. |
| 58 | acpaths = "-I ./m4" |
| 59 | |
| 60 | # Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h |
| 61 | do_compile_prepend () { |
| 62 | mkdir -p ${B}/src |
| 63 | } |
| 64 | |
| 65 | do_install_append() { |
| 66 | for i in df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done |
| 67 | |
| 68 | install -d ${D}${base_bindir} |
| 69 | [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done |
| 70 | |
| 71 | install -d ${D}${sbindir} |
| 72 | [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done |
| 73 | |
| 74 | # [ requires special handling because [.coreutils will cause the sed stuff |
| 75 | # in update-alternatives to fail, therefore use lbracket - the name used |
| 76 | # for the actual source file. |
| 77 | mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN} |
| 78 | |
| 79 | # prebuilt man pages |
| 80 | install -d ${D}/${mandir}/man1 |
| 81 | install -t ${D}/${mandir}/man1 ${S}/man/*.1 |
| 82 | # prebuilt man pages don't do a separate man page for [ vs test. |
| 83 | # see comment above r.e. sed and update-alternatives |
| 84 | cp -a ${D}${mandir}/man1/test.1 ${D}${mandir}/man1/lbracket.1.${BPN} |
| 85 | } |
| 86 | |
| 87 | do_install_append_class-native(){ |
| 88 | # remove groups to fix conflict with shadow-native |
| 89 | rm -f ${D}${STAGING_BINDIR_NATIVE}/groups |
| 90 | } |
| 91 | |
| 92 | inherit update-alternatives |
| 93 | |
| 94 | ALTERNATIVE_PRIORITY = "100" |
| 95 | ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 mktemp df" |
| 96 | ALTERNATIVE_${PN}-doc = "base64.1 mktemp.1 df.1 lbracket.1 groups.1 kill.1 uptime.1 stat.1" |
| 97 | |
| 98 | ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64" |
| 99 | ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}" |
| 100 | ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1" |
| 101 | |
| 102 | ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp" |
| 103 | ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}" |
| 104 | ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1" |
| 105 | |
| 106 | ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df" |
| 107 | ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}" |
| 108 | ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1" |
| 109 | |
| 110 | ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/[" |
| 111 | ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}" |
| 112 | ALTERNATIVE_LINK_NAME[lbracket.1] = "${mandir}/man1/lbracket.1" |
| 113 | |
| 114 | ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1" |
| 115 | ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1" |
| 116 | ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" |
| 117 | ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1" |
| 118 | |
| 119 | python __anonymous() { |
| 120 | for prog in d.getVar('base_bindir_progs', True).split(): |
| 121 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog)) |
| 122 | |
| 123 | for prog in d.getVar('sbindir_progs', True).split(): |
| 124 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog)) |
| 125 | } |
| 126 | |
| 127 | BBCLASSEXTEND = "native nativesdk" |