summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f2f5c970d806649dd2b07130166cac5cc567cd4c (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
# Maintainer: krypt.co <aur@>
pkgname=kr
pkgver=2.3.0
pkgrel=1
pkgdesc="SSH using a key stored in Kryptonite"
arch=('i686' 'x86_64')
url="https://github.com/kryptco/kr"
license=('custom')
groups=()
depends=('gcc-libs-multilib')
makedepends=('rust' 'cargo' 'go')
checkdepends=()
optdepends=()
provides=('kr')
conflicts=('kr')
backup=()
options=()
install=kr.install
changelog=()
source=("git+https://github.com/kryptco/kr#tag=$pkgver")
md5sums=('SKIP') 
validpgpkeys=()

pkgver() {
  cd ${srcdir}/src/github.com/kryptco/kr
  git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    # ensure a toolchain is selected if rustup was used to install rust
    (which rustup 2>/dev/null && (rustup which cargo || rustup default stable)) || true
    mkdir -p "${srcdir}/src/github.com/kryptco/"
    rm -rf "${srcdir}/src/github.com/kryptco/kr"
    mv "${srcdir}/kr" "${srcdir}/src/github.com/kryptco/kr"
}

build() {
	cd "${srcdir}/src/github.com/kryptco/kr"
	GOPATH=${srcdir} make
}

check() {
	cd "${srcdir}/src/github.com/kryptco/kr"
	GOPATH=${srcdir} make check
}

package() {
	cd "${srcdir}/src/github.com/kryptco/kr"
	export PREFIX=${pkgdir}/usr
	install -D -m 644 "LICENSE" "${pkgdir}/usr/share/licenses/kr/LICENSE"
	GOPATH=${srcdir} make install
}