Date: Thursday, January 3, 2019 @ 20:21:40 Author: demize Revision: 342908
Import prometheus PKGBUILD Added: prometheus/repos/ prometheus/trunk/ prometheus/trunk/PKGBUILD prometheus/trunk/prometheus.service prometheus/trunk/prometheus.sysusers ---------------------+ PKGBUILD | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ prometheus.service | 17 ++++++++++++++ prometheus.sysusers | 1 3 files changed, 77 insertions(+) Added: trunk/PKGBUILD =================================================================== --- trunk/PKGBUILD (rev 0) +++ trunk/PKGBUILD 2019-01-03 20:21:40 UTC (rev 342908) @@ -0,0 +1,59 @@ +# Maintainer: Johannes Löthberg <johan...@kyriasis.com> + +pkgname=prometheus +pkgver=2.6.0 +pkgrel=2 + +pkgdesc='An open-source systems monitoring and alerting toolkit' +url='https://prometheus.io' +arch=('x86_64') +license=('Apache') + +depends=('glibc') +makedepends=('go-pie' 'git' 'bzr') + +backup=('etc/prometheus/prometheus.yml') + +source=("https://github.com/prometheus/prometheus/archive/v$pkgver.tar.gz" + prometheus.service + prometheus.sysusers) + +sha256sums=('e0d3e77e45466fd055726268354a02834968a3275791be6cbd17513ec7860c1d' + 'a1484a9c97e51c02e61ba8dfbd21aed34a8315fd111391ac0d13196cde7503a9' + '2747fabb4e56b808361eb7dd7acf9729ab8973d1ebe2f857dd56f6c71f71e45f') + +build() { + cd prometheus-$pkgver + + go build \ + -gcflags "all=-trimpath=${PWD}" \ + -asmflags "all=-trimpath=${PWD}" \ + -ldflags "-extldflags ${LDFLAGS}" \ + ./cmd/prometheus + go build \ + -gcflags "all=-trimpath=${PWD}" \ + -asmflags "all=-trimpath=${PWD}" \ + -ldflags "-extldflags ${LDFLAGS}" \ + ./cmd/promtool +} + +package() { + install -Dm644 prometheus.service "$pkgdir"/usr/lib/systemd/system/prometheus.service + install -Dm644 prometheus.sysusers "$pkgdir"/usr/lib/sysusers.d/prometheus.conf + + cd prometheus-$pkgver + + install -Dm755 -t "$pkgdir"/usr/bin prometheus promtool + install -Dm755 -t "$pkgdir"/etc/prometheus documentation/examples/prometheus.yml + install -dm755 "$pkgdir"/etc/prometheus/{consoles,console_libraries} + install -dm755 -o210 -g210 "$pkgdir"/var/lib/prometheus + + # Web + install -dm755 "$pkgdir"/usr/share/prometheus/ + cp -R web/ui "$pkgdir"/usr/share/prometheus/web + + # Examples + install -Dm644 -t "$pkgdir"/usr/share/doc/prometheus/examples documentation/examples/prometheus*.yml + cp -R consoles console_libraries "$pkgdir"/usr/share/doc/prometheus/examples + +} Added: trunk/prometheus.service =================================================================== --- trunk/prometheus.service (rev 0) +++ trunk/prometheus.service 2019-01-03 20:21:40 UTC (rev 342908) @@ -0,0 +1,17 @@ +[Unit] +Description=Prometheus service +Requires=network-online.target +After=network-online.target + +[Service] +User=prometheus +Group=prometheus +Restart=on-failure +ExecStart=/usr/bin/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/var/lib/prometheus/data +ExecReload=/bin/kill -HUP $MAINPID +NoNewPrivileges=true +ProtectHome=yes +ProtectSystem=yes + +[Install] +WantedBy=multi-user.target Added: trunk/prometheus.sysusers =================================================================== --- trunk/prometheus.sysusers (rev 0) +++ trunk/prometheus.sysusers 2019-01-03 20:21:40 UTC (rev 342908) @@ -0,0 +1 @@ +u prometheus 210 "Prometheus dedicated user"