summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1d11c88f2c7e6f0f3754f678a5dd19edc00fc0fe (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
pkgname=ibdump
_commit=e656df3a89c823fcfebc58961ecd4ce8fa6533d4
pkgver=6.1.0.r35.ge656df3
pkgrel=3
pkgdesc="InfiniBand and RoCE RDMA packet capture tool for Mellanox"
url="https://github.com/Mellanox/ibdump"
license=(GPL2 custom:BSD)
arch=(x86_64)
depends=(libibverbs)
makedepends=(git mstflint)
source=("git+https://github.com/Mellanox/ibdump#commit=$_commit"
	unbork.diff)
sha256sums=('SKIP'
            '1b951beecf20d488e97bdbcc80e414eb1898e2cd994ec579f3a56b52edd55d3c')

pkgver() {
	cd ibdump
	git describe --tags | sed 's/^ibdump-//; s/-/.r/; s/[-_]/./g'
}

prepare() {
	cd ibdump
	patch -Np1 < ../unbork.diff
	rm -f gitversion.h
	make gitversion.h
}

build() {
	cd ibdump

	# Build with mstflint (for new ConnectX, but breaks CX3):
	make clean
	make WITH_MSTFLINT=yes MSTFLINT_INCLUDE_DIR=/usr/include/mstflint

	mv ibdump{,-mst}

	# Build without mstflint (for ConnectX <= 3):
	make clean
	make WITHOUT_FW_TOOLS=yes
}

package() {
	cd ibdump
	install -D -m 0755 ./ibdump "$pkgdir"/usr/bin/ibdump
	install -D -m 0755 ./ibdump-mst "$pkgdir"/usr/bin/ibdump-mst
	install -D -m 0644 ./LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
	install -D -m 0644 ./README.md "$pkgdir"/usr/share/doc/$pkgname/README.md
}