summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7aba6c4cd7fa69cfbd2d4d590f8116b3cc179651 (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
# Maintainer: Václav Kubernát <sir.venceslas@gmail.com>

pkgname=cp2cp-git
_gitname=libshvproto-rs
pkgver=r271.14b3cb7
pkgrel=1
pkgdesc='ChainPack to Cpon and back utility'
url='https://github.com/silicon-heaven/libshvproto-rs'
license=('MIT')
makedepends=('cargo' 'git')
depends=()
provides=('cp2cp')
conflicts=('cp2cp')
arch=('i686' 'x86_64' 'armv6h' 'armv7h')
source=('git+https://github.com/silicon-heaven/libshvproto-rs')
b2sums=('SKIP')

pkgver() {
	cd "$srcdir/$_gitname"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
	cd "$srcdir/$_gitname"
    cargo fetch --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
	cd "$srcdir/$_gitname"
    cargo build --release --all-features
}

check() {
	cd "$srcdir/$_gitname"
    cargo test --all-features
}

package() {
    install -Dm0755 -t "$pkgdir/usr/bin/" "$srcdir/$_gitname/target/release/cp2cp"
    install -Dm644 "$srcdir/$_gitname/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}