From cb6efd2371a47af4c06cfea4bcedf59e894ee560 Mon Sep 17 00:00:00 2001 From: Toyam Cox Date: Sat, 11 Nov 2017 19:19:29 -0500 Subject: [PATCH] prometheus: Improve packaging --- srcpkgs/prometheus/files/prometheus/run | 9 +++++++++ srcpkgs/prometheus/template | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 srcpkgs/prometheus/files/prometheus/run diff --git a/srcpkgs/prometheus/files/prometheus/run b/srcpkgs/prometheus/files/prometheus/run new file mode 100755 index 00000000000..fbc074e65d6 --- /dev/null +++ b/srcpkgs/prometheus/files/prometheus/run @@ -0,0 +1,9 @@ +#!/bin/sh + +[ -f ./conf ] && . ./conf + +: ${WRKDIR:=/var/lib/prometheus} + +cd "${WRKDIR}" + +exec chpst -u _prometheus prometheus --config.file=/etc/prometheus/prometheus.yml $ARGS diff --git a/srcpkgs/prometheus/template b/srcpkgs/prometheus/template index 4b99cf9a4e4..6d864634d22 100644 --- a/srcpkgs/prometheus/template +++ b/srcpkgs/prometheus/template @@ -1,7 +1,7 @@ # Template file for 'prometheus' pkgname=prometheus version=2.0.0 -revision=1 +revision=2 build_style=go go_import_path="github.com/prometheus/prometheus" go_package="github.com/prometheus/prometheus/cmd/prometheus github.com/prometheus/prometheus/cmd/promtool" @@ -9,6 +9,7 @@ go_ldflags="-X ${go_import_path}/version.Version=${version} -X ${go_import_path}/version.Revision=${version} -X ${go_import_path}/version.Branch=${version} -X ${go_import_path}/version.BuildUser=VoidLinux" +conf_files="/etc/prometheus/prometheus.yml" maintainer="Toyam Cox " license="Apache-2.0" homepage="https://prometheus.io/" @@ -16,6 +17,10 @@ short_desc="Monitoring system and time series database" distfiles="https://github.com/prometheus/prometheus/archive/v${version}.tar.gz" checksum=6947ae9b2d414d49304034a2635f0e1ecd45ac83a4f4592ea5bcca40d6f7951b +system_accounts="_prometheus" + +make_dirs="/var/lib/prometheus 700 _prometheus _prometheus" + post_install() { vlicense LICENSE vlicense NOTICE @@ -25,5 +30,7 @@ post_install() { vcopy consoles etc/prometheus vcopy console_libraries etc/prometheus vcopy documentation/examples/* usr/share/examples/prometheus/ + vcopy documentation/examples/prometheus.yml etc/prometheus/ vcopy documentation/images usr/share/doc/prometheus/ + vsv prometheus }