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

kamerka: update package. #4459

Merged
merged 2 commits into from
Feb 7, 2025
Merged
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
49 changes: 28 additions & 21 deletions packages/kamerka/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,49 @@
# See COPYING for license details.

pkgname=kamerka
pkgver=40.be17620
pkgrel=5
epoch=1
pkgver=44.39d6796
pkgrel=1
pkgdesc='Build interactive map of cameras from Shodan.'
arch=('any')
groups=('blackarch' 'blackarch-recon')
url='https://github.com/woj-ciech/kamerka'
license=('custom:unknown')
depends=('python' 'python-geopy' 'python-colorama' 'python-shodan'
'python-folium' 'python-twitter' 'python-instagramapi'
'python-flickrapi' 'python-branca' 'python-google-streetview'
'python-elasticsearch')
makedepends=('git')
source=("git+https://github.com/woj-ciech/$pkgname.git#commit=be17620618163cf414cda63576f7947e6a7ec44c")
url='https://github.com/s7x/kamerka'
license=('MIT')
depends=('python')
makedepends=('git' 'python-setuptools' 'python-pip')
source=("git+https://github.com/s7x/$pkgname.git")
sha512sums=('SKIP')
install="$pkgname.install"

#pkgver() {
# cd $pkgname
#
# echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
#}
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 755 -t "$pkgdir/usr/share/$pkgname/" *.py *.yml
install -Dm 644 requirements.txt "$pkgdir/usr/share/$pkgname/requirements.txt"
install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md

install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

rm -rf LICENSE *.md

install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
cp -a * "$pkgdir/usr/share/$pkgname/"

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

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

20 changes: 20 additions & 0 deletions packages/kamerka/kamerka.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
post_install() {
set -e
cd /usr/share/kamerka
python -m venv venv
source venv/bin/activate &&
pip install --isolated --root="/usr/share/kamerka" --prefix='venv' \
-r requirements.txt
echo
echo ">"
echo "> Don't forget to put your API keys in /usr/share/kamerka/kamerka.py"
echo ">"
}

post_upgrade() {
post_install "$@"
}

post_remove() {
rm -r /usr/share/kamerka
}