--- _orig/net/wireshark/Portfile	2013-12-19 18:03:19.000000000 -0500
+++ net/wireshark/Portfile	2014-04-05 17:00:26.000000000 -0400
@@ -2,7 +2,7 @@
 
 PortSystem 1.0
 name		wireshark
-version		1.10.5
+version		1.10.6
 revision	0
 categories	net
 license		{GPL-2 GPL-3}
@@ -19,9 +19,9 @@
 master_sites	http://www.wireshark.org/download/src/			\
 		http://www.wireshark.org/download/src/all-versions/
 
-checksums           md5     a66894a62f05e1e7a3156a807f3296ea \
-                    sha1    ebbf4f8382fc8961c1fb7959727b3e6792e597c1 \
-                    rmd160  e4db106c6977c25c91bc5f85fe2be13c29091a55
+checksums           md5     c67435039d67ef1757bfff0ab88824ab \
+                    sha1    081a2daf85e3257d7a2699e84a330712e3e5b9bb \
+                    rmd160  3018f4d60d1ac86dfffd875a53373c85f5be44e8
 
 use_bzip2	yes
 
@@ -32,14 +32,9 @@
 depends_build 		\
 		port:pkgconfig
 depends_lib 		\
-		port:adns \
-		port:libgcrypt \
+		port:c-ares \
 		port:libgeoip \
 		path:lib/pkgconfig/glib-2.0.pc:glib2 \
-		port:libsmi \
-		port:lua \
-		port:gnutls \
-		port:gtk2 \
 		port:openssl \
 		port:portaudio \
 		port:libpcap \
@@ -47,23 +42,24 @@
 		port:zlib
 
 configure.args	\
-		--with-libsmi=${prefix} \
+		--without-libsmi \
 		--disable-usr-local \
-		--with-adns=${prefix} \
-		--without-c-ares \
-		--with-geoip=${prefix} \
-		--with-gnutls=yes \
-		--with-libgcrypt-prefix=${prefix} \
-		--with-lua=${prefix} \
-		--enable-ipv6 \
+		--without-adns \
+		--with-c-ares=${prefix} \
+		--without-geoip \
+		--without-gnutls \
+		--with-gcrypt=no \
+		--without-lua \
+		--disable-ipv6 \
 		--with-pcap=${prefix} \
-		--with-ssl=${prefix} \
+		--without-ssl \
 		--with-zlib=${prefix} \
 		--mandir=\\\${prefix}/share/man \
 		--infodir=\\\${prefix}/share/info \
-		--with-portaudio=${prefix} \
+		--without-portaudio \
 		--disable-warnings-as-errors \
-		--with-krb5=${prefix}
+		--with-krb5=${prefix} \
+                --disable-wireshark
 
 configure.ldflags-append "-Wl,-search_paths_first"
 
@@ -92,53 +88,74 @@
 	eval xinstall -m 644 [glob ${worksrcpath}/wiretap/*.h] ${destroot}${prefix}/include/wireshark/wiretap/
 }
 
+post-configure {
+	reinplace "s|cp -pr \$(srcdir)/packaging/macosx/Wireshark.app /Applications|cp -pr \$(srcdir)/packaging/macosx/Wireshark.app ${destroot}${applications_dir}|" ${worksrcpath}/Makefile
+}
+
 if {[string match *llvm-gcc-4.2* ${configure.compiler}]} {
 	# see #32386
 	configure.cflags -fno-var-tracking
 }
 
-variant no_adns description {don't use adns library for async. dns resolution instead of the default c-ares library} {
-	configure.args-append	--without-adns \
-							--with-c-ares=${prefix}
-	configure.args-delete	--with-adns=${prefix} \
-							--without-c-ares
-	depends_lib-delete	port:adns
-	depends_lib-append	port:c-ares
+notes "
+To use wireshark as non-root user, you need to give user access to /dev/bpf* like this for the group admin:
+(default is root:wheel and 600)
+    $ sudo /usr/bin/chgrp admin /dev/bpf*; 
+    $ sudo /bin/chmod g+r /dev/bpf*
+
+As an alternative, you can enabled variant setuid_root (not recommended).
+"
+
+default_variants  +x11 +gnutls +libgcrypt +lua +libsmi +geoip +ssl +rtp
+
+## make: *** No rule to make target `ui/gtk/libgtkui.a', needed by `wireshark'.  Stop.
+variant gui {
+	build.target     all osx-app
+	destroot.target  install osx-install
+}
+
+variant adns description {use adns library for async. dns resolution instead of the default c-ares library} {
+	configure.args-delete	--without-adns \
+				--with-c-ares=${prefix}
+	configure.args-append	--with-adns=${prefix} \
+				--without-c-ares
+	depends_lib-append	port:adns
+	depends_lib-delete	port:c-ares
 }
 
-variant no_gnutls {
-	configure.args-append	--without-gnutls
-	configure.args-delete	--with-gnutls=yes
-	depends_lib-delete	port:gnutls
+variant gnutls {
+	configure.args-delete	--without-gnutls
+	configure.args-append	--with-gnutls=yes
+	depends_lib-append	port:gnutls
 }
 
-variant no_libgcrypt {
-	configure.args-append	--with-gcrypt=no
-	configure.args-delete	--with-libgcrypt-prefix=${prefix}
-	depends_lib-delete	port:libgcrypt
+variant libgcrypt {
+	configure.args-delete	--with-gcrypt=no
+	configure.args-append	--with-libgcrypt-prefix=${prefix}
+	depends_lib-append	port:libgcrypt
 }
 
-variant no_ipv6 {
-	configure.args-append	--disable-ipv6
-	configure.args-delete	--enable-ipv6
+variant ipv6 {
+	configure.args-delete   --disable-ipv6
+	configure.args-append	--enable-ipv6
 }
 
-variant no_lua {
-	configure.args-append	--without-lua
-	configure.args-delete	--with-lua=${prefix}
-	depends_lib-delete	port:lua
+variant lua {
+	configure.args-delete	--without-lua
+	configure.args-append	--with-lua=${prefix}
+	depends_lib-append	port:lua
 }
 
-variant no_libsmi {
-	configure.args-append	--without-libsmi
-	configure.args-delete	--with-libsmi=${prefix}
-	depends_lib-delete	port:libsmi
+variant libsmi {
+	configure.args-delete	--without-libsmi
+	configure.args-append	--with-libsmi=${prefix}
+	depends_lib-append	port:libsmi
 }
 
-variant no_geoip {
-	configure.args-append	--without-geoip
-	configure.args-delete	--with-geoip=${prefix}
-	depends_lib-delete	port:libgeoip
+variant geoip {
+	configure.args-delete	--without-geoip
+	configure.args-append	--with-geoip=${prefix}
+	depends_lib-append	port:libgeoip
 }
 
 ## 1.10.0 doesn't include python options in configure
@@ -161,23 +178,28 @@
 ## 	configure.args-append	--without-python
 ## }
 
-variant no_rtp description {remove rtp support} {
-	configure.args-append   --without-portaudio
-	configure.args-delete   --with-portaudio=${prefix}
-	depends_lib-delete      port:portaudio
+variant rtp description {rtp support} {
+	configure.args-delete   --without-portaudio
+	configure.args-append   --with-portaudio=${prefix}
+	depends_lib-append      port:portaudio
 }
 
-variant no_ssl {
-	configure.args-append --without-ssl
-	depends_lib-delete	port:openssl
+variant ssl {
+	configure.args-delete --without-ssl
+	depends_lib-append	port:openssl
 }
 
-variant no_x11	{
-	depends_lib-delete	port:gtk2
-	configure.args-delete	--disable-gtk2
-	configure.args-append	--disable-wireshark
+variant x11	{
+	depends_lib-append	port:gtk2
+	configure.args-append	--disable-gtk2
+	configure.args-delete	--disable-wireshark
 }
 
+variant setuid_root description {install dumpcap binary as setuid root} {
+        configure.args-append   --enable-setuid-install
+        destroot.asroot         yes
+        install.asroot          yes
+}
 
 #
 ##EOF
