commit 400a41d420a5ab03682cf666722449cc45acc761 Author: Nils Czernia Date: Wed Oct 18 12:34:20 2017 +0200 Inital commit diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..a3cb115 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,19 @@ +# Generated by mksrcinfo v8 +# Wed Oct 18 10:34:10 UTC 2017 +pkgbase = prometheus-postgresql-exporter + pkgdesc = Prometheus exporter for PostrgreSQL + pkgver = 0.2.3 + pkgrel = 1 + url = https://github.com/wrouesnel/postgres_exporter + arch = x86_64 + arch = i686 + license = Apache + makedepends = git + makedepends = go + source = https://github.com/wrouesnel/postgres_exporter/archive/v0.2.3.tar.gz + source = prometheus-postgresql-exporter.service + sha256sums = 203ea51a9e5fb1fadceaa82ad63637db7248e22ae8b876613f3c8c2c255682d7 + sha256sums = cda225c236df0e2a6d71c17a5390a92ed5cc7f71b8ca5843590c59fa02cdb135 + +pkgname = prometheus-postgresql-exporter + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..556ff7e --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +* +!PKGBUILD +!.SRCINFO +!.gitignore +!prometheus-postgresql-exporter.service diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..054bf58 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,42 @@ +# Maintainer: Nils Czernia + +pkgname=prometheus-postgresql-exporter +pkgver=0.2.3 +pkgrel=1 +pkgdesc="Prometheus exporter for PostrgreSQL" +arch=('x86_64' 'i686') +url="https://github.com/wrouesnel/postgres_exporter" +license=('Apache') +makedepends=('git' 'go') +source=("https://github.com/wrouesnel/postgres_exporter/archive/v${pkgver}.tar.gz" + "prometheus-postgresql-exporter.service") +sha256sums=('203ea51a9e5fb1fadceaa82ad63637db7248e22ae8b876613f3c8c2c255682d7' + 'cda225c236df0e2a6d71c17a5390a92ed5cc7f71b8ca5843590c59fa02cdb135') + +prepare() { + cd "${srcdir}/postgres_exporter-${pkgver}" + + export GOPATH="${srcdir}/gopath" + mkdir -p "${GOPATH}/src/github.com/wrouesnel" + ln -snf "${srcdir}/postgres_exporter-${pkgver}" "${GOPATH}/src/github.com/wrouesnel/postgres_exporter" +} + +build() { + export GOPATH="${srcdir}/gopath" + cd "${GOPATH}/src/github.com/wrouesnel/postgres_exporter" + make +} + +check() { + export GOPATH="${srcdir}/gopath" + cd "${GOPATH}/src/github.com/wrouesnel/postgres_exporter" + + make test +} + +package() { + cd "${srcdir}/postgres_exporter-${pkgver}" + + install -Dm755 "postgres_exporter" "${pkgdir}/usr/bin/prometheus_postgresql_exporter" + install -Dm755 "${srcdir}/prometheus-postgresql-exporter.service" "${pkgdir}/usr/lib/systemd/system/prometheus-postgresql-exporter.service" +} diff --git a/prometheus-postgresql-exporter.service b/prometheus-postgresql-exporter.service new file mode 100644 index 0000000..6f7f07c --- /dev/null +++ b/prometheus-postgresql-exporter.service @@ -0,0 +1,9 @@ +[Unit] +Description=Prometheus exporter for PostgreSQL +After=network.target + +[Service] +ExecStart=/usr/bin/prometheus_postgresql_exporter + +[Install] +WantedBy=multi-user.target