summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 15fd7b7495a8b9fa3badbe50eb0da71f680d269e (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
# Maintainer: drakkan <nicola.murino at gmail dot com>
# Contributor: Pierre Carrier <pierre at gcarrier dot fr>
pkgname=wrk
pkgver=4.2.0
pkgrel=2
pkgdesc="Modern HTTP benchmarking tool"
arch=(i686 x86_64 aarch64)
url="https://github.com/wg/wrk/"
license=(Apache)
depends=('openssl' 'luajit')
source=("https://github.com/wg/$pkgname/archive/${pkgver}.tar.gz")
sha256sums=('e255f696bff6e329f5d19091da6b06164b8d59d62cb9e673625bdcd27fe7bdad')
options=('!makeflags'
         '!buildflags')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  if [ -d "/usr/include/luajit-2.0" ]
  then
    sed -i "s/[(]WITH_LUAJIT[)]\/include/\(WITH_LUAJIT\)\/include\/luajit-2.0/" Makefile
  elif [ -d "/usr/include/luajit-2.1" ]
  then
    sed -i "s/[(]WITH_LUAJIT[)]\/include/\(WITH_LUAJIT\)\/include\/luajit-2.1/" Makefile
  fi
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make WITH_OPENSSL=/usr WITH_LUAJIT=/usr
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  install -Dm755 wrk "${pkgdir}/usr/bin/wrk"
  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/wrk/LICENSE
  install -Dm644 NOTICE "${pkgdir}"/usr/share/licenses/wrk/NOTICE
  install -d -m755 "${pkgdir}"/usr/share/doc/wrk/examples/
  install -Dm644 README.md "${pkgdir}"/usr/share/doc/wrk/README
  install -Dm644 SCRIPTING "${pkgdir}"/usr/share/doc/wrk/SCRIPTING
  install -Dm644 CHANGES "${pkgdir}"/usr/share/doc/wrk/CHANGES
  install -Dm644 scripts/*.lua "${pkgdir}"/usr/share/doc/wrk/examples/
}

# vim:set ts=2 sw=2 et: