# Maintainer: Developer <dev@opalos.org>
# Maintainer: Developer <dev@opalos.org>

pkgname=wireless_tools
pkgver=%version%
_pkgver=${pkgver%.pre*}
pkgrel=%release%
pkgdesc='Tools allowing to manipulate the Wireless Extensions'
url='https://hewlettpackard.github.io/wireless-tools/Tools.html'
license=('GPL')
arch=('x86_64')
source=("https://hewlettpackard.github.io/wireless-tools/${pkgname}.${pkgver}.tar.gz")
sha256sums=('abd9c5c98abf1fdd11892ac2f8a56737544fe101e1be27c6241a564948f34c63')

prepare() {
	cd "${srcdir}/${pkgname}.${_pkgver}"
	sed '/BUILD_STATIC =/d' -i Makefile
}

build() {
	cd "${srcdir}/${pkgname}.${_pkgver}"
	make CFLAGS="${CFLAGS} -I." LDFLAGS="${LDFLAGS}"
}

package() {
	cd "${srcdir}/${pkgname}.${_pkgver}"
	make \
		INSTALL_DIR="${pkgdir}/usr/bin" \
		INSTALL_LIB="${pkgdir}/usr/lib" \
		INSTALL_INC="${pkgdir}/usr/include" \
		INSTALL_MAN="${pkgdir}/usr/share/man" \
		install
}
