summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rawlinson2021-06-22 09:09:12 +0000
committerGeorge Rawlinson2021-06-22 09:09:12 +0000
commita17b17969f49b0d766698ba2f6a0477b71c8b96b (patch)
treebd2974acf9571b89c8092ce12aa2dc586a24906b
downloadaur-a17b17969f49b0d766698ba2f6a0477b71c8b96b.tar.gz
addpkg: boundary 0.3.0-1
-rw-r--r--.SRCINFO26
-rw-r--r--PKGBUILD89
-rw-r--r--systemd.service14
-rw-r--r--sysusers.conf1
-rw-r--r--tmpfiles.conf1
5 files changed, 131 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b0018dda8170
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+pkgbase = boundary
+ pkgdesc = Enables identity-based access management for dynamic infrastructure
+ pkgver = 0.3.0
+ pkgrel = 1
+ url = https://www.boundaryproject.io/
+ arch = x86_64
+ license = GPL
+ makedepends = git
+ makedepends = go
+ makedepends = nodejs-lts-fermium
+ makedepends = yarn
+ depends = glibc
+ optdepends = postgresql: for local postgresql instance
+ noextract = boundary-ui-40ee317f47100e0be459f9c6aee12e966efd7961.tar.gz
+ source = boundary-0.3.0.tar.gz::https://github.com/hashicorp/boundary/archive/v0.3.0.tar.gz
+ source = boundary-ui-40ee317f47100e0be459f9c6aee12e966efd7961.tar.gz::https://github.com/hashicorp/boundary-ui/archive/40ee317f47100e0be459f9c6aee12e966efd7961.tar.gz
+ source = systemd.service
+ source = tmpfiles.conf
+ source = sysusers.conf
+ b2sums = 7e0e1d87cfea9a228b1188b9e85eecd969c5a0e481111defcd0853b1027f26941055a200d806d63c07667feae316f8899b1120c3b522e06758f396bdfae976d4
+ b2sums = e0e24dc3dde4293d8d129d41c7bdf2a9c80995fdd05d1b4c1093f4275145e60921fd0ef8b330eeca89fb2939758381ceeecd009d268e32742479c8c13e66a8dd
+ b2sums = c35684fbcd28d6aa23abf9e3765321a9434f3826c5d84f5dc95f0695df78007b2f1cb535eeab3a8157f27f7cb6c2444bf40efc468b6a8017de07f87a095e50a1
+ b2sums = 155721b62bf6d820c59b711f547cfdb5c42c7ad713e1e0bb3d973af511b4d5fd57a913c59a39045af7213b19e6fb76e5836190a2c630e2f93bba975657cd719d
+ b2sums = 6c1cf64c430d711b544d9655af746b6525d9ee9c441f7842ee2f115b52886e37c684f97cf30b753971b3ac18a731b4249c7ed8e5311cc759bd69d2a62e089aff
+
+pkgname = boundary
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..bd554c228d6d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,89 @@
+# Maintainer: George Rawlinson <grawlinson@archlinux.org>
+
+pkgname=boundary
+pkgver=0.3.0
+# UI version found at: internal/ui/VERSION
+# head -n 1 $pkgname-$pkgver/internal/ui/VERSION | cut -d ' ' -f 1
+_uiver=40ee317f47100e0be459f9c6aee12e966efd7961
+pkgrel=1
+pkgdesc="Enables identity-based access management for dynamic infrastructure"
+arch=('x86_64')
+url="https://www.boundaryproject.io/"
+license=('GPL')
+depends=('glibc')
+makedepends=(
+ # boundary
+ 'git' 'go'
+ # boundary-ui
+ 'nodejs-lts-fermium' 'yarn'
+)
+optdepends=('postgresql: for local postgresql instance')
+source=(
+ "$pkgname-$pkgver.tar.gz::https://github.com/hashicorp/boundary/archive/v$pkgver.tar.gz"
+ "$pkgname-ui-$_uiver.tar.gz::https://github.com/hashicorp/boundary-ui/archive/$_uiver.tar.gz"
+ 'systemd.service'
+ 'tmpfiles.conf'
+ 'sysusers.conf'
+)
+noextract=("$pkgname-ui-$_uiver.tar.gz")
+b2sums=('7e0e1d87cfea9a228b1188b9e85eecd969c5a0e481111defcd0853b1027f26941055a200d806d63c07667feae316f8899b1120c3b522e06758f396bdfae976d4'
+ 'e0e24dc3dde4293d8d129d41c7bdf2a9c80995fdd05d1b4c1093f4275145e60921fd0ef8b330eeca89fb2939758381ceeecd009d268e32742479c8c13e66a8dd'
+ '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-$_uiver.tar.gz"
+
+ # download go modules
+ cd "$pkgname-$pkgver"
+ mkdir build
+ go mod vendor
+
+ # 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
+ cd "$srcdir/$pkgname-$pkgver"
+ go build -v \
+ -buildmode=pie \
+ -trimpath \
+ -mod=vendor \
+ -modcacherw \
+ -ldflags "-linkmode external -extldflags ${LDFLAGS} \
+ -X github.com/hashicorp/boundary/version.GitCommit=$pkgver" \
+ -tags "ui" \
+ -o build ./cmd/...
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+
+ # binary
+ install -vDm755 "build/$pkgname" -t "$pkgdir/usr/bin"
+
+ # 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 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
+}
diff --git a/systemd.service b/systemd.service
new file mode 100644
index 000000000000..6e5b80da7563
--- /dev/null
+++ b/systemd.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=boundary - @@TYPE@@
+Documentation=https://www.boundaryproject.io/docs
+
+[Service]
+ExecStart=/usr/bin/boundary server -config /etc/boundary/@@TYPE@@.hcl
+User=boundary
+Group=boundary
+LimitMEMLOCK=infinity
+Capabilities=CAP_IPC_LOCK+ep
+CapabilityBoundingSet=CAP_SYSLOG CAP_IPC_LOCK
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sysusers.conf b/sysusers.conf
new file mode 100644
index 000000000000..6c88ac792167
--- /dev/null
+++ b/sysusers.conf
@@ -0,0 +1 @@
+u boundary - "Boundary user"
diff --git a/tmpfiles.conf b/tmpfiles.conf
new file mode 100644
index 000000000000..33f8da15bd33
--- /dev/null
+++ b/tmpfiles.conf
@@ -0,0 +1 @@
+d /etc/boundary 0750 boundary boundary