summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 901762cc2e2806d1b045de6e7fd1a8ecd2c092b0 (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
53
54
55
56
57
58
# Maintainer: krypt.co <aur@>
pkgname=kr
pkgver=2.4.1
pkgrel=1
pkgdesc="SSH using a key stored in Krypton"
arch=('i686' 'x86_64')
url="https://github.com/kryptco/kr"
license=('custom')
groups=()
depends=('gcc-libs-multilib')
makedepends=('rustup' 'go' 'rsync')
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'
  echo "2.4.1"
}

prepare() {
    cd ${srcdir}/kr && git submodule update --init --recursive && cd -
    # ensure a toolchain is selected if rustup was used to install rust
    (which rustup 2>/dev/null && (rustup which cargo || rustup default stable)) || true
    rustup target add wasm32-unknown-emscripten
    # cargo web 0.6.9 required to build dashboard frontend
    cargo install --debug --version 0.6.9 cargo-web 2>/dev/null || true
    cargo web --version
    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
}