aboutsummaryrefslogtreecommitdiffstats
path: root/testing/acmetool/APKBUILD
blob: 17373b8b140bda4c88ab374ba6e6bbe98286611c (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
# Contributor: kpcyrd <git@rxv.cc>
# Maintainer: kpcyrd <git@rxv.cc>
pkgname=acmetool
pkgver=0.0.67
pkgrel=0
pkgdesc="An easy-to-use command line tool for automatically acquiring certificates from ACME servers (such as Let's Encrypt)"
url="https://github.com/hlandau/acme"
arch="all"
license="MIT"
makedepends="glide go libcap-dev"
subpackages="$pkgname-doc"
# no test suite available
options="!check"
source="$pkgname-$pkgver.tar.gz::https://github.com/hlandau/acme/archive/v$pkgver.tar.gz
	glide.lock
	glide.yaml
	"
builddir="$srcdir/src/github.com/hlandau/acme"

prepare() {
	mkdir -p ${builddir%/*}
	mv "$srcdir/acme-$pkgver" "$builddir"
	cd "$builddir"
	cp "$srcdir"/glide.yaml "$srcdir"/glide.lock .
	export GOPATH="$srcdir"
	glide install --skip-test
	default_prepare
}

build() {
	cd "$builddir"
	export GOPATH="$srcdir"
	go build -v -ldflags "-s -w -X github.com/hlandau/acme/hooks.DefaultPath=/etc/acme/hooks" \
		./cmd/acmetool/...
}

package() {
	cd "$builddir"
	install -Dm 755 acmetool "$pkgdir/usr/bin/acmetool"

	install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README"
	install -Dm644 _doc/* -t "$pkgdir/usr/share/doc/$pkgname/"
}

glide_init() {
	abuild clean deps unpack prepare
	cd "$builddir"
	export GOPATH="$srcdir"
	rm -f glide.yaml glide.lock
	glide init --non-interactive
	glide update
	cp glide.yaml glide.lock "$startdir"
	cd "$startdir" && abuild checksum clean
}

sha512sums="c6f2bbdd97ced5ba4b5f7b466aaf1cc18d2930e43f9d3b6939e8abd05d622a177a84f2278af172c050733022b2d62fede7c40c1aedf6546d8da4021a621f1703  acmetool-0.0.67.tar.gz
6ea636b99e3a2cab73e52a75bc92430fae6515d00c3287f5bbe942666e8fbba0883a3a89a6930021c7aae4451c4a9586eb034c35282d0e331d2f7b8456897bca  glide.lock
108403fb50acdc3f74ad02d07b22665192206db8450a94156c57e129577835663f36c1a7fd40bd924bc84297c07417465b8013d9262bc497b74c000c268c7d42  glide.yaml"