aboutsummaryrefslogtreecommitdiffstats
path: root/community/rest-server/APKBUILD
blob: e870e54fe5a349a708b505da75948393bede102c (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
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=rest-server
pkgver=0.9.8
pkgrel=0
pkgdesc="A high performance HTTP server that implements restic's REST backend API"
url="https://github.com/restic/rest-server"
arch="all"
license="BSD-2-Clause"
depends=""
makedepends="go"
install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/restic/$pkgname/archive/v$pkgver.tar.gz
	$pkgname.confd
	$pkgname.initd"
builddir="$srcdir/src/github.com/restic/$pkgname"

export GOPATH="$srcdir"

prepare() {
	mkdir -p "${builddir%/*}"
	ln -s "$srcdir"/$pkgname-$pkgver "$builddir"
	default_prepare
}

build() {
	cd "$builddir"
	go build ./cmd/...
}

check() {
	cd "$builddir"
	go test -v . ./cmd/rest-server
}

package() {
	cd "$builddir"

	install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
	install -Dm644 README.md \
		"$pkgdir"/usr/share/doc/$pkgname/README.md

	install -Dm755 "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname
}

sha512sums="6f7ee557b7bf278ee97e9f8887909b6ab253a231123e755e12b6e5a6c028953acf8ba5c5bdedae60b2875a8268bb5cb80aadcad29b809fcbe5ee0afa402c1e96  rest-server-0.9.8.tar.gz
cd9e4d3df04c26aa602a57196bdfb14d7ad6e957f1d9596a09e596b9d01543eee08474817ba47192659fe6f5ab15b8fa64400fb6a8d24111f5c792b1412f5e5b  rest-server.confd
185c0022d07c66fcee2d84af1bb0a11ac0753bd79deb8f5ae7dc2bd84909886aa3e58f42cd6ace4f191da6128d0385036948d4a8accd14cf9cdb9603001b9aca  rest-server.initd"