From 5d409e0d2d5241d5670f115b8d60a4215aa6e882 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 20 May 2007 14:22:20 +0000 Subject: [PATCH] Add ngrep from #1719 git-svn-id: svn://svn.openwrt.org/openwrt/packages@7281 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/ngrep/Makefile | 64 +++++++++++++++++++++++++ net/ngrep/patches/001-makefile_in.patch | 20 ++++++++ net/ngrep/patches/001-ngrep.patch | 12 +++++ 3 files changed, 96 insertions(+) create mode 100644 net/ngrep/Makefile create mode 100644 net/ngrep/patches/001-makefile_in.patch create mode 100644 net/ngrep/patches/001-ngrep.patch diff --git a/net/ngrep/Makefile b/net/ngrep/Makefile new file mode 100644 index 000000000..fbc6714e5 --- /dev/null +++ b/net/ngrep/Makefile @@ -0,0 +1,64 @@ +# +# Copyright (C) 2007 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:=ngrep +PKG_VERSION:=1.45 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/ngrep +PKG_MD5SUM:=bc8150331601f3b869549c94866b4f1c +PKG_CAT:=bzcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install + +include $(INCLUDE_DIR)/package.mk + +define Package/ngrep + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +libpcre + TITLE:=network grep + DESCRIPTION:=\ + ngrep a pcap-aware tool that will allow you to specify extended\\\ + regular expressions to match against data payloads of packets. It\\\ + currently recognizes TCP, UDP, and ICMP across Ethernet, PPP, SLIP,\\\ + FDDI, Token Ring and null interfaces, and understands BPF filter\\\ + logic in the same fashion as more common packet sniffing tools,\\\ + like tcpdump and snoop. + URL:=http://ngrep.sourceforge.net +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --with-pcap-includes=$(STAGING_DIR)/usr/include \ + --enable-pcre \ + --with-pcre=$(STAGING_DIR)/usr \ + --enable-ipv6 \ + --disable-dropprivs \ + ,\ + LDFLAGS="-L$(STAGING_DIR)/usr/lib -lpcre" \ + ) +endef + +define Build/Compile + $(call Build/Compile/Default,\ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all \ + ) +endef + +define Package/ngrep/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,ngrep)) diff --git a/net/ngrep/patches/001-makefile_in.patch b/net/ngrep/patches/001-makefile_in.patch new file mode 100644 index 000000000..5d7ab0931 --- /dev/null +++ b/net/ngrep/patches/001-makefile_in.patch @@ -0,0 +1,20 @@ +diff -u ngrep-1.45/Makefile.in ngrep-1.45.mod/Makefile.in +--- ngrep-1.45/Makefile.in Tue Nov 28 15:35:37 2006 ++++ ngrep-1.45.mod/Makefile.in Sat May 19 10:40:57 2007 +@@ -32,13 +32,13 @@ + + INSTALL = ./install-sh + +-REGEX_DIR=@REGEX_DIR@ +-REGEX_OBJS=@REGEX_OBJS@ ++REGEX_DIR= ++REGEX_OBJS= + + + all: $(TARGET) + +-$(TARGET): $(REGEX_OBJS) $(OBJS) ++$(TARGET): $(OBJS) + $(CC) $(CFLAGS) $(LDFLAGS) $(STRIPFLAG) -o $(TARGET) $(OBJS) $(REGEX_OBJS) $(LIBS) + + debug: $(REGEX_OBJS) $(OBJS) \ No newline at end of file diff --git a/net/ngrep/patches/001-ngrep.patch b/net/ngrep/patches/001-ngrep.patch new file mode 100644 index 000000000..c3cb2e7d4 --- /dev/null +++ b/net/ngrep/patches/001-ngrep.patch @@ -0,0 +1,12 @@ +diff -ur ngrep-1.45/ngrep.c ngrep-1.45.mod/ngrep.c +--- ngrep-1.45/ngrep.c Tue Nov 28 15:38:43 2006 ++++ ngrep-1.45.mod/ngrep.c Sat May 19 10:21:27 2007 +@@ -92,7 +92,7 @@ + #endif + + #if USE_PCRE +-#include "pcre-5.0/pcre.h" ++#include "pcre.h" + #else + #include "regex-0.12/regex.h" + #endif