Skip to contentSkip to conversation

wireshark: new package

PATCH Superseded Baruch Siach 2 participants 4 messages Oct 24, 2012

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 wireshark: new package

This is only the bare minimum needed to build the textual tshark utility. Support for more options, including the wireshark GUI, can be added later.

---

Changes v1 -> v2:
* Patch configure.in and enable autoreconf, instead of overriding $prefix
* Remove --with-sysroot as suggested by Arnout Vandecappelle

The tshark RPATH is still cluttered with local build paths. Adding --libdir=/usr/lib doesn't solve this. Any suggestion?

 package/Config.in                                    |    1 +
 package/wireshark/Config.in                          |   14 ++++++++++++++
 .../wireshark/wireshark-dont-include-prefix.patch    |   18 ++++++++++++++++++
 package/wireshark/wireshark.mk                       |   10 ++++++++++
 4 files changed, 43 insertions(+)
 create mode 100644 package/wireshark/Config.in
 create mode 100644 package/wireshark/wireshark-dont-include-prefix.patch
 create mode 100644 package/wireshark/wireshark.mk
package/Config.in +1 -0
index 1650c71..cd8d9ba 100644
@@ -646,6 +646,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 source "package/wget/Config.in"
 endif
 source "package/wireless_tools/Config.in"
+source "package/wireshark/Config.in"
 source "package/wpa_supplicant/Config.in"
 source "package/xinetd/Config.in"
 source "package/xl2tp/Config.in"
package/wireshark/Config.in new file +14 -0
new file mode 100644
index 0000000..e6d4e72
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_WIRESHARK
+	bool "wireshark"
+	select BR2_PACKAGE_LIBPCAP
+	select BR2_PACKAGE_LIBGCRYPT
+	select BR2_PACKAGE_LIBGLIB2
+	depends on BR2_USE_WCHAR # glib2
+	help
+	  Network traffic sniffer and protocol decoder. Currently only tshark,
+	  the console interface, is enabled.
+
+	  http://www.wireshark.org
+
+comment "wireshark requires a toolchain with WCHAR support"
+	depends on !BR2_USE_WCHAR
package/wireshark/wireshark-dont-include-prefix.patch new file +18 -0
new file mode 100644
index 0000000..6f3c946
@@ -0,0 +1,18 @@
+configure.in: don't add the build host's /usr/include and /usr/lib to the 
+search path of include files and libraries. This is not what you want when 
+cross compiling.
+
+Signed-off-by: Baruch Siach <[email protected]>
+---
+diff -Nuar wireshark-1.8.3.orig/configure.in wireshark-1.8.3/configure.in
+--- wireshark-1.8.3.orig/configure.in	2012-08-15 23:33:32.000000000 +0300
++++ wireshark-1.8.3/configure.in	2012-10-24 09:54:15.259853331 +0200
+@@ -639,7 +639,7 @@
+ # If using $prefix we add "$prefix/include" to the include search path
+ # and "$prefix/lib" to the library search path.
+ #
+-if test "x$prefix" != "x" ; then
++if false ; then
+ 	AC_MSG_CHECKING(whether to use $prefix for headers and libraries)
+ 	if test -d $prefix/include ; then
+ 		AC_MSG_RESULT(yes)
package/wireshark/wireshark.mk new file +10 -0
new file mode 100644
index 0000000..b50c223
@@ -0,0 +1,10 @@
+WIRESHARK_VERSION = 1.8.3
+WIRESHARK_SOURCE = wireshark-$(WIRESHARK_VERSION).tar.bz2
+WIRESHARK_SITE = http://www.wireshark.org/download/src/all-versions
+WIRESHARK_DEPENDENCIES = libpcap libgcrypt libglib2
+WIRESHARK_AUTORECONF = YES
+WIRESHARK_CONF_ENV = LIBGCRYPT_CONFIG=$(STAGING_DIR)/usr/bin/libgcrypt-config
+WIRESHARK_CONF_OPT = --disable-wireshark --without-krb5 --disable-usr-local \
+		     --enable-static=no
+
+$(eval $(call autotools-package))
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v2 1/1 wireshark: new package

Quoted 14 lines · Baruch Siach
package/wireshark/wireshark-dont-include-prefix.patch new file +8 -0
new file mode 100644
index 0000000..6f3c946
@@ -0,0 +1,18 @@
+configure.in: don't add the build host's /usr/include and /usr/lib to the 
+search path of include files and libraries. This is not what you want when 
+cross compiling.
+
+Signed-off-by: Baruch Siach <[email protected]>
+---
+diff -Nuar wireshark-1.8.3.orig/configure.in wireshark-1.8.3/configure.in
+--- wireshark-1.8.3.orig/configure.in	2012-08-15 23:33:32.000000000 +0300

package/wireshark/wireshark-dont-include-prefix.patch line 18

Quoted 10 lines
package/wireshark/wireshark-dont-include-prefix.patch new file +10 -0
++++ wireshark-1.8.3/configure.in	2012-10-24 09:54:15.259853331 +0200
+@@ -639,7 +639,7 @@
+ # If using $prefix we add "$prefix/include" to the include search path
+ # and "$prefix/lib" to the library search path.
+ #
+-if test "x$prefix" != "x" ; then
++if false ; then
+ 	AC_MSG_CHECKING(whether to use $prefix for headers and libraries)
+ 	if test -d $prefix/include ; then
+ 		AC_MSG_RESULT(yes)

This works, but cannot be submitted upstream. Do you think you can come up with a patch suitable for upstream inclusion?

Note that the OE patch is not better than your proposal:
http://cgit.openembedded.org/openembedded/tree/recipes/wireshark/files/fix-configure.patch.
It is also not suitable for upstream.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

PATCH v2 1/1 wireshark: new package

Hi Thomas,

Quoted 30 lines · Thomas Petazzoni
Quoted 14 lines · Baruch Siach
package/wireshark/wireshark-dont-include-prefix.patch new file +8 -0
new file mode 100644
index 0000000..6f3c946
@@ -0,0 +1,18 @@
+configure.in: don't add the build host's /usr/include and /usr/lib to the 
+search path of include files and libraries. This is not what you want when 
+cross compiling.
+
+Signed-off-by: Baruch Siach <[email protected]>
+---
+diff -Nuar wireshark-1.8.3.orig/configure.in wireshark-1.8.3/configure.in
+--- wireshark-1.8.3.orig/configure.in	2012-08-15 23:33:32.000000000 +0300

package/wireshark/wireshark-dont-include-prefix.patch line 18

Quoted 10 lines
package/wireshark/wireshark-dont-include-prefix.patch new file +10 -0
++++ wireshark-1.8.3/configure.in	2012-10-24 09:54:15.259853331 +0200
+@@ -639,7 +639,7 @@
+ # If using $prefix we add "$prefix/include" to the include search path
+ # and "$prefix/lib" to the library search path.
+ #
+-if test "x$prefix" != "x" ; then
++if false ; then
+ 	AC_MSG_CHECKING(whether to use $prefix for headers and libraries)
+ 	if test -d $prefix/include ; then
+ 		AC_MSG_RESULT(yes)

This works, but cannot be submitted upstream. Do you think you can come up with a patch suitable for upstream inclusion?

Quoted 3 lines

Note that the OE patch is not better than your proposal:
http://cgit.openembedded.org/openembedded/tree/recipes/wireshark/files/fix-configure.patch.
It is also not suitable for upstream.

Well, the ultimate solution would probably be to add a --disable-usr configure option, like the existing --disable-usr-local. I see if I can find time to work on this. I'm no autotools expert.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#3 lore raw

PATCH v2 1/1 wireshark: new package

Dear Baruch Siach,

Quoted 3 lines · Baruch Siach

Well, the ultimate solution would probably be to add a --disable-usr configure option, like the existing --disable-usr-local. I see if I can find time to work on this. I'm no autotools expert.

This really shouldn't be needed. No autotools-based package that I'm aware of needs this. If the default include flags are not good, you pass additional CFLAGS/CPPFLAGS, that's the way autoconf works.

So basically, the whole idea of adding /usr/include forcefully is stupid and should be removed, IMO.

Thomas

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