# FOR REFERENCE ONLY

--- prod/net/wireshark/Portfile			2015-07-12 16:22:41.000000000 -0400
+++ dev/net/wireshark-devel/Portfile	2015-07-14 21:57:58.000000000 -0400
@@ -1,15 +1,19 @@
-# $Id: Portfile 137761 2015-06-18 20:07:17Z ricci@macports.org $
+# $Id: Portfile 131578 2015-01-15 00:14:59Z larryv@macports.org $

 PortSystem 1.0
-name		wireshark
-version		1.12.6
+
+name		wireshark-devel
+epoch		2
+version		1.99.7
 revision	0
 categories	net
 license		{GPL-2 GPL-3}
-maintainers	darkart.com:opendarwin.org
+maintainers	gmail.com:hsivank
 description	Graphical network analyzer and capture tool
 homepage	http://wireshark.org/
 platforms	darwin
+distname	wireshark-${version}
+dist_subdir	wireshark

 long_description A network analyzer that lets you capture and \
 		 interactively browse Ethernet frames. \
@@ -19,23 +23,18 @@
 master_sites	http://www.wireshark.org/download/src/			\
 		http://www.wireshark.org/download/src/all-versions/

-checksums           md5     25ad2bc1c2a21396827c238fcff51bf3 \
-                    sha1    5b592bd0389b76d3bdee6a7336e9492f8162c94d \
-                    rmd160  46d0ceb05ea26670e73fc89928d54c0a00151cbe
+checksums	   rmd160  7a9a0a50fdeb91fc97871129167329fc694b09b4 \
+				sha256  3d34d51edabc07ceb13734f222421f2fb012a870c837ffb313dc1af51c16b28a

 use_bzip2	yes

 conflicts	wireshark-devel

-patchfiles	patch-configure.diff	\
-			patch-configure.pixmap-fix.diff
-
 depends_build 		\
 		port:pkgconfig
 depends_lib 		\
 		port:c-ares \
 		port:gettext \
-		port:kerberos5 \
 		port:libcomerr \
 		port:libgpg-error \
 		path:lib/pkgconfig/glib-2.0.pc:glib2 \
@@ -43,45 +42,34 @@
 		port:zlib

 configure.args	\
-		--without-libsmi \
 		--disable-usr-local \
+		--disable-warnings-as-errors \
 		--without-adns \
 		--with-c-ares=${prefix} \
 		--without-geoip \
 		--without-gnutls \
 		--with-gcrypt=no \
+		--without-libsmi \
 		--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-krb5 \
 		--without-ssl \
 		--disable-wireshark


 configure.ldflags-append "-Wl,-search_paths_first"

-default_variants +gnutls +libgcrypt +ipv6 +lua +libsmi +geoip +rtp +ssl
+default_variants +gnutls +libgcrypt +ipv6 +krb5 +lua +libsmi +geoip +rtp +ssl

-if {![variant_isset qt] && ![variant_isset gtk3]} {
-	default_variants	+x11
+if {![variant_isset qt] && ![variant_isset x11] && ![variant_isset gtk3]} {
+	default_variants	+qt5
 }

-## 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
-## }
-
-
 pre-destroot {
 	xinstall -d ${destroot}${prefix}/include/wireshark/epan/crypt/
 	xinstall -d ${destroot}${prefix}/include/wireshark/epan/dfilter/
@@ -117,6 +105,12 @@
 	depends_lib-append		port:gnutls
 }

+variant krb5 {
+	configure.args-delete	--without-krb5
+	configure.args-append	--with-krb5=${prefix}
+	depends_lib-append	 	port:kerberos5
+}
+
 variant libgcrypt {
 	configure.args-delete	--with-gcrypt=no
 	configure.args-append	--with-libgcrypt-prefix=${prefix}
@@ -146,35 +140,26 @@
 	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
-## }
-##
-## 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
-## }
-##
-## 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
-## }
-##
-## variant no_python description {do not build python interface} conflicts python25 python26 python27 {
-## 	configure.args-append	--without-python
-## }
-
-variant qt description {use qt for the GUI} conflicts x11 gtk3	{
-## qt 5.3.1 doesn't work at this point, wireshark needs to be adjusted for Qt 5.
-##	depends_lib-append		port:qt5-mac
+variant qt description {use qt4 for the GUI} conflicts x11 gtk3 qt5	{
 	depends_lib-append		port:qt4-mac
 	configure.args-delete	--disable-wireshark
-	configure.args-append	--with-qt=yes
+	configure.args-append	--with-qt=4
+	configure.args-append	--with-gtk2=no
+	configure.args-append	--with-gtk3=no
+}
+
+variant qt5 description {use qt5 for the GUI} conflicts x11 gtk3 qt {
+	depends_lib-append		port:qt5-mac
+	configure.args-delete	--disable-wireshark
+	configure.args-append	--with-qt=5
 	configure.args-append	--with-gtk2=no
 	configure.args-append	--with-gtk3=no
+
+	configure.pkg_config_path	${configure.pkg_config_path}:${prefix}/libexec/qt5-mac/lib/pkgconfig
+	configure.env-append		PATH=$env(PATH):${prefix}/libexec/qt5-mac/bin
+	build.env-append			PATH=$env(PATH):${prefix}/libexec/qt5-mac/bin
 }
+
 variant rtp description {add rtp support} {
 	configure.args-delete   --without-portaudio
 	configure.args-append   --with-portaudio=${prefix}
@@ -183,11 +168,11 @@

 variant ssl {
 	configure.args-delete	--without-ssl
+	configure.args-append   --with-ssl=${prefix}
 	depends_lib-append		port:openssl
 }

-## variant x11 conflicts qt	{
-variant x11 description {use X11 (gtk2) for GUI} conflicts qt gtk3	{
+variant x11 description {use X11 (gtk2) for GUI} conflicts qt qt5 gtk3	{
 	depends_lib-append		port:gtk2 \
 							port:atk \
 							path:lib/pkgconfig/cairo.pc:cairo \
@@ -212,21 +197,23 @@
 	configure.args-append	--with-gtk3=no
 }

-variant gtk3 description {use X11 (gtk3) for GUI} conflicts qt x11	{
-	depends_lib-append		port:gtk3
+variant gtk3 description {use X11 (gtk3) for GUI} conflicts qt qt5 x11	{
+	depends_lib-append		port:gtk3 \
+							port:adwaita-icon-theme
+
 	configure.args-delete	--disable-wireshark
 	configure.args-append	--with-qt=no
 	configure.args-append	--with-gtk2=no
 	configure.args-append	--with-gtk3=yes
 }

+platform macosx {
+	if { [variant_isset qt] || [variant_isset qt5] || [variant_isset x11] || [variant_isset gtk3] } {
+		patchfiles-append		patch-osxapp.diff
+		destroot.target-append	osx-install
+	}
+}

 livecheck.type	regex
 livecheck.url	${homepage}download.html
-livecheck.regex	"Stable Release \\((\\d+(?:\\.\\d+)*)"
+livecheck.regex	"Development Release \\((\\d+(?:\\.\\d+)*)"
-#
-##EOF
-
-
-#
-##EOF
