summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO26
-rw-r--r--PKGBUILD58
-rw-r--r--hopglass-server-wrapper3
-rw-r--r--hopglass-server.service13
-rw-r--r--hopglass-server.sysusers1
-rw-r--r--hopglass-server.tmpfiles2
-rw-r--r--hopglass-server@.service14
7 files changed, 117 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..fe23fe201de9
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+pkgbase = hopglass-server
+ pkgdesc = The HopGlass server collects data from Freifunk networks
+ pkgver = v0.1.3_39_g3d5b233
+ pkgrel = 1
+ url = https://github.com/hopglass/hopglass-server
+ arch = x86_64
+ license = AGPL-3.0
+ makedepends = yarn
+ depends = nodejs
+ backup = etc/hopglass-server/aliases.json
+ backup = etc/hopglass-server/config.json
+ source = git+https://github.com/hopglass/hopglass-server
+ source = hopglass-server-wrapper
+ source = hopglass-server.service
+ source = hopglass-server.sysusers
+ source = hopglass-server@.service
+ source = hopglass-server.tmpfiles
+ sha256sums = SKIP
+ sha256sums = 6bf23bc9f54004aaaf21a1d8ae2b7db674463e8cc0b0072133e133c2f100611b
+ sha256sums = fbbe882ea0a2c67b284d537deffc41b986b058ec3ac776509cec20c0f3d79808
+ sha256sums = ea593147929f11b796c8d10d6aa649e25ac4d2bb692a0416aea884d4b7797565
+ sha256sums = 273c5455635d08862f2a2059019a457dd59e046b5d6415b1425eac2f605fca0c
+ sha256sums = 12adb52aeece94ae09e99bf14615b605ce92a2ce26eaf20f541bc967b78712db
+
+pkgname = hopglass-server
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..270aa7df3934
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,58 @@
+# Maintainer: Milan Pässler <me at pbb dot lc>
+
+pkgname=hopglass-server
+pkgver=v0.1.3_39_g3d5b233
+pkgrel=1
+pkgdesc="The HopGlass server collects data from Freifunk networks"
+arch=('x86_64')
+url="https://github.com/hopglass/hopglass-server"
+license=('AGPL-3.0')
+depends=('nodejs')
+makedepends=('yarn')
+source=("git+https://github.com/hopglass/hopglass-server"
+ hopglass-server-wrapper
+ hopglass-server.service
+ hopglass-server.sysusers
+ hopglass-server@.service
+ hopglass-server.tmpfiles)
+
+sha256sums=('SKIP'
+ '6bf23bc9f54004aaaf21a1d8ae2b7db674463e8cc0b0072133e133c2f100611b'
+ 'fbbe882ea0a2c67b284d537deffc41b986b058ec3ac776509cec20c0f3d79808'
+ 'ea593147929f11b796c8d10d6aa649e25ac4d2bb692a0416aea884d4b7797565'
+ '273c5455635d08862f2a2059019a457dd59e046b5d6415b1425eac2f605fca0c'
+ '12adb52aeece94ae09e99bf14615b605ce92a2ce26eaf20f541bc967b78712db')
+
+pkgver() {
+ cd "${srcdir}/hopglass-server"
+ git describe --tags --long | sed s/-/_/g
+}
+
+backup=('etc/hopglass-server/aliases.json' 'etc/hopglass-server/config.json')
+
+build() {
+ cd "${srcdir}/hopglass-server"
+ yarn --production
+}
+
+package() {
+ install -Dm644 hopglass-server/hopglass-server.js -t "${pkgdir}"/usr/share/hopglass-server/
+ install -Dm644 hopglass-server/config.json.example -t "${pkgdir}"/usr/share/hopglass-server/
+ install -Dm644 hopglass-server/aliases.json.example -t "${pkgdir}"/usr/share/hopglass-server/
+ install -Dm644 hopglass-server/config.json.defaults -t "${pkgdir}"/usr/share/hopglass-server/
+ install -Dm644 hopglass-server/README.md -t "${pkgdir}"/usr/share/hopglass-server/
+
+ cp -r hopglass-server/modules "${pkgdir}"/usr/share/hopglass-server/
+ cp -r hopglass-server/scripts "${pkgdir}"/usr/share/hopglass-server/
+ cp -r hopglass-server/node_modules "${pkgdir}"/usr/share/hopglass-server/
+
+ install -Dm755 hopglass-server-wrapper "${pkgdir}"/usr/bin/hopglass-server
+ install -Dm644 hopglass-server/LICENSE -t "${pkgdir}"/usr/share/licenses/hopglass-server/
+ install -Dm644 hopglass-server.service -t "${pkgdir}"/usr/lib/systemd/system/
+ install -Dm644 hopglass-server@.service -t "${pkgdir}"/usr/lib/systemd/system/
+ install -Dm644 hopglass-server.sysusers "${pkgdir}"/usr/lib/sysusers.d/hopglass-server.conf
+ install -Dm644 hopglass-server/config.json.example "${pkgdir}"/etc/hopglass-server/config.json
+ install -Dm644 hopglass-server/aliases.json.example "${pkgdir}"/etc/hopglass-server/aliases.json
+
+ install -d "${pkgdir}"/var/lib/hopglass-server/
+}
diff --git a/hopglass-server-wrapper b/hopglass-server-wrapper
new file mode 100644
index 000000000000..7f73b436efc6
--- /dev/null
+++ b/hopglass-server-wrapper
@@ -0,0 +1,3 @@
+#!/usr/bin/bash
+export NODE_PATH=/usr/share/hopglass-server/
+/usr/bin/node /usr/share/hopglass-server/hopglass-server.js $@
diff --git a/hopglass-server.service b/hopglass-server.service
new file mode 100644
index 000000000000..97764427583f
--- /dev/null
+++ b/hopglass-server.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=The HopGlass Server collects data from the Freifunk network
+
+[Service]
+Type=simple
+User=hopglass-server
+Group=nobody
+WorkingDirectory=/var/lib/hopglass-server/
+ExecStart=/usr/bin/hopglass-server --config /etc/hopglass-server/config.json
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/hopglass-server.sysusers b/hopglass-server.sysusers
new file mode 100644
index 000000000000..b58243c215e9
--- /dev/null
+++ b/hopglass-server.sysusers
@@ -0,0 +1 @@
+u hopglass-server - "HopGlass server user" /var/lib/hopglass-server /bin/false
diff --git a/hopglass-server.tmpfiles b/hopglass-server.tmpfiles
new file mode 100644
index 000000000000..557819698467
--- /dev/null
+++ b/hopglass-server.tmpfiles
@@ -0,0 +1,2 @@
+d /var/lib/hopglass-server 0755
+Z /var/lib/hopglass-server - hopglass-server nobody
diff --git a/hopglass-server@.service b/hopglass-server@.service
new file mode 100644
index 000000000000..a5e6a0485946
--- /dev/null
+++ b/hopglass-server@.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=The HopGlass Server collects data from the Freifunk network (%I)
+
+[Service]
+Type=simple
+User=hopglass-server
+Group=nobody
+WorkingDirectory=/var/lib/hopglass-server/%I/
+ExecStart=/usr/bin/hopglass-server --config /etc/hopglass-server/%I/config.json
+ExecStartPre=/usr/bin/mkdir -p /var/lib/hopglass-server/%I/
+Restart=always
+
+[Install]
+WantedBy=multi-user.target