summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Weidenbaum2015-06-09 11:41:58 -0700
committerAndy Weidenbaum2015-06-09 11:41:58 -0700
commita1a81e2a19aa9a26812b4a94eda35077efc62f89 (patch)
treee291c63bad0af6e6a7fbbdc746a8f5a6d870faf6
downloadaur-a1a81e2a19aa9a26812b4a94eda35077efc62f89.tar.gz
Initial import
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD42
-rw-r--r--god.install28
-rw-r--r--god.service11
4 files changed, 103 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..fd1126ffa34
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = god
+ pkgdesc = A process monitoring framework in Ruby
+ pkgver = 0.13.6
+ pkgrel = 1
+ url = http://godrb.com
+ install = god.install
+ arch = i686
+ arch = x86_64
+ license = MIT
+ depends = ruby
+ provides = god
+ provides = ruby-god
+ conflicts = god
+ conflicts = ruby-god
+ noextract = god-0.13.6.gem
+ source = https://rubygems.org/downloads/god-0.13.6.gem
+ source = god.service
+ sha256sums = 691f862e96392d20788d8f50de5f08e7c6c79cac3d05a6a892623d36a7fff85c
+ sha256sums = 4b2ec4edbc94dd11b5178ec66846b94232157d1f9710de5f58fc2deb0a1e1596
+
+pkgname = god
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..75a154e3721
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Andy Weidenbaum <archbaum@gmail.com>
+
+pkgname=god
+pkgver=0.13.6
+pkgrel=1
+pkgdesc="A process monitoring framework in Ruby"
+arch=('i686' 'x86_64')
+url="http://godrb.com"
+license=('MIT')
+depends=('ruby')
+source=(https://rubygems.org/downloads/${pkgname#*-}-${pkgver}.gem
+ god.service)
+sha256sums=('691f862e96392d20788d8f50de5f08e7c6c79cac3d05a6a892623d36a7fff85c'
+ '4b2ec4edbc94dd11b5178ec66846b94232157d1f9710de5f58fc2deb0a1e1596')
+noextract=("${pkgname#*-}-${pkgver}.gem")
+provides=('god' 'ruby-god')
+conflicts=('god' 'ruby-god')
+install=god.install
+
+_rbver=$(gem env gempath | awk -F: '{print $2}' | sed 's@.*gems/@@')
+
+package() {
+ cd "$srcdir"
+
+ msg 'Installing...'
+ gem install \
+ --no-user-install \
+ --ignore-dependencies \
+ -i "$pkgdir$(ruby -rubygems -e'puts Gem.default_dir')" \
+ ${pkgname#*-}-$pkgver.gem
+
+ msg 'Readying directories...'
+ mkdir -p "$pkgdir"/{etc/god/conf.d,/var/log/god,}
+
+ msg 'Installing executables in /usr/bin...'
+ find "$pkgdir/usr/lib/ruby/gems/$_rbver/bin" -type f -execdir \
+ install -Dm 755 '{}' "$pkgdir/usr/bin/"'{}' \;
+ rm -rf "$pkgdir/usr/bin/home"
+
+ msg 'Installing systemd service file...'
+ install -Dm644 "$srcdir/god.service" "$pkgdir/usr/lib/systemd/system/god.service"
+}
diff --git a/god.install b/god.install
new file mode 100644
index 00000000000..4c0f8e7c54f
--- /dev/null
+++ b/god.install
@@ -0,0 +1,28 @@
+post_install() {
+ _mkuser
+ chown -R god:god /etc/god /var/log/god
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ _rmuser
+ rm -rf /etc/god /var/log/god
+}
+
+_mkuser() {
+ getent passwd god &>/dev/null || {
+ echo -n "Creating god user... "
+ grep -E "^god:" /etc/group >/dev/null || groupadd god
+ useradd -m -d /etc/god -g god -s /usr/bin/nologin god
+ echo "done"
+ }
+}
+
+_rmuser() {
+ echo -n "Removing god user... "
+ userdel -rf god 2>/dev/null
+ echo "done"
+}
diff --git a/god.service b/god.service
new file mode 100644
index 00000000000..e680edce517
--- /dev/null
+++ b/god.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=God
+
+[Service]
+Type=simple
+PIDFile=/run/god.pid
+ExecStart=/usr/bin/god -c /etc/god/god.conf -P /run/god.pid -l /var/log/god --log-level info -D
+ExecStop=/usr/bin/god terminate
+
+[Install]
+WantedBy=multi-user.target