From 106bed3d77207bd15e67fa8bc95d4c509bfe934b Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Fri, 6 Nov 2015 14:30:04 +0000 Subject: [PATCH] OpenTSDB is a distributed, scalable Time Series Database (TSDB) written on top of HBase. OpenTSDB was written to address a common need: store, index and serve metrics collected from computer systems (network gear, operating systems, applications) at a large scale, and make this data easily accessible and graphable. WWW: http://www.opentsdb.net Differential Revision: https://reviews.freebsd.org/D4083 --- databases/Makefile | 1 + databases/opentsdb/Makefile | 58 +++++++++++++++++++ databases/opentsdb/distinfo | 2 + databases/opentsdb/files/opentsdb.in | 31 ++++++++++ databases/opentsdb/files/patch-Makefile.in | 20 +++++++ databases/opentsdb/files/patch-configure | 11 ++++ .../files/patch-src_utils_Config.java | 10 ++++ databases/opentsdb/pkg-descr | 7 +++ databases/opentsdb/pkg-plist | 47 +++++++++++++++ 9 files changed, 187 insertions(+) create mode 100644 databases/opentsdb/Makefile create mode 100644 databases/opentsdb/distinfo create mode 100644 databases/opentsdb/files/opentsdb.in create mode 100644 databases/opentsdb/files/patch-Makefile.in create mode 100644 databases/opentsdb/files/patch-configure create mode 100644 databases/opentsdb/files/patch-src_utils_Config.java create mode 100644 databases/opentsdb/pkg-descr create mode 100644 databases/opentsdb/pkg-plist diff --git a/databases/Makefile b/databases/Makefile index cf2aa20ea309..bc4f7b98c8c9 100644 --- a/databases/Makefile +++ b/databases/Makefile @@ -244,6 +244,7 @@ SUBDIR += openark-kit SUBDIR += openbase-jdbc SUBDIR += opendbx + SUBDIR += opentsdb SUBDIR += oracle7-client SUBDIR += oracle8-client SUBDIR += oracle_odbc_driver diff --git a/databases/opentsdb/Makefile b/databases/opentsdb/Makefile new file mode 100644 index 000000000000..30f56b59c8ec --- /dev/null +++ b/databases/opentsdb/Makefile @@ -0,0 +1,58 @@ +# Created by: Johannes Meixner +# $FreeBSD$ + +PORTNAME= opentsdb +PORTVERSION= 2.1.1 +CATEGORIES= databases java +MASTER_SITES= https://github.com/OpenTSDB/opentsdb/releases/download/${PORTVERSION}/ + +MAINTAINER= xmj@chaot.net +COMMENT= OpenTSDB is the Scalable Timeseries Database + +LICENSE= LGPL3 + +BUILD_DEPENDS= bash:${PORTSDIR}/shells/bash \ + curl:${PORTSDIR}/ftp/curl \ + gawk:${PORTSDIR}/lang/gawk +LIB_DEPENDS= libhadoop.so:${PORTSDIR}/devel/hadoop2 +RUN_DEPENDS= hbase>0:${PORTSDIR}/databases/hbase + +USES= gmake python +USE_JAVA= yes + +OPTIONS_DEFINE= GNUPLOT +OPTIONS_DEFAULT= GNUPLOT + +GNUPLOT_RUN_DEPENDS= gnuplot:${PORTSDIR}/math/gnuplot + +HAS_CONFIGURE= yes +MAKE_JOBS_UNSAFE= yes + +OPENTSDB_LOGDIR= /var/log/${PORTNAME} +OPENTSDB_RUNDIR= /var/run/${PORTNAME} + +OPENTSDB_USER= opentsdb +OPENTSDB_GROUP= opentsdb + +USERS= ${OPENTSDB_USER} +GROUPS= ${OPENTSDB_GROUP} + +USE_RC_SUBR= opentsdb + +SUB_LIST= OPENTSDB_USER="${OPENTSDB_USER}" \ + OPENTSDB_LOGDIR="${OPENTSDB_LOGDIR}" \ + OPENTSDB_RUNDIR="${OPENTSDB_RUNDIR}" + +post-patch: + ${REINPLACE_CMD} -i"" -e "s|python|${PYTHON_CMD}|" ${WRKSRC}/build-aux/gen_build_data.sh + ${REINPLACE_CMD} -i"" -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/Makefile.in + ${REINPLACE_CMD} -i"" -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/src/utils/Config.java + ${REINPLACE_CMD} -i"" -e "s|tsd.http.staticroot =|tsd.http.staticroot = ${DATADIR}/static|; s|tsd.http.cachedir =|tsd.http.cachedir = /tmp/opentsdb|; s|tsd.network.port =|tsd.network.port = 4242|;" ${WRKSRC}/src/opentsdb.conf + +post-install: + ${MKDIR} ${STAGEDIR}${ETCDIR} ${STAGEDIR}${OPENTSDB_LOGDIR} ${STAGEDIR}${OPENTSDB_RUNDIR} + ${INSTALL_DATA} ${WRKSRC}/src/logback.xml ${STAGEDIR}${ETCDIR} + ${INSTALL_DATA} ${WRKSRC}/src/opentsdb.conf ${STAGEDIR}${ETCDIR}/opentsdb.conf.sample + (cd "${STAGEDIR}${PREFIX}"; ${FIND} -s share/${PORTNAME}/static -name \*cache.html) >> ${TMPPLIST} + +.include diff --git a/databases/opentsdb/distinfo b/databases/opentsdb/distinfo new file mode 100644 index 000000000000..75cf3d84450e --- /dev/null +++ b/databases/opentsdb/distinfo @@ -0,0 +1,2 @@ +SHA256 (opentsdb-2.1.1.tar.gz) = 2b091fd59941a5af21f8fb5195025f541e15d83853f78e1b0ab90db4f36e8b9f +SIZE (opentsdb-2.1.1.tar.gz) = 74609397 diff --git a/databases/opentsdb/files/opentsdb.in b/databases/opentsdb/files/opentsdb.in new file mode 100644 index 000000000000..3c6c73573742 --- /dev/null +++ b/databases/opentsdb/files/opentsdb.in @@ -0,0 +1,31 @@ +#!/bin/sh - +# Copyright (c) 2015 Johannes Meixner + +# PROVIDE: opentsdb +# REQUIRE: LOGIN +# KEYWORD: shutdown +# opentsdb_enable (bool): Set to NO by default. +# Set it to YES to enable OpenTSDB + +. /etc/rc.subr + +export PATH=${PATH}:%%PREFIX%%/bin + +name=opentsdb +rcvar=opentsdb_enable + +load_rc_config "${name}" + +: ${opentsdb_enable:=NO} +: ${opentsdb_user:=opentsdb} +: ${opentsdb_opts:=tsd 2> %%OPENTSDB_LOGDIR%%/error.log 1> %%OPENTSDB_LOGDIR%%/tsdb.log} + +pidfile="%%OPENTSDB_RUNDIR%%/${name}.pid" +opentsdb_daemon="%%PREFIX%%/bin/tsdb" +procname="daemon*" + +command="/usr/sbin/daemon" +command_args="-P ${pidfile} ${opentsdb_daemon} ${opentsdb_opts}" + +run_rc_command "$1" + diff --git a/databases/opentsdb/files/patch-Makefile.in b/databases/opentsdb/files/patch-Makefile.in new file mode 100644 index 000000000000..35542639b5d3 --- /dev/null +++ b/databases/opentsdb/files/patch-Makefile.in @@ -0,0 +1,20 @@ +--- Makefile.in.orig 2015-09-12 19:49:17 UTC ++++ Makefile.in +@@ -1415,7 +1415,7 @@ printdeps: + # This is kind of a hack, but I couldn't find a better way to adjust the paths + # in the script before it gets installed... + install-exec-hook: +- script=tsdb; pkgdatadir='$(pkgdatadir)'; configdir='$(pkgdatadir)/etc/opentsdb'; \ ++ script=tsdb; pkgdatadir='$(pkgdatadir)'; configdir='/usr/local/etc/opentsdb'; \ + abs_srcdir=''; abs_builddir=''; $(edit_tsdb_script) + cat tsdb.tmp >"$(DESTDIR)$(bindir)/tsdb" + rm -f tsdb.tmp +@@ -1468,7 +1468,7 @@ gwttsd: staticroot + # how to tell it to install a bunch of files recursively for which I don't + # know ahead of time what the file names are. + install-data-local: staticroot install-data-lib install-data-tools \ +- install-data-bin install-data-etc ++ install-data-bin + @$(NORMAL_INSTALL) + test -z "$(staticdir)" || $(mkdir_p) "$(DESTDIR)$(staticdir)" + @set -e; pwd; ls -lFh; cd "$(DEV_TSD_STATICROOT)"; \ diff --git a/databases/opentsdb/files/patch-configure b/databases/opentsdb/files/patch-configure new file mode 100644 index 000000000000..b5dccb05c8a1 --- /dev/null +++ b/databases/opentsdb/files/patch-configure @@ -0,0 +1,11 @@ +--- configure.orig 2015-09-12 19:49:18 UTC ++++ configure +@@ -1714,7 +1714,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_aux_dir= +-for ac_dir in build-aux "$srcdir"/build-aux; do ++for ac_dir in `pwd`/build-aux; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" diff --git a/databases/opentsdb/files/patch-src_utils_Config.java b/databases/opentsdb/files/patch-src_utils_Config.java new file mode 100644 index 000000000000..21968e9a2a76 --- /dev/null +++ b/databases/opentsdb/files/patch-src_utils_Config.java @@ -0,0 +1,10 @@ +--- src/utils/Config.java.orig 2015-11-04 10:25:48 UTC ++++ src/utils/Config.java +@@ -509,6 +509,7 @@ public class Config { + } else { + file_locations.add("/etc/opentsdb.conf"); + file_locations.add("/etc/opentsdb/opentsdb.conf"); ++ file_locations.add("%%PREFIX%%/etc/opentsdb/opentsdb.conf"); + file_locations.add("/opt/opentsdb/opentsdb.conf"); + } + diff --git a/databases/opentsdb/pkg-descr b/databases/opentsdb/pkg-descr new file mode 100644 index 000000000000..cf696c5e1fb3 --- /dev/null +++ b/databases/opentsdb/pkg-descr @@ -0,0 +1,7 @@ +OpenTSDB is a distributed, scalable Time Series Database (TSDB) written +on top of HBase. OpenTSDB was written to address a common need: store, +index and serve metrics collected from computer systems (network gear, +operating systems, applications) at a large scale, and make this data +easily accessible and graphable. + +WWW: http://www.opentsdb.net diff --git a/databases/opentsdb/pkg-plist b/databases/opentsdb/pkg-plist new file mode 100644 index 000000000000..0371916f605e --- /dev/null +++ b/databases/opentsdb/pkg-plist @@ -0,0 +1,47 @@ +bin/tsdb +%%DATADIR%%/bin/mygnuplot.bat +%%DATADIR%%/bin/mygnuplot.sh +%%DATADIR%%/bin/tsdb +%%DATADIR%%/lib/async-1.4.0.jar +%%DATADIR%%/lib/asynchbase-1.6.0.jar +%%DATADIR%%/lib/guava-18.0.jar +%%DATADIR%%/lib/jackson-annotations-2.4.3.jar +%%DATADIR%%/lib/jackson-core-2.4.3.jar +%%DATADIR%%/lib/jackson-databind-2.4.3.jar +%%DATADIR%%/lib/log4j-over-slf4j-1.7.7.jar +%%DATADIR%%/lib/logback-classic-1.0.13.jar +%%DATADIR%%/lib/logback-core-1.0.13.jar +%%DATADIR%%/lib/netty-3.9.4.Final.jar +%%DATADIR%%/lib/protobuf-java-2.5.0.jar +%%DATADIR%%/lib/slf4j-api-1.7.7.jar +%%DATADIR%%/lib/tsdb-2.1.1.jar +%%DATADIR%%/lib/zookeeper-3.3.6.jar +%%DATADIR%%/static/clear.cache.gif +%%DATADIR%%/static/favicon.ico +%%DATADIR%%/static/gwt/standard/images/corner.png +%%DATADIR%%/static/gwt/standard/images/corner_ie6.png +%%DATADIR%%/static/gwt/standard/images/hborder.png +%%DATADIR%%/static/gwt/standard/images/hborder_ie6.png +%%DATADIR%%/static/gwt/standard/images/ie6/corner_dialog_topleft.png +%%DATADIR%%/static/gwt/standard/images/ie6/corner_dialog_topright.png +%%DATADIR%%/static/gwt/standard/images/ie6/hborder_blue_shadow.png +%%DATADIR%%/static/gwt/standard/images/ie6/hborder_gray_shadow.png +%%DATADIR%%/static/gwt/standard/images/ie6/vborder_blue_shadow.png +%%DATADIR%%/static/gwt/standard/images/ie6/vborder_gray_shadow.png +%%DATADIR%%/static/gwt/standard/images/splitPanelThumb.png +%%DATADIR%%/static/gwt/standard/images/vborder.png +%%DATADIR%%/static/gwt/standard/images/vborder_ie6.png +%%DATADIR%%/static/gwt/standard/standard.css +%%DATADIR%%/static/gwt/standard/standard_rtl.css +%%DATADIR%%/static/hosted.html +%%DATADIR%%/static/queryui.nocache.js +%%DATADIR%%/tools/check_tsd +%%DATADIR%%/tools/clean_cache.sh +%%DATADIR%%/tools/create_table.sh +%%DATADIR%%/tools/opentsdb_restart.py +%%DATADIR%%/tools/tsddrain.py +%%DATADIR%%/tools/upgrade_1to2.sh +%%ETCDIR%%/logback.xml +@sample %%ETCDIR%%/opentsdb.conf.sample +@dir(opentsdb,opentsdb,750) /var/log/opentsdb +@dir(opentsdb,opentsdb,750) /var/run/opentsdb