Skip to content

Commit

Permalink
ghauri: fix package. (#4429)
Browse files Browse the repository at this point in the history
* ghauri: fix package.

* Update ghauri.install

Removed comments on the post_install() procedure.

* Update PKGBUILD

Increased the pkgrel version to 2

* Update ghauri.install

Added \n on the last line.

* Update ghauri.install

Fix last line (normally
  • Loading branch information
s7x authored Dec 9, 2024
1 parent fefa872 commit c51c8a5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 11 deletions.
1 change: 1 addition & 0 deletions lists/to-release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ghauri
37 changes: 26 additions & 11 deletions packages/ghauri/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,48 @@

pkgname=ghauri
pkgver=1.4.1.r0.g316410a
pkgrel=1
pkgrel=2
pkgdesc='An advanced cross-platform tool that automates the process of detecting and exploiting SQL injection security flaws.'
arch=('any')
groups=('blackarch' 'blackarch-webapp' 'blackarch-exploitation')
url='https://github.com/r0oth3x49/ghauri'
license=('MIT')
depends=('python' 'python-chardet' 'python-tldextract' 'python-colorama'
'python-requests')
makedepends=('git' 'python-setuptools')
depends=('python')
makedepends=('git' 'python-setuptools' 'python-pip')
source=("git+https://github.com/r0oth3x49/$pkgname.git")
sha512sums=('SKIP')
install="$pkgname.install"

pkgver() {
cd $pkgname

git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | sed 's/#/\./g'
( 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() {
package() {
cd $pkgname

python setup.py build
}
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

package() {
cd $pkgname
install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

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

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

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

python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
chmod a+x "$pkgdir/usr/bin/$pkgname"
}

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

post_upgrade() {
post_install "$@"
}

post_remove() {
# /usr/share/ghauri/venv
rm -r /usr/share/ghauri
}

0 comments on commit c51c8a5

Please sign in to comment.