add net-tools package (closes: #1197)
authorNicolas Thill <nico@openwrt.org>
Sat, 27 Jan 2007 17:00:57 +0000 (17:00 +0000)
committerNicolas Thill <nico@openwrt.org>
Sat, 27 Jan 2007 17:00:57 +0000 (17:00 +0000)
SVN-Revision: 6221

net/net-tools/Makefile [new file with mode: 0644]
net/net-tools/patches/01-config.patch [new file with mode: 0644]
net/net-tools/patches/02-compile-fixes.patch [new file with mode: 0644]

diff --git a/net/net-tools/Makefile b/net/net-tools/Makefile
new file mode 100644 (file)
index 0000000..a744fbf
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# $Id$
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=net-tools
+PKG_VERSION:=1.60
+PKG_RELEASE:=1
+
+PKG_MD5SUM:=888774accab40217dde927e21979c165
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://www.tazenda.demon.co.uk/phil/net-tools/
+PKG_CAT:=bzcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/net-tools
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Original net-tools
+  DESCRIPTION:=\
+       The net-tools package contains usual linux commands: \\\
+       arp, hostname, ipmaddr, iptunnel, mii-tool, nameif, netstat, plipconfig, rarp, \\\
+       route and slattach.
+  URL:=http://www.tazenda.demon.co.uk/phil/net-tools/
+endef
+
+define Build/Compile
+        $(MAKE) -C $(PKG_BUILD_DIR) \
+                CC="$(TARGET_CC)" \
+                COPTS="$(TARGET_CFLAGS)" 
+endef
+
+define Package/net-tools/install
+       $(INSTALL_DIR) $(1)/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/netstat $(1)/bin/
+       $(INSTALL_DIR) $(1)/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/route $(1)/sbin/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/arp $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostname $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ipmaddr $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/iptunnel $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/mii-tool $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/nameif $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/plipconfig $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/rarp $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/slattach $(1)/usr/sbin/
+endef
+
+# FIXME: check if commands are really provided by busybox (busybox | grep <name>)
+define Package/net-tools/postrm
+#!/bin/sh
+ln -sf busybox $${IPKG_INSTROOT}/bin/netstat
+ln -sf ../bin/busybox $${IPKG_INSTROOT}/sbin/route
+endef
+
+$(eval $(call BuildPackage,net-tools))
diff --git a/net/net-tools/patches/01-config.patch b/net/net-tools/patches/01-config.patch
new file mode 100644 (file)
index 0000000..04760fb
--- /dev/null
@@ -0,0 +1,209 @@
+--- /dev/null  2006-11-02 13:38:16.000000000 +0100
++++ net-tools-1.60.works/config.make   2007-01-14 04:43:34.000000000 +0100
+@@ -0,0 +1,35 @@
++# I18N=0
++HAVE_AFUNIX=1
++HAVE_AFINET=1
++HAVE_AFINET6=1
++# HAVE_AFIPX=0
++# HAVE_AFATALK=0
++# HAVE_AFAX25=0
++# HAVE_AFNETROM=0
++# HAVE_AFROSE=0
++# HAVE_AFX25=0
++# HAVE_AFECONET=0
++# HAVE_AFDECnet=0
++# HAVE_AFASH=0
++HAVE_HWETHER=1
++# HAVE_HWARC=0
++# HAVE_HWSLIP=0
++HAVE_HWPPP=1
++HAVE_HWTUNNEL=1
++# HAVE_HWSTRIP=0
++# HAVE_HWTR=0
++# HAVE_HWAX25=0
++# HAVE_HWROSE=0
++# HAVE_HWNETROM=0
++# HAVE_HWX25=0
++# HAVE_HWFR=0
++# HAVE_HWSIT=0
++# HAVE_HWFDDI=0
++# HAVE_HWHIPPI=0
++# HAVE_HWASH=0
++# HAVE_HWHDLCLAPB=0
++# HAVE_HWIRDA=0
++# HAVE_HWEC=0
++HAVE_FW_MASQUERADE=1
++HAVE_IP_TOOLS=1
++HAVE_MII=1
+--- /dev/null  2006-11-02 13:38:16.000000000 +0100
++++ net-tools-1.60.works/config.status 2007-01-14 04:43:34.000000000 +0100
+@@ -0,0 +1,91 @@
++#
++# config.in   Configure.sh source for the net-tools.
++#             This file contains the definition of what the support
++#             library contains.  Most of all, it defines which types
++#             of address families and hardware we know of.
++#
++# NET-TOOLS   A collection of programs that form the base set of the
++#             NET-3 Networking Distribution for the LINUX operating
++#             system.
++#
++# Version:    config.in 1.22  (99-04-19)
++#
++# Author:     Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
++#             Copyright 1988-1993 MicroWalt Corporation
++#
++#             Bernd 'eckes' Eckenfels <net-tools@lina.inka.de>
++#             Arnaldo Carvalho de Melo <acme@conectiva.com.br>
++#               GNU gettext - I18N
++#
++#             This program is free software; you can redistribute it
++#             and/or  modify it under  the terms of  the GNU General
++#             Public  License as  published  by  the  Free  Software
++#             Foundation;  either  version 2 of the License, or  (at
++#             your option) any later version.
++#
++= /*
++=  * config.h Automatically generated configuration includefile
++=  *
++=  * NET-TOOLS        A collection of programs that form the base set of the
++=  *          NET-3 Networking Distribution for the LINUX operating
++=  *          system.
++=  *
++=  *          DO  NOT  EDIT  DIRECTLY
++=  *
++=  */
++*
++*
++*              Internationalization
++*
++* The net-tools package has currently been translated to French,
++* German and Brazilian Portugese.  Other translations are, of
++* course, welcome.  Answer `n' here if you have no support for
++* internationalization on your system.
++*
++bool 'Does your system support GNU gettext?' I18N n
++*
++*
++*             Protocol Families.
++* 
++bool 'UNIX protocol family' HAVE_AFUNIX y
++bool 'INET (TCP/IP) protocol family' HAVE_AFINET y
++bool 'INET6 (IPv6) protocol family' HAVE_AFINET6 n
++bool 'Novell IPX/SPX protocol family' HAVE_AFIPX n
++bool 'Appletalk DDP protocol family' HAVE_AFATALK n
++bool 'AX25 (packet radio) protocol family' HAVE_AFAX25 n
++bool 'NET/ROM (packet radio) protocol family' HAVE_AFNETROM n
++bool 'Rose (packet radio) protocol family' HAVE_AFROSE n
++bool 'X.25 (CCITT) protocol family' HAVE_AFX25 n
++bool 'Econet protocol family' HAVE_AFECONET n
++bool 'DECnet protocol family' HAVE_AFDECnet n
++bool 'Ash protocol family' HAVE_AFASH n
++*
++*
++*            Device Hardware types.
++*
++bool 'Ethernet (generic) support' HAVE_HWETHER y
++bool 'ARCnet support' HAVE_HWARC n
++bool 'SLIP (serial line) support' HAVE_HWSLIP n
++bool 'PPP (serial line) support' HAVE_HWPPP y
++bool 'IPIP Tunnel support' HAVE_HWTUNNEL y
++bool 'STRIP (Metricom radio) support' HAVE_HWSTRIP n
++bool 'Token ring (generic) support' HAVE_HWTR n
++bool 'AX25 (packet radio) support' HAVE_HWAX25 n
++bool 'Rose (packet radio) support' HAVE_HWROSE n
++bool 'NET/ROM (packet radio) support' HAVE_HWNETROM n
++bool 'X.25 (generic) support' HAVE_HWX25 n
++bool 'DLCI/FRAD (frame relay) support' HAVE_HWFR n
++bool 'SIT (IPv6-in-IPv4) support' HAVE_HWSIT n
++bool 'FDDI (generic) support' HAVE_HWFDDI n
++bool 'HIPPI (generic) support' HAVE_HWHIPPI n
++bool 'Ash hardware support' HAVE_HWASH n
++bool '(Cisco)-HDLC/LAPB support' HAVE_HWHDLCLAPB n
++bool 'IrDA support' HAVE_HWIRDA n
++bool 'Econet hardware support' HAVE_HWEC n
++*
++*
++*           Other Features.
++*
++bool 'IP Masquerading support' HAVE_FW_MASQUERADE y
++bool 'Build iptunnel and ipmaddr' HAVE_IP_TOOLS y
++bool 'Build mii-tool' HAVE_MII y
+--- /dev/null  2006-11-02 13:38:16.000000000 +0100
++++ net-tools-1.60.works/config.h      2007-01-14 04:43:34.000000000 +0100
+@@ -0,0 +1,74 @@
++/*
++* config.h    Automatically generated configuration includefile
++*
++* NET-TOOLS   A collection of programs that form the base set of the
++*             NET-3 Networking Distribution for the LINUX operating
++*             system.
++*
++*             DO  NOT  EDIT  DIRECTLY
++*
++*/
++
++/* 
++ * 
++ * Internationalization
++ * 
++ * The net-tools package has currently been translated to French,
++ * German and Brazilian Portugese.  Other translations are, of
++ * course, welcome.  Answer `n' here if you have no support for
++ * internationalization on your system.
++ * 
++ */
++#define I18N 0
++
++/* 
++ * 
++ * Protocol Families.
++ * 
++ */
++#define HAVE_AFUNIX 1
++#define HAVE_AFINET 1
++#define HAVE_AFINET6 1
++#define HAVE_AFIPX 0
++#define HAVE_AFATALK 0
++#define HAVE_AFAX25 0
++#define HAVE_AFNETROM 0
++#define HAVE_AFROSE 0
++#define HAVE_AFX25 0
++#define HAVE_AFECONET 0
++#define HAVE_AFDECnet 0
++#define HAVE_AFASH 0
++
++/* 
++ * 
++ * Device Hardware types.
++ * 
++ */
++#define HAVE_HWETHER 1
++#define HAVE_HWARC 0
++#define HAVE_HWSLIP 0
++#define HAVE_HWPPP 1
++#define HAVE_HWTUNNEL 1
++#define HAVE_HWSTRIP 0
++#define HAVE_HWTR 0
++#define HAVE_HWAX25 0
++#define HAVE_HWROSE 0
++#define HAVE_HWNETROM 0
++#define HAVE_HWX25 0
++#define HAVE_HWFR 0
++#define HAVE_HWSIT 0
++#define HAVE_HWFDDI 0
++#define HAVE_HWHIPPI 0
++#define HAVE_HWASH 0
++#define HAVE_HWHDLCLAPB 0
++#define HAVE_HWIRDA 0
++#define HAVE_HWEC 0
++
++/* 
++ * 
++ * Other Features.
++ * 
++ */
++#define HAVE_FW_MASQUERADE 1
++#define HAVE_IP_TOOLS 1
++#define HAVE_MII 1
diff --git a/net/net-tools/patches/02-compile-fixes.patch b/net/net-tools/patches/02-compile-fixes.patch
new file mode 100644 (file)
index 0000000..a72bf3e
--- /dev/null
@@ -0,0 +1,74 @@
+--- net-tools-1.60/lib/inet_sr.c       2000-02-20 22:46:45.000000000 +0100
++++ net-tools-1.60.works/lib/inet_sr.c 2007-01-14 04:44:40.000000000 +0100
+@@ -105,6 +105,7 @@
+     case 2:
+        isnet = 0; break;
+     default:
++       break;
+     }
+     /* Fill in the other fields. */
+--- net-tools-1.60/hostname.c  2001-04-08 19:04:23.000000000 +0200
++++ net-tools-1.60.works/hostname.c    2007-01-14 04:46:09.000000000 +0100
+@@ -98,6 +98,7 @@
+           fprintf(stderr, _("%s: name too long\n"), program_name);
+           break;
+       default:
++            break;
+       }
+       exit(1);
+     };
+@@ -117,6 +118,7 @@
+           fprintf(stderr, _("%s: name too long\n"), program_name);
+           break;
+       default:
++            break;
+       }
+       exit(1);
+     };
+@@ -174,6 +176,7 @@
+       printf("%s\n", hp->h_name);
+       break;
+     default:
++        break;
+     }
+ }
+@@ -330,7 +333,7 @@
+       case 'h':
+       default:
+           usage();
+-
++            break;
+       };
+--- net-tools-1.60/mii-tool.c  2000-05-21 16:31:17.000000000 +0200
++++ net-tools-1.60.works/mii-tool.c    2007-01-14 04:47:42.000000000 +0100
+@@ -379,16 +379,16 @@
+ /*--------------------------------------------------------------------*/
+ const char *usage =
+-"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]
+-       -V, --version               display version information
+-       -v, --verbose               more verbose output
+-       -R, --reset                 reset MII to poweron state
+-       -r, --restart               restart autonegotiation
+-       -w, --watch                 monitor for link status changes
+-       -l, --log                   with -w, write events to syslog
+-       -A, --advertise=media,...   advertise only specified media
+-       -F, --force=media           force specified media technology
+-media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,
++"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\n\
++       -V, --version               display version information\n\
++       -v, --verbose               more verbose output\n\
++       -R, --reset                 reset MII to poweron state\n\
++       -r, --restart               restart autonegotiation\n\
++       -w, --watch                 monitor for link status changes\n\
++       -l, --log                   with -w, write events to syslog\n\
++       -A, --advertise=media,...   advertise only specified media\n\
++       -F, --force=media           force specified media technology\n\
++media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,\n\
+        (to advertise both HD and FD) 100baseTx, 10baseT\n";
+ int main(int argc, char **argv)