Updated to use update-alternatives and fix some FHS bugs
authorDavid Karlstrom <daka@thg.se>
Sat, 23 Jul 2005 13:36:38 +0000 (13:36 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Sat, 23 Jul 2005 13:36:38 +0000 (13:36 +0000)
17 files changed:
packages/binutils/binutils.inc
packages/binutils/binutils_2.16.bb
packages/busybox/busybox_1.00.bb
packages/bzip2/bzip2_1.0.2.bb
packages/console-tools/console-tools_0.3.2.bb
packages/coreutils/coreutils_5.1.3.bb
packages/cpio/cpio_2.5.bb
packages/gawk/gawk_3.1.4.bb
packages/grep/grep_2.5.1.bb
packages/ncurses/ncurses.inc
packages/ncurses/ncurses_5.4.bb
packages/sed/sed_4.1.2.bb
packages/sysvinit/sysvinit_2.86.bb
packages/tar/tar_1.13.93.bb
packages/util-linux/util-linux.inc
packages/util-linux/util-linux_2.12q.bb
packages/wget/wget_1.9.1.bb

index 731f58b..e544e9e 100644 (file)
@@ -16,7 +16,6 @@ FILES_${PN}-dev = " \
 
 FILES_${PN}-symlinks = " \
        ${bindir}/addr2line \
-       ${bindir}/ar \
        ${bindir}/as \
        ${bindir}/c++filt \
        ${bindir}/gprof \
@@ -27,7 +26,6 @@ FILES_${PN}-symlinks = " \
        ${bindir}/ranlib \
        ${bindir}/readelf \
        ${bindir}/size \
-       ${bindir}/strings \
        ${bindir}/strip"
 
 EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
@@ -101,4 +99,19 @@ do_install () {
        for p in ${TARGET_SYS}-* ; do
                ln -sf $p `echo $p | sed -e s,${TARGET_SYS}-,,`
        done
+
+       rm ${D}${bindir}/ar ${D}${bindir}/strings
+}
+
+
+pkg_postinst_${PN}-symlinks () {
+       update-alternatives --install ${bindir}/ar ar ${TARGET_SYS}-ar 100
+       update-alternatives --install ${bindir}/strings strings ${TARGET_SYS}-strings 100
 }
+
+
+pkg_prerm_${PN}-symlinks () {
+       update-alternatives --remove ar ${TARGET_SYS}-ar
+       update-alternatives --remove strings ${TARGET_SYS}-strings
+}
+
index 27e2f89..bb280f0 100644 (file)
@@ -3,7 +3,7 @@ HOMEPAGE = "http://www.gnu.org/software/binutils/"
 SECTION = "devel"
 LICENSE = "GPL"
 MAINTAINER = "Gerald Britton <gbritton@doomcom.org>"
-PR = "r0"
+PR = "r1"
 
 DEFAULT_PREFERENCE_linux-uclibc = "-1"
 
index 1a5b392..056213c 100644 (file)
@@ -10,7 +10,7 @@ HOMEPAGE = "http://www.busybox.net"
 LICENSE = "GPL"
 SECTION = "base"
 PRIORITY = "required"
-PR = "r27"
+PR = "r28"
 
 SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.gz \
            file://add-getkey-applet.patch;patch=1 \
@@ -73,39 +73,89 @@ do_compile () {
 do_install () {
        install -d ${D}${sysconfdir}/init.d
        oe_runmake 'PREFIX=${D}' install
+
+       # Move everything to /busybox (not supposed to end up in any package)
+       install -d ${D}/busybox
+       mv ${D}${base_bindir} ${D}${base_sbindir} ${D}${prefix} ${D}/busybox/
+       # Move the busybox binary back to /bin
+       install -d ${D}${base_bindir}
+       mv ${D}/busybox${base_bindir}/busybox ${D}${base_bindir}/
+       # Move back the sh symlink
+       mv ${D}/busybox${base_bindir}/sh ${D}${base_bindir}/
+
        install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/
        install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/
        if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then 
+               # Move crond back to /usr/sbin/crond
+               install -d ${D}${sbindir}
+               mv ${D}/busybox${sbindir}/crond ${D}${sbindir}/
+
                install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
        fi
        if grep "CONFIG_HTTPD=y" ${WORKDIR}/defconfig; then 
+               # Move httpd back to /usr/sbin/httpd
+               install -d ${D}${sbindir}
+               mv ${D}/busybox${sbindir}/httpd ${D}${sbindir}/
+                                       
                install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/
                install -d ${D}/srv/www
        fi
        if grep "CONFIG_UDHCPD=y" ${WORKDIR}/defconfig; then 
+               # Move udhcpd back to /usr/sbin/udhcpd
+               install -d ${D}${sbindir}
+               mv ${D}/busybox${sbindir}/udhcpd ${D}${sbindir}/
+                                       
                install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/
        fi
        if grep "CONFIG_HWCLOCK=y" ${WORKDIR}/defconfig; then 
+               # Move hwclock back to /sbin/hwclock
+               install -d ${D}${base_sbindir}
+               mv ${D}/busybox${base_sbindir}/hwclock ${D}${base_sbindir}/
+                                       
                install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/
        fi
        if grep "CONFIG_UDHCPC=y" ${WORKDIR}/defconfig; then 
+               # Move dhcpc back to /usr/sbin/udhcpc
+               install -d ${D}${base_sbindir}
+               mv ${D}/busybox${base_sbindir}/udhcpc ${D}${base_sbindir}/
+
                install -d ${D}${sysconfdir}/udhcpc.d
                install -d ${D}${datadir}/udhcpc
                install -m 0755 ${S}/examples/udhcp/simple.script ${D}${sysconfdir}/udhcpc.d/50default
                install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script
        fi
-       rm ${D}${base_bindir}/mount
-       install -m 0755 ${WORKDIR}/mount.busybox ${D}${base_bindir}/
-       rm ${D}${base_bindir}/umount
-       install -m 0755 ${WORKDIR}/umount.busybox ${D}${base_bindir}/
+
+       install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
 }
 
 pkg_postinst_${PN} () {
-       update-alternatives --install /bin/mount mount /bin/mount.busybox 50
-       update-alternatives --install /bin/umount umount /bin/umount.busybox 50
+       # If we are not making an image we create links for the utilities that doesn't exist
+       # so the update-alternatives script will get the utilities it needs
+       # (update-alternatives have no problem replacing links later anyway)
+       alias test='busybox test'
+       if test "x$D" = "x"; then while read link; do if test ! -h "$link"; then case "$link" in /*/*/*) to="../../bin/busybox";; /bin/*) to="busybox";; /*/*) to="../bin/busybox";; esac; busybox ln -s $to $link; fi; done </etc/busybox.links; fi
+       
+       # This adds the links, remember that this has to work when building an image too, hence the $D
+       while read link; do case "$link" in /*/*/*) to="../../bin/busybox";; /bin/*) to="busybox";; /*/*) to="../bin/busybox";; esac; bn=`basename $link`; update-alternatives --install $link $bn $to 50; done <$D/etc/busybox.links
 }
 
 pkg_prerm_${PN} () {
-       update-alternatives --remove mount /bin/mount.busybox
-       update-alternatives --remove umount /bin/umount.busybox
+       # This is so you can make busybox commit suicide - removing busybox with no other packages
+       # providing its files, this will make update-alternatives work, but the update-rc.d part
+       # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh
+       tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX`
+       ln -s /bin/busybox $tmpdir/[
+       ln -s /bin/busybox $tmpdir/test
+       ln -s /bin/busybox $tmpdir/head
+       ln -s /bin/busybox $tmpdir/sh
+       ln -s /bin/busybox $tmpdir/basename
+       ln -s /bin/busybox $tmpdir/echo
+       ln -s /bin/busybox $tmpdir/mv
+       ln -s /bin/busybox $tmpdir/ln
+       ln -s /bin/busybox $tmpdir/dirname
+       ln -s /bin/busybox $tmpdir/rm
+       ln -s /bin/busybox $tmpdir/sed
+       ln -s /bin/busybox $tmpdir/sort
+       export PATH=$PATH:$tmpdir
+       while read link; do case "$link" in /*/*/*) to="../../bin/busybox";; /bin/*) to="busybox";; /*/*) to="../bin/busybox";; esac; bn=`basename $link`; sh /usr/bin/update-alternatives --remove $bn $to; done </etc/busybox.links
 }
index 0233f0f..1e1cb8e 100644 (file)
@@ -1,5 +1,6 @@
 DESCRIPTION = "Very high-quality data compression program."
 SECTION = "console/utils"
+PR = "r1"
 
 LICENSE = "bzip2"
 SRC_URI = "ftp://sources.redhat.com/pub/bzip2/v102/bzip2-${PV}.tar.gz \
@@ -23,4 +24,18 @@ do_stage () {
 do_install () {
        oe_runmake 'DESTDIR=${D}' install
        oe_libinstall -a -so libbz2 ${D}${libdir}
+       mv ${D}${bindir}/bunzip2 ${D}${bindir}/bunzip2.${PN}
+       mv ${D}${bindir}/bzcat ${D}${bindir}/bzcat.${PN}
+}
+
+
+pkg_postinst_${PN} () {
+       update-alternatives --install ${bindir}/bunzip2 bunzip2 bunzip2.${PN} 100
+       update-alternatives --install ${bindir}/bzcat bzcat bzcat.${PN} 100
+}
+
+
+pkg_prerm_${PN} () {
+       update-alternatives --remove bunzip2 bunzip2.${PN}
+       update-alternatives --remove bzcat bzcat.${PN}
 }
index 7cf684c..2a94a4f 100644 (file)
@@ -1,6 +1,7 @@
 SECTION = "base"
 LICENSE = "GPL"
 DESCRIPTION = "Allows you to set-up and manipulate the Linux console."
+PR = "r1"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/lct/console-tools-${PV}.tar.gz \
            file://codepage.patch;patch=1 \
@@ -23,3 +24,23 @@ do_compile () {
 }
 
 inherit autotools 
+
+do_install () {
+       autotools_do_install
+       mv ${D}${bindir}/chvt ${D}${bindir}/chvt.${PN}
+       mv ${D}${bindir}/deallocvt ${D}${bindir}/deallocvt.${PN}
+       mv ${D}${bindir}/openvt ${D}${bindir}/openvt.${PN}
+}
+
+pkg_postinst_${PN} () {
+       update-alternatives --install ${bindir}/chvt chvt chvt.${PN} 100
+       update-alternatives --install ${bindir}/deallocvt deallocvt deallocvt.${PN} 100
+       update-alternatives --install ${bindir}/openvt openvt openvt.${PN} 100
+}
+
+pkg_prerm_${PN} () {
+       update-alternatives --remove chvt chvt.${PN}
+       update-alternatives --remove deallocvt deallocvt.${PN}
+       update-alternatives --remove openvt openvt.${PN}
+}
+                       
index 6290a49..47c7344 100644 (file)
@@ -3,10 +3,65 @@ SECTION = "base"
 DESCRIPTION = "A collection of core GNU utilities."
 RREPLACES = "textutils shellutils fileutils"
 RPROVIDES = "textutils shellutils fileutils"
-PR = "r1"
+PR = "r2"
 
 SRC_URI = "ftp://alpha.gnu.org/gnu/coreutils/coreutils-${PV}.tar.bz2 \
            file://install-cross.patch;patch=1;pnum=0 \
            file://man.patch;patch=1"
 
 inherit autotools
+
+bindir_progs = "basename cksum comm csplit cut dir dircolors dirname du \
+               env expand expr factor fmt fold groups head hostid id install \
+               join link logname md5sum mkfifo nice nl nohup od paste pathchk \
+               pinky pr printenv printf ptx readlink seq sha1sum shred sort \
+               split stat sum tac tail tee test tr tsort tty unexpand uniq \
+               unlink uptime users vdir wc who whoami yes \
+               "
+
+base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill \
+                    ln ls mkdir mknod mv pwd rm rmdir sleep stty sync touch \
+                    true uname \
+                    "
+
+sbindir_progs= "chroot"
+
+do_install () {
+       autotools_do_install
+       
+       # Renaming the utilities that should go in /usr/bin
+       for i in ${bindir_progs}; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}; done
+       mv ${D}${bindir}/[ ${D}${bindir}/[.${PN}
+       
+       # Renaming and moving the utilities that should go in /bin (FHS)
+       install -d ${D}${base_bindir}
+       for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${PN}; done
+
+       # Renaming and moving the utilities that should go in /usr/sbin (FHS)
+       install -d ${D}${sbindir}
+       for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${PN}; done
+}
+
+pkg_postinst_${PN} () {
+       # The utilities in /usr/bin
+       for i in ${bindir_progs}; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done
+       update-alternatives --install "${bindir}/\[" "\[" "\[.${PN}" 100
+       
+       # The utilities in /bin
+       for i in ${base_bindir_progs}; do update-alternatives --install ${base_bindir}/$i $i $i.${PN} 100; done
+       
+       # The utilities in /usr/sbin
+       for i in ${sbindir_progs}; do update-alternatives --install ${sbindir}/$i $i $i.${PN} 100; done
+}
+
+pkg_prerm_${PN} () {
+       # The utilities in /usr/bin
+       for i in ${bindir_progs}; do update-alternatives --remove $i $i.${PN}; done
+       update-alternatives --remove "\[" "\[.${PN}"
+
+       # The utilities in /bin
+       for i in ${base_bindir_progs}; do update-alternatives --remove $i $i.${PN}; done
+
+       # The utilities in /usr/sbin
+       for i in ${sbindir_progs}; do update-alternatives --remove $i $i.${PN}; done
+}
index 020ca58..e7ee85e 100644 (file)
@@ -3,10 +3,26 @@ HOMEPAGE = "http://www.gnu.org/software/cpio/"
 SECTION = "console"
 LICENSE = "GPL"
 MAINTAINER = "Chris Larson <kergoth@handhelds.org>"
-PR = "r2"
+PR = "r3"
 
 SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \
           file://install.patch;patch=1"
 S = "${WORKDIR}/cpio-${PV}"
 
 inherit autotools
+
+do_install () {
+       autotools_do_install
+       mv ${D}${libexecdir}/rmt ${D}${libexecdir}/rmt.${PN}
+}
+
+
+pkg_postinst_${PN} () {
+       update-alternatives --install ${libexecdir}/rmt rmt rmt.${PN} 50
+}
+
+
+pkg_prerm_${PN} () {
+       update-alternatives --remove rmt rmt.${PN}
+}
+
index 0ebcbce..bf93f7e 100644 (file)
@@ -2,9 +2,9 @@ LICENSE = "GPL"
 SECTION = "interpreters"
 DESCRIPTION = "A program that you can use to select particular records in a \
 file and perform operations upon them."
-PR = "r1"
+PR = "r2"
 PACKAGES += "gawk-common pgawk"
-FILES_${PN} = "${bindir}/gawk* ${bindir}/igawk ${bindir}/awk*"
+FILES_${PN} = "${bindir}/gawk* ${bindir}/igawk"
 FILES_gawk-common += "${datadir}/awk ${libexecdir}/awk"
 FILES_pgawk = "${bindir}/pgawk*"
 RDEPENDS_gawk += "gawk-common"
@@ -17,3 +17,13 @@ inherit autotools
 do_configure_prepend () {
        grep -E '^AC_DEFUN' m4/*.m4|grep -E '\(\[?(AM|AC)_'|xargs rm -f
 }
+
+pkg_postinst_${PN} () {
+       update-alternatives --install ${bindir}/awk awk gawk 100
+}
+
+
+pkg_prerm_${PN} () {
+       update-alternatives --remove awk gawk
+}
+
index 0f18902..8f6b9b3 100644 (file)
@@ -2,6 +2,7 @@ LICENSE = "GPL"
 SECTION = "console/utils"
 DESCRIPTION = "grep GNU utility"
 MAINTAINER = "Pawel Osiczko <p.osiczko@tetrapyloctomy.org>"
+PR = "r1"
 
 SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.bz2"
 
@@ -13,3 +14,24 @@ do_configure () {
        rm -f ${S}/m4/init.m4
        autotools_do_configure
 }
+
+do_install () {
+       autotools_do_install
+       install -d ${D}${base_bindir}
+       mv ${D}${bindir}/grep ${D}${base_bindir}/grep.${PN}
+       mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep.${PN}
+       mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep.${PN}
+}
+
+
+pkg_postinst_${PN} () {
+       update-alternatives --install ${base_bindir}/grep grep grep.${PN} 100
+       update-alternatives --install ${base_bindir}/egrep egrep egrep.${PN} 100
+       update-alternatives --install ${base_bindir}/fgrep fgrep fgrep.${PN} 100
+}
+
+pkg_prerm_${PN} () {
+       update-alternatives --remove grep grep.${PN}
+       update-alternatives --remove egrep egrep.${PN}
+       update-alternatives --remove fgrep fgrep.${PN}
+}
index 58e7b59..f400617 100644 (file)
@@ -12,7 +12,7 @@ inherit autotools
 
 # This keeps only tput/tset in ncurses
 # clear/reset are in already busybox
-FILES_ncurses-tools = "${bindir}/tic ${bindir}/toe ${bindir}/infotocap ${bindir}/captoinfo ${bindir}/infocmp ${bindir}/clear ${bindir}/reset ${bindir}/tack "
+FILES_ncurses-tools = "${bindir}/tic ${bindir}/toe ${bindir}/infotocap ${bindir}/captoinfo ${bindir}/infocmp ${bindir}/clear.${PN} ${bindir}/reset.${PN} ${bindir}/tack "
 FILES_ncurses-terminfo = "${datadir}/terminfo"
 FILES_${PN} = "${bindir}/tput ${bindir}/tset ${libdir}/lib*.so.* usr/share/tabset etc/terminfo"
 
@@ -73,4 +73,19 @@ do_install() {
        then
                ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm
        fi
+
+       mv ${D}${bindir}/clear ${D}${bindir}/clear.${PN}
+       mv ${D}${bindir}/reset ${D}${bindir}/reset.${PN}
+}
+               
+               
+pkg_postinst_ncurses-tools () {
+       update-alternatives --install ${bindir}/clear clear clear.${PN} 100
+       update-alternatives --install ${bindir}/reset reset reset.${PN} 100
+}
+                               
+                       
+pkg_prerm_ncurses-tools () {
+       update-alternatives --remove clear clear.${PN}
+       update-alternatives --remove reset reset.${PN}
 }
index 61909d5..5b03eaa 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r7"
+PR = "r8"
 
 SRC_URI = "${GNU_MIRROR}/ncurses/ncurses-${PV}.tar.gz \
           file://visibility.patch;patch=1"
index eac4a9c..fe80f3e 100644 (file)
@@ -1,8 +1,26 @@
 LICENSE = "GPL"
 SECTION = "console/utils"
 DESCRIPTION = "sed is a Stream EDitor."
+PR = "r1"
 
 SRC_URI = "${GNU_MIRROR}/sed/sed-${PV}.tar.gz"
 S = "${WORKDIR}/sed-${PV}"
 
 inherit autotools
+
+do_install () {
+       autotools_do_install
+       install -d ${D}${base_bindir}
+       mv ${D}${bindir}/sed ${D}${base_bindir}/sed.${PN}
+}
+
+
+pkg_postinst_${PN} () {
+       update-alternatives --install ${base_bindir}/sed sed sed.${PN} 100
+}
+
+
+pkg_prerm_${PN} () {
+       update-alternatives --remove sed sed.${PN}
+}
+
index d7b68eb..cfe6164 100644 (file)
@@ -3,7 +3,7 @@ SECTION = "base"
 LICENSE = "GPL"
 MAINTAINER = "Chris Larson <kergoth@handhelds.org>"
 HOMEPAGE = "http://freshmeat.net/projects/sysvinit/"
-PR = "r15"
+PR = "r16"
 
 # USE_VT and SERIAL_CONSOLE are generally defined by the MACHINE .conf.
 # Set PACKAGE_ARCH appropriately.
@@ -40,7 +40,7 @@ ALTERNATIVE_PRIORITY = "50"
 
 PACKAGES =+ "sysvinit-pidof sysvinit-sulogin"
 FILES_${PN} += "${base_sbindir} ${base_bindir}"
-FILES_sysvinit-pidof = "${base_bindir}/pidof"
+FILES_sysvinit-pidof = "${base_bindir}/pidof.sysvinit"
 FILES_sysvinit-sulogin = "${base_sbindir}/sulogin"
 
 CFLAGS_prepend = "-D_GNU_SOURCE "
@@ -89,5 +89,38 @@ EOF
                install -d ${D}${sysconfdir}/rc$level.d
                ln -s ../init.d/stop-bootlogd ${D}${sysconfdir}/rc$level.d/S99stop-bootlogd
        done
-       mv                 ${D}${base_sbindir}/init               ${D}${base_sbindir}/init.sysvinit
+       mv                 ${D}${base_sbindir}/init               ${D}${base_sbindir}/init.${PN}
+       mv ${D}${base_bindir}/pidof ${D}${base_bindir}/pidof.${PN}
+       mv ${D}${base_sbindir}/halt ${D}${base_sbindir}/halt.${PN}
+       mv ${D}${base_sbindir}/reboot ${D}${base_sbindir}/reboot.${PN}
+       mv ${D}${base_sbindir}/shutdown ${D}${base_sbindir}/shutdown.${PN}
+       mv ${D}${bindir}/last ${D}${bindir}/last.${PN}
+       mv ${D}${bindir}/mesg ${D}${bindir}/mesg.${PN}
+       mv ${D}${bindir}/wall ${D}${bindir}/wall.${PN}
+}
+
+pkg_postinst_${PN} () {
+       update-alternatives --install ${base_sbindir}/halt halt halt.${PN} 200
+       update-alternatives --install ${base_sbindir}/reboot reboot reboot.${PN} 200
+       update-alternatives --install ${base_sbindir}/shutdown shutdown shutdown.${PN} 200
+       update-alternatives --install ${bindir}/last last last.${PN} 200
+       update-alternatives --install ${bindir}/mesg mesg mesg.${PN} 200
+       update-alternatives --install ${bindir}/wall wall wall.${PN} 200
+}
+
+pkg_prerm_${PN} () {
+       update-alternatives --remove halt halt.${PN}
+       update-alternatives --remove reboot reboot.${PN}
+       update-alternatives --remove shutdown shutdown.${PN}
+       update-alternatives --remove last last.${PN}
+       update-alternatives --remove mesg mesg.${PN}
+       update-alternatives --remove wall wall.${PN}
+}
+
+pkg_postinst_sysvinit-pidof () {
+       update-alternatives --install ${base_bindir}/pidof pidof pidof.${PN} 200
+}
+
+pkg_prerm_sysvinit-pidof () {
+       update-alternatives --remove pidof pidof.${PN}
 }
index 19600c6..971bc56 100644 (file)
@@ -3,9 +3,27 @@ DESCRIPTION = "GNU tar saves many files together into a single tape \
 or disk archive, and can restore individual files from the archive."
 LICENSE = "GPL"
 MAINTAINER = "Chris Larson <kergoth@handhelds.org>"
+PR = "r1"
 
 SRC_URI = "ftp://alpha.gnu.org/gnu/tar/tar-${PV}.tar.gz \
           file://configure.patch;patch=1 \
           file://m4.patch;patch=1"
 
 inherit autotools
+
+do_install () {
+       autotools_do_install
+       install -d ${D}${base_bindir}
+       mv ${D}${bindir}/tar ${D}${base_bindir}/tar.${PN}
+       mv ${D}${libexecdir}/rmt ${D}${libexecdir}/rmt.${PN}
+}
+
+pkg_postinst_${PN} () {
+       update-alternatives --install ${base_bindir}/tar tar tar.${PN} 100
+       update-alternatives --install ${libexecdir}/rmt rmt rmt.${PN} 100
+}
+
+pkg_prerm_${PN} () {
+       update-alternatives --remove tar tar.${PN}
+       update-alternatives --remove rmt rmt.${PN}
+}
index 5d4ed80..505fcbe 100644 (file)
@@ -14,7 +14,7 @@ SRC_URI = "ftp://ftp.kernel.org/pub/linux/utils/util-linux/util-linux-${PV}.tar.
 
 PACKAGES_prepend = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-readprofile "
 
-FILES_util-linux-fdisk = "/sbin/fdisk"
+FILES_util-linux-fdisk = "/sbin/fdisk.${PN}"
 FILES_util-linux-cfdisk = "/sbin/cfdisk"
 FILES_util-linux-sfdisk = "/sbin/sfdisk"
 FILES_util-linux-readprofile = "/usr/sbin/readprofile"
@@ -39,4 +39,82 @@ do_install () {
        oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \
                'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \
                'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install
+
+       mv ${D}${base_bindir}/dmesg ${D}${base_bindir}/dmesg.${PN}
+       mv ${D}${base_bindir}/kill ${D}${base_bindir}/kill.${PN}
+       mv ${D}${base_bindir}/more ${D}${base_bindir}/more.${PN}
+       mv ${D}${base_sbindir}/halt ${D}${base_sbindir}/halt.${PN}
+       mv ${D}${base_sbindir}/hwclock ${D}${base_sbindir}/hwclock.${PN}
+       mv ${D}${base_sbindir}/losetup ${D}${base_sbindir}/losetup.${PN}
+       mv ${D}${base_sbindir}/mkswap ${D}${base_sbindir}/mkswap.${PN}
+       mv ${D}${base_sbindir}/pivot_root ${D}${base_sbindir}/pivot_root.${PN}
+       mv ${D}${base_sbindir}/reboot ${D}${base_sbindir}/reboot.${PN}
+       mv ${D}${base_sbindir}/shutdown ${D}${base_sbindir}/shutdown.${PN}
+       mv ${D}${base_sbindir}/sln ${D}${base_sbindir}/sln.${PN}
+       mv ${D}${base_sbindir}/swapoff ${D}${base_sbindir}/swapoff.${PN}
+       mv ${D}${base_sbindir}/swapon ${D}${base_sbindir}/swapon.${PN}
+       mv ${D}${bindir}/hexdump ${D}${bindir}/hexdump.${PN}
+       mv ${D}${bindir}/last ${D}${bindir}/last.${PN}
+       mv ${D}${bindir}/logger ${D}${bindir}/logger.${PN}
+       mv ${D}${bindir}/mesg ${D}${bindir}/mesg.${PN}
+       mv ${D}${bindir}/renice ${D}${bindir}/renice.${PN}
+       mv ${D}${bindir}/wall ${D}${bindir}/wall.${PN}
+
+       mv ${D}${base_sbindir}/fdisk ${D}${base_sbindir}/fdisk.${PN}
+}
+
+pkg_postinst_${PN} () {
+       update-alternatives --install ${base_bindir}/dmesg dmesg dmesg.${PN} 100
+       update-alternatives --install ${base_bindir}/kill kill kill.${PN} 100
+       update-alternatives --install ${base_bindir}/more more more.${PN} 100
+       update-alternatives --install ${base_sbindir}/hwclock hwclock hwclock.${PN} 100
+       update-alternatives --install ${base_sbindir}/losetup losetup losetup.${PN} 100
+       update-alternatives --install ${base_sbindir}/mkswap mkswap mkswap.${PN} 100
+       update-alternatives --install ${base_sbindir}/pivot_root pivot_root pivot_root.${PN} 100
+       update-alternatives --install ${base_sbindir}/sln sln sln.${PN} 100
+       update-alternatives --install ${base_sbindir}/swapoff swapoff swapoff.${PN} 100
+       update-alternatives --install ${base_sbindir}/swapon swapon swapon.${PN} 100
+       update-alternatives --install ${bindir}/hexdump hexdump hexdump.${PN} 100
+       update-alternatives --install ${bindir}/last last last.${PN} 100
+       update-alternatives --install ${bindir}/logger logger logger.${PN} 100
+       update-alternatives --install ${bindir}/mesg mesg mesg.${PN} 100
+       update-alternatives --install ${bindir}/renice renice renice.${PN} 100
+       update-alternatives --install ${bindir}/wall wall wall.${PN} 100
+       
+       # There seems to be problem, atleast on nslu2, with these, untill they are
+       # fixed the busybox ones have higher priority
+       update-alternatives --install ${base_sbindir}/shutdown shutdown shutdown.${PN} 10
+       update-alternatives --install ${base_sbindir}/reboot reboot reboot.${PN} 10
+       update-alternatives --install ${base_sbindir}/halt halt halt.${PN} 10
+}
+
+pkg_prerm_${PN} () {
+       update-alternatives --remove dmesg dmesg.${PN}
+       update-alternatives --remove kill kill.${PN}
+       update-alternatives --remove more more.${PN}
+       update-alternatives --remove halt halt.${PN}
+       update-alternatives --remove hwclock hwclock.${PN}
+       update-alternatives --remove losetup losetup.${PN}
+       update-alternatives --remove mkswap mkswap.${PN}
+       update-alternatives --remove pivot_root pivot_root.${PN}
+       update-alternatives --remove reboot reboot.${PN}
+       update-alternatives --remove shutdown shutdown.${PN}
+       update-alternatives --remove sln sln.${PN}
+       update-alternatives --remove swapoff swapoff.${PN}
+       update-alternatives --remove swapon swapon.${PN}
+       update-alternatives --remove hexdump hexdump.${PN}
+       update-alternatives --remove last last.${PN}
+       update-alternatives --remove logger logger.${PN}
+       update-alternatives --remove mesg mesg.${PN}
+       update-alternatives --remove renice renice.${PN}
+       update-alternatives --remove wall wall.${PN}
 }
+
+pkg_postinst_util-linux-fdisk () {
+       update-alternatives --install ${base_sbindir}/fdisk fdisk fdisk.${PN} 100
+}
+
+pkg_prerm_util-linux-fdisk () {
+       update-alternatives --remove fdisk fdisk.${PN}
+}
+
index 16ccb6f..ee95220 100644 (file)
@@ -19,3 +19,16 @@ do_configure () {
        rm -f libtool.m4
        autotools_do_configure
 }
+
+do_install () {
+       autotools_do_install
+       mv ${D}${bindir}/wget ${D}${bindir}/wget.${PN}
+}
+
+pkg_postinst_${PN} () {
+       update-alternatives --install ${bindir}/wget wget wget.${PN} 100
+}
+
+pkg_prerm_${PN} () {
+       update-alternatives --remove wget wget.${PN}
+}