archrelease: copy trunk to community-any
[ArchLinux/community.git] / docker-machine / repos / community-x86_64 / PKGBUILD
blob1c0f37382df2f1b60072446537d63a76ac95b795
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Dmitry Chusovitin <dchusovitin@gmail.com>
4 pkgname=docker-machine
5 pkgver=0.16.2
6 pkgrel=5
7 pkgdesc='Machine management for a container-centric world'
8 arch=('x86_64')
9 url='https://github.com/docker/machine'
10 license=('Apache')
11 depends=('glibc')
12 optdepends=('net-tools: for VirtualBox support')
13 makedepends=('go')
14 optdepends=('net-tools: required for VirtualBox driver')
15 source=("$pkgname-$pkgver.tar.gz::https://github.com/docker/machine/archive/v$pkgver.tar.gz")
16 sha512sums=('92408c18be23cee040e96412dafeff16415834c3141b0a9c1f82cb9d6b1e0700344a158a44ffac24fed2c244d3fa5c531d9f13ffffaa4be1f4fcbd79104f899e')
18 prepare() {
19   mkdir -p build/src
20   mv machine-$pkgver/vendor/* build/src/
21   mkdir -p build/src/github.com/docker
22   ln -s "$srcdir"/machine-$pkgver build/src/github.com/docker/machine
25 build() {
26   export GOPATH="$srcdir/build"
27   export CGO_CPPFLAGS="${CPPFLAGS}"
28   export CGO_CFLAGS="${CFLAGS}"
29   export CGO_CXXFLAGS="${CXXFLAGS}"
30   export CGO_LDFLAGS="${LDFLAGS}"
31   export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
32   export GO111MODULE=off
34   cd machine-$pkgver
35   go build -o bin/docker-machine cmd/docker-machine/machine.go # -gccgoflags "$CFLAGS $LDFLAGS"
38 package() {
39   cd machine-$pkgver
40   install -Dm755 bin/docker-machine "$pkgdir"/usr/bin/docker-machine
41   install -Dm644 contrib/completion/bash/docker-machine.bash "$pkgdir"/usr/share/bash-completion/completions/docker-machine
42   install -Dm644 contrib/completion/zsh/_docker-machine "$pkgdir"/usr/share/zsh/site-functions/_docker-machine
43   install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE