summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin MacMartin2015-06-10 00:37:49 -0400
committerKevin MacMartin2015-06-10 00:37:49 -0400
commit54a2eb84cd93d67ed515eb63d70d8b6982dde296 (patch)
tree9db1a67a3907ed6573ac1b22cc7137762ffe53e1
downloadaur-nightfall.tar.gz
Initial import into AUR 4
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD28
-rw-r--r--nightfall.install18
3 files changed, 60 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..2078f5cf4a1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,14 @@
+pkgbase = nightfall
+ pkgdesc = Cjdns inet auto-peering tracker
+ pkgver = 1.1
+ pkgrel = 1
+ url = https://github.com/kpcyrd/nightfall
+ install = nightfall.install
+ arch = any
+ license = GPL3
+ depends = nodejs
+ source = https://github.com/kpcyrd/nightfall/archive/v1.1.tar.gz
+ sha512sums = ec9238bd809d5bc5343655c9f7f433c06116b903b78c8c9bd6fee72167f5a6c7435f42a6c2bb405235dc7c39271c8df2aa241cf5199df418d0d101d1dbc33a6c
+
+pkgname = nightfall
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..590f5d97b89
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,28 @@
+# Maintainer: Kevin MacMartin <prurigro@gmail.com>
+
+pkgname=nightfall
+pkgver=1.1
+pkgrel=1
+pkgdesc='Cjdns inet auto-peering tracker'
+url="https://github.com/kpcyrd/nightfall"
+license=('GPL3')
+arch=('any')
+depends=('nodejs')
+install=$pkgname.install
+source=("$url/archive/v$pkgver.tar.gz")
+sha512sums=('ec9238bd809d5bc5343655c9f7f433c06116b903b78c8c9bd6fee72167f5a6c7435f42a6c2bb405235dc7c39271c8df2aa241cf5199df418d0d101d1dbc33a6c')
+
+prepare() {
+ # Change the dependency on /usr/bin/nodejs to /usr/bin/node
+ sed -i 's|^#!/usr/bin/env nodejs|#!/usr/bin/env node|' $pkgname-$pkgver/$pkgname.js
+}
+
+package() {
+ cd $pkgname-$pkgver
+ # Install the script
+ install -Dm755 $pkgname.js "$pkgdir/usr/bin/$pkgname"
+ # Install documentation
+ install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
+ # Install the systemd service
+ install -Dm644 init/$pkgname.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
+}
diff --git a/nightfall.install b/nightfall.install
new file mode 100644
index 00000000000..5ed1bf26875
--- /dev/null
+++ b/nightfall.install
@@ -0,0 +1,18 @@
+post_install() {
+ # Create nightfall user/group if it doesn't already exist
+ [[ $(getent passwd nightfall) ]] \
+ || useradd -d / -s /usr/bin/nologin nightfall
+ return 0
+}
+
+post_upgrade() {
+ # Run the install function on upgrade
+ post_install
+}
+
+pre_remove() {
+ # Remove the nightfall user/group if it exists
+ [[ $(getent passwd nightfall) ]] \
+ && userdel nightfall
+ return 0
+}