All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] new package: ngrep
@ 2011-06-30  1:18 Wade Berrier
  2011-06-30  7:18 ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Wade Berrier @ 2011-06-30  1:18 UTC (permalink / raw)
  To: buildroot


Signed-off-by: Wade Berrier <wberrier@gmail.com>
---
 package/Config.in                          |    1 +
 package/ngrep/Config.in                    |    8 +++++++
 package/ngrep/ngrep-1.45-make-objs.patch   |   19 ++++++++++++++++++
 package/ngrep/ngrep-1.45-pcre-header.patch |   12 +++++++++++
 package/ngrep/ngrep.mk                     |   29 ++++++++++++++++++++++++++++
 5 files changed, 69 insertions(+), 0 deletions(-)
 create mode 100644 package/ngrep/Config.in
 create mode 100644 package/ngrep/ngrep-1.45-make-objs.patch
 create mode 100644 package/ngrep/ngrep-1.45-pcre-header.patch
 create mode 100644 package/ngrep/ngrep.mk

diff --git a/package/Config.in b/package/Config.in
index 8f1f030..dc07b58 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -421,6 +421,7 @@ source "package/netsnmp/Config.in"
 source "package/netstat-nat/Config.in"
 source "package/nfs-utils/Config.in"
 source "package/ngircd/Config.in"
+source "package/ngrep/Config.in"
 source "package/ntp/Config.in"
 source "package/nuttcp/Config.in"
 source "package/olsr/Config.in"
diff --git a/package/ngrep/Config.in b/package/ngrep/Config.in
new file mode 100644
index 0000000..cd91225
--- /dev/null
+++ b/package/ngrep/Config.in
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_NGREP
+	bool "ngrep"
+	select BR2_PACKAGE_LIBPCAP
+	select BR2_PACKAGE_PCRE
+	help
+	  Network grep.
+
+	  http://ngrep.sourceforge.net/
diff --git a/package/ngrep/ngrep-1.45-make-objs.patch b/package/ngrep/ngrep-1.45-make-objs.patch
new file mode 100644
index 0000000..cf316d5
--- /dev/null
+++ b/package/ngrep/ngrep-1.45-make-objs.patch
@@ -0,0 +1,19 @@
+--- ngrep-1.45/Makefile.in.orig	2006-11-28 06:35:37.000000000 -0700
++++ ngrep-1.45/Makefile.in	2011-06-29 14:05:27.000000000 -0600
+@@ -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)
diff --git a/package/ngrep/ngrep-1.45-pcre-header.patch b/package/ngrep/ngrep-1.45-pcre-header.patch
new file mode 100644
index 0000000..3c878fb
--- /dev/null
+++ b/package/ngrep/ngrep-1.45-pcre-header.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
diff --git a/package/ngrep/ngrep.mk b/package/ngrep/ngrep.mk
new file mode 100644
index 0000000..1947edb
--- /dev/null
+++ b/package/ngrep/ngrep.mk
@@ -0,0 +1,29 @@
+#############################################################
+#
+# ngrep
+#
+#############################################################
+
+NGREP_VERSION:=1.45
+NGREP_SOURCE:=ngrep-$(NGREP_VERSION).tar.bz2
+NGREP_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/ngrep/ngrep/$(NGREP_VERSION)
+# no install-strip/install-exec
+NGREP_INSTALL_TARGET_OPT= DESTDIR="$(TARGET_DIR)" install
+NGREP_CONF_ENV:=LDFLAGS="-lpcre"
+NGREP_CONF_OPT:= \
+	--with-pcap-includes=$(STAGING_DIR)/usr/include \
+	--enable-pcre \
+	--with-pcre=$(STAGING_DIR)/usr \
+	--disable-dropprivs
+
+ifeq ($(BR2_INET_IPV6),y)
+NGREP_CONF_OPT += --enable-ipv6
+endif
+
+NGREP_DEPENDENCIES:=libpcap pcre
+
+$(eval $(call AUTOTARGETS,package,ngrep))
+
+$(NGREP_HOOK_POST_INSTALL): $(NGREP_TARGET_INSTALL_TARGET)
+	$(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/bin/ngrep
+	touch $@
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] new package: ngrep
  2011-06-30  1:18 [Buildroot] [PATCH] new package: ngrep Wade Berrier
@ 2011-06-30  7:18 ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2011-06-30  7:18 UTC (permalink / raw)
  To: buildroot

Hello Wade,

Thanks for this patch. A few comments below.

Le Wed, 29 Jun 2011 19:18:42 -0600,
Wade Berrier <wberrier@gmail.com> a ?crit :

> diff --git a/package/ngrep/ngrep-1.45-make-objs.patch b/package/ngrep/ngrep-1.45-make-objs.patch
> new file mode 100644
> index 0000000..cf316d5
> --- /dev/null
> +++ b/package/ngrep/ngrep-1.45-make-objs.patch

All patches applied to packages should have a header with a description
detailing what the patch is doing/fixing + a Signed-off-by line.

> diff --git a/package/ngrep/ngrep-1.45-pcre-header.patch b/package/ngrep/ngrep-1.45-pcre-header.patch
> new file mode 100644
> index 0000000..3c878fb
> --- /dev/null
> +++ b/package/ngrep/ngrep-1.45-pcre-header.patch

Same here.

> +NGREP_VERSION:=1.45
> +NGREP_SOURCE:=ngrep-$(NGREP_VERSION).tar.bz2
> +NGREP_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/ngrep/ngrep/$(NGREP_VERSION)

We mostly don't use := but simply = for variable definitions in
packages.

> +# no install-strip/install-exec
> +NGREP_INSTALL_TARGET_OPT= DESTDIR="$(TARGET_DIR)" install

Not needed, this is now the default in current versions of Buildroot.

> +NGREP_CONF_ENV:=LDFLAGS="-lpcre"

This will override the initial value LDFLAGS="$(TARGET_LDFLAGS)". Is it
really needed ? If the configure script detects pcre, then it should
already append -lpcre.

> +$(NGREP_HOOK_POST_INSTALL): $(NGREP_TARGET_INSTALL_TARGET)
> +	$(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/bin/ngrep
> +	touch $@

This is no longer a valid way of writing post install hooks, and
moreover, stripping the binaries is no longer needed, as this is
already done globally. You can simply remove those three lines.

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] new package: ngrep
  2011-09-06 21:22 ` Thomas Petazzoni
@ 2011-09-10 19:02   ` Wade Berrier
  0 siblings, 0 replies; 5+ messages in thread
From: Wade Berrier @ 2011-09-10 19:02 UTC (permalink / raw)
  To: buildroot

Hi,

An updated patch has been sent to the mailing list.  Thanks for the 
feedback.

Wade

P.S. The buildroot documentation looks great, by the way.

On 09/06/2011 03:22 PM, Thomas Petazzoni wrote:
> Hello,
>
> Thanks for this contribution!
>
> Le Tue, 6 Sep 2011 13:08:46 -0600,
> Wade Berrier<wberrier@gmail.com>  a ?crit :
>
>> Here's a nice lightweight alternative to tcpdump (not as feature full, but smaller)
>>
>> Wade
>
> This part of your message will be kept in the commit log. So it
> shouldn't be formulated this way. Just keep the subject "[PATCH] new
> package: ngrep" and just be your Signed-off-by line below.
>
>> diff --git a/package/ngrep/ngrep-1.45-make-objs.patch b/package/ngrep/ngrep-1.45-make-objs.patch
>> new file mode 100644
>> index 0000000..cf316d5
>> --- /dev/null
>> +++ b/package/ngrep/ngrep-1.45-make-objs.patch
>> @@ -0,0 +1,19 @@
>
> Each patch must start with a description of what it does, and a
> Signed-off-by line.
>
>> +++ b/package/ngrep/ngrep-1.45-pcre-header.patch
>> @@ -0,0 +1,12 @@
>
> Same here.
>
>> +++ b/package/ngrep/ngrep.mk
>
> This must come from a very old version of Buildroot. Can you check the
> current Buildroot documentation?
>
> See comments below.
>
>> @@ -0,0 +1,29 @@
>> +#############################################################
>> +#
>> +# ngrep
>> +#
>> +#############################################################
>> +
>> +NGREP_VERSION:=1.45
>
> Please use '=' instead of ':='.
>
>> +NGREP_SOURCE:=ngrep-$(NGREP_VERSION).tar.bz2
>> +NGREP_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/ngrep/ngrep/$(NGREP_VERSION)
>> +# no install-strip/install-exec
>> +NGREP_INSTALL_TARGET_OPT= DESTDIR="$(TARGET_DIR)" install
>
> Not needed anymore, the 'install' target is always used.
>
>> +NGREP_DEPENDENCIES:=libpcap pcre
>> +
>> +$(eval $(call AUTOTARGETS,package,ngrep))
>> +
>> +$(NGREP_HOOK_POST_INSTALL): $(NGREP_TARGET_INSTALL_TARGET)
>> +	$(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/bin/ngrep
>> +	touch $@
>
> Please remove this post install hook:
>   1) it is no longer the right way of writing post install hooks
>   2) stripping in each package is no longer needed, it is done globally
>      by the Buildroot infrastructure
>
> Regards,
>
> Thomas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] new package: ngrep
  2011-09-06 19:08 Wade Berrier
