summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2708fd1d3f9472135e824519f90846621a9bcb8e (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
# Maintainer: Kuan-Yen Chou <kuanyenchou at gmail dot com>

pkgname=spin-git
pkgver=6.5.2.r51.ge21106f
pkgrel=2
pkgdesc='Explicit state logic model checking tool'
depends=('glibc')
optdepends=('tcl: ispin graphical interface'
            'ispin: GUI for Spin')
arch=('x86_64')
url='https://spinroot.com/'
license=('BSD-3-Clause')
provides=('spin')
conflicts=('spin')
source=("$pkgname"::'git+https://github.com/nimble-code/Spin')
sha512sums=('SKIP')

pkgver() {
    cd "$srcdir/$pkgname"
    if git describe --long --tags >/dev/null 2>&1; then
        git describe --long --tags | sed 's/^version-//;s/\([^-]*-g\)/r\1/;s/-/./g'
    else
        printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git describe --always)"
    fi
}

build() {
    cd "$srcdir/$pkgname"
    make -C Src
    gzip -9c Man/spin.1 > Man/spin.1.gz
}

package() {
    cd "$srcdir/$pkgname"
    install -Dm 755 Src/spin "${pkgdir}/usr/bin/spin"
    install -Dm 644 Src/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm 644 Man/spin.1.gz "${pkgdir}/usr/share/man/man1/spin.1.gz"
    install -d "${pkgdir}/usr/share/doc/spin/examples"
    find Examples/ -type f -exec chmod 644 {} +
    cp -a Examples/* "${pkgdir}/usr/share/doc/spin/examples/"
}