Ticket #40782: Portfile-cmake-1.99.5.8

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