@ 2011-09-06 21:22 ` Thomas Petazzoni
  2011-09-10 19:02   ` Wade Berrier
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2011-09-06 21:22 UTC (permalink / raw)
  To: buildroot

Hello,

Thanks for this contribution!

Le Tue, 6 Sep 2011 13:08:46 -0600,
Wade Berrier <wberrier@gmail.com> a ?crit :

> Here's a nice lightweight alternative to tcpdump (not as feature full, but smaller)
> 
> Wade

This part of your message will be kept in the commit log. So it
shouldn't be formulated this way. Just keep the subject "[PATCH] new
package: ngrep" and just be your Signed-off-by line below.

> diff --git a/package/ngrep/ngrep-1.45-make-objs.patch b/package/ngrep/ngrep-1.45-make-objs.patch
> new file mode 100644
> index 0000000..cf316d5
> --- /dev/null
> +++ b/package/ngrep/ngrep-1.45-make-objs.patch
> @@ -0,0 +1,19 @@

Each patch must start with a description of what it does, and a
Signed-off-by line.

> +++ b/package/ngrep/ngrep-1.45-pcre-header.patch
> @@ -0,0 +1,12 @@

Same here.

> +++ b/package/ngrep/ngrep.mk

This must come from a very old version of Buildroot. Can you check the
current Buildroot documentation?

See comments below.

> @@ -0,0 +1,29 @@
> +#############################################################
> +#
> +# ngrep
> +#
> +#############################################################
> +
> +NGREP_VERSION:=1.45

Please use '=' instead of ':='.

> +NGREP_SOURCE:=ngrep-$(NGREP_VERSION).tar.bz2
> +NGREP_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/ngrep/ngrep/$(NGREP_VERSION)
> +# no install-strip/install-exec
> +NGREP_INSTALL_TARGET_OPT= DESTDIR="$(TARGET_DIR)" install

Not needed anymore, the 'install' target is always used.

> +NGREP_DEPENDENCIES:=libpcap pcre
> +
> +$(eval $(call AUTOTARGETS,package,ngrep))
> +
> +$(NGREP_HOOK_POST_INSTALL): $(NGREP_TARGET_INSTALL_TARGET)
> +	$(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/bin/ngrep
> +	touch $@

Please remove this post install hook:
 1) it is no longer the right way of writing post install hooks
 2) stripping in each package is no longer needed, it is done globally
    by the Buildroot infrastructure

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] new package: ngrep
@ 2011-09-06 19:08 Wade Berrier
  2011-09-06 21:22 ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Wade Berrier @ 2011-09-06 19:08 UTC (permalink / raw)
  To: buildroot

Hi,

Here's a nice lightweight alternative to tcpdump (not as feature full, but smaller)

Wade

