app=wireless-tools
version=29
build=1sml
altname="$(echo $app | sed 's/-/_/')"
homepage="https://hewlettpackard.github.io/wireless-tools/"
download="https://hewlettpackard.github.io/wireless-tools/wireless_tools.29.tar.gz"
desc="Set of tools allowing manipulation of wireless extensions"
requires="musl"

build() {
  mkandenterbuilddir
  rm -rf "$altname.$version"

  tar xf $srcdir/$altname.$version.tar.?z
  cd "$altname.$version"
  fixbuilddirpermissions

  applypatch $srcdir/wireless-tools-Makefile.patch
  applypatch $srcdir/wireless-tools-headers.patch

  make INSTALL_MAN="$pkg/share/man" INSTALL_DIR="$pkg/bin" CFLAGS="$CFLAGS -D_GNU_SOURCE -D_BSD_SOURCE"
  make INSTALL_MAN="$pkg/share/man" INSTALL_DIR="$pkg/bin" install DESTDIR="$pkg"

  cp COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
d2f182e60aeb2f3fa6dbb52b49be48a7ed25c1e660116c8b763b6d2baf863855c7459f1d8e0d4ae7d9f526a8f47d3cc5deaf1db5fe5352fdd821a427aa31716a  wireless_tools.29.tar.lz
629dee411f8b37047613fb8381b431caed8c1dcc24a3ced058c38f3628696ded1b8a0432ce5da75dbc93d42c7c82e54f16c0102fb0d961c840fe925f30377114  wireless-tools-Makefile.patch
502e0b879bed0ccbcb6de0580984f4187cdbf4adc87caae44652a6a9ff786103a3930d9dfecd2fbe4754743cde2cc0a310ab67f4a794d0d18e88bdaf41662f14  wireless-tools-headers.patch
"
