Ticket #40782: wireshark-2.0.1-cmake.Portfile

File wireshark-2.0.1-cmake.Portfile, 9.6 KB (added by mojca (Mojca Miklavec), 9 years ago)

Update wireshark to version 2.0.1 (CMake-based installation)

Line 
1# -*- 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
2# $Id: Portfile 106559 2013-05-31 00:13:02Z cal@macports.org $
3
4PortSystem          1.0
5PortGroup           cmake 1.0
6
7name                wireshark
8version             2.0.1
9categories          net
10license             {GPL-2 GPL-3}
11maintainers         gmail.com:hsivank
12description         Graphical network analyzer and capture tool
13homepage            http://wireshark.org/
14platforms           darwin
15
16long_description    A network analyzer that lets you capture and \
17                    interactively browse Ethernet frames. \
18                    Packet data can be read from a file, or live from a local \
19                    network interface.
20
21master_sites        http://www.wireshark.org/download/src/ \
22                    http://www.wireshark.org/download/src/all-versions/
23
24use_bzip2           yes
25
26checksums           rmd160  0a83fb6d2c74005840492d0811a4eca29b565602 \
27                    sha256  c9bd07dd0d0045d6ca7537390a1afbcdf33716d193ea7d7084ae4f6c30b683ab
28# as sourced from https://www.wireshark.org/download/SIGNATURES-2.0.0.txt
29
30conflicts           wireshark-devel
31
32depends_build-append \
33                    port:pkgconfig
34
35depends_lib         path:lib/pkgconfig/glib-2.0.pc:glib2 \
36                    path:lib/libssl.dylib:openssl \
37                    port:libpcap
38
39configure.args-append \
40                    -DCMAKE_INSTALL_RPATH:STRING="${prefix}/lib" \
41                    -DCMAKE_INSTALL_NAME_DIR:STRING="${prefix}/lib" \
42                    -DENABLE_APPLICATION_BUNDLE=OFF \
43                    -DENABLE_ADNS=OFF \
44                    -DENABLE_CARES=OFF \
45                    -DENABLE_GCRYPT=OFF \
46                    -DENABLE_GEOIP=OFF \
47                    -DENABLE_GNUTLS=OFF \
48                    -DENABLE_KERBEROS=OFF \
49                    -DENABLE_LUA=OFF \
50                    -DENABLE_NETLINK=OFF \
51                    -DENABLE_PORTAUDIO=OFF \
52                    -DENABLE_SMI=OFF \
53                    -DENABLE_ZLIB=OFF \
54                    -DBUILD_wireshark_gtk=OFF \
55                    -DBUILD_wireshark=OFF
56
57variant qt4 conflicts no_gui qt5 gtk2 gtk3 description {Use Qt5 instead of Qt4 to build wireshark} {
58    PortGroup               qt4 1.0
59    configure.args-replace  -DENABLE_APPLICATION_BUNDLE=OFF -DENABLE_APPLICATION_BUNDLE=ON
60    configure.args-replace  -DBUILD_wireshark=OFF -DBUILD_wireshark=ON
61    configure.args-append   -DENABLE_QT5=OFF
62
63    # post-destroot {
64    #     ln -s ${prefix}/bin/dumpcap ${destroot}/${prefix}/bin/wireshark.app/Contents/MacOS/
65    #     file mkdir ${destroot}/${prefix}/bin/wireshark.app/Contents/PlugIns
66    #     ln -s ${prefix}/lib/wireshark/plugins/${version} ${destroot}/${prefix}/bin/wireshark.app/Contents/PlugIns/wireshark
67    #     file copy ${worksrcpath}/packaging/macosx/Resources ${destroot}/${prefix}/bin/wireshark.app/Contents/
68    #     file delete ${destroot}/${prefix}/bin/wireshark.app/Contents/Info.plist
69    #     file copy ${worksrcpath}/packaging/macosx/Info.plist ${destroot}/${prefix}/bin/wireshark.app/Contents/
70    #     move ${destroot}/${prefix}/bin/wireshark.app ${destroot}${applications_dir}/Wireshark.app
71    # }
72}
73
74variant qt5 conflicts no_gui qt4 gtk2 gtk3 description {Build Wireshark} {
75    PortGroup               qt5 1.0
76    configure.args-replace  -DENABLE_APPLICATION_BUNDLE=OFF -DENABLE_APPLICATION_BUNDLE=ON
77    configure.args-replace  -DBUILD_wireshark=OFF -DBUILD_wireshark=ON
78    configure.args-append   -DENABLE_QT5=ON
79
80    # post-destroot {
81    #     ln -s ${prefix}/bin/dumpcap ${destroot}/${prefix}/bin/wireshark.app/Contents/MacOS/
82    #     file mkdir ${destroot}/${prefix}/bin/wireshark.app/Contents/PlugIns
83    #     ln -s ${prefix}/lib/wireshark/plugins/${version} ${destroot}/${prefix}/bin/wireshark.app/Contents/PlugIns/wireshark
84    #     file copy ${worksrcpath}/packaging/macosx/Resources ${destroot}/${prefix}/bin/wireshark.app/Contents/
85    #     file delete ${destroot}/${prefix}/bin/wireshark.app/Contents/Info.plist
86    #     file copy ${worksrcpath}/packaging/macosx/Info.plist ${destroot}/${prefix}/bin/wireshark.app/Contents/
87    #     move ${destroot}/${prefix}/bin/wireshark.app ${destroot}${applications_dir}/Wireshark.app
88    # }
89}
90
91variant gtk2 conflicts no_gui qt4 qt5 gtk3 description {Use GTK3 instead of GTK2 to build wireshark} {
92    configure.args-replace  -DBUILD_wireshark_gtk=OFF -DBUILD_wireshark_gtk=ON
93    configure.args-append   -DENABLE_GTK3=OFF
94    depends_lib-append      port:gtk2
95   
96    post-destroot {
97            file mkdir ${destroot}/${applications_dir}/Wireshark.app/Contents/MacOS
98            ln -s ${prefix}/bin/wireshark-gtk ${destroot}/${applications_dir}/Wireshark.app/Contents/MacOS/Wireshark
99            ln -s ${prefix}/bin/dumpcap ${destroot}/${applications_dir}/Wireshark.app/Contents/MacOS/dumpcap
100            file mkdir ${destroot}/${applications_dir}/Wireshark.app/Contents/PlugIns
101            ln -s ${prefix}/lib/wireshark/plugins/${version} ${destroot}/${applications_dir}/Wireshark.app/Contents/PlugIns/wireshark
102            file copy ${worksrcpath}/packaging/macosx/Resources ${destroot}/${applications_dir}/Wireshark.app/Contents/
103            file copy ${worksrcpath}/packaging/macosx/Info.plist ${destroot}/${applications_dir}/Wireshark.app/Contents/
104    }
105}
106variant gtk3 conflicts no_gui qt4 qt5 gtk2 description {Build Wireshark (GTK+ UI)} {
107    configure.args-replace  -DBUILD_wireshark_gtk=OFF -DBUILD_wireshark_gtk=ON
108    configure.args-append   -DENABLE_GTK3=ON
109    depends_lib-append      port:gtk3 \
110                            port:adwaita-icon-theme
111    post-destroot {
112        file mkdir ${destroot}/${applications_dir}/Wireshark.app/Contents/MacOS
113        ln -s ${prefix}/bin/wireshark-gtk ${destroot}/${applications_dir}/Wireshark.app/Contents/MacOS/Wireshark
114        ln -s ${prefix}/bin/dumpcap ${destroot}/${applications_dir}/Wireshark.app/Contents/MacOS/dumpcap
115        file mkdir ${destroot}/${applications_dir}/Wireshark.app/Contents/PlugIns
116        ln -s ${prefix}/lib/wireshark/plugins/${version} ${destroot}/${applications_dir}/Wireshark.app/Contents/PlugIns/wireshark
117        file copy ${worksrcpath}/packaging/macosx/Resources ${destroot}/${applications_dir}/Wireshark.app/Contents/
118        file copy ${worksrcpath}/packaging/macosx/Info.plist ${destroot}/${applications_dir}/Wireshark.app/Contents/
119    }
120}
121
122variant adns conflicts cares description {use adns library for async. dns resolution} {
123    configure.args-replace  -DENABLE_ADNS=OFF -DENABLE_ADNS=ON
124    depends_lib-append      port:adns
125}
126
127variant portaudio description {Build with PortAudio support} {
128    configure.args-replace  -DENABLE_PORTAUDIO=OFF -DENABLE_PORTAUDIO=ON
129    depends_lib-append      port:portaudio
130}
131
132variant zlib description {Build with zlib compression support} {
133    configure.args-replace  -DENABLE_ZLIB=OFF -DENABLE_ZLIB=ON
134    depends_lib-append      port:zlib
135}
136
137variant lua description {Build with Lua dissector support} {
138    configure.args-replace  -DENABLE_LUA=OFF -DENABLE_LUA=ON
139    depends_lib-append      port:lua52
140}
141
142variant libsmi description {Build with libsmi snmp support} {
143    configure.args-replace  -DENABLE_SMI=OFF -DENABLE_SMI=ON
144    depends_lib-append      port:libsmi
145}
146
147variant gnutls description {Build with GNU TLS support} {
148    configure.args-replace  -DENABLE_GNUTLS=OFF -DENABLE_GNUTLS=ON
149    depends_lib-append      port:gnutls
150}
151
152variant libgcrypt description {Build with GNU crypto support} {
153    configure.args-replace  -DENABLE_GCRYPT=OFF -DENABLE_GCRYPT=ON
154    depends_lib-append      port:libgcrypt
155}
156
157variant cares conflicts adns description description {Build with c-ares support} {
158    configure.args-replace  -DENABLE_CARES=OFF -DENABLE_CARES=ON
159    depends_lib-append      port:c-ares
160}
161
162variant kerberos5 description {Build with Kerberos support} {
163    configure.args-replace  -DENABLE_KERBEROS=OFF -DENABLE_KERBEROS=ON \
164    configure.args-append   -DCMAKE_SHARED_LINKER_FLAGS="-lk5crypto"
165    depends_lib-append      port:kerberos5
166}
167
168variant geoip description {Build with GeoIP support} {
169    configure.args-replace  -DENABLE_GEOIP=OFF -DENABLE_GEOIP=ON
170    depends_lib-append      port:libgeoip
171}
172
173default_variants +portaudio +zlib +libsmi +gnutls +libgcrypt +cares +geoip +kerberos5
174
175if {![variant_isset qt4] && ![variant_isset qt5] && ![variant_isset gtk2] && ![variant_isset gtk3] && ![variant_isset no_gui]} {
176    default_variants-append +qt5
177}
178
179post-destroot {
180    xinstall -d ${destroot}${prefix}/include/wireshark/epan/crypt/
181    xinstall -d ${destroot}${prefix}/include/wireshark/epan/dfilter/
182    xinstall -d ${destroot}${prefix}/include/wireshark/epan/dissectors/
183    xinstall -d ${destroot}${prefix}/include/wireshark/epan/ftypes/
184    xinstall -d ${destroot}${prefix}/include/wireshark/wiretap/
185    xinstall -m 644 -W ${worksrcpath}/ color.h config.h register.h ${destroot}${prefix}/include/wireshark/
186    xinstall -m 644 {*}[glob ${worksrcpath}/epan/*.h] ${destroot}${prefix}/include/wireshark/epan/
187    xinstall -m 644 {*}[glob ${worksrcpath}/epan/crypt/*.h] ${destroot}${prefix}/include/wireshark/epan/crypt/
188    xinstall -m 644 {*}[glob ${worksrcpath}/epan/dfilter/*.h] ${destroot}${prefix}/include/wireshark/epan/dfilter/
189    xinstall -m 644 {*}[glob ${worksrcpath}/epan/dissectors/*.h] ${destroot}${prefix}/include/wireshark/epan/dissectors/
190    xinstall -m 644 {*}[glob ${worksrcpath}/epan/ftypes/*.h] ${destroot}${prefix}/include/wireshark/epan/ftypes/
191    xinstall -m 644 {*}[glob ${worksrcpath}/wiretap/*.h] ${destroot}${prefix}/include/wireshark/wiretap/
192}
193
194livecheck.type      regex
195livecheck.url       ${homepage}download.html
196livecheck.regex     "Stable Release \\((\\d+(?:\\.\\d+)*)"