upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / wpscan / repos / community-x86_64 / PKGBUILD
blob90a4bd63e9f5d30c2f0c735a1505cb57e7fbd7a8
1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>
3 # Contributor: alexiobash < me (at) alexiobash (dot) com >
5 pkgname=wpscan
6 pkgver=3.8.22
7 pkgrel=3
8 epoch=1
9 pkgdesc='Black box WordPress vulnerability scanner'
10 url='https://wpscan.org'
11 arch=('x86_64')
12 license=('custom:WPScan')
13 depends=('ruby-bundler' 'libxslt' 'libyaml' 'curl' 'libxml2')
14 optdepends=('metasploit')
15 options=('!strip' '!emptydirs')
16 install=wpscan.install
17 source=(https://github.com/wpscanteam/wpscan/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
18 sha512sums=('fbd7eee9d108a6abe010e16f4e5aaaca7aa91a50e38682c30e263fd37c153797de52752723f2addfeb4431af3b63f36438903c6532f8603a0bcd23cca20c0d6e')
19 b2sums=('3585610396b724d75beac8436ee1e7819850cf5635ccbad2679ae590415fdbbbf7955d7d2a7c7d85f61ce993d01c553c539d1e56bc59856c6c7e752e45785e54')
21 prepare() {
22   cd ${pkgname}-${pkgver}
23   sed -i '/bundler/ s|~>|>=|g' $pkgname.gemspec
24   bundle config build.nokogiri --use-system-libraries
25   bundle config set --local path vendor/bundle
26   bundle config set --local without development test
29 build() {
30   cd ${pkgname}-${pkgver}
31   CFLAGS+=" -I/usr/include/libxml2"
32   bundle install -j"$(nproc)"
33   # reproducible builds: don't leak jobs count
34   sed '/BUNDLE_JOBS/d' -i .bundle/config
37 package() {
38   cd ${pkgname}-${pkgver}
40   install -d "${pkgdir}/opt/${pkgname}"
41   cp -ra --no-preserve=owner . "${pkgdir}/opt/${pkgname}"
43   install -d "${pkgdir}/usr/bin"
44   cat > "${pkgdir}/usr/bin/${pkgname}" << EOF
45 #!/bin/sh
46 BUNDLE_GEMFILE=/opt/${pkgname}/Gemfile bundle exec ruby /opt/wpscan/bin/wpscan "\$@"
47 EOF
48   chmod 755 "${pkgdir}/usr/bin/${pkgname}"
50   install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
51   install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
53   cd "${pkgdir}"/opt/wpscan/vendor/bundle/ruby/*
54   rm -rf cache gems/*/{ext,lib/*/*.so} \
55     extensions/*/*/*/{mkmf.log,gem_make.out}
58 # vim: ts=2 sw=2 et: