aboutsummaryrefslogtreecommitdiffstats
path: root/testing/terraform/APKBUILD
blob: 83f722e44c7d0fd6bbb6f26a4f86fd08c444d449 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Contributor: Thomas Boerger <thomas@webhippie.de>
# Maintainer: Thomas Boerger <thomas@webhippie.de>
pkgname=terraform
pkgver=0.6.16
pkgrel=0
pkgdesc="Building, changing, and combining infrastructure safely and efficiently"
url="https://www.terraform.io/"
arch="all"
license="MPL 2.0"
depends=""
depends_dev=""
makedepends="$depends_dev go go-tools bash"
install=""
subpackages=""
source="${pkgname}-${pkgver}.tar.gz::https://github.com/hashicorp/terraform/archive/v$pkgver.tar.gz"

builddir="${srcdir}/terraform-${pkgver}"
_godir="${srcdir}/go"
_gourl="github.com/hashicorp/terraform"

_providers="provider-atlas provider-aws provider-azure provider-azurerm
	provider-chef provider-clc provider-cloudflare provider-cloudstack
	provider-cobbler provider-consul provider-datadog provider-digitalocean
	provider-dme provider-dnsimple provider-docker provider-dyn provider-fastly
	provider-github provider-google provider-heroku provider-influxdb
	provider-librato provider-mailgun provider-mysql provider-null
	provider-openstack provider-packet provider-postgresql provider-powerdns
	provider-rundeck provider-softlayer provider-statuscake provider-template
	provider-terraform provider-tls provider-triton provider-ultradns
	provider-vcd provider-vsphere"

_provisioners="provisioner-chef provisioner-file provisioner-local-exec
	provisioner-remote-exec"

build() {
	mkdir -p ${_godir}/bin ${_godir}/src/github.com/hashicorp
	ln -sf ${builddir} ${_godir}/src/github.com/hashicorp/terraform

	cd ${_godir}/src/${_gourl}
	export GOPATH="${_godir}"

	go generate $(go list ./... | grep -v /vendor/)
	go install -v ${_gourl} || return 1

	for binary in ${_providers}; do
		go install -v ${_gourl}/builtin/bins/${binary} || return 1
	done

	for binary in ${_provisioners}; do
		go install -v ${_gourl}/builtin/bins/${binary} || return 1
	done
}

package() {
	cd "$_godir"/bin

	ls

	install -Dm755 terraform \
		"${pkgdir}/usr/bin/terraform" || return 1

	for binary in ${_providers}; do
		install -Dm755 ${binary} \
			"${pkgdir}/usr/bin/terraform-${binary}" || return 1
	done

	for binary in ${_provisioners}; do
		install -Dm755 ${binary} \
			"${pkgdir}/usr/bin/terraform-${binary}" || return 1
	done
}

md5sums="708618e86b8c6e33cf5553dd16810e85  terraform-0.6.16.tar.gz"
sha256sums="c84bae32a170d993982de9c537eac74f70601e7a667dc2ea9803b86e04b1221d  terraform-0.6.16.tar.gz"
sha512sums="9eab68c4ffe7a187703ec970e6d5812261b819fd20ff2f24751e9f4472caa3e06315db0a07056a777454eda45b6ee6d4d3210307eaff8aab06406eaa48ac9082  terraform-0.6.16.tar.gz"