summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8c74e36c3abecc44b704aa2fea98cc05c0e204e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Maintainer: peeweep <peeweep at 0x0 dot ee>

pkgname=beef-git
_pkgname=beef
pkgver=20200103.c6910a71
pkgrel=1
pkgdesc="The Browser Exploitation Framework"
arch=('x86_64')
url="http://beefproject.com/"
_url="https://github.com/beefproject/beef"
license=('GPL2')
depends=('ruby' 'ruby-bundler' 'sqlite' 'nodejs')
makedepends=('git')
source=("${pkgname}::git+${_url}.git"
  https://web.archive.org/web/20191227182209/https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz
  "${pkgname}.install"
  "${pkgname}.sh"
)
install=${pkgname}.install
sha256sums=('SKIP'
            'd1c309c4cf676884fe2314522de0819767ce44f6c776d60e2657e9eeaf93640c'
            'c68c4369c27992d1d3dae817c9933a555e7975956dae46e3fcfb3fc665dcf785'
            '98d72df13e4f61271afd623070a5e81c9edf2e5b4f39d71b45f3279e255649a0')

pkgver() {
  cd "${srcdir}/${pkgname}"
  git log -1 --format='%cd.%h' --date=short | tr -d -
}

build() {
  cd "${srcdir}/${pkgname}"

  # Print beef logo
  if [ -f core/main/console/beef.ascii ]; then
    cat core/main/console/beef.ascii
    echo
  fi

  bundle install --without test development --path vendor/bundle
}

package() {
  # cp -r src/beef-git/* pkg/usr/share/beef
  install -d "${pkgdir}/usr/share/${_pkgname}"
  cp -r "${srcdir}/${pkgname}"/* "${pkgdir}/usr/share/${_pkgname}"

  # update vendor path
  install -d "${pkgdir}/usr/share/${_pkgname}/.bundle"
  install -Dm644 "${srcdir}/${pkgname}/.bundle/config" "${pkgdir}/usr/share/${_pkgname}/.bundle/config"

  install -Dm755 "${pkgname}.sh" "${pkgdir}/usr/bin/beef"

  # install GeoIP database to /opt/GeoIP
  install -d "${pkgdir}/opt/GeoIP"
  install -Dm644 "${srcdir}"/GeoLite2-City*/* "${pkgdir}/opt/GeoIP/"

  # update LICENSE
  install -d "${pkgdir}/usr/share/licenses/GeoIP"
  install -Dm644 "${pkgdir}/opt/GeoIP"/LICENSE.txt "${pkgdir}/usr/share/licenses/GeoIP/LICENSE"
  install -Dm644 "${pkgdir}/opt/GeoIP"/COPYRIGHT.txt "${pkgdir}/usr/share/licenses/GeoIP/COPYRIGHT"
  install -d "${pkgdir}/usr/share/licenses/${_pkgname}"
  install -Dm644 "${srcdir}/${pkgname}/doc"/* "${pkgdir}/usr/share/licenses/${_pkgname}/"
}

# vim: ts=2 sw=2 et: