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

pkgname=exploitdb
_pkgver=2019-09-15
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=("${pkgname}-${_pkgver}.tar.gz::https://github.com/offensive-security/${pkgname}/archive/${_pkgver}.tar.gz"
        "rcfile.diff")
sha512sums=('5df7c5da4f29a01eb4001c46fbeff62e2f92edd4602638b51d1275664a76374682090c882d74fdfff831d17b78fddc9e0328fb6f0981787e4a8c017e924c958a'
            'e170da5b974975c6c23c5b09e8c1825bbb17446fb506f2d00f92f86f94394acf18a53458bd90969de38da642fc1f7abb08ba940969108002dab17415b88211d6')
b2sums=('6e54510969ec677736c8168b2e1ee62cfd175d0a442513635f57badddd25480bbd2fc1bb153a1906ad76eaecbc1250c08fc38798d0dbb51e1ad210671a1dd86f'
        '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:
