summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsorz2019-01-16 17:45:50 +0800
committersorz2019-01-16 17:46:43 +0800
commit90c8c729464d297ccaa3e19e6f527c7ef94cf338 (patch)
tree309a6e9dbaf85c3c14b840242fe0d86309a4471c
downloadaur-90c8c729464d297ccaa3e19e6f527c7ef94cf338.tar.gz
Initial upload babelweb2-git
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD46
-rw-r--r--babelweb2.service20
3 files changed, 83 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..05789d7a606
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = babelweb2-git
+ pkgdesc = Yet Another Monitoring Tool for the Babel routing daemon.
+ pkgver = r224.506f97f
+ pkgrel = 1
+ url = https://github.com/Vivena/babelweb2
+ arch = x86_64
+ arch = i686
+ license = MIT
+ makedepends = git
+ makedepends = go-pie
+ source = babelweb2::git+https://github.com/Vivena/babelweb2.git
+ source = babelweb2.service
+ sha256sums = SKIP
+ sha256sums = 90592927110b955e2e533f90752c50b468dd8824379fdcfca2be41c42343ccfd
+
+pkgname = babelweb2-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..3af9e217852
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+pkgname=babelweb2-git
+_pkgname=babelweb2
+pkgver=r224.506f97f
+pkgrel=1
+pkgdesc='Yet Another Monitoring Tool for the Babel routing daemon.'
+arch=('x86_64' 'i686')
+url='https://github.com/Vivena/babelweb2'
+license=('MIT')
+makedepends=('git' 'go-pie')
+source=("${_pkgname}::git+https://github.com/Vivena/babelweb2.git"
+ "babelweb2.service")
+sha256sums=('SKIP'
+ '90592927110b955e2e533f90752c50b468dd8824379fdcfca2be41c42343ccfd')
+
+pkgver() {
+ cd "${srcdir}/${_pkgname}"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ mkdir -p gopath/src/github.com/Vivena
+ ln -rTsf $_pkgname gopath/src/github.com/Vivena/$_pkgname
+ export GOPATH="$srcdir"/gopath
+
+ cd gopath/src/github.com/Vivena/$_pkgname
+ go get -v github.com/Vivena/babelweb2
+}
+
+
+build() {
+ export GOPATH="$srcdir"/gopath
+ cd gopath/src/github.com/Vivena/$_pkgname
+ go build \
+ -gcflags "all=-trimpath=$PWD" \
+ -asmflags "all=-trimpath=$PWD" \
+ -ldflags "-extldflags $LDFLAGS" \
+ -o $_pkgname .
+}
+
+package() {
+ cd "$_pkgname"
+ install -Dm 755 $_pkgname "${pkgdir}/usr/bin/$_pkgname"
+ mkdir -p $pkgdir/usr/share/$_pkgname
+ cp -r static $pkgdir/usr/share/$_pkgname
+ install -Dm644 "$srcdir/babelweb2.service" "$pkgdir/usr/lib/systemd/system/babelweb2.service"
+}
diff --git a/babelweb2.service b/babelweb2.service
new file mode 100644
index 00000000000..dfe9bc5cfc7
--- /dev/null
+++ b/babelweb2.service
@@ -0,0 +1,20 @@
+[Unit]
+Description=Yet Another Monitoring Tool for the Babel routing daemon
+After=network.target
+
+[Service]
+Type=simple
+User=nobody
+ExecStart=/usr/bin/babelweb2 -static /usr/share/babelweb2/static/
+Restart=on-failure
+
+PrivateTmp=true
+PrivateDevices=true
+ProtectSystem=strict
+ProtectHome=true
+ProtectKernelModules=true
+ProtectControlGroups=true
+
+[Install]
+WantedBy=multi-user.target
+