#### this file is sourced not run
PKGNAME=wireshark
PKGVER=3.2.1
PKGBUILD=1
PKGARCH=x86_64

# source: kirk/JakeSFR
TARBALL=$PKGNAME-$PKGVER.tar.xz
MD5SUM=e699b1e001c6303013791d81faf7727d
#SRC_URL=http://distro.ibiblio.org/fatdog/source/810/$TARBALL
SRC_URL=https://1.as.dl.wireshark.org/src/all-versions/$TARBALL


SLACKREQ='qt5-common libpcap'

SLACKDESC="${PKGNAME}: ${PKGNAME} ${PKGVER} (Network analyzer)
${PKGNAME}:
${PKGNAME}: Wireshark is a network traffic analyzer, or sniffer, for Unix and
${PKGNAME}: Unix-like operating systems.  It uses QT4, a graphical user interface
${PKGNAME}: library, and libpcap, a packet capture and filtering library.
${PKGNAME}: The Wireshark distribution also comes with TShark, which is a
${PKGNAME}: line-oriented sniffer similar to Suns snoop, or tcpdump. It uses the
${PKGNAME}: same dissection, capture-file reading and writing, and packet filtering
${PKGNAME}: code as Wireshark. Editcap, which is a program to read capture
${PKGNAME}: files and write the packets from that capture file.
${PKGNAME}: http://www.wireshark.org
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/${PKGNAME}* &&
	# quick fix for: error: unknown type name 'uint16_t'
	sed -i '13i#include <stdint.h>' sharkd_session.c &&
	true
}
### default pkg_package
### build
pkg_build() {
	# qt5
	export PATH="$PATH:/opt/qt5/bin"
	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/qt5/$LIBDIR"
	export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/qt5/$LIBDIR/pkgconfig"
	export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/opt/qt5/include"
	export QT5_PATH="/opt/qt5/bin"
	export QT5_LD_LIBRARY_PATH="/opt/qt5/$LIBDIR"
	export QT5_PKG_CONFIG_PATH="/opt/qt5/$LIBDIR/pkgconfig"
	export QT5_CPLUS_INCLUDE_PATH="/opt/qt5/include" 
	
	cd /tmp/${PKGNAME}* &&
	pkg_build_cmake &&
	pkg_build_slackdesc &&
	true
}
