diff options
-rw-r--r-- | .SRCINFO | 21 | ||||
-rw-r--r-- | .gitignore | 10 | ||||
-rw-r--r-- | PKGBUILD | 47 | ||||
-rw-r--r-- | chronograf.install | 12 | ||||
-rw-r--r-- | chronograf.service | 12 |
5 files changed, 102 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..320b8150bad9 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = chronograf + pkgdesc = A new data visualization tool for InfluxDB + pkgver = 0.3.2 + pkgrel = 1 + url = http://influxdb.org/chronograf + install = chronograf.install + arch = i686 + arch = x86_64 + license = MIT + makedepends = go + makedepends = git + backup = etc/chronograf.toml + source = https://s3.amazonaws.com/get.influxdb.org/chronograf/chronograf_0.3.2_amd64.deb + source = chronograf.install + source = chronograf.service + md5sums = 1a8c09b6abf8276408a2b2a4e1eb7e84 + md5sums = 5eeadbb9b80534dcf87ce3a9131ab75e + md5sums = 396feb4648ea8447c3d69bc97a80b9be + +pkgname = chronograf + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..181b3460e424 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +* +!PKGBUILD +!.SRCINFO +!*.patch +!*.desktop +!*.install +!*.service +!*.sh +!*.conf +!.gitignore diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..d06b2378cd8f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,47 @@ +# Maintainer: Justin Dray <justin@dray.be> + +pkgname='chronograf' +pkgver='0.3.2' +pkgrel='1' +epoch= +pkgdesc='A new data visualization tool for InfluxDB' +arch=('i686' 'x86_64') +url='http://influxdb.org/chronograf' +license=('MIT') +groups=() +depends=() +makedepends=('go' 'git') +checkdepends=() +optdepends=() +provides=() +conflicts=() +replaces=() +backup=('etc/chronograf.toml') +options=() +install="$pkgname.install" +pkgtar="v${pkgver}.tar.gz" +source=("https://s3.amazonaws.com/get.influxdb.org/chronograf/chronograf_0.3.2_amd64.deb" + "$pkgname.install" + "$pkgname.service") +changelog= +noextract=() +md5sums=('1a8c09b6abf8276408a2b2a4e1eb7e84' + '5eeadbb9b80534dcf87ce3a9131ab75e' + '396feb4648ea8447c3d69bc97a80b9be') + +prepare() { + bsdtar xf data.tar.gz + + sed -i 's|/opt/|/var/lib/|g' "$srcdir/opt/chronograf/config.toml" +} + +package() { + # systemctl service file + install -D -m644 "$srcdir/chronograf.service" "$pkgdir/usr/lib/systemd/system/chronograf.service" + + # binary + install -D -m755 "$srcdir/opt/chronograf/chronograf" "$pkgdir/usr/bin/chronograf" + + # configuration file + install -D -m644 "$srcdir/opt/chronograf/config.toml" "$pkgdir/etc/chronograf.toml" +} diff --git a/chronograf.install b/chronograf.install new file mode 100644 index 000000000000..94f6d5919f65 --- /dev/null +++ b/chronograf.install @@ -0,0 +1,12 @@ +post_install() { + post_upgrade + passwd -l chronograf &>/dev/null +} + +post_upgrade() { + getent group chronograf >/dev/null || groupadd -r chronograf + getent passwd chronograf >/dev/null || useradd -c 'chronograf' -g chronograf -d '/var/lib/chronograf' -r -m -s /bin/false chronograf + + mkdir -p /var/lib/chronograf + chown chronograf.chronograf /var/lib/chronograf +} diff --git a/chronograf.service b/chronograf.service new file mode 100644 index 000000000000..a3e017317737 --- /dev/null +++ b/chronograf.service @@ -0,0 +1,12 @@ +[Unit] +Description=A new data visualization tool for InfluxDB +After=network-online.target + +[Service] +User=chronograf +ExecStart=/usr/bin/chronograf -config=/etc/chronograf.toml +Restart=on-failure +KillMode=process + +[Install] +WantedBy=multi-user.target |