Ticket #40782: Portfile-cmake-1.99.3.8

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