summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c5eec89e9f6e8128f80855fe66375edcba193512 (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
# Maintainer: Mathieu Tortuyaux <mathieu.tortuyaux@gmail.com>
pkgname=terracognita-git
_pkgname=terracognita
pkgver=v0.3.0.r27.gdfc5a99
pkgrel=1
epoch=1
pkgdesc="Reads from existing Cloud Providers (reverse Terraform) and generates your infrastructure as code on Terraform configuration"
provides=($_pkgname)
conflicts=($_pkgname)
arch=('i686' 'x86_64')
url="https://github.com/cycloidio/$_pkgname"
license=('MIT')
makedepends=('go>=2:1.11')
source=("$pkgname::git+https://github.com/cycloidio/$_pkgname.git")
md5sums=('SKIP')

pkgver() {
	cd "$srcdir/$pkgname"
  	git describe --tags --always | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	cd "$srcdir/$pkgname"
  	VERSION=$(git describe --tags --always | sed 's/\([^-]*-g\)/r\1/;s/-/./g')
	GO111MODULE=on \
	CGO_ENABLED=0 \
	GOARCH=amd64 \
	go build \
		-o $_pkgname \
		-gcflags "all=-trimpath=${PWD}" \
		-asmflags "all=-trimpath=${PWD}" \
		-ldflags "-X github.com/cycloidio/terracognita/cmd.Version=${VERSION}"
}

package() {
	cd "$srcdir/$pkgname"
	install -Dm755 "$_pkgname" "$pkgdir/usr/bin/$_pkgname"
}