Signed-off-by: Wade Berrier <wberrier@gmail.com>
---
 package/Config.in                          |    1 +
 package/ngrep/Config.in                    |    8 +++++++
 package/ngrep/ngrep-1.45-make-objs.patch   |   19 ++++++++++++++++++
 package/ngrep/ngrep-1.45-pcre-header.patch |   12 +++++++++++
 package/ngrep/ngrep.mk                     |   29 ++++++++++++++++++++++++++++
 5 files changed, 69 insertions(+), 0 deletions(-)
 create mode 100644 package/ngrep/Config.in
 create mode 100644 package/ngrep/ngrep-1.45-make-objs.patch
 create mode 100644 package/ngrep/ngrep-1.45-pcre-header.patch
 create mode 100644 package/ngrep/ngrep.mk

diff --git a/package/Config.in b/package/Config.in
index 7112e05..8d43e4e 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -433,6 +433,7 @@ source "package/netsnmp/Config.in"
 source "package/netstat-nat/Config.in"
 source "package/nfs-utils/Config.in"
 source "package/ngircd/Config.in"
+source "package/ngrep/Config.in"
 source "package/ntp/Config.in"
 source "package/nuttcp/Config.in"
 source "package/olsr/Config.in"
diff --git a/package/ngrep/Config.in b/package/ngrep/Config.in
new file mode 100644
index 0000000..cd91225
--- /dev/null
+++ b/package/ngrep/Config.in
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_NGREP
+	bool "ngrep"
+	select BR2_PACKAGE_LIBPCAP
+	select BR2_PACKAGE_PCRE
+	help
+	  Network grep.
+
+	  http://ngrep.sourceforge.net/
diff --git a/package/ngrep/ngrep-1.45-make-objs.patch b/package/ngrep/ngrep-1.45-make-objs.patch
new file mode 100644
index 0000000..cf316d5
--- /dev/null
+++ b/package/ngrep/ngrep-1.45-make-objs.patch
@@ -0,0 +1,19 @@
+--- ngrep-1.45/Makefile.in.orig	2006-11-28 06:35:37.000000000 -0700
++++ ngrep-1.45/Makefile.in	2011-06-29 14:05:27.000000000 -0600
+@@ -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)
diff --git a/package/ngrep/ngrep-1.45-pcre-header.patch b/package/ngrep/ngrep-1.45-pcre-header.patch
new file mode 100644
index 0000000..3c878fb
--- /dev/null
+++ b/package/ngrep/ngrep-1.45-pcre-header.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
diff --git a/package/ngrep/ngrep.mk b/package/ngrep/ngrep.mk
new file mode 100644
index 0000000..1947edb
--- /dev/null
+++ b/package/ngrep/ngrep.mk
@@ -0,0 +1,29 @@
+#############################################################
+#
+# ngrep
+#
+#############################################################
+
+NGREP_VERSION:=1.45
+NGREP_SOURCE:=ngrep-$(NGREP_VERSION).tar.bz2
+NGREP_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/ngrep/ngrep/$(NGREP_VERSION)
+# no install-strip/install-exec
+NGREP_INSTALL_TARGET_OPT= DESTDIR="$(TARGET_DIR)" install
+NGREP_CONF_ENV:=LDFLAGS="-lpcre"
+NGREP_CONF_OPT:= \
+	--with-pcap-includes=$(STAGING_DIR)/usr/include \
+	--enable-pcre \
+	--with-pcre=$(STAGING_DIR)/usr \
+	--disable-dropprivs
+
+ifeq ($(BR2_INET_IPV6),y)
+NGREP_CONF_OPT += --enable-ipv6
+endif
+
+NGREP_DEPENDENCIES:=libpcap pcre
+
+$(eval $(call AUTOTARGETS,package,ngrep))
+
+$(NGREP_HOOK_POST_INSTALL): $(NGREP_TARGET_INSTALL_TARGET)
+	$(STRIPCMD) $(STRIP_STRIP_ALL) $(TARGET_DIR)/usr/bin/ngrep
+	touch $@
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-09-10 19:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-30  1:18 [Buildroot] [PATCH] new package: ngrep Wade Berrier
2011-06-30  7:18 ` Thomas Petazzoni
2011-09-06 19:08 Wade Berrier
2011-09-06 21:22 ` Thomas Petazzoni
2011-09-10 19:02   ` Wade Berrier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.