diff options
-rw-r--r-- | databases/Makefile | 3 | ||||
-rw-r--r-- | databases/prometheus/DESCR | 6 | ||||
-rw-r--r-- | databases/prometheus/Makefile | 54 | ||||
-rw-r--r-- | databases/prometheus/PLIST | 16 | ||||
-rw-r--r-- | databases/prometheus/distinfo | 7 | ||||
-rw-r--r-- | databases/prometheus/patches/patch-cmd_prometheus_main.go | 35 |
6 files changed, 120 insertions, 1 deletions
diff --git a/databases/Makefile b/databases/Makefile index 9573a156864..f8afe0d02bc 100644 --- a/databases/Makefile +++ b/databases/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.575 2019/03/05 15:55:13 taca Exp $ +# $NetBSD: Makefile,v 1.576 2019/03/17 12:55:13 tm Exp $ COMMENT= Databases @@ -332,6 +332,7 @@ SUBDIR+= postgresql96-plperl SUBDIR+= postgresql96-plpython SUBDIR+= postgresql96-pltcl SUBDIR+= postgresql96-server +SUBDIR+= prometheus SUBDIR+= pxtools SUBDIR+= py-PgSQL SUBDIR+= py-alembic diff --git a/databases/prometheus/DESCR b/databases/prometheus/DESCR new file mode 100644 index 00000000000..90b87fae373 --- /dev/null +++ b/databases/prometheus/DESCR @@ -0,0 +1,6 @@ +The Prometheus monitoring system and time series database. + +Prometheus, a Cloud Native Computing Foundation project, is a systems and +service monitoring system. It collects metrics from configured targets at +given intervals, evaluates rule expressions, displays the results, and +can trigger alerts if some condition is observed to be true. diff --git a/databases/prometheus/Makefile b/databases/prometheus/Makefile new file mode 100644 index 00000000000..aa2b3b045a1 --- /dev/null +++ b/databases/prometheus/Makefile @@ -0,0 +1,54 @@ +# $NetBSD: Makefile,v 1.1 2019/03/17 12:55:13 tm Exp $ + +DISTNAME= prometheus-2.8.0 +MASTER_SITES= ${MASTER_SITE_GITHUB:=prometheus/} +CATEGORIES= databases +GITHUB_TAG= v${PKGVERSION_NOREV} + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= https://github.com/prometheus/prometheus +COMMENT= The Prometheus monitoring system and time series database +LICENSE= apache-2.0 + +GO_DIST_BASE= ${DISTNAME} +GO_SRCPATH= github.com/prometheus/prometheus + +PKG_SYSCONFSUBDIR= prometheus + +USE_TOOLS+= pax +BUILD_DEFS+= VARBASE PKG_SYSCONFDIR + +SUBST_CLASSES+= paths +SUBST_FILES.paths+= cmd/prometheus/main.go +SUBST_SED.paths+= -e "s|@VARBASE@|${VARBASE}|g" +SUBST_SED.paths+= -e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g" +SUBST_STAGE.paths= post-configure + +MAKE_DIRS+= ${PKG_SYSCONFDIR}/consoles ${PKG_SYSCONFDIR}/console_libraries +EXAMPLE_DIR= share/examples/prometheus +EXAMPLE_FILES= prometheus.yml +EXAMPLE_FILES+= consoles/index.html.example consoles/node-cpu.html \ + consoles/node-disk.html consoles/node-overview.html \ + consoles/node.html consoles/prometheus-overview.html \ + consoles/prometheus.html +EXAMPLE_FILES+= console_libraries/menu.lib console_libraries/prom.lib +INSTALLATION_DIRS+= ${PREFIX}/${EXAMPLE_DIR} + +.for f in ${EXAMPLE_FILES} +CONF_FILES+= ${EXAMPLE_DIR}/${f} ${PKG_SYSCONFDIR}/${f} +.endfor + +do-install: + ${INSTALL_DATA} ${WRKSRC}/documentation/examples/prometheus.yml ${DESTDIR}${PREFIX}/${EXAMPLE_DIR} + ${RUN} cd ${WRKDIR} && ${PAX} -rw bin ${DESTDIR}${PREFIX} + ${RUN} cd ${WRKSRC} && \ + ${PAX} -rw consoles ${DESTDIR}${PREFIX}/${EXAMPLE_DIR} && \ + ${PAX} -rw console_libraries ${DESTDIR}${PREFIX}/${EXAMPLE_DIR} + +post-install: +.for f in ${EXAMPLE_FILES} + ${CHMOD} ${NONBINMODE} ${DESTDIR}${PREFIX}/${EXAMPLE_DIR}/${f} +.endfor + +.include "../../lang/go/go-package.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/databases/prometheus/PLIST b/databases/prometheus/PLIST new file mode 100644 index 00000000000..2068fc881f8 --- /dev/null +++ b/databases/prometheus/PLIST @@ -0,0 +1,16 @@ +@comment $NetBSD: PLIST,v 1.1 2019/03/17 12:55:13 tm Exp $ +bin/adapter-usage +bin/example_write_adapter +bin/prometheus +bin/promtool +bin/remote_storage_adapter +share/examples/prometheus/console_libraries/menu.lib +share/examples/prometheus/console_libraries/prom.lib +share/examples/prometheus/consoles/index.html.example +share/examples/prometheus/consoles/node-cpu.html +share/examples/prometheus/consoles/node-disk.html +share/examples/prometheus/consoles/node-overview.html +share/examples/prometheus/consoles/node.html +share/examples/prometheus/consoles/prometheus-overview.html +share/examples/prometheus/consoles/prometheus.html +share/examples/prometheus/prometheus.yml diff --git a/databases/prometheus/distinfo b/databases/prometheus/distinfo new file mode 100644 index 00000000000..7c5862e72c2 --- /dev/null +++ b/databases/prometheus/distinfo @@ -0,0 +1,7 @@ +$NetBSD: distinfo,v 1.1 2019/03/17 12:55:13 tm Exp $ + +SHA1 (prometheus-2.8.0.tar.gz) = 3a4ce194b0db6670c33110d390cb3770c53b51e4 +RMD160 (prometheus-2.8.0.tar.gz) = 36cf8d13bde68c1f295ad96a8abc825a44c49d0c +SHA512 (prometheus-2.8.0.tar.gz) = 9b0b0679768a9426547b232a87a3109008c28a59ef74b9376f192209c4005c7f18d622601ebef14516786378c5f014f6734a4e1a7929ffc0b9b7c369d28030eb +Size (prometheus-2.8.0.tar.gz) = 11097030 bytes +SHA1 (patch-cmd_prometheus_main.go) = 51f608ee8bb399f1145b0e8fcdc586ef1b3ba9c9 diff --git a/databases/prometheus/patches/patch-cmd_prometheus_main.go b/databases/prometheus/patches/patch-cmd_prometheus_main.go new file mode 100644 index 00000000000..7c8fa7ee091 --- /dev/null +++ b/databases/prometheus/patches/patch-cmd_prometheus_main.go @@ -0,0 +1,35 @@ +$NetBSD: patch-cmd_prometheus_main.go,v 1.1 2019/03/17 12:55:13 tm Exp $ + +Add prefix for SYSCONFDIR and VARBASE to store configuration file and metrics data at the correct location. + +--- cmd/prometheus/main.go.orig 2019-03-12 04:09:20.000000000 +0000 ++++ cmd/prometheus/main.go +@@ -133,7 +133,7 @@ func main() { + a.HelpFlag.Short('h') + + a.Flag("config.file", "Prometheus configuration file path."). +- Default("prometheus.yml").StringVar(&cfg.configFile) ++ Default("@PKG_SYSCONFDIR@/prometheus.yml").StringVar(&cfg.configFile) + + a.Flag("web.listen-address", "Address to listen on for UI, API, and telemetry."). + Default("0.0.0.0:9090").StringVar(&cfg.web.ListenAddress) +@@ -163,16 +163,16 @@ func main() { + Default("false").BoolVar(&cfg.web.EnableAdminAPI) + + a.Flag("web.console.templates", "Path to the console template directory, available at /consoles."). +- Default("consoles").StringVar(&cfg.web.ConsoleTemplatesPath) ++ Default("@PKG_SYSCONFDIR@/consoles").StringVar(&cfg.web.ConsoleTemplatesPath) + + a.Flag("web.console.libraries", "Path to the console library directory."). +- Default("console_libraries").StringVar(&cfg.web.ConsoleLibrariesPath) ++ Default("@PKG_SYSCONFDIR@/console_libraries").StringVar(&cfg.web.ConsoleLibrariesPath) + + a.Flag("web.page-title", "Document title of Prometheus instance."). + Default("Prometheus Time Series Collection and Processing Server").StringVar(&cfg.web.PageTitle) + + a.Flag("storage.tsdb.path", "Base path for metrics storage."). +- Default("data/").StringVar(&cfg.localStoragePath) ++ Default("@VARBASE@/lib/prometheus/data/").StringVar(&cfg.localStoragePath) + + a.Flag("storage.tsdb.min-block-duration", "Minimum duration of a data block before being persisted. For use in testing."). + Hidden().Default("2h").SetValue(&cfg.tsdb.MinBlockDuration) |