diff options
author | 5amu | 2021-02-12 09:48:58 +0100 |
---|---|---|
committer | 5amu | 2021-02-12 09:50:36 +0100 |
commit | 4dbe938fd6eaed06ab63a2449fe5508d467d69bc (patch) | |
tree | 163c6a0d860ad1737d1b26a88cbb5a8f3dee0079 /PKGBUILD | |
download | aur-4dbe938fd6eaed06ab63a2449fe5508d467d69bc.tar.gz |
First packaging (ever for me :)) of searchpoc.py
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..88da012e207a --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,47 @@ +# Maintainer 5amu <v.casalino@protonmail.com> + +pkgbase=searchpoc +pkgname=searchpoc +pkgver=v0.0.1 +pkgrel=0 +pkgdesc="Search a PoC for a (or some) given CVE id" +url="https://github.com/5amu/searchpoc/" +license=('MIT') +_source='https://raw.githubusercontent.com/5amu/searchpoc/v0.0.1/searchpoc.py' +arch=('any') +_md5sum='556b2288b8e95eff0c08413edcceb433' +depends=( + python3 +) + +prepare() { + cd $srcdir/ + + source_filename=${_source##*/} + if [ ! -f "$source_filename" ]; then + echo "Downloading the python script ..." + curl -A "$source_filename" -O "$_source" + else + echo "Already downloaded!" + fi + + echo "Validating sources ..." + source_expected_md5sum=${_md5sum} + source_actual_md5sum=$(md5sum $source_filename | awk '{print $1}') + + if [ "$source_actual_md5sum" == "$source_expected_md5sum" ]; then + echo "Validated - $source_filename" + else + echo "Corrupted source - $source_filename"; return 1 + fi +} + +build() { echo;} + +package() { + cd $srcdir/ + mkdir -p $pkgdir/usr/bin/ + install -m 0755 $srcdir/${_source##*/} $pkgdir/usr/bin/$pkgname +} + +#vim: syntax=sh |