# Contributor: Thomas Boerger # Maintainer: Thomas Boerger pkgname=terraform pkgver=0.6.16 pkgrel=1 pkgdesc="Building, changing, and combining infrastructure safely and efficiently" url="https://www.terraform.io/" arch="x86_64" 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"