Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sparrow-wifi: add package #4363

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lists/to-release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sparrow-wifi
48 changes: 48 additions & 0 deletions packages/sparrow-wifi/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=sparrow-wifi
pkgver=192.b6018c5
pkgrel=1
pkgdesc='Next-Gen GUI-based WiFi and Bluetooth Analyzer.'
arch=('any')
groups=('blackarch' 'blackarch-bluetooth' 'blackarch-wireless')
url='https://github.com/ghostop14/sparrow-wifi'
license=('GPL-3.0')
depends=('python' 'gpsd')
makedepends=('git' 'python-setuptools' 'python-pip')
source=("git+https://github.com/ghostop14/$pkgname.git")
sha512sums=('SKIP')
install="$pkgname.install"

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)"
)
}

package() {
cd $pkgname

install -dm 755 "$pkgdir/usr/bin"
install -Dm 644 requirements.txt "$pkgdir/usr/share/$pkgname/requirements.txt"
install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md docs/*.pdf

rm -rf LICENSE *.md docs/*.pdf .gitignore

cp -a * "$pkgdir/usr/share/$pkgname/"

cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
source /usr/share/$pkgname/venv/bin/activate
exec python /usr/share/$pkgname/sparrow-wifi.py "\$@"
EOF

chmod a+x "$pkgdir/usr/bin/$pkgname"
}

12 changes: 12 additions & 0 deletions packages/sparrow-wifi/sparrow-wifi.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
post_install() {
set -e
cd /usr/share/sparrow-wifi
python -m venv venv
source venv/bin/activate &&
pip install --isolated --root="/usr/share/sparrow-wifi" --prefix='venv' \
-r requirements.txt
}

post_upgrade() {
post_install "$@"
}
Loading