]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/coreutils/coreutils_5.1.3.bb
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / coreutils / coreutils_5.1.3.bb
1 LICENSE = "GPL"
2 SECTION = "base"
3 DESCRIPTION = "A collection of core GNU utilities."
4 RREPLACES = "textutils shellutils fileutils"
5 RPROVIDES = "textutils shellutils fileutils"
6 PR = "r7"
7
8 SRC_URI = "ftp://alpha.gnu.org/gnu/coreutils/coreutils-${PV}.tar.bz2 \
9            file://install-cross.patch;patch=1;pnum=0 \
10            file://man.patch;patch=1"
11
12 inherit autotools
13
14 # [ gets a special treatment and is not included in this
15 bindir_progs = "basename cksum comm csplit cut 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 \
21                 "
22
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 \
26                      true uname \
27                      "
28
29 sbindir_progs= "chroot"
30
31 do_install () {
32         autotools_do_install
33         
34         # Renaming the utilities that should go in /usr/bin
35         for i in ${bindir_progs}; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}; done
36         
37         # Renaming and moving the utilities that should go in /bin (FHS)
38         install -d ${D}${base_bindir}
39         for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${PN}; done
40
41         # Renaming and moving the utilities that should go in /usr/sbin (FHS)
42         install -d ${D}${sbindir}
43         for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${PN}; done
44
45         # [ requires special handling because [.coreutils will cause the sed stuff
46         # in update-alternatives to fail, therefore use lbracket - the name used
47         # for the actual source file.
48         mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${PN}
49         # hostname and uptime separated. busybox's versions are preferred
50         mv ${D}${bindir}/hostname ${D}${base_bindir}/hostname.${PN}
51         mv ${D}${bindir}/uptime ${D}${bindir}/uptime.${PN}
52                                         
53 }
54
55 pkg_postinst_${PN} () {
56         # The utilities in /usr/bin
57         for i in ${bindir_progs}; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done
58
59         # The utilities in /bin
60         for i in ${base_bindir_progs}; do update-alternatives --install ${base_bindir}/$i $i $i.${PN} 100; done
61         
62         # The utilities in /usr/sbin
63         for i in ${sbindir_progs}; do update-alternatives --install ${sbindir}/$i $i $i.${PN} 100; done
64
65         # Special cases. uptime and hostname is broken, prefer busybox's version. [ needs to be treated separately. 
66         update-alternatives --install ${bindir}/uptime uptime uptime.${PN} 10
67         update-alternatives --install ${base_bindir}/hostname hostname hostname.${PN} 10
68         update-alternatives --install '${bindir}/[' '[' 'lbracket.${PN}' 100
69 }
70
71 pkg_prerm_${PN} () {
72         # The utilities in /usr/bin
73         for i in ${bindir_progs}; do update-alternatives --remove $i $i.${PN}; done
74
75         # The utilities in /bin
76         for i in ${base_bindir_progs}; do update-alternatives --remove $i $i.${PN}; done
77
78         # The utilities in /usr/sbin
79         for i in ${sbindir_progs}; do update-alternatives --remove $i $i.${PN}; done
80
81         # The special cases
82         update-alternatives --remove hostname hostname.${PN}
83         update-alternatives --remove uptime uptime.${PN}
84         update-alternatives --remove '[' 'lbracket.${PN}'
85 }