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

pkgname=xfel-git
pkgver=1.3.2.r35.ga02562b
pkgrel=3
pkgdesc="Tiny FEL tools for allwinner SOC, support RISC-V D1 chip."
arch=(x86_64
    aarch64
    riscv64)
url="https://github.com/xboot/xfel"
license=('MIT')
provides=(${pkgname%-git})
conflicts=(${pkgname%-git})
depends=('libusb'
    'glibc')
makedepends=('git' 'gcc')
source=("${pkgname%-git}::git+${url}.git")
sha256sums=('SKIP')

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

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

build() {
    cd "${srcdir}/${pkgname%-git}"
    make
}

package() {
    install -Dm0755 "${srcdir}/${pkgname%-git}/${pkgname%-git}" "${pkgdir}/usr/bin/${pkgname%-git}"
    install -Dm0644 "${srcdir}/${pkgname%-git}/99-xfel.rules" "${pkgdir}/etc/udev/rules.d/99-xfel.rules"
    install -Dm0644 "${srcdir}/${pkgname%-git}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}