summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e5dc7eb5f01558131d1b621366bc493326ad7968 (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
# Maintainer: taotieren <admin@taotieren.com>

pkgbase=can-tests-git
pkgname=can-tests-git
pkgver=2023.05.0.r5.g3258274
pkgrel=6
groups=()
pkgdesc="Linux-CAN / SocketCAN testing applications"
arch=(x86_64
    aarch64
    riscv64)
url="https://github.com/linux-can/can-tests"
license=('GPL-2.0-only' 'BSD-3-Clause')
provides=(${pkgname%-git})
conflicts=(${pkgname%-git})
depends=(glibc
    bash)
makedepends=(git)
optdepends=(
    "can-utils: Linux-CAN / SocketCAN user space applications"
    "can-doc: Linux-CAN / SocketCAN documentation"
    "can-isotp-dkms: Kernel modules for isotp")
source=("${pkgname}::git+${url}.git")
sha256sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgname}"
    git describe --long --tags | sed 's/^v//g' | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare()
{
    git -C "${srcdir}/${pkgname}" clean -dfx
}

build() {
    export LDFLAGS="-z relro -z now -z shstk"
    make -C $pkgname PREFIX=/usr
}

package() {
    cd "${srcdir}/${pkgname}"
    make PREFIX=/usr DESTDIR="$pkgdir/" install

    cd "$pkgdir/usr/bin"
    mv canfdtest tst-canfdtest
    mv cansniffer tst-cansniffer
}