summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD32
-rw-r--r--beacon.install4
-rw-r--r--beacon.service14
4 files changed, 66 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..fac22c31bcdf
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = beacon
+ pkgdesc = Tiny system utility reporting CPU, memory, uptime to logs, cloudwatch, http
+ pkgver = 1.1.0
+ pkgrel = 1
+ url = https://github.com/shazbits/beacon
+ install = beacon.install
+ arch = x86_64
+ license = MIT
+ makedepends = go
+ source = https://github.com/shazbits/beacon/archive/v1.1.0.tar.gz
+ source = beacon.service
+ sha256sums = ac309ac8419fe4ee02b204421a8462ce28308c77d9fc42358d2d94504176d1c1
+ sha256sums = c1e33e6fbb2320fe0ea13e3ca95edbbf779686785a0f6304f32a49dbed97ed9f
+
+pkgname = beacon
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..cdfcfccca9df
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,32 @@
+# Maintainer: Romain Dura <romain "at" shazbits "dot" com>
+
+pkgname=beacon
+pkgver=1.1.0
+pkgrel=1
+pkgdesc='Tiny system utility reporting CPU, memory, uptime to logs, cloudwatch, http'
+arch=('x86_64')
+url="https://github.com/shazbits/$pkgname"
+license=('MIT')
+makedepends=('go')
+install=beacon.install
+source=("$url/archive/v$pkgver.tar.gz"
+ 'beacon.service')
+sha256sums=('ac309ac8419fe4ee02b204421a8462ce28308c77d9fc42358d2d94504176d1c1'
+ 'c1e33e6fbb2320fe0ea13e3ca95edbbf779686785a0f6304f32a49dbed97ed9f')
+
+build() {
+ cd $pkgname-$pkgver
+ go build \
+ -gcflags "all=-trimpath=$PWD" \
+ -asmflags "all=-trimpath=$PWD" \
+ -ldflags "-extldflags $LDFLAGS" \
+ -o $pkgname .
+}
+
+package() {
+ cd $pkgname-$pkgver
+ install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ install -Dm644 config.yml.example "$pkgdir/etc/beacon/config.yml"
+ install -Dm644 "$srcdir/beacon.service" "$pkgdir/usr/lib/systemd/system/beacon.service"
+}
diff --git a/beacon.install b/beacon.install
new file mode 100644
index 000000000000..787472e33aff
--- /dev/null
+++ b/beacon.install
@@ -0,0 +1,4 @@
+post_install() {
+ echo "The beacon service must be running for beacon to work."
+ echo "Configure /etc/beacon/config.yml, enable and start beacon.service."
+}
diff --git a/beacon.service b/beacon.service
new file mode 100644
index 000000000000..4da0094a8539
--- /dev/null
+++ b/beacon.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Beacon service
+After=network.target
+StartLimitIntervalSec=0
+
+[Service]
+Type=simple
+Restart=always
+RestartSec=1
+User=root
+ExecStart=/usr/bin/beacon
+
+[Install]
+WantedBy=multi-user.target