summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7d3792d220514f7b283d481fbfeb6ee3f8dc809f (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
# Maintainer: Christophe Robin <crobin@nekoo.com>

pkgname=infrakit-git
pkgver=v0.4.1.r77.gce06e23
pkgrel=2
pkgdesc="A toolkit for creating and managing declarative, self-healing infrastructure."
arch=('x86_64')
url="https://github.com/docker/infrakit"
license=('Apache')
depends=('libvirt')
makedepends=('go' 'make' 'git' 'libvirt')
source=("${pkgname}::git+ssh://git@github.com/docker/infrakit.git" "discovery.patch")
md5sums=('SKIP'
         '243888bff971a8bd63e389a415abede5')

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

prepare() {
    mkdir "${srcdir}/go" || true
    export GOPATH="${srcdir}/go"
    export PATH="${GOPATH}/bin:${PATH}"
    mkdir -p "${GOPATH}/src/github.com/docker" || true
    cd "${GOPATH}/src/github.com/docker"
    ln -sfT "${srcdir}/${pkgname}" infrakit
    cd infrakit

    patch -p1 < "${srcdir}/discovery.patch"

    make get-tools
}

build() {
    export GOPATH="${srcdir}/go"
    export PATH="${GOPATH}/bin:${PATH}"
    cd "${GOPATH}/src/github.com/docker/infrakit"
    make binaries
}

package() {
    install -d "${pkgdir}/usr/bin"

    for artifact in "${GOPATH}/src/github.com/docker/infrakit/build/"*; do
        install -D -m755 "$artifact" "${pkgdir}/usr/bin/$( basename "$artifact" )"
    done
}