diff --git a/packages/finduncommonshares/PKGBUILD b/packages/finduncommonshares/PKGBUILD new file mode 100644 index 00000000000..9f8c192a4b6 --- /dev/null +++ b/packages/finduncommonshares/PKGBUILD @@ -0,0 +1,45 @@ +# This file is part of BlackArch Linux ( https://www.blackarch.org/ ). +# See COPYING for license details. + +pkgname=finduncommonshares +pkgver=3.2.r4.g16864c1 +pkgrel=1 +pkgdesc='Python script allowing to quickly find uncommon shares in vast Windows Domains.' +arch=('any') +groups=('blackarch' 'blackarch-windows') +url='https://github.com/p0dalirius/finduncommonshares' +license=('FIXME') +depends=('impacket' 'python' 'python-dnspython' 'python-pycryptodome' 'python-sectools' 'python-xlsxwriter') +makedepends=('git') +source=("git+$url.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)" + ) +} + +package() { + cd $pkgname + + install -dm 755 "$pkgdir/usr/bin" + install -dm 755 "$pkgdir/usr/share/$pkgname" + + install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md + + cp -a FindUncommonShares.py "$pkgdir/usr/share/$pkgname/" + + cat > "$pkgdir/usr/bin/$pkgname" << EOF +#!/bin/sh +exec python /usr/share/$pkgname/FindUncommonShares.py "\$@" +EOF + + chmod a+x "$pkgdir/usr/bin/$pkgname" +} +