aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ejson/APKBUILD
blob: a2f0dfc53c2c0c26207986e866ff022d3e4e2f6b (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
# Maintainer: Andy McLeod <andy@amcleod.ca>
pkgname=ejson
pkgver=1.2.1
pkgrel=6
pkgdesc="EJSON is a small library to manage encrypted secrets using asymmetric encryption."
url="https://github.com/Shopify/ejson"
arch="all"
license="MIT"
depends="mandoc" # Requires man to show help
makedepends="go ronn"
source="$pkgname-$pkgver.tar.gz::https://github.com/Shopify/$pkgname/archive/v$pkgver.tar.gz"

_gourl=github.com/Shopify/ejson
builddir="$srcdir"/src/$_gourl

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

build() {
	export GOPATH="$srcdir"
	export GO111MODULE=off
	CGO_ENABLED=0 go build -v -o e${pkgname} github.com/Shopify/ejson/cmd/ejson

	# Overwrite bundle exec so it runs our ronn command from the system not
	# from some rubygems repo
	sed -i 's|^BUNDLE_EXEC=.*|BUNDLE_EXEC=exec|' Makefile
	make man
}

check() {
	go test -v ./...
}

package() {
	install -Dm755 e${pkgname} "$pkgdir"/usr/bin/ejson

	# Keep this in the main package, ejson calls into 'man' to show
	# the help string
	mkdir -p "$pkgdir"/usr/share
	mv build/man "$pkgdir"/usr/share/man/
}
sha512sums="cd49e70b1578f0f960b6d6d77499297bcee7eac3b8595109757697ef844ba8867c353e257105af9b90fdbcca3a08445ae0c9b666c7bc6db26ab7303b5834c5bd  ejson-1.2.1.tar.gz"