[package] add cdp tools (#5190)
authorFlorian Fainelli <florian@openwrt.org>
Thu, 28 May 2009 14:20:22 +0000 (14:20 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Thu, 28 May 2009 14:20:22 +0000 (14:20 +0000)
SVN-Revision: 16138

net/cdp/Makefile [new file with mode: 0644]
net/cdp/patches/001-compile_fixes.patch [new file with mode: 0644]

diff --git a/net/cdp/Makefile b/net/cdp/Makefile
new file mode 100644 (file)
index 0000000..676a3b6
--- /dev/null
@@ -0,0 +1,52 @@
+# 
+# Copyright (C) 2009 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cdp-tools
+PKG_VERSION:=20070302
+PKG_RELEASE:=1
+
+PKG_SOURCE:=cdp-tools.tar.gz
+PKG_SOURCE_URL:=http://gpl.internetconnection.net/files/
+PKG_MD5SUM:=94e3a355a5c82a2a5b14114d1f9b0599
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/package.mk
+
+PKG_BUILD_DEPENDS:=+libpcap +libnet1
+
+
+define Package/cdp-tools
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=CDP tools (CISCO)
+  URL:=http://gpl.internetconnection.net
+  DEPENDS:=+libpcap
+endef
+
+define Package/dhcpcd/description
+       Tools to work with the Cisco Discovery Protocol (CDP)
+endef
+
+define Build/Compile
+       CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/include/pcap -I$(STAGING_DIR)/usr/lib/libnet-1.1.x/include" \
+       LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/usr/lib/libnet-1.1.x/lib" \
+       CFLAGS="$(TARGET_CFLAGS)" \
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+       $(TARGET_CONFIGURE_OPTS) \
+       all
+endef
+
+
+define Package/cdp-tools/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/{cdp-send,cdp-listen,cdp-routemgr} $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,cdp-tools))
diff --git a/net/cdp/patches/001-compile_fixes.patch b/net/cdp/patches/001-compile_fixes.patch
new file mode 100644 (file)
index 0000000..90be6df
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/Makefile.orig    2006-10-26 20:58:35.000000000 +0300
++++ b/Makefile 2009-05-22 18:20:44.000000000 +0300
+@@ -1,7 +1,6 @@
+-CFLAGS += $(shell libnet-config --cflags --defines)
+-all: cdp-listen cdp-send
++all: cdp-send cdp-listen
+-cdp-listen: cdp-listen.o -lpcap
+-cdp-send: cdp-send.o $(shell libnet-config --libs)
++cdp-listen: cdp-listen.o $(STAGING_DIR)/usr/lib/libpcap.so
++cdp-send: cdp-send.o $(STAGING_DIR)/usr/lib/libnet-1.1.x/lib/libnet.a
+ clean:; rm -f cdp-send.o cdp-send cdp-listen.o cdp-listen