Skip to content

Commit

Permalink
influxdb: Import version 1.7.6.
Browse files Browse the repository at this point in the history
InfluxDB is an open source time series database with no external
dependencies.  It is useful for recording metrics, events, and
performing analytics.

Patches and testing provided by Bill Welliver in TritonDataCenter#194
  • Loading branch information
jperkin committed May 15, 2019
1 parent c998df6 commit 2a25149
Show file tree
Hide file tree
Showing 9 changed files with 732 additions and 0 deletions.
14 changes: 14 additions & 0 deletions databases/influxdb/DESCR
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
InfluxDB is an open source time series database with no external
dependencies. It's useful for recording metrics, events, and performing
analytics.

Features:

* Built-in HTTP API so you don't have to write any server side code to
get up and running.
* Data can be tagged, allowing very flexible querying.
* SQL-like query language.
* Simple to install and manage, and fast to get data in and out.
* It aims to answer queries in real-time. That means every data point
is indexed as it comes in and is immediately available in queries
that should return in < 100ms.
85 changes: 85 additions & 0 deletions databases/influxdb/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# $NetBSD: Makefile,v 1.1 2019/05/15 18:03:33 jperkin Exp $

DISTNAME= influxdb-1.7.6
MASTER_SITES= ${MASTER_SITE_GITHUB:=influxdata/}
CATEGORIES= databases
GITHUB_PROJECT= influxdb
GITHUB_TAG= v${PKGVERSION_NOREV}

MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= https://github.com/influxdata/influxdb
COMMENT= Scalable datastore for metrics, events, and real-time analytics
LICENSE= mit

BUILD_DEPENDS+= asciidoc-[0-9]*:../../textproc/asciidoc
BUILD_DEPENDS+= xmlto-[0-9]*:../../textproc/xmlto

USE_TOOLS+= gmake

GO_DIST_BASE= ${DISTNAME}
GO_SRCPATH= github.com/influxdata/influxdb

PKG_SYSCONFSUBDIR= influxdb

DATADIR= ${VARBASE}/lib/influxdb
LOGDIR= ${VARBASE}/log/influxdb

BUILD_DEFS+= INFLUXDB_USER INFLUXDB_GROUP VARBASE
FILES_SUBST+= INFLUXDB_USER=${INFLUXDB_USER:Q}
FILES_SUBST+= INFLUXDB_GROUP=${INFLUXDB_GROUP:Q}
FILES_SUBST+= DATADIR=${DATADIR:Q}
FILES_SUBST+= LOGDIR=${LOGDIR:Q}

INFLUXDB_USER?= influxdb
INFLUXDB_GROUP?= influxdb
OWN_DIRS_PERMS+= ${DATADIR} ${INFLUXDB_USER} ${INFLUXDB_GROUP} 0700
OWN_DIRS_PERMS+= ${LOGDIR} ${INFLUXDB_USER} ${INFLUXDB_GROUP} 0700
PKG_USERS_VARS+= INFLUXDB_USER
PKG_GROUPS_VARS+= INFLUXDB_GROUP
PKG_GROUPS= ${INFLUXDB_GROUP}
PKG_USERS= ${INFLUXDB_USER}:${INFLUXDB_GROUP}
RCD_SCRIPTS= influxdb

INSTALLATION_DIRS+= bin ${PKGMANDIR}/man1
INSTALLATION_DIRS+= share/doc/influxdb share/examples/influxdb

DOC_FILES+= LICENSE DEPENDENCIES.md QUERIES.md README.md CHANGELOG.md
BIN_FILES+= influx influx_inspect influx_stress influx_tsm influxd
BIN_FILES+= stress_test_server test_client
CONF_FILES+= ${PREFIX}/share/examples/${PKGBASE}/config.sample.toml \
${PKG_SYSCONFDIR}/config.toml

.include "go-deps.mk"

INFLUX_GO_FLAGS= -s
INFLUX_GO_FLAGS+= -X main.version=${PKGVERSION_NOREV}
INFLUX_GO_FLAGS+= -X main.commit=${GITHUB_TAG}
INFLUX_GO_FLAGS+= -X main.buildstamp=pkgsrc

