# Maintainer: Eli Schwartz <eschwartz@archlinux.org>
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=exploitdb
_pkgver=2021-09-08
pkgver=${_pkgver//-/}
pkgrel=1
pkgdesc="Offensive Security’s Exploit Database Archive"
arch=('any')
url="https://www.exploit-db.com/"
license=('GPL')
optdepends=('libxml2: to check nmap XML results'
            'xclip: copy paths to the clipboard')
backup=('etc/searchsploit_rc')
options=('!strip')
source=("https://github.com/offensive-security/${pkgname}/archive/${_pkgver}/${pkgname}-${_pkgver}.tar.gz"
        "rcfile.diff")
sha512sums=('bbad64dbd219ee8fe988b254030aeaa383c03a704a5b3324e44c52c9dcba5994d27d7760962a2e3baf7ee78aef5e0e78a81d691f64cbeb75e7cc07723edb1c14'
            'e170da5b974975c6c23c5b09e8c1825bbb17446fb506f2d00f92f86f94394acf18a53458bd90969de38da642fc1f7abb08ba940969108002dab17415b88211d6')
b2sums=('42bbe59e2f0fd85af0f2814d55cf59c3f46ce32100dfa4d912e8728fd57eaf4c880a920371604f082dba1940e6b01c1b057ce102d20707e7b6922eb4eec4963e'
        'f033a50db6358297580363d62bbd9d4a6003b5476ba361650133841138af76b990ed49e2e34d487cf4167ebeb3cd6b8f9230e5e700a5d96f7f06cbc5b42c4076')

prepare() {
    cd ${pkgname}-${_pkgver}

    patch -p1 -i ../rcfile.diff
}

package() {
    cd ${pkgname}-${_pkgver}

    install -Dm755 searchsploit "${pkgdir}"/usr/bin/searchsploit
    install -Dm644 .searchsploit_rc "${pkgdir}"/etc/searchsploit_rc
    mkdir -p "${pkgdir}"/usr/share/${pkgname}
    cp -a exploits/ shellcodes/ files_*.csv "${pkgdir}"/usr/share/${pkgname}
}

# vim: ts=4 sw=4 et:
