diff options
author | Kevin Tian <kevin.tian@intel.com> | 2010-08-16 15:40:50 +0800 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-19 13:11:25 +0100 |
commit | f5dcdf918110ed8033a0e4ee80fbf29e6816fef4 (patch) | |
tree | 3009f1cc9be6bcfb175e1a0b3b7936b53e82816d /meta-lsb/packages/net-tools/net-tools_1.60-23.bb | |
parent | 26f34098c88acff55636cdaf64bdd0a5ac0e3d5d (diff) | |
download | openembedded-core-f5dcdf918110ed8033a0e4ee80fbf29e6816fef4.tar.gz openembedded-core-f5dcdf918110ed8033a0e4ee80fbf29e6816fef4.tar.bz2 openembedded-core-f5dcdf918110ed8033a0e4ee80fbf29e6816fef4.tar.xz openembedded-core-f5dcdf918110ed8033a0e4ee80fbf29e6816fef4.zip |
net-tools: add new recipe (1.60-23)
Borrow from OpenEmbedded with below difference:
- use Debian as the SRC_URI
- instead of copying all Debian locally, handle it in recipe automatically
which eases our maintenance effort in the future
- enable gettext
It's said the net-tools is deprecated by iproute2. However not all utilities
are replaced yet, such as hostname, domainname, netstat, slattach, ...
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Diffstat (limited to 'meta-lsb/packages/net-tools/net-tools_1.60-23.bb')
-rw-r--r-- | meta-lsb/packages/net-tools/net-tools_1.60-23.bb | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/meta-lsb/packages/net-tools/net-tools_1.60-23.bb b/meta-lsb/packages/net-tools/net-tools_1.60-23.bb new file mode 100644 index 000000000..031169c06 --- /dev/null +++ b/meta-lsb/packages/net-tools/net-tools_1.60-23.bb @@ -0,0 +1,77 @@ +SUMMARY="A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system" +HOMEPAGE = "http://net-tools.berlios.de/" +BUGTRACKER = "http://bugs.debian.org/net-tools" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ + file://ifconfig.c;startline=11;endline=15;md5=da4c7bb79a5d0798faa99ef869721f4a" +PR = "r0" + +SRC_URI = "ftp://ftp.debian.org/debian/pool/main/n/net-tools/net-tools_1.60.orig.tar.gz \ + ftp://ftp.debian.org/debian/pool/main/n/net-tools/${PN}_${PV}.diff.gz;apply=no \ + file://net-tools-config.h \ + file://net-tools-config.make" + +S = "${WORKDIR}/net-tools-1.60" + +inherit gettext + +# The Makefile is lame, no parallel build +PARALLEL_MAKE = "" + +# Unlike other Debian packages, net-tools *.diff.gz contains another series of +# patches maintained by quilt. So manually apply them before applying other local +# patches. Also remove all temp files before leaving, because do_patch() will pop +# up all previously applied patches in the start +nettools_do_patch() { + cd ${S} + patch -p1 < ${WORKDIR}/${PN}_${PV}.diff + QUILT_PATCHES=${S}/debian/patches quilt push -a + rm -rf ${S}/patches ${S}/.pc +} + +# We invoke base do_patch at end, to incorporate any local patch +python do_patch() { + bb.build.exec_func('nettools_do_patch', d) + bb.build.exec_func('patch_do_patch', d) +} + +do_configure() { + # net-tools has its own config mechanism requiring "make config" + # we pre-generate desired options and copy to source directory instead + cp ${WORKDIR}/net-tools-config.h ${S}/config.h + cp ${WORKDIR}/net-tools-config.make ${S}/config.make +} + +do_compile() { + # net-tools use COPTS/LOPTS to allow adding custom options + export COPTS="$CFLAGS" + export LOPTS="$LDFLAGS" + unset CFLAGS + unset LDFLAGS + + oe_runmake +} + +do_install() { + oe_runmake 'BASEDIR=${D}' install + + for app in ${D}/${base_sbindir}/* ${D}/${base_bindir}/*; do + mv $app $app.${PN} + done +} + +pkg_postinst_${PN} () { + for app in arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach ; do + update-alternatives --install ${base_sbindir}/$app $app $app.${PN} 100 + done + + for app in dnsdomainname domainname hostname netstat nisdomainname ypdomainname ; do + update-alternatives --install ${base_bindir}/$app $app $app.${PN} 100 + done +} + +pkg_prerm_${PN} () { + for app in arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach dnsdomainname domainname hostname netstat nisdomainname ypdomainname ; do + update-alternatives --remove $app $app.${PN} + done +} |