do-build:
${RUN} ${PKGSRC_SETENV} ${MAKE_ENV} \
${GO} build -ldflags "${INFLUX_GO_FLAGS}" ${GO_BUILD_PATTERN}
${RUN} ${PKGSRC_SETENV} ${MAKE_ENV} \
${GO} install -ldflags "${INFLUX_GO_FLAGS}" ${GO_BUILD_PATTERN}
${RUN} cd ${WRKSRC}/man && ${PKGSRC_SETENV} ${MAKE_ENV} ${GMAKE}
${RUN} ${SED} \
-e 's,/var,${VARBASE},g' \
-e 's,^# reporting.*,reporting-disabled = true,g' \
${WRKSRC}/etc/config.sample.toml >${WRKDIR}/.config.toml

do-install:
for manpage in ${WRKSRC}/man/*.1; do \
${INSTALL_MAN} $$manpage ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1; \
done
.for x in ${BIN_FILES}
${INSTALL_PROGRAM} ${WRKDIR}/bin/${x} \
${DESTDIR}${PREFIX}/bin/${x}
.endfor
.for x in ${DOC_FILES}
${INSTALL_DATA} ${WRKSRC}/${x} \
${DESTDIR}${PREFIX}/share/doc/influxdb/${x}
.endfor
${INSTALL_DATA} ${WRKSRC}/etc/config.sample.toml ${DESTDIR}${PREFIX}/share/examples/${PKGBASE}

.include "../../lang/go/go-package.mk"
.include "../../mk/bsd.pkg.mk"
26 changes: 26 additions & 0 deletions databases/influxdb/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@comment $NetBSD: PLIST,v 1.1 2019/05/15 18:03:33 jperkin Exp $
bin/influx
bin/influx_inspect
bin/influx_stress
bin/influx_tsm
bin/influxd
bin/stress_test_server
bin/test_client
man/man1/influx.1
man/man1/influx_inspect.1
man/man1/influx_stress.1
man/man1/influx_tsm.1
man/man1/influxd-backup.1
man/man1/influxd-config.1
man/man1/influxd-restore.1
man/man1/influxd-run.1
man/man1/influxd-version.1
man/man1/influxd.1
share/doc/influxdb/CHANGELOG.md
share/doc/influxdb/DEPENDENCIES.md
share/doc/influxdb/LICENSE
share/doc/influxdb/QUERIES.md
share/doc/influxdb/README.md
share/examples/influxdb/config.sample.toml
@pkgdir man1
@pkgdir etc/influxdb
364 changes: 364 additions & 0 deletions databases/influxdb/distinfo

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions databases/influxdb/files/influxdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!@RCD_SCRIPTS_SHELL@

# PROVIDE: influxdb
# REQUIRE: DAEMON
# KEYWORD: shutdown

if [ -f /etc/rc.subr ]
then
. /etc/rc.subr
fi

name="influxdb"
rcvar=$name
influxdb_user="@INFLUXDB_USER@"
influxdb_group="@INFLUXDB_GROUP@"
influxdb_chdir="@VARBASE@/lib/influxdb"
pidfile="@VARBASE@/lib/influxdb/data/influxdb.pid"
STDERR="@LOGDIR@/influxdb.log"
command="@PREFIX@/bin/influxd"
command_args="-config @PREFIX@/etc/influxdb/config.toml -pidfile ${pidfile} 1>/dev/null 2>> $STDERR &"

load_rc_config $name
run_rc_command "$1"
39 changes: 39 additions & 0 deletions databases/influxdb/files/smf/manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='@SMF_NAME@:default'>
<service name='@SMF_PREFIX@/@SMF_NAME@' type='service' version='1'>
<create_default_instance enabled='false' />
<single_instance />
<dependency name='network' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/milestone/network:default' />
</dependency>
<dependency name='fs-local' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/filesystem/local:default' />
</dependency>
<method_context working_directory="@DATADIR@">
<method_credential user='@INFLUXDB_USER@' group='@INFLUXDB_GROUP@' />
</method_context>
<exec_method type='method' name='start'
exec='@PREFIX@/bin/influxd -config @PKG_SYSCONFDIR@/config.toml -pidfile @DATADIR@/influxdb.pid 2>> @LOGDIR@/influxdb.log &amp;'
timeout_seconds="60" />
<exec_method type='method' name='stop' exec=':kill' timeout_seconds="60" />
<template>
<common_name>
<loctext xml:lang='C'>InfluxDB Time Series database</loctext>
</common_name>
<documentation>
<manpage title='influx' section='1' manpath='@PREFIX@/@PKGMANDIR@'/>
<manpage title='influx_inspect' section='1' manpath='@PREFIX@/@PKGMANDIR@'/>
<manpage title='influx_stress' section='1' manpath='@PREFIX@/@PKGMANDIR@'/>
<manpage title='influx_tsm' section='1' manpath='@PREFIX@/@PKGMANDIR@'/>
<manpage title='influxd-backup' section='1' manpath='@PREFIX@/@PKGMANDIR@'/>
<manpage title='influxd-config' section='1' manpath='@PREFIX@/@PKGMANDIR@'/>
<manpage title='influxd-restore' section='1' manpath='@PREFIX@/@PKGMANDIR@'/>
<manpage title='influxd-run' section='1' manpath='@PREFIX@/@PKGMANDIR@'/>
<manpage title='influxd-version' section='1' manpath='@PREFIX@/@PKGMANDIR@'/>
<manpage title='influxd' section='1' manpath='@PREFIX@/@PKGMANDIR@'/>
<doc_link name='homepage' uri='https://docs.influxdata.com/influxdb/' />
</documentation>
</template>
</service>
</service_bundle>
91 changes: 91 additions & 0 deletions databases/influxdb/go-deps.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# $NetBSD: go-deps.mk,v 1.1 2019/05/15 18:03:33 jperkin Exp $

GO_DEPS+= github.com/collectd/go-collectd:2ce14454:collectd.org
GO_DEPS+= github.com/BurntSushi/toml:a368813c
GO_DEPS+= github.com/Masterminds/semver:c7af1294
GO_DEPS+= github.com/alecthomas/kingpin:947dcec5
GO_DEPS+= github.com/alecthomas/template:a0175ee3
GO_DEPS+= github.com/alecthomas/units:2efee857
GO_DEPS+= github.com/apache/arrow:f5df7735
GO_DEPS+= github.com/apex/log:941dea75
GO_DEPS+= github.com/aws/aws-sdk-go:dd947f47
GO_DEPS+= github.com/beorn7/perks:3a771d99
GO_DEPS+= github.com/blakesmith/ar:8bd4349a
GO_DEPS+= github.com/bmizerany/pat:6226ea59
GO_DEPS+= github.com/boltdb/bolt:2f1ce7a8
GO_DEPS+= github.com/c-bata/go-prompt:e99fbc79
GO_DEPS+= github.com/caarlos0/ctrlc:70dc48d5
GO_DEPS+= github.com/campoy/unique:88950e53
GO_DEPS+= github.com/cespare/xxhash:5c37fe37
GO_DEPS+= github.com/davecgh/go-spew:346938d6
GO_DEPS+= github.com/dgrijalva/jwt-go:06ea1031
GO_DEPS+= github.com/dgryski/go-bitstream:3522498c
GO_DEPS+= github.com/fatih/color:570b54ca
GO_DEPS+= github.com/glycerine/go-unsnap-stream:9f0cb551
GO_DEPS+= github.com/go-ini/ini:7b294651
GO_DEPS+= github.com/go-sql-driver/mysql:72cd26f2
GO_DEPS+= github.com/gogo/protobuf:636bf030
GO_DEPS+= github.com/golang/protobuf:b4deda09
GO_DEPS+= github.com/golang/snappy:d9eb7a3d
GO_DEPS+= github.com/google/go-cmp:3af367b6
GO_DEPS+= github.com/google/go-github:dd29b543
GO_DEPS+= github.com/google/go-querystring:44c6ddd0
GO_DEPS+= github.com/goreleaser/goreleaser:f99940ff
GO_DEPS+= github.com/goreleaser/nfpm:de75d679
GO_DEPS+= github.com/imdario/mergo:9f23e2d6
GO_DEPS+= github.com/influxdata/flux:bcfc535f
GO_DEPS+= github.com/influxdata/influxql:1cbfca8e
GO_DEPS+= github.com/influxdata/line-protocol:a3afd890
GO_DEPS+= github.com/influxdata/roaring:fc520f41
GO_DEPS+= github.com/influxdata/tdigest:bf2b5ad3
GO_DEPS+= github.com/influxdata/usage-client:6d389537
GO_DEPS+= github.com/jmespath/go-jmespath:0b12d6b5
GO_DEPS+= github.com/jsternberg/zap-logfmt:ac4bd917
GO_DEPS+= github.com/jwilder/encoding:b4e1701a
GO_DEPS+= github.com/kisielk/gotool:80517062
GO_DEPS+= github.com/klauspost/compress:b939724e
GO_DEPS+= github.com/klauspost/cpuid:ae7887de
GO_DEPS+= github.com/klauspost/crc32:cb6bfca9
GO_DEPS+= github.com/klauspost/pgzip:0bf5dcad
GO_DEPS+= github.com/lib/pq:4ded0e93
GO_DEPS+= github.com/mattn/go-colorable:167de6bf
GO_DEPS+= github.com/mattn/go-isatty:6ca4dbf5
GO_DEPS+= github.com/mattn/go-runewidth:9e777a83
GO_DEPS+= github.com/mattn/go-tty:13ff1204
GO_DEPS+= github.com/mattn/go-zglob:2ea3427b
GO_DEPS+= github.com/matttproud/golang_protobuf_extensions:c12348ce
GO_DEPS+= github.com/mitchellh/go-homedir:ae18d6b8
GO_DEPS+= github.com/mschoch/smat:90eadee7
GO_DEPS+= github.com/opentracing/opentracing-go:bd9c3193
GO_DEPS+= github.com/paulbellamy/ratecounter:524851a9
GO_DEPS+= github.com/peterh/liner:8c1271fc
GO_DEPS+= github.com/philhofer/fwd:bb6d471d
GO_DEPS+= github.com/pkg/errors:645ef004
GO_DEPS+= github.com/pkg/term:bffc007b
GO_DEPS+= github.com/prometheus/client_golang:661e31bf
GO_DEPS+= github.com/prometheus/client_model:5c3871d8
GO_DEPS+= github.com/prometheus/common:7600349d
GO_DEPS+= github.com/prometheus/procfs:ae68e2d4
GO_DEPS+= github.com/retailnext/hllpp:101a6d2f
GO_DEPS+= github.com/satori/go.uuid:f58768cc
GO_DEPS+= github.com/segmentio/kafka-go:0b3aacc5
GO_DEPS+= github.com/spf13/cast:8c9545af
GO_DEPS+= github.com/tinylib/msgp:b2b6a672
GO_DEPS+= github.com/willf/bitset:d860f346
GO_DEPS+= github.com/xlab/treeprint:d6fb6747
GO_DEPS+= github.com/uber-go/atomic:1ea20fb1:go.uber.org/atomic
GO_DEPS+= github.com/uber-go/multierr:3c493748:go.uber.org/multierr
GO_DEPS+= github.com/uber-go/zap:4d45f961:go.uber.org/zap
GO_DEPS+= github.com/golang/crypto:a2144134:golang.org/x/crypto
GO_DEPS+= github.com/golang/net:a680a1ef:golang.org/x/net
GO_DEPS+= github.com/golang/oauth2:c57b0fac:golang.org/x/oauth2
GO_DEPS+= github.com/golang/sync:1d60e460:golang.org/x/sync
GO_DEPS+= github.com/golang/sys:ac767d65:golang.org/x/sys
GO_DEPS+= github.com/golang/text:f21a4dfb:golang.org/x/text
GO_DEPS+= github.com/golang/time:fbb02b22:golang.org/x/time
GO_DEPS+= github.com/golang/tools:45ff765b:golang.org/x/tools
GO_DEPS+= github.com/golang/appengine:ae0ab99d:google.golang.org/appengine
GO_DEPS+= github.com/google/go-genproto:fedd2861:google.golang.org/genproto
GO_DEPS+= github.com/grpc/grpc-go:168a6198:google.golang.org/grpc
GO_DEPS+= github.com/go-yaml/yaml:5420a8b6:gopkg.in/yaml.v2
GO_DEPS+= github.com/dominikh/go-tools:d73ab98e:honnef.co/go/tools
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$NetBSD: patch-.._.._pkg_term_termios_ioctl__solaris.go,v 1.1 2019/05/15 18:03:34 jperkin Exp $

Apply SunOS fix from https://github.com/pkg/term/pull/41

--- ../../pkg/term/termios/ioctl_solaris.go.orig 2018-07-30 02:16:39.000000000 +0000
+++ ../../pkg/term/termios/ioctl_solaris.go
@@ -3,5 +3,5 @@ package termios
import "golang.org/x/sys/unix"

func ioctl(fd, request, argp uintptr) error {
- return unix.IoctlSetInt(int(fd), int(request), int(argp))
+ return unix.IoctlSetInt(int(fd), uint(request), int(argp))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
$NetBSD: patch-.._.._pkg_term_termios_termios__solaris.go,v 1.1 2019/05/15 18:03:34 jperkin Exp $

Apply SunOS fix from https://github.com/pkg/term/pull/41

--- ../../pkg/term/termios/termios_solaris.go.orig 2019-04-25 03:19:22.118815385 +0000
+++ ../../pkg/term/termios/termios_solaris.go
@@ -31,13 +31,13 @@ const FIORDCHK = C.FIORDCHK
// Tcgetattr gets the current serial port settings.
func Tcgetattr(fd uintptr, argp *syscall.Termios) error {
termios, err := unix.IoctlGetTermios(int(fd), unix.TCGETS)
- *argp = syscall.Termios(*termios)
+ *argp = *(tiosToSyscall(termios))
return err
}

// Tcsetattr sets the current serial port settings.
func Tcsetattr(fd, action uintptr, argp *syscall.Termios) error {
- return unix.IoctlSetTermios(int(fd), int(action), (*unix.Termios)(argp))
+ return unix.IoctlSetTermios(int(fd), uint(action), tiosToUnix(argp))
}

// Tcsendbreak transmits a continuous stream of zero-valued bits for a specific
@@ -77,26 +77,50 @@ func Tiocoutq(fd uintptr, argp *int) err

// Cfgetispeed returns the input baud rate stored in the termios structure.
func Cfgetispeed(attr *syscall.Termios) uint32 {
- solTermios := (*unix.Termios)(attr)
+ solTermios := tiosToUnix(attr)
return uint32(C.cfgetispeed((*C.termios_t)(unsafe.Pointer(solTermios))))
}

// Cfsetispeed sets the input baud rate stored in the termios structure.
func Cfsetispeed(attr *syscall.Termios, speed uintptr) error {
- solTermios := (*unix.Termios)(attr)
+ solTermios := tiosToUnix(attr)
_, err := C.cfsetispeed((*C.termios_t)(unsafe.Pointer(solTermios)), C.speed_t(speed))
return err
}

// Cfgetospeed returns the output baud rate stored in the termios structure.
func Cfgetospeed(attr *syscall.Termios) uint32 {
- solTermios := (*unix.Termios)(attr)
+ solTermios := tiosToUnix(attr)
return uint32(C.cfgetospeed((*C.termios_t)(unsafe.Pointer(solTermios))))
}

// Cfsetospeed sets the output baud rate stored in the termios structure.
func Cfsetospeed(attr *syscall.Termios, speed uintptr) error {
- solTermios := (*unix.Termios)(attr)
+ solTermios := tiosToUnix(attr)
_, err := C.cfsetospeed((*C.termios_t)(unsafe.Pointer(solTermios)), C.speed_t(speed))
return err
}
+
+// tiosToUnix copies a syscall.Termios to a x/sys/unix.Termios.
+// This is needed since type conversions between the two fail due to
+// more recent x/sys/unix.Termios renaming the padding field.
+func tiosToUnix(st *syscall.Termios) *unix.Termios {
+ return &unix.Termios{
+ Iflag: st.Iflag,
+ Oflag: st.Oflag,
+ Cflag: st.Cflag,
+ Lflag: st.Lflag,
+ Cc: st.Cc,
+ }
+}
+
+// tiosToSyscall copies a x/sys/unix.Termios to a syscall.Termios.
+func tiosToSyscall(ut *unix.Termios) *syscall.Termios {
+ return &syscall.Termios{
+ Iflag: ut.Iflag,
+ Oflag: ut.Oflag,
+ Cflag: ut.Cflag,
+ Lflag: ut.Lflag,
+ Cc: ut.Cc,
+ }
+}

0 comments on commit 2a25149

Please sign in to comment.