blob: a562f95b316ef192090c4f1b01668d8435f31d48 (
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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgname=boundary
pkgver=0.11.2
# UI version (commit) found at: internal/ui/VERSION
# tar -O -xf boundary-$pkgver.tar.gz boundary-$pkgver/internal/ui/VERSION | head -n 1 | cut -d ' ' -f 1
_ui_commit='ff6e2bb4cf8dfaa2122801baa2ad48a619000d7d'
pkgrel=1
pkgdesc='Enables identity-based access management for dynamic infrastructure'
arch=('x86_64')
url='https://www.boundaryproject.io/'
license=('MPL2')
depends=('glibc')
makedepends=(
# boundary
'git' 'go'
# boundary-ui
'nodejs-lts-fermium' 'yarn'
)
optdepends=('postgresql: for local postgresql instance')
options=('!lto')
source=(
"$pkgname-$pkgver.tar.gz::https://github.com/hashicorp/boundary/archive/v$pkgver.tar.gz"
"$pkgname-ui-$_ui_commit.tar.gz::https://github.com/hashicorp/boundary-ui/archive/$_ui_commit.tar.gz"
'systemd.service'
'tmpfiles.conf'
'sysusers.conf'
)
noextract=("$pkgname-ui-$_ui_commit.tar.gz")
sha512sums=('ebacc4d048fd3482596efcc6440f81d80e195953001c543ff37e55c986011a85321503bc8cb3b84830203b9a175dd1d6f2637beea02e77c2964e16ff27e08a77'
'55c9c4fd071b83bcdebb8a9ca68f663a62bc22b5528166a10b1d959988f411826e4e90472992a000ef97b74d676302232b5d0e101576e7e6be833c3786c33b5f'
'051fc1fff51f9f9a4323b2596d31392a1f47b59880741bf7c1e6d53dd968190c0b5c0aacb5549549c0a47cbbc70b63c003cec0b04f081b44bfb3ed78417e70c9'
'afaa4ffc99b0c2192f060b6fe04088d7ef9702f68aef626af34fdede3fb874aea76986102f91f5b7df93bcaedf406c46aa7226573ed8d68981c8174b7fd4fb32'
'f4f3e00b08145faa5a7c4ec60c49b6c0eb7399965571cdf8e81ccc81dc97f9b130d45de77df7b2eb10b9c7caf6804fcaf5975892c0ef56ced4eba453f6a68d28')
b2sums=('8f148adfbc3d98592c19f531748f9fd4fb9e459070dd4d5d8653eda8bc6a8ea71a5ba0d7889501b9a5e8d55146b59fdd175ab05841d65e4e20bcb4774ccfa23d'
'64622f26953e108e154b4477c41e58692a043f88ee6686434e606187e15d500319112a0820634fa99d7cb1397256fe1dd25ff05a8890d3cd70fb0bd80d976e14'
'c35684fbcd28d6aa23abf9e3765321a9434f3826c5d84f5dc95f0695df78007b2f1cb535eeab3a8157f27f7cb6c2444bf40efc468b6a8017de07f87a095e50a1'
'155721b62bf6d820c59b711f547cfdb5c42c7ad713e1e0bb3d973af511b4d5fd57a913c59a39045af7213b19e6fb76e5836190a2c630e2f93bba975657cd719d'
'6c1cf64c430d711b544d9655af746b6525d9ee9c441f7842ee2f115b52886e37c684f97cf30b753971b3ac18a731b4249c7ed8e5311cc759bd69d2a62e089aff')
prepare() {
# extract boundary-ui
mkdir -p "$pkgname-$pkgver/internal/ui/.tmp/boundary-ui"
bsdtar \
--strip-components 1 \
--directory "$pkgname-$pkgver/internal/ui/.tmp/boundary-ui" \
--extract --file "$pkgname-ui-$_ui_commit.tar.gz"
cd "$pkgname-$pkgver"
# create directory for build output
mkdir build
# download go modules
go mod download
# create systemd units from template
cd build
for unit in worker controller; do
sed "s/@@TYPE@@/$unit/" "$srcdir/systemd.service" > "$pkgname-$unit.service"
done
}
build() {
# boundary-ui
cd "$pkgname-$pkgver/internal/ui/.tmp/boundary-ui"
yarn install
yarn build
# boundary plugins
# extracted from ./scripts/build.sh
cd "$srcdir/$pkgname-$pkgver"
ORIG_PATH=$(pwd)
for PLUGIN_TYPE in host; do
for CURR_PLUGIN in $(ls $ORIG_PATH/plugins/$PLUGIN_TYPE/mains); do
cd $ORIG_PATH/plugins/$PLUGIN_TYPE/mains/$CURR_PLUGIN
go build -v \
-o $ORIG_PATH/plugins/$PLUGIN_TYPE/assets/boundary-plugin-${PLUGIN_TYPE}-${CURR_PLUGIN} \
.
cd $ORIG_PATH
done
cd $ORIG_PATH/plugins/$PLUGIN_TYPE/assets
for CURR_PLUGIN in $(ls); do
gzip -f -9 $CURR_PLUGIN
done
cd $ORIG_PATH
done
# boundary
go build -v \
-buildmode=pie \
-trimpath \
-mod=readonly \
-modcacherw \
-ldflags "-linkmode external -extldflags ${LDFLAGS} \
-X github.com/hashicorp/boundary/version.GitCommit=tarball \
-X github.com/hashicorp/boundary/version.Version=$pkgver" \
-tags "ui" \
-o build ./cmd/...
}
package() {
cd "$pkgname-$pkgver"
# binary
install -vDm755 -t "$pkgdir/usr/bin" "build/$pkgname"
# systemd integration
install -vDm644 ../tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
install -vDm644 ../sysusers.conf "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
install -vDm644 -t "$pkgdir/usr/lib/systemd/system" \
"build/$pkgname-worker.service" \
"build/$pkgname-controller.service"
# license
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
|