description="Network Sniffer with nice GUI"
url="http://www.wireshark.org"

packager="tnut <tnut@nutyx.org>"
contributors="fanch,tnut,Greg,Rémy"

makedepends=(cmake ninja shared-mime-info gtk3 libpcap pcre hicolor-icon-theme
             qtbase qttranslations qtmultimedia qtsvg)
run=(shared-mime-info hicolor-icon-theme)


name=wireshark
version=3.0.8

source=(https://www.wireshark.org/download/src/all-versions/wireshark-$version.tar.xz)

prepare() {
getent group wireshark ||groupadd -g 62 wireshark
}
build() {
  cd $name-$version

  mkdir build
  cd    build
  cmake  -DCMAKE_INSTALL_PREFIX=/usr \
         -DCMAKE_BUILD_TYPE=Release \
         -DMAKE_INSTALL_DOCDIR=/usr/share/doc/$name-$version \
         -G Ninja ..

  ninja
  DESTDIR=$PKG ninja install

  install -v -m755 -d $PKG/usr/share/doc/wireshark-$version
  install -v -m644    ../README.linux ../doc/README.* ../doc/{*.pod,randpkt.txt} \
                      $PKG/usr/share/doc/wireshark-$version

  pushd $PKG/usr/share/doc/wireshark-$version
     for FILENAME in ../../wireshark/*.html; do
         ln -s -v -f $FILENAME .
     done
  popd
  unset FILENAME
}
