1*edff4923SAndrew GeisslerDESCRIPTION = "wireshark - a popular network protocol analyzer"
2*edff4923SAndrew GeisslerHOMEPAGE = "http://www.wireshark.org"
3*edff4923SAndrew GeisslerSECTION = "net"
4*edff4923SAndrew GeisslerLICENSE = "GPL-2.0-only"
5*edff4923SAndrew GeisslerLIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
6*edff4923SAndrew Geissler
7*edff4923SAndrew GeisslerDEPENDS = "pcre2 expat glib-2.0 glib-2.0-native libgcrypt libgpg-error libxml2 bison-native c-ares speexdsp"
8*edff4923SAndrew Geissler
9*edff4923SAndrew GeisslerDEPENDS:append:class-target = " wireshark-native chrpath-replacement-native "
10*edff4923SAndrew Geissler
11*edff4923SAndrew GeisslerSRC_URI = "https://1.eu.dl.wireshark.org/src/wireshark-${PV}.tar.xz \
12*edff4923SAndrew Geissler           file://0001-wireshark-src-improve-reproducibility.patch \
13*edff4923SAndrew Geissler           file://0002-flex-Remove-line-directives.patch \
14*edff4923SAndrew Geissler           file://0004-lemon-Remove-line-directives.patch \
15*edff4923SAndrew Geissler           file://0001-UseLemon.cmake-do-not-use-lemon-data-from-the-host.patch \
16*edff4923SAndrew Geissler           "
17*edff4923SAndrew Geissler
18*edff4923SAndrew GeisslerUPSTREAM_CHECK_URI = "https://1.as.dl.wireshark.org/src"
19*edff4923SAndrew Geissler
20*edff4923SAndrew GeisslerSRC_URI[sha256sum] = "55e793ab87a9a73aac44336235c92cb76c52180c469b362ed3a54f26fbb1261f"
21*edff4923SAndrew Geissler
22*edff4923SAndrew GeisslerPE = "1"
23*edff4923SAndrew Geissler
24*edff4923SAndrew Geisslerinherit cmake pkgconfig python3native python3targetconfig perlnative upstream-version-is-even mime mime-xdg
25*edff4923SAndrew Geissler
26*edff4923SAndrew GeisslerPACKAGECONFIG ?= "libpcap gnutls libnl libcap sbc"
27*edff4923SAndrew Geissler
28*edff4923SAndrew GeisslerPACKAGECONFIG:class-native = "libpcap gnutls ssl libssh"
29*edff4923SAndrew Geissler
30*edff4923SAndrew GeisslerPACKAGECONFIG[libcap] = "-DENABLE_CAP=ON,-DENABLE_CAP=OFF -DENABLE_PCAP_NG_DEFAULT=ON, libcap"
31*edff4923SAndrew GeisslerPACKAGECONFIG[libpcap] = "-DENABLE_PCAP=ON,-DENABLE_PCAP=OFF -DENABLE_PCAP_NG_DEFAULT=ON , libpcap"
32*edff4923SAndrew GeisslerPACKAGECONFIG[libsmi] = "-DENABLE_SMI=ON,-DENABLE_SMI=OFF,libsmi"
33*edff4923SAndrew GeisslerPACKAGECONFIG[libnl] = ",,libnl"
34*edff4923SAndrew GeisslerPACKAGECONFIG[portaudio] = "-DENABLE_PORTAUDIO=ON,-DENABLE_PORTAUDIO=OFF, portaudio-v19"
35*edff4923SAndrew GeisslerPACKAGECONFIG[gnutls] = "-DENABLE_GNUTLS=ON,-DENABLE_GNUTLS=OFF, gnutls"
36*edff4923SAndrew GeisslerPACKAGECONFIG[ssl] = ",,openssl"
37*edff4923SAndrew GeisslerPACKAGECONFIG[krb5] = "-DENABLE_KRB5=ON,-DENABLE_KRB5=OFF, krb5"
38*edff4923SAndrew GeisslerPACKAGECONFIG[lua] = "-DENABLE_LUA=ON,-DENABLE_LUA=OFF, lua"
39*edff4923SAndrew GeisslerPACKAGECONFIG[zlib] = "-DENABLE_ZLIB=ON,-DENABLE_ZLIB=OFF, zlib"
40*edff4923SAndrew GeisslerPACKAGECONFIG[geoip] = ",, geoip"
41*edff4923SAndrew GeisslerPACKAGECONFIG[plugins] = "-DENABLE_PLUGINS=ON,-DENABLE_PLUGINS=OFF"
42*edff4923SAndrew GeisslerPACKAGECONFIG[sbc] = "-DENABLE_SBC=ON,-DENABLE_SBC=OFF, sbc"
43*edff4923SAndrew GeisslerPACKAGECONFIG[libssh] = "-DENABLE_LIBSSH=ON,-DENABLE_LIBSSH=OFF, libssh2"
44*edff4923SAndrew GeisslerPACKAGECONFIG[lz4] = "-DENABLE_LZ4=ON,-DENABLE_LZ4=OFF, lz4"
45*edff4923SAndrew GeisslerPACKAGECONFIG[zstd] = "-DENABLE_STTD=ON,-DENABLE_ZSTD=OFF, zstd"
46*edff4923SAndrew GeisslerPACKAGECONFIG[nghttp2] = "-DENABLE_NGHTTP2=ON,-DENABLE_NGHTTP2=OFF, nghttp2"
47*edff4923SAndrew Geissler
48*edff4923SAndrew Geissler# these next two options require addional layers
49*edff4923SAndrew GeisslerPACKAGECONFIG[qt5] = "-DENABLE_QT5=ON -DBUILD_wireshark=ON, -DENABLE_QT5=OFF -DBUILD_wireshark=OFF, qttools-native qtmultimedia qtsvg"
50*edff4923SAndrew Geissler
51*edff4923SAndrew Geisslerinherit ${@bb.utils.contains('PACKAGECONFIG', 'qt5', 'cmake_qt5', '', d)}
52*edff4923SAndrew Geissler
53*edff4923SAndrew GeisslerEXTRA_OECMAKE += "-DENABLE_NETLINK=ON \
54*edff4923SAndrew Geissler                  -DBUILD_mmdbresolve=OFF \
55*edff4923SAndrew Geissler                  -DBUILD_randpktdump=OFF \
56*edff4923SAndrew Geissler                  -DBUILD_androiddump=OFF \
57*edff4923SAndrew Geissler                  -DBUILD_dcerpcidl2wrs=OFF \
58*edff4923SAndrew Geissler                  -DM_INCLUDE_DIR=${includedir} \
59*edff4923SAndrew Geissler                  -DM_LIBRARY=${libdir} \
60*edff4923SAndrew Geissler                 "
61*edff4923SAndrew GeisslerCFLAGS:append = " -lm"
62*edff4923SAndrew Geissler
63*edff4923SAndrew Geisslerdo_compile:append:class-target() {
64*edff4923SAndrew Geissler    # Fix TMPDIR, these are in the comments section
65*edff4923SAndrew Geissler    sed -i -e "s:** source file.*::g"  ${B}/wiretap/ascend_parser.c
66*edff4923SAndrew Geissler    sed -i -e "s:** source file.*::g"  ${B}/wiretap/candump_parser.c
67*edff4923SAndrew Geissler    sed -i -e "s:** source file.*::g"  ${B}/wiretap/busmaster_parser.c
68*edff4923SAndrew Geissler    sed -i -e "s:** source file.*::g"  ${B}/epan/protobuf_lang_parser.c
69*edff4923SAndrew Geissler    sed -i -e "s:** source file.*::g"  ${B}/epan/dtd_grammar.c
70*edff4923SAndrew Geissler    sed -i -e "s:** source file.*::g"  ${B}/epan/dfilter/grammar.c
71*edff4923SAndrew Geissler}
72*edff4923SAndrew Geissler
73*edff4923SAndrew Geisslerdo_install:append:class-native() {
74*edff4923SAndrew Geissler	install -d ${D}${bindir}
75*edff4923SAndrew Geissler	for f in lemon
76*edff4923SAndrew Geissler	do
77*edff4923SAndrew Geissler		install -m 0755 ${B}/run/$f ${D}${bindir}
78*edff4923SAndrew Geissler	done
79*edff4923SAndrew Geissler}
80*edff4923SAndrew Geissler
81*edff4923SAndrew Geisslerdo_install:append:class-target() {
82*edff4923SAndrew Geissler	for f in `find ${D}${libdir} ${D}${bindir} -type f -executable`
83*edff4923SAndrew Geissler	do
84*edff4923SAndrew Geissler		chrpath --delete $f
85*edff4923SAndrew Geissler	done
86*edff4923SAndrew Geissler
87*edff4923SAndrew Geissler    # We don't need the cmake files installed
88*edff4923SAndrew Geissler    rm -fr ${D}${usrlib}/${BPN}/cmake
89*edff4923SAndrew Geissler}
90*edff4923SAndrew Geissler
91*edff4923SAndrew GeisslerPACKAGE_BEFORE_PN += "tshark"
92*edff4923SAndrew Geissler
93*edff4923SAndrew GeisslerFILES:tshark = "${bindir}/tshark ${mandir}/man1/tshark.*"
94*edff4923SAndrew Geissler
95*edff4923SAndrew GeisslerFILES:${PN} += "${datadir}*"
96*edff4923SAndrew Geissler
97*edff4923SAndrew GeisslerRDEPENDS:tshark = "wireshark"
98*edff4923SAndrew Geissler
99*edff4923SAndrew GeisslerBBCLASSEXTEND = "native"
100