4 # not thoroughly testes yet
5 DEFAULT_PREFERENCE = "-1"
8 ftp://ftp.gnu.org/gnu/coreutils/coreutils-${PV}.tar.gz \
9 file://automake-version.patch;patch=1 \
10 file://man.patch;patch=1 \
14 # [ gets a special treatment and is not included in this
15 bindir_progs = "basename cksum comm csplit cut df dir dircolors dirname du \
16 env expand expr factor fmt fold groups head hostid id install \
17 join link logname md5sum mkfifo nice nl nohup od paste pathchk \
18 pinky pr printenv printf ptx readlink seq sha1sum shred sort \
19 split stat sum tac tail tee test tr tsort tty unexpand uniq \
20 unlink users vdir wc who whoami yes \
23 # hostname gets a special treatment and is not included in this
24 base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill \
25 ln ls mkdir mknod mv pwd rm rmdir sleep stty sync touch \
29 sbindir_progs= "chroot"
31 do_configure_prepend() {
32 install -m 0644 ${WORKDIR}/onceonly.m4 ${S}/m4
38 # Renaming the utilities that should go in /usr/bin
39 for i in ${bindir_progs}; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}; done
41 # Renaming and moving the utilities that should go in /bin (FHS)
42 install -d ${D}${base_bindir}
43 for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${PN}; done
45 # Renaming and moving the utilities that should go in /usr/sbin (FHS)
46 install -d ${D}${sbindir}
47 for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${PN}; done
49 # [ requires special handling because [.coreutils will cause the sed stuff
50 # in update-alternatives to fail, therefore use lbracket - the name used
51 # for the actual source file.
52 mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${PN}
53 # hostname and uptime separated. busybox's versions are preferred
54 if [ -e ${D}${bindir}/hostname ]; then
55 mv ${D}${bindir}/hostname ${D}${base_bindir}/hostname.${PN}
57 if [ -e ${D}${bindir}/uptime ]; then
58 mv ${D}${bindir}/uptime ${D}${bindir}/uptime.${PN}
62 pkg_postinst_${PN} () {
63 # The utilities in /usr/bin
64 for i in ${bindir_progs}; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done
66 # The utilities in /bin
67 for i in ${base_bindir_progs}; do update-alternatives --install ${base_bindir}/$i $i $i.${PN} 100; done
69 # The utilities in /usr/sbin
70 for i in ${sbindir_progs}; do update-alternatives --install ${sbindir}/$i $i $i.${PN} 100; done
72 # Special cases. uptime and hostname is broken, prefer busybox's version. [ needs to be treated separately.
73 update-alternatives --install ${bindir}/uptime uptime uptime.${PN} 10
74 update-alternatives --install ${base_bindir}/hostname hostname hostname.${PN} 10
75 update-alternatives --install '${bindir}/[' '[' 'lbracket.${PN}' 100
79 # The utilities in /usr/bin
80 for i in ${bindir_progs}; do update-alternatives --remove $i $i.${PN}; done
82 # The utilities in /bin
83 for i in ${base_bindir_progs}; do update-alternatives --remove $i $i.${PN}; done
85 # The utilities in /usr/sbin
86 for i in ${sbindir_progs}; do update-alternatives --remove $i $i.${PN}; done
89 update-alternatives --remove hostname hostname.${PN}
90 update-alternatives --remove uptime uptime.${PN}
91 update-alternatives --remove '[' 'lbracket.${PN}'