# This file is part of BlackArch Linux ( https://www.blackarch.org/ ). # See COPYING for license details. # pkgname=libbtbb pkgver=2020.12.R1.r7.gf0fe176 pkgrel=1 pkgdesc='Bluetooth baseband decoding library.' arch=('x86_64' 'aarch64') url='https://github.com/greatscottgadgets/libbtbb' license=('GPL-2.0-or-later') depends=('python') makedepends=('git' 'cmake' 'python-distutils-extra') source=("git+https://github.com/greatscottgadgets/$pkgname.git") sha512sums=('SKIP') pkgver() { cd $pkgname ( set -o pipefail git describe --long --tags --abbrev=7 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || printf "%s.%s" "$(git rev-list --count HEAD)" \ "$(git rev-parse --short=7 HEAD)" ) } build() { cd $pkgname mkdir -p build && cd build sed -i -r -e "s#@CMAKE_INSTALL_PREFIX@#/usr#" ../lib/libbtbb.pc.in cmake \ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ -DCMAKE_INSTALL_PREFIX="$pkgdir/usr" \ -DENABLE_PYTHON=FALSE \ .. make cd ../python/pcaptools python setup.py build } package() { cd "$pkgname/build/" make install cd ../python/pcaptools mkdir -p "$pkgdir/usr/bin" cp btaptap "$pkgdir/usr/bin/" python setup.py install --root="$pkgdir" -O1 --skip-build }