Ticket #40782: Portfile-cmake-1.99.2.8

File Portfile-cmake-1.99.2.8, 9.9 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   port:pkgconfig \
37                port:cmake
38
39depends_lib     path:lib/pkgconfig/glib-2.0.pc:glib2 \
40                path:lib/libssl.dylib:openssl \
41                port:libpcap
42
43configure.args  -DCMAKE_INSTALL_RPATH:STRING="${prefix}/lib" \
44                -DCMAKE_INSTALL_NAME_DIR:STRING="${prefix}/lib" \
45                -DENABLE_NETLINK=OFF \
46                -DENABLE_APPLICATION_BUNDLE=OFF
47
48default_variants +qt5 +portaudio +zlib +lua +libsmi +gnutls +libgcrypt +cares +geoip
49
50variant qt4 conflicts no_gui qt5 gtk2 gtk3 description {Use Qt5 instead of Qt4 to build wireshark} {
51        configure.args-append   -DBUILD_wireshark=ON \
52                                -DENABLE_QT5=OFF
53        depends_lib-append      port:qt4-mac
54        configure.env           PATH=$env(PATH):${prefix}/libexec/qt4-mac/bin
55        post-destroot {
56                ln -s ${prefix}/bin/dumpcap ${destroot}/${prefix}/bin/wireshark.app/Contents/MacOS/
57                file mkdir ${destroot}/${prefix}/bin/wireshark.app/Contents/PlugIns
58                ln -s ${prefix}/lib/wireshark/plugins/${version} ${destroot}/${prefix}/bin/wireshark.app/Contents/PlugIns/wireshark
59                file copy ${worksrcpath}/packaging/macosx/Resources ${destroot}/${prefix}/bin/wireshark.app/Contents/
60                file delete ${destroot}/${prefix}/bin/wireshark.app/Contents/Info.plist
61                file copy ${worksrcpath}/packaging/macosx/Info.plist ${destroot}/${prefix}/bin/wireshark.app/Contents/
62                move ${destroot}/${prefix}/bin/wireshark.app ${destroot}${applications_dir}/Wireshark.app
63        }
64}
65
66variant qt5 conflicts no_gui qt4 gtk2 gtk3 description {Build Wireshark} {
67       configure.args-append    -DBUILD_wireshark=ON \
68                                -DENABLE_QT5=ON
69       depends_lib-append       port:qt5-mac
70       configure.env            PATH=$env(PATH):${prefix}/libexec/qt5-mac/bin
71       post-destroot {
72                ln -s ${prefix}/bin/dumpcap ${destroot}/${prefix}/bin/wireshark.app/Contents/MacOS/
73                file mkdir ${destroot}/${prefix}/bin/wireshark.app/Contents/PlugIns
74                ln -s ${prefix}/lib/wireshark/plugins/${version} ${destroot}/${prefix}/bin/wireshark.app/Contents/PlugIns/wireshark
75                file copy ${worksrcpath}/packaging/macosx/Resources ${destroot}/${prefix}/bin/wireshark.app/Contents/
76                file delete ${destroot}/${prefix}/bin/wireshark.app/Contents/Info.plist
77                file copy ${worksrcpath}/packaging/macosx/Info.plist ${destroot}/${prefix}/bin/wireshark.app/Contents/
78                move ${destroot}/${prefix}/bin/wireshark.app ${destroot}${applications_dir}/Wireshark.app
79       }
80}
81
82if {![variant_isset qt4] && ![variant_isset qt5]} {
83        configure.args-append   -DBUILD_wireshark=OFF
84}
85
86variant gtk2 conflicts no_gui qt4 qt5 gtk3 description {Use GTK3 instead of GTK2 to build wireshark} {
87        configure.args-append   -DBUILD_wireshark_gtk=ON \
88                                -DENABLE_GTK3=OFF
89        depends_lib-append      port:gtk2
90
91        post-destroot {
92                file mkdir ${destroot}/${applications_dir}/Wireshark.app/Contents/MacOS
93                ln -s ${prefix}/bin/wireshark-gtk ${destroot}/${applications_dir}/Wireshark.app/Contents/MacOS/Wireshark
94                ln -s ${prefix}/bin/dumpcap ${destroot}/${applications_dir}/Wireshark.app/Contents/MacOS/dumpcap
95                file mkdir ${destroot}/${applications_dir}/Wireshark.app/Contents/PlugIns
96                ln -s ${prefix}/lib/wireshark/plugins/${version} ${destroot}/${applications_dir}/Wireshark.app/Contents/PlugIns/wireshark
97                file copy ${worksrcpath}/packaging/macosx/Resources ${destroot}/${applications_dir}/Wireshark.app/Contents/
98                file copy ${worksrcpath}/packaging/macosx/Info.plist ${destroot}/${applications_dir}/Wireshark.app/Contents/
99        }
100}
101variant gtk3 conflicts no_gui qt4 qt5 gtk2 description {Build Wireshark (GTK+ UI)} {
102        configure.args-append       -DBUILD_wireshark_gtk=ON \
103                                -DENABLE_GTK3=ON
104        depends_lib-append      port:gtk3 \
105                                port:adwaita-icon-theme
106        post-destroot {
107                file mkdir ${destroot}/${applications_dir}/Wireshark.app/Contents/MacOS
108                ln -s ${prefix}/bin/wireshark-gtk ${destroot}/${applications_dir}/Wireshark.app/Contents/MacOS/Wireshark
109                ln -s ${prefix}/bin/dumpcap ${destroot}/${applications_dir}/Wireshark.app/Contents/MacOS/dumpcap
110                file mkdir ${destroot}/${applications_dir}/Wireshark.app/Contents/PlugIns
111                ln -s ${prefix}/lib/wireshark/plugins/${version} ${destroot}/${applications_dir}/Wireshark.app/Contents/PlugIns/wireshark
112                file copy ${worksrcpath}/packaging/macosx/Resources ${destroot}/${applications_dir}/Wireshark.app/Contents/
113                file copy ${worksrcpath}/packaging/macosx/Info.plist ${destroot}/${applications_dir}/Wireshark.app/Contents/
114        }
115}
116if {![variant_isset gtk2]  && ![variant_isset gtk3]} {
117        configure.args-append   -DBUILD_wireshark_gtk=OFF
118}
119
120variant no_gui conflicts qt4 qt5 gtk2 gtk3 description {Disable wireshark and wireshark_gtk} {
121        configure.args-append   -DBUILD_wireshark_gtk=OFF \
122                                -DBUILD_wireshark=OFF
123}
124
125variant adns conflicts cares description {use adns library for async. dns resolution} {
126        configure.args-append   -DENABLE_ADNS=ON
127        depends_lib-append      port:adns
128}
129if {![variant_isset adns]} {
130        configure.args-append   -DENABLE_ADNS=OFF
131}
132
133variant portaudio description {Build with PortAudio support} {
134        configure.args-append   -DENABLE_PORTAUDIO=ON
135        depends_lib-append      port:portaudio
136}
137if {![variant_isset portaudio]} {
138        configure.args-append   -DENABLE_PORTAUDIO=OFF
139}
140
141variant zlib description {Build with zlib compression support} {
142        configure.args-append   -DENABLE_ZLIB=ON
143        depends_lib-append      port:zlib
144}
145if {![variant_isset zlib]} {
146        configure.args-append   -DENABLE_ZLIB=OFF
147}
148
149variant lua description {Build with Lua dissector support} {
150        configure.args-append   -DENABLE_LUA=ON
151        depends_lib-append      port:lua
152}
153if {![variant_isset lua]} {
154        configure.args-append   -DENABLE_LUA=OFF
155}
156
157variant libsmi description {Build with libsmi snmp support} {
158        configure.args-append   -DENABLE_SMI=ON
159        depends_lib-append      port:libsmi
160}
161if {![variant_isset libsmi]} {
162        configure.args-append   -DENABLE_SMI=OFF
163}
164
165variant gnutls description {Build with GNU TLS support} {
166        configure.args-append   -DENABLE_GNUTLS=ON
167        depends_lib-append      port:gnutls
168}
169if {![variant_isset gnutls]} {
170        configure.args-append   -DENABLE_GNUTLS=OFF
171}
172
173variant libgcrypt description {Build with GNU crypto support} {
174        configure.args-append   -DENABLE_GCRYPT=ON
175        depends_lib-append      port:libgcrypt
176}
177if {![variant_isset libgcrypt]} {
178        configure.args-append   -DENABLE_GCRYPT=OFF
179}
180
181variant cares conflicts adns description description {Build with c-ares support} {
182        configure.args-append   -DENABLE_CARES=ON
183        depends_lib-append      port:c-ares
184}
185if {![variant_isset cares]} {
186        configure.args-append   -DENABLE_CARES=OFF
187}
188
189variant kerberos5 description {Build with Kerberos support} {
190        configure.args-append   -DENABLE_KERBEROS=ON
191        depends_lib-append      port:kerberos5
192}
193if {![variant_isset kerberos5]} {
194        configure.args-append   -DENABLE_KERBEROS=OFF
195}
196
197variant geoip description {Build with GeoIP support} {
198        configure.args-append   -DENABLE_GEOIP=ON
199        depends_lib-append      port:libgeoip
200}
201if {![variant_isset geoip]} {
202        configure.args-append   -DENABLE_GEOIP=OFF
203}
204
205post-destroot {
206       xinstall -d ${destroot}${prefix}/include/wireshark/epan/crypt/
207       xinstall -d ${destroot}${prefix}/include/wireshark/epan/dfilter/
208       xinstall -d ${destroot}${prefix}/include/wireshark/epan/dissectors/
209       xinstall -d ${destroot}${prefix}/include/wireshark/epan/ftypes/
210       xinstall -d ${destroot}${prefix}/include/wireshark/wiretap/
211       xinstall -m 644 -W ${worksrcpath}/ color.h config.h register.h ${destroot}${prefix}/include/wireshark/
212       xinstall -m 644 {*}[glob ${worksrcpath}/epan/*.h] ${destroot}${prefix}/include/wireshark/epan/
213       xinstall -m 644 {*}[glob ${worksrcpath}/epan/crypt/*.h] ${destroot}${prefix}/include/wireshark/epan/crypt/
214       xinstall -m 644 {*}[glob ${worksrcpath}/epan/dfilter/*.h] ${destroot}${prefix}/include/wireshark/epan/dfilter/
215       xinstall -m 644 {*}[glob ${worksrcpath}/epan/dissectors/*.h] ${destroot}${prefix}/include/wireshark/epan/dissectors/
216       xinstall -m 644 {*}[glob ${worksrcpath}/epan/ftypes/*.h] ${destroot}${prefix}/include/wireshark/epan/ftypes/
217       xinstall -m 644 {*}[glob ${worksrcpath}/wiretap/*.h] ${destroot}${prefix}/include/wireshark/wiretap/
218}