--- _orig/net/wireshark//Portfile	2014-05-06 16:30:13.000000000 -0400
+++ net/wireshark//Portfile	2014-05-23 11:35:31.000000000 -0400
@@ -1,180 +1,203 @@
-# $Id: Portfile 119784 2014-05-06 20:17:22Z ricci@macports.org $
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id: Portfile 114970 2013-12-19 22:34:46Z ricci@macports.org $
 
-PortSystem 1.0
-name		wireshark
-version		1.10.7
-revision	0
-categories	net
-license		{GPL-2 GPL-3}
-maintainers	darkart.com:opendarwin.org
-description	Graphical network analyzer and capture tool
-homepage	http://wireshark.org/
-platforms	darwin
-
-long_description A network analyzer that lets you capture and \
-		 interactively browse Ethernet frames. \
-		 Packet data can be read from a file, or live from a local \
-		 network interface.
-
-master_sites	http://www.wireshark.org/download/src/			\
-		http://www.wireshark.org/download/src/all-versions/
-
-checksums           md5     0e8a111d24c11255eae139c8f27fd25b \
-                    sha1    5e5ce4fdc9aa53e545fc0fbd22eea6adcf7dfc0b \
-                    rmd160  67fcd4cce612a5af705e1db5a57549444d4c4e57
-
-use_bzip2	yes
-
-conflicts	wireshark-devel
-
-patchfiles	patch-configure.diff
-
-depends_build 		\
-		port:pkgconfig
-depends_lib 		\
-		port:c-ares \
-		path:lib/pkgconfig/glib-2.0.pc:glib2 \
-		port:libpcap \
-		port:kerberos5 \
-		port:zlib
-
-configure.args	\
-		--without-libsmi \
-		--disable-usr-local \
-		--without-adns \
-		--with-c-ares=${prefix} \
-		--without-geoip \
-		--without-gnutls \
-		--with-gcrypt=no \
-		--without-lua \
-		--disable-ipv6 \
-		--with-pcap=${prefix} \
-		--with-ssl=${prefix} \
-		--with-zlib=${prefix} \
-		--mandir=\\\${prefix}/share/man \
-		--infodir=\\\${prefix}/share/info \
-		--without-portaudio \
-		--disable-warnings-as-errors \
-		--with-krb5=${prefix} \
-		--without-ssl \
-		--disable-wireshark
+PortSystem      1.0
 
+name                wireshark
+version             1.10.6
+revision            0
+categories          net
+license             {GPL-2 GPL-3}
+maintainers         darkart.com:opendarwin.org
+description         Graphical network analyzer and capture tool
+homepage            http://wireshark.org/
+platforms           darwin
+
+long_description    A network analyzer that lets you capture and \
+                    interactively browse Ethernet frames. \
+                    Packet data can be read from a file, or live from a local \
+                    network interface.
+
+master_sites        http://www.wireshark.org/download/src/            \
+                    http://www.wireshark.org/download/src/all-versions/
+
+checksums           rmd160  3018f4d60d1ac86dfffd875a53373c85f5be44e8 \
+                    sha256  a9de3fd3002d4df0946cfea2f5a33557666e14c7014dbc42d1f78dfe113f6b5d
+
+use_bzip2           yes
+
+conflicts           wireshark-devel
+
+patchfiles          patch-configure.diff
+
+depends_build         \
+        port:pkgconfig
+depends_lib         \
+        port:c-ares \
+        path:lib/pkgconfig/glib-2.0.pc:glib2 \
+        port:libpcap \
+        port:kerberos5 \
+        port:zlib
+
+configure.args    \
+        --without-libsmi \
+        --disable-usr-local \
+        --without-adns \
+        --with-c-ares=${prefix} \
+        --without-geoip \
+        --without-gnutls \
+        --with-gcrypt=no \
+        --without-lua \
+        --disable-ipv6 \
+        --with-pcap=${prefix} \
+        --without-ssl \
+        --with-zlib=${prefix} \
+        --mandir=\\\${prefix}/share/man \
+        --infodir=\\\${prefix}/share/info \
+        --without-portaudio \
+        --disable-warnings-as-errors \
+        --with-krb5=${prefix} \
+                --disable-wireshark
 
 configure.ldflags-append "-Wl,-search_paths_first"
 
-default_variants +adns +gnutls +libgcrypt +ipv6 +lua +libsmi +geoip +rtp +ssl +x11
-
-
 ## 1.10.0 doesn't include python options in configure
 ## if {[variant_isset no_python]} {
 ## } elseif {[variant_isset python25]} {
 ## } elseif {[variant_isset python26]} {
 ## } elseif {[variant_isset python27]} {
 ## } else {
-## 	default_variants +no_python
+##     default_variants +no_python
 ## }
 
 
 pre-destroot {
-	xinstall -d ${destroot}${prefix}/include/wireshark/epan/crypt/
-	xinstall -d ${destroot}${prefix}/include/wireshark/epan/dfilter/
-	xinstall -d ${destroot}${prefix}/include/wireshark/epan/dissectors/
-	xinstall -d ${destroot}${prefix}/include/wireshark/epan/ftypes/
-	xinstall -d ${destroot}${prefix}/include/wireshark/wiretap/
-	xinstall -m 644 -W ${worksrcpath}/ color.h config.h register.h ${destroot}${prefix}/include/wireshark/
-	eval xinstall -m 644 [glob ${worksrcpath}/epan/*.h] ${destroot}${prefix}/include/wireshark/epan/
-	eval xinstall -m 644 [glob ${worksrcpath}/epan/crypt/*.h] ${destroot}${prefix}/include/wireshark/epan/crypt/
-	eval xinstall -m 644 [glob ${worksrcpath}/epan/dfilter/*.h] ${destroot}${prefix}/include/wireshark/epan/dfilter/
-	eval xinstall -m 644 [glob ${worksrcpath}/epan/dissectors/*.h] ${destroot}${prefix}/include/wireshark/epan/dissectors/
-	eval xinstall -m 644 [glob ${worksrcpath}/epan/ftypes/*.h] ${destroot}${prefix}/include/wireshark/epan/ftypes/
-	eval xinstall -m 644 [glob ${worksrcpath}/wiretap/*.h] ${destroot}${prefix}/include/wireshark/wiretap/
+    xinstall -d ${destroot}${prefix}/include/wireshark/epan/crypt/
+    xinstall -d ${destroot}${prefix}/include/wireshark/epan/dfilter/
+    xinstall -d ${destroot}${prefix}/include/wireshark/epan/dissectors/
+    xinstall -d ${destroot}${prefix}/include/wireshark/epan/ftypes/
+    xinstall -d ${destroot}${prefix}/include/wireshark/wiretap/
+    xinstall -m 644 -W ${worksrcpath}/ color.h config.h register.h ${destroot}${prefix}/include/wireshark/
+    eval xinstall -m 644 [glob ${worksrcpath}/epan/*.h] ${destroot}${prefix}/include/wireshark/epan/
+    eval xinstall -m 644 [glob ${worksrcpath}/epan/crypt/*.h] ${destroot}${prefix}/include/wireshark/epan/crypt/
+    eval xinstall -m 644 [glob ${worksrcpath}/epan/dfilter/*.h] ${destroot}${prefix}/include/wireshark/epan/dfilter/
+    eval xinstall -m 644 [glob ${worksrcpath}/epan/dissectors/*.h] ${destroot}${prefix}/include/wireshark/epan/dissectors/
+    eval xinstall -m 644 [glob ${worksrcpath}/epan/ftypes/*.h] ${destroot}${prefix}/include/wireshark/epan/ftypes/
+    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
+    # see #32386
+    configure.cflags -fno-var-tracking
+}
+
+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 description { build osx app } {
+    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
+    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 gnutls {
-	configure.args-delete	--without-gnutls
-	configure.args-append	--with-gnutls=yes
-	depends_lib-append		port:gnutls
+variant gnutls description { gnutls support } {
+    configure.args-delete    --without-gnutls
+    configure.args-append    --with-gnutls=yes
+    depends_lib-append    port:gnutls
 }
 
-variant libgcrypt {
-	configure.args-delete	--with-gcrypt=no
-	configure.args-append	--with-libgcrypt-prefix=${prefix}
-	depends_lib-append		port:libgcrypt
+variant libgcrypt description { libgcrypt support } {
+    configure.args-delete    --with-gcrypt=no
+    configure.args-append    --with-libgcrypt-prefix=${prefix}
+    depends_lib-append    port:libgcrypt
 }
 
-variant ipv6 {
-	configure.args-delete	--disable-ipv6
-	configure.args-append	--enable-ipv6
+variant ipv6 description { ipv6 support } {
+    configure.args-delete   --disable-ipv6
+    configure.args-append    --enable-ipv6
 }
 
-variant lua {
-	configure.args-delete	--without-lua
-	configure.args-append	--with-lua=${prefix}
-	depends_lib-append		port:lua
+variant lua description { lua support } {
+    configure.args-delete    --without-lua
+    configure.args-append    --with-lua=${prefix}
+    depends_lib-append    port:lua
 }
 
-variant libsmi {
-	configure.args-delete	--without-libsmi
-	configure.args-append	--with-libsmi=${prefix}
-	depends_lib-append		port:libsmi
+variant libsmi description { libsmi support } {
+    configure.args-delete    --without-libsmi
+    configure.args-append    --with-libsmi=${prefix}
+    depends_lib-append    port:libsmi
 }
 
-variant geoip {
-	configure.args-delete	--without-geoip
-	configure.args-append	--with-geoip=${prefix}
-	depends_lib-append		port:libgeoip
+variant geoip description { libgeoip support } {
+    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
 ## variant python25 description {use python25 for the experimental python interface} conflicts no_python python26 python27 {
-## 	configure.args-append	--with-python=${prefix}
-## 	depends_lib-append	port:python25
+##     configure.args-append    --with-python=${prefix}
+##     depends_lib-append    port:python25
 ## }
-## 
+##
 ## variant python26 description {use python26 for the experimental python interface} conflicts no_python python25 python27 {
-## 	configure.args-append	--with-python=${prefix}
-## 	depends_lib-append	port:python26
+##     configure.args-append    --with-python=${prefix}
+##     depends_lib-append    port:python26
 ## }
-## 
+##
 ## variant python27 description {use python27 for the experimental python interface} conflicts no_python python25 python26 {
-## 	configure.args-append	--with-python=${prefix}/lib/wireshark/python/${version}
-## 	depends_lib-append	port:python27
+##     configure.args-append    --with-python=${prefix}/lib/wireshark/python/${version}
+##     depends_lib-append    port:python27
 ## }
-## 
+##
 ## variant no_python description {do not build python interface} conflicts python25 python26 python27 {
-## 	configure.args-append	--without-python
+##     configure.args-append    --without-python
 ## }
 
-variant rtp description {add rtp support} {
-	configure.args-delete   --without-portaudio
-	configure.args-append   --with-portaudio=${prefix}
-	depends_lib-append      port:portaudio
+variant rtp description {rtp support} {
+    configure.args-delete   --without-portaudio
+    configure.args-append   --with-portaudio=${prefix}
+    depends_lib-append      port:portaudio
 }
 
-variant ssl {
-	configure.args-delete	--without-ssl
-	depends_lib-append		port:openssl
+variant ssl description { openssl support } {
+    configure.args-delete --without-ssl
+    depends_lib-append    port:openssl
 }
 
-variant x11	{
-	depends_lib-append		port:gtk2
-	configure.args-delete	--disable-wireshark
+variant x11 description { x11 support with gtk2 } {
+    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
