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 | |
parent | 26f34098c88acff55636cdaf64bdd0a5ac0e3d5d (diff) | |
download | poky-f5dcdf918110ed8033a0e4ee80fbf29e6816fef4.tar.gz |
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>
3 files changed, 188 insertions, 0 deletions
diff --git a/meta-lsb/packages/net-tools/net-tools-1.60-23/net-tools-config.h b/meta-lsb/packages/net-tools/net-tools-1.60-23/net-tools-config.h new file mode 100644 index 0000000000..92c527a51e --- /dev/null +++ b/meta-lsb/packages/net-tools/net-tools-1.60-23/net-tools-config.h | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * config.h Automatically generated configuration includefile | ||
3 | * | ||
4 | * NET-TOOLS A collection of programs that form the base set of the | ||
5 | * NET-3 Networking Distribution for the LINUX operating | ||
6 | * system. | ||
7 | * | ||
8 | * DO NOT EDIT DIRECTLY | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | /* | ||
13 | * | ||
14 | * Internationalization | ||
15 | * | ||
16 | * The net-tools package has currently been translated to French, | ||
17 | * German and Brazilian Portugese. Other translations are, of | ||
18 | * course, welcome. Answer `n' here if you have no support for | ||
19 | * internationalization on your system. | ||
20 | * | ||
21 | */ | ||
22 | #define I18N 1 | ||
23 | |||
24 | /* | ||
25 | * | ||
26 | * Protocol Families. | ||
27 | * | ||
28 | */ | ||
29 | #define HAVE_AFUNIX 1 | ||
30 | #define HAVE_AFINET 1 | ||
31 | #define HAVE_AFINET6 1 | ||
32 | #define HAVE_AFIPX 0 | ||
33 | #define HAVE_AFATALK 0 | ||
34 | #define HAVE_AFAX25 0 | ||
35 | #define HAVE_AFNETROM 1 | ||
36 | #define HAVE_AFROSE 0 | ||
37 | #define HAVE_AFX25 0 | ||
38 | #define HAVE_AFECONET 0 | ||
39 | #define HAVE_AFDECnet 0 | ||
40 | #define HAVE_AFASH 0 | ||
41 | |||
42 | /* | ||
43 | * | ||
44 | * Device Hardware types. | ||
45 | * | ||
46 | */ | ||
47 | #define HAVE_HWETHER 1 | ||
48 | #define HAVE_HWARC 1 | ||
49 | #define HAVE_HWSLIP 1 | ||
50 | #define HAVE_HWPPP 1 | ||
51 | #define HAVE_HWTUNNEL 1 | ||
52 | #define HAVE_HWSTRIP 1 | ||
53 | #define HAVE_HWTR 1 | ||
54 | #define HAVE_HWAX25 0 | ||
55 | #define HAVE_HWROSE 0 | ||
56 | #define HAVE_HWNETROM 1 | ||
57 | #define HAVE_HWX25 0 | ||
58 | #define HAVE_HWFR 1 | ||
59 | #define HAVE_HWSIT 0 | ||
60 | #define HAVE_HWFDDI 0 | ||
61 | #define HAVE_HWHIPPI 0 | ||
62 | #define HAVE_HWASH 0 | ||
63 | #define HAVE_HWHDLCLAPB 0 | ||
64 | #define HAVE_HWIRDA 1 | ||
65 | #define HAVE_HWEC 0 | ||
66 | #define HAVE_HWIB 0 | ||
67 | |||
68 | /* | ||
69 | * | ||
70 | * Other Features. | ||
71 | * | ||
72 | */ | ||
73 | #define HAVE_FW_MASQUERADE 1 | ||
74 | #define HAVE_IP_TOOLS 1 | ||
75 | #define HAVE_MII 1 | ||
diff --git a/meta-lsb/packages/net-tools/net-tools-1.60-23/net-tools-config.make b/meta-lsb/packages/net-tools/net-tools-1.60-23/net-tools-config.make new file mode 100644 index 0000000000..ec516f27ee --- /dev/null +++ b/meta-lsb/packages/net-tools/net-tools-1.60-23/net-tools-config.make | |||
@@ -0,0 +1,36 @@ | |||
1 | I18N=1 | ||
2 | HAVE_AFUNIX=1 | ||
3 | HAVE_AFINET=1 | ||
4 | HAVE_AFINET6=1 | ||
5 | # HAVE_AFIPX=0 | ||
6 | # HAVE_AFATALK=0 | ||
7 | # HAVE_AFAX25=0 | ||
8 | HAVE_AFNETROM=1 | ||
9 | # HAVE_AFROSE=0 | ||
10 | # HAVE_AFX25=0 | ||
11 | # HAVE_AFECONET=0 | ||
12 | # HAVE_AFDECnet=0 | ||
13 | # HAVE_AFASH=0 | ||
14 | HAVE_HWETHER=1 | ||
15 | HAVE_HWARC=1 | ||
16 | HAVE_HWSLIP=1 | ||
17 | HAVE_HWPPP=1 | ||
18 | HAVE_HWTUNNEL=1 | ||
19 | HAVE_HWSTRIP=1 | ||
20 | HAVE_HWTR=1 | ||
21 | # HAVE_HWAX25=0 | ||
22 | # HAVE_HWROSE=0 | ||
23 | HAVE_HWNETROM=1 | ||
24 | # HAVE_HWX25=0 | ||
25 | HAVE_HWFR=1 | ||
26 | # HAVE_HWSIT=0 | ||
27 | # HAVE_HWFDDI=0 | ||
28 | # HAVE_HWHIPPI=0 | ||
29 | # HAVE_HWASH=0 | ||
30 | # HAVE_HWHDLCLAPB=0 | ||
31 | HAVE_HWIRDA=1 | ||
32 | # HAVE_HWEC=0 | ||
33 | # HAVE_HWIB=0 | ||
34 | HAVE_FW_MASQUERADE=1 | ||
35 | HAVE_IP_TOOLS=1 | ||
36 | HAVE_MII=1 | ||
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 0000000000..031169c067 --- /dev/null +++ b/meta-lsb/packages/net-tools/net-tools_1.60-23.bb | |||
@@ -0,0 +1,77 @@ | |||
1 | SUMMARY="A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system" | ||
2 | HOMEPAGE = "http://net-tools.berlios.de/" | ||
3 | BUGTRACKER = "http://bugs.debian.org/net-tools" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ | ||
6 | file://ifconfig.c;startline=11;endline=15;md5=da4c7bb79a5d0798faa99ef869721f4a" | ||
7 | PR = "r0" | ||
8 | |||
9 | SRC_URI = "ftp://ftp.debian.org/debian/pool/main/n/net-tools/net-tools_1.60.orig.tar.gz \ | ||
10 | ftp://ftp.debian.org/debian/pool/main/n/net-tools/${PN}_${PV}.diff.gz;apply=no \ | ||
11 | file://net-tools-config.h \ | ||
12 | file://net-tools-config.make" | ||
13 | |||
14 | S = "${WORKDIR}/net-tools-1.60" | ||
15 | |||
16 | inherit gettext | ||
17 | |||
18 | # The Makefile is lame, no parallel build | ||
19 | PARALLEL_MAKE = "" | ||
20 | |||
21 | # Unlike other Debian packages, net-tools *.diff.gz contains another series of | ||
22 | # patches maintained by quilt. So manually apply them before applying other local | ||
23 | # patches. Also remove all temp files before leaving, because do_patch() will pop | ||
24 | # up all previously applied patches in the start | ||
25 | nettools_do_patch() { | ||
26 | cd ${S} | ||
27 | patch -p1 < ${WORKDIR}/${PN}_${PV}.diff | ||
28 | QUILT_PATCHES=${S}/debian/patches quilt push -a | ||
29 | rm -rf ${S}/patches ${S}/.pc | ||
30 | } | ||
31 | |||
32 | # We invoke base do_patch at end, to incorporate any local patch | ||
33 | python do_patch() { | ||
34 | bb.build.exec_func('nettools_do_patch', d) | ||
35 | bb.build.exec_func('patch_do_patch', d) | ||
36 | } | ||
37 | |||
38 | do_configure() { | ||
39 | # net-tools has its own config mechanism requiring "make config" | ||
40 | # we pre-generate desired options and copy to source directory instead | ||
41 | cp ${WORKDIR}/net-tools-config.h ${S}/config.h | ||
42 | cp ${WORKDIR}/net-tools-config.make ${S}/config.make | ||
43 | } | ||
44 | |||
45 | do_compile() { | ||
46 | # net-tools use COPTS/LOPTS to allow adding custom options | ||
47 | export COPTS="$CFLAGS" | ||
48 | export LOPTS="$LDFLAGS" | ||
49 | unset CFLAGS | ||
50 | unset LDFLAGS | ||
51 | |||
52 | oe_runmake | ||
53 | } | ||
54 | |||
55 | do_install() { | ||
56 | oe_runmake 'BASEDIR=${D}' install | ||
57 | |||
58 | for app in ${D}/${base_sbindir}/* ${D}/${base_bindir}/*; do | ||
59 | mv $app $app.${PN} | ||
60 | done | ||
61 | } | ||
62 | |||
63 | pkg_postinst_${PN} () { | ||
64 | for app in arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach ; do | ||
65 | update-alternatives --install ${base_sbindir}/$app $app $app.${PN} 100 | ||
66 | done | ||
67 | |||
68 | for app in dnsdomainname domainname hostname netstat nisdomainname ypdomainname ; do | ||
69 | update-alternatives --install ${base_bindir}/$app $app $app.${PN} 100 | ||
70 | done | ||
71 | } | ||
72 | |||
73 | pkg_prerm_${PN} () { | ||
74 | for app in arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach dnsdomainname domainname hostname netstat nisdomainname ypdomainname ; do | ||
75 | update-alternatives --remove $app $app.${PN} | ||
76 | done | ||
77 | } | ||