blob: 525224c39a0a3d24758cac8b217712e265aa451a (
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
62
|
# Maintainer: wuxb <wuxb45 at gmail dot com>
pkgname=spdk-git
pkgver=r0.0 # pkgver() updates this
pkgrel=9
pkgdesc='spdk-git: headers, libs, and scripts'
arch=('x86_64')
license=('BSD')
url='https://spdk.io/'
depends=('glibc')
makedepends=('cmake' 'meson')
provides=('spdk')
conflicts=('spdk' 'dpdk')
source=("$pkgname::git+https://github.com/spdk/spdk.git")
sha256sums=('SKIP')
pkgver() {
cd "$pkgname"
( set -o pipefail
git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
)
}
prepare () {
cd "$srcdir/$pkgname"
git submodule update --init
}
build() {
cd "$srcdir/$pkgname"
./configure --prefix=/usr --with-shared --disable-tests --disable-unit-tests --enable-lto
make
}
package() {
cd "$srcdir/$pkgname"
mkdir -p $pkgdir/usr/lib/
mkdir -p $pkgdir/usr/include/spdk/
mkdir -p $pkgdir/usr/bin/
mkdir -p $pkgdir/usr/share/spdk/bin/
mkdir -p $pkgdir/usr/share/spdk/examples/
# programs and examples in /usr/share/spdk/
cp -a build/bin/* $pkgdir/usr/share/spdk/bin/
cp -a build/examples/* $pkgdir/usr/share/spdk/examples/
# shared libs
cp -a build/lib/* $pkgdir/usr/lib/
cp -a dpdk/build/lib/* $pkgdir/usr/lib/
# discard .pc files
rm -rf $pkgdir/usr/lib/pkgconfig
# header files
cp -a include/spdk/* $pkgdir/usr/include/spdk/
cp -rL dpdk/build/include/* $pkgdir/usr/include/
# self-contained /usr/bin/spdk-setup
echo '#!/usr/bin/env bash' >$pkgdir/usr/bin/spdk-setup
cat scripts/{common,setup}.sh >>$pkgdir/usr/bin/spdk-setup
sed -ri '/^rootdir/d;/^source/d;s,\$rootdir,/usr,' $pkgdir/usr/bin/spdk-setup
chmod +x $pkgdir/usr/bin/spdk-setup
}
|