Ticket #40782: Portfile-cmake-1.99.8

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