summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2a83af57bea358e5db12344d990f1391c4e1bcec (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=netperf-git
pkgver=2.7.0.r48.g3bc455b
pkgrel=2
pkgdesc="Benchmarking tool for many different types of networking"
arch=('i686' 'x86_64')
url="https://hewlettpackard.github.io/netperf/"
license=('MIT')
depends=('glibc' 'libsmbios' 'lksctp-tools')
makedepends=('git')
provides=("netperf=$pkgver")
conflicts=('netperf')
source=("git+https://github.com/HewlettPackard/netperf.git"
        "remove_duplicate_variable_definitions.patch::https://github.com/HewlettPackard/netperf/commit/c6a2e17fe35f0e68823451fedfdf5b1dbecddbe3.patch")
sha256sums=('SKIP'
            'beff59413888ab2961804a195ff68fe5db92183736fedb3bc20bfbba424c2384')


prepare() {
  cd "netperf"

  patch -Np1 -i "$srcdir/remove_duplicate_variable_definitions.patch"
}

pkgver() {
  cd "netperf"

  _tag=$(git tag -l --sort -v:refname | head -n1)
  _rev=$(git rev-list --count $_tag..HEAD)
  _hash=$(git rev-parse --short HEAD)
  printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^netperf-//'
}

build() {
  cd "netperf"

  ./autogen.sh
  ./configure \
    --prefix="/usr" \
    --enable-dccp \
    --enable-demo \
    --enable-sctp \
    --enable-unixdomain
  make
}

check() {
  cd "netperf"

  make check
}

package() {
  cd "netperf"

  make DESTDIR="$pkgdir" install
  install -Dm644 "COPYING" -t "$pkgdir/usr/share/licenses/netperf"
}