aboutsummaryrefslogtreecommitdiffstats
path: root/testing/vault/APKBUILD
blob: 76ad5c23721a81894351b065fece6efcdae5f3f5 (plain) (blame)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Contributor: Christian Kampka <christian@kampka.net>
# Maintainer:
pkgname=vault
pkgver=0.3.1
pkgrel=1
pkgdesc="Vault is a tool for securely accessing secrets."
url="https://www.vaultproject.io/"
arch="all"
license="MPL 2.0"
depends=""
depends_dev=""
makedepends="go godep git $depends_dev"
install="$pkgname.pre-install"
pkgusers="vault"
pkggroups="vault"
subpackages=""
options="!strip"
source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.gz
  Godeps.json
  vault.confd
  vault.hcl
  vault.initd"

_disturl="dev.alpinelinux.org:/archive/$pkgname/"
_gourl="github.com/hashicorp/vault"
_builddir="${srcdir}/vault"

prepare() {
  cd "${_builddir}"
  local i
  for i in $source; do
    case $i in
      *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
    esac
  done
}

snapshot() {
  abuild clean
  abuild deps

  export GOPATH="${_builddir}"
  mkdir -p $_builddir
  cd "$srcdir"

  msg "Checking out v${pkgver} tag"
  git clone -q --branch v${pkgver} https://$_gourl || return 1

  cd ${_builddir}
  # use custom godeps file

  install -D "$startdir"/Godeps.json \
		$_builddir/Godeps/Godeps.json || return 1

  #go get -v -d || return 1
  godep restore || return 1

  cd "$srcdir"
  tar zcf $pkgname-$pkgver.tar.gz vault || return 1
  rsync --progress -La $pkgname-$pkgver.tar.gz \
    $_disturl || return 1
  cd $startdir && abuild undeps
}

build() {
  cd "$_builddir" || return 1
  export GOPATH="${_builddir}"
  mkdir -p "${_builddir}/src/github.com/hashicorp"
  ln -s "${_builddir}" "${_builddir}/src/github.com/hashicorp/vault"
  go build -x -v -o bin/${pkgname} || return 1
}

package() {
  cd "$_builddir"
  install -m755 -D "${srcdir}/${pkgname}.initd" \
  "${pkgdir}/etc/init.d/${pkgname}" || return 1
  install -m644 -D "${srcdir}/${pkgname}.confd" \
  "${pkgdir}/etc/conf.d/$pkgname" || return 1
  install -m750 -o root -g vault \
  -D "${_builddir}/bin/${pkgname}" \
  "${pkgdir}/usr/sbin/${pkgname}" || return 1
  install -m750 -o vault -g vault -d "$pkgdir/var/lib/${pkgname}" || return 1
  install -m750 -o root -g vault -D "$srcdir/${pkgname}.hcl" \
    "$pkgdir/etc/${pkgname}.hcl" || return 1
}

md5sums="aa87b935427faf60d7a50aa758600156  vault-0.3.1.tar.gz
d299fb9fdf7f66fa6d5e073425487fd9  Godeps.json
2148a788620484be07e1e24feb1cbd34  vault.confd
1f7802f479024809856e3be2e44a1b19  vault.hcl
ca400b34773b25367acc85a950c3c887  vault.initd"
sha256sums="d33328eeb4e5821ac9b68a8a60c11a3eec075a7d70e22d180c4078c3d556d04c  vault-0.3.1.tar.gz
62284c985b6771d28e37330112701354c7596339d31ccbc4baf0551d8f538360  Godeps.json
f197536bc5bf4531072c0a5cb17627bf01abd188b0cc2005e0ff1768e6143d32  vault.confd
cacbd75cbaccf1034cd21d3015797cf0c1c1ce9c7e7ef7c1e4db4b54b92fe696  vault.hcl
8274a9c735906980a734a8a720232d8816bfbeb8294d4c96baac2e9885abf6a2  vault.initd"
sha512sums="2ee2cb681d9caa0c50f43f4050ef9e6ac93cf0170ac2a874f67dcbae1f393d996bff500cd8693a7cf84063a109eeeaf5fb8ce52b4ee5d7deb4da412548517870  vault-0.3.1.tar.gz
898ea279df93c55c9fc549739530bf63236171afba95f51184f11ce092e6c0ef8bd49382674832c21910ddce92ed9839b3fc582334469c9c783cba352c0e5cf8  Godeps.json
6f3f30e5c9d9dd5117f18fce0e669f0cd752a6be4910405d6b394f15273372731ee887a5ba4c700293e5b8bc2bf40fd69d4337156f77b03549d2dc2c0a666bec  vault.confd
8c064aa5dcca84822c1fa85e9d0ff520df46f794b2e9c689a9b4f81f74279387b3aebc08b3ca26cf786c2fcf1a330e765bf5a511074c24f87e5346672346ba1c  vault.hcl
34993256eb1700ef0738e24227af7732ea81f9e096b34b5f6a282fce364e9c92319c2fc219083eec0185927dde89d565dfcc0d0507bcdbebd3e003027760d447  vault.initd"