summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 010f0ace7de2e65164c339c24300847718b50fbe (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
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: alexiobash < me (at) alexiobash (dot) com >

_pkgname=wpscan
pkgname=wpscan-git
pkgver=2.9.1.2040.5118c68
pkgrel=1
epoch=1
pkgdesc='Black box WordPress vulnerability scanner'
url='http://wpscan.org'
arch=('i686' 'x86_64')
license=('custom:WPScan')
depends=('ruby-bundler' 'libxslt' 'libyaml' 'curl')
makedepends=('git' 'unzip')
provides=('wpscan')
conflicts=('wpscan')
options=('!strip' '!emptydirs')
install=wpscan.install
source=(${pkgname}::git+https://github.com/wpscanteam/wpscan)
sha512sums=('SKIP')

pkgver() {
  cd ${pkgname}
  printf "%s.%s.%s" "$(git describe --tags --abbrev=0)" \
    "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd ${pkgname}
  unzip -o data.zip
  rm data.zip
  cd lib/common
  # replace cache location with local user share
  sed "s|ROOT_DIR, 'cache'|ENV['HOME'] + '/.local/share/${_pkgname}/cache'|" -i common_helper.rb
  sed "s|ROOT_DIR, 'log.txt'|ENV['HOME'] + '/.local/share/${_pkgname}/log.txt'|" -i common_helper.rb
}

build() {
  cd ${pkgname}
  bundle install -j"$(nproc)" --path vendor/bundle --without development test
}

package() {
  cd ${pkgname}

  install -d "${pkgdir}/opt/${_pkgname}"
  cp -ra --no-preserve=owner . "${pkgdir}/opt/${_pkgname}"
  rm -r "${pkgdir}/opt/${_pkgname}/.git"

  install -d "${pkgdir}/usr/bin"
  cat > "${pkgdir}/usr/bin/${_pkgname}" << EOF
#!/bin/sh
BUNDLE_GEMFILE=/opt/${_pkgname}/Gemfile bundle exec ruby /opt/${_pkgname}/${_pkgname}.rb "\$@"
EOF
  chmod 755 "${pkgdir}/usr/bin/${_pkgname}"

  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 CHANGELOG.md DISCLAIMER.txt README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et: