blob: aefc1e6e7e6f26d42867ba799dae15984d9e11de [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Basic networking tools"
2DESCRIPTION = "A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system"
3HOMEPAGE = "http://net-tools.berlios.de/"
4BUGTRACKER = "http://bugs.debian.org/net-tools"
5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
7 file://ifconfig.c;beginline=11;endline=15;md5=d1ca372080ad5401e23ca0afc35cf9ba"
8
9SRC_URI = "http://snapshot.debian.org/archive/debian/20050312T000000Z/pool/main/n/${BPN}/${BPN}_1.60.orig.tar.gz;name=tarball \
10 http://snapshot.debian.org/archive/debian//20150831T093342Z/pool/main/n/${BPN}/${BPN}_${PV}.diff.gz;apply=no;name=patch \
11 file://net-tools-config.h \
12 file://net-tools-config.make \
13 file://ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch \
14 "
15
16S = "${WORKDIR}/net-tools-1.60"
17
18SRC_URI[tarball.md5sum] = "ecaf37acb5b5daff4bdda77785fd916d"
19SRC_URI[tarball.sha256sum] = "ec67967cf7b1a3a3828a84762fbc013ac50ee5dc9aa3095d5c591f302c2de0f5"
20
21SRC_URI[patch.md5sum] = "ea3592f49ac8380962bc4d9b66c7e7e9"
22SRC_URI[patch.sha256sum] = "aeeeafaff68866a446f01bb639d4e0146a60af34dcd20e31a3e46585022fc76c"
23
24inherit gettext
25
26# The Makefile is lame, no parallel build
27PARALLEL_MAKE = ""
28
29# Unlike other Debian packages, net-tools *.diff.gz contains another series of
30# patches maintained by quilt. So manually apply them before applying other local
31# patches. Also remove all temp files before leaving, because do_patch() will pop
32# up all previously applied patches in the start
33nettools_do_patch() {
34 cd ${S}
35 quilt pop -a || true
36 if [ -d ${S}/.pc-nettools ]; then
37 rm -rf ${S}/.pc
38 mv ${S}/.pc-nettools ${S}/.pc
39 QUILT_PATCHES=${S}/debian/patches quilt pop -a
40 rm -rf ${S}/.pc ${S}/debian
41 fi
42 patch -p1 < ${WORKDIR}/${BPN}_${PV}.diff
43 QUILT_PATCHES=${S}/debian/patches quilt push -a
44 mv ${S}/.pc ${S}/.pc-nettools
45}
46
47do_unpack[cleandirs] += "${S}"
48
49# We invoke base do_patch at end, to incorporate any local patch
50python do_patch() {
51 bb.build.exec_func('nettools_do_patch', d)
52 bb.build.exec_func('patch_do_patch', d)
53}
54
55do_configure() {
56 # net-tools has its own config mechanism requiring "make config"
57 # we pre-generate desired options and copy to source directory instead
58 cp ${WORKDIR}/net-tools-config.h ${S}/config.h
59 cp ${WORKDIR}/net-tools-config.make ${S}/config.make
60}
61
62do_compile() {
63 # net-tools use COPTS/LOPTS to allow adding custom options
64 export COPTS="$CFLAGS"
65 export LOPTS="$LDFLAGS"
66 unset CFLAGS
67 unset LDFLAGS
68
69 oe_runmake
70}
71
72do_install() {
73 oe_runmake 'BASEDIR=${D}' install
74}
75
76inherit update-alternatives
77
78base_sbindir_progs = "arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach"
79base_bindir_progs = "dnsdomainname domainname hostname netstat nisdomainname ypdomainname"
80
81ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}"
82python __anonymous() {
83 for prog in d.getVar('base_sbindir_progs', True).split():
84 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir', True), prog))
85 for prog in d.getVar('base_bindir_progs', True).split():
86 d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
87}
88ALTERNATIVE_PRIORITY = "100"
89