Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Jul 2021 21:29:03 GMT
From:      Li-Wen Hsu <lwhsu@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 71a09abcf55d - main - databases/metabase: (New) Simple and powerful analytics tool that supports multiple data stores
Message-ID:  <202107312129.16VLT3DP032341@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by lwhsu:

URL: https://cgit.FreeBSD.org/ports/commit/?id=71a09abcf55da3469921ea4154bd704183c23372

commit 71a09abcf55da3469921ea4154bd704183c23372
Author:     Daniel Morante <daniel@morante.net>
AuthorDate: 2021-07-31 21:27:19 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2021-07-31 21:28:47 +0000

    databases/metabase: (New) Simple and powerful analytics tool that supports multiple data stores
    
    PR:             257304
---
 databases/Makefile                      |  1 +
 databases/metabase/Makefile             | 41 ++++++++++++++++++++
 databases/metabase/distinfo             |  3 ++
 databases/metabase/files/metabase.conf  | 26 +++++++++++++
 databases/metabase/files/metabase.in    | 69 +++++++++++++++++++++++++++++++++
 databases/metabase/files/pkg-message.in | 18 +++++++++
 databases/metabase/pkg-descr            |  9 +++++
 7 files changed, 167 insertions(+)

diff --git a/databases/Makefile b/databases/Makefile
index 8f4ab7c02a88..2844c19b287c 100644
--- a/databases/Makefile
+++ b/databases/Makefile
@@ -192,6 +192,7 @@
     SUBDIR += mdbx
     SUBDIR += mdcached
     SUBDIR += memcached
+    SUBDIR += metabase
     SUBDIR += mongodb-tools
     SUBDIR += mongodb36
     SUBDIR += mongodb36-tools
diff --git a/databases/metabase/Makefile b/databases/metabase/Makefile
new file mode 100644
index 000000000000..84b4418d38f9
--- /dev/null
+++ b/databases/metabase/Makefile
@@ -0,0 +1,41 @@
+PORTNAME=	metabase
+DISTVERSIONPREFIX=	v
+DISTVERSION=	0.40.1
+CATEGORIES=	databases java
+MASTER_SITES=	https://downloads.metabase.com/${DISTVERSIONPREFIX}${PORTVERSION}/
+DISTNAME=	${PORTNAME}
+EXTRACT_SUFX=	.jar
+DIST_SUBDIR=	${PORTNAME}-${PORTVERSION}
+EXTRACT_ONLY=
+
+MAINTAINER=	daniel@morante.net
+COMMENT=	Simple and powerful analytics tool that supports multiple data stores
+
+LICENSE=	AGPLv3
+
+USE_JAVA=	yes
+JAVA_RUN=	yes
+USE_RC_SUBR=	${PORTNAME}
+
+NO_ARCH=	yes
+NO_BUILD=	yes
+
+SUB_FILES=	pkg-message
+SUB_LIST+=	PORTNAME=${PORTNAME} \
+		METABASEDATADIR=/var/db/${PORTNAME} \
+		METABASE_USER=${USERS} \
+		METABASE_GROUP=${GROUPS} \
+		JAVA_HOME=${JAVA_HOME}
+
+USERS=	www
+GROUPS=	www
+
+PLIST_FILES=	libexec/${PORTNAME}.jar "@sample etc/${PORTNAME}.conf.sample"
+
+do-install:
+	${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/${PORTNAME}.jar \
+		${STAGEDIR}${PREFIX}/libexec/${PORTNAME}.jar
+	${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.conf \
+		${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample
+
+.include <bsd.port.mk>
diff --git a/databases/metabase/distinfo b/databases/metabase/distinfo
new file mode 100644
index 000000000000..c1ff9286f085
--- /dev/null
+++ b/databases/metabase/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1626738677
+SHA256 (metabase-0.40.1/metabase.jar) = 972babb2ce60740729ba56323188bdf998e417dc1d9bac5642d7a429e4a793b1
+SIZE (metabase-0.40.1/metabase.jar) = 270293188
diff --git a/databases/metabase/files/metabase.conf b/databases/metabase/files/metabase.conf
new file mode 100644
index 000000000000..e88a290d3fbd
--- /dev/null
+++ b/databases/metabase/files/metabase.conf
@@ -0,0 +1,26 @@
+# Metabase configuration file
+#
+# See https://www.metabase.com/docs/latest/operations-guide/start.html
+# for a full listing of all configurable options.
+
+# User password complexity and min length, <weak|normal|strong>
+#MB_PASSWORD_COMPLEXITY=normal
+#MB_PASSWORD_LENGTH=10
+
+# By default Metabase will listen on localhost on port 3000.
+#MB_JETTY_HOST=0.0.0.0
+#MB_JETTY_PORT=3000
+
+# Default config database is built-in H2.  Use any one of <postgres|mysql|h2>
+#MB_DB_TYPE=postgres
+
+# If using a diffrent config database specify the name, port, user, pass, and host
+#MB_DB_DBNAME=metabase
+#MB_DB_PORT=5432
+#MB_DB_USER=metabase
+#MB_DB_PASS=metabase
+#MB_DB_HOST=localhost
+
+# Show emoji in logs <true|false>
+#MB_EMOJI_IN_LOGS=true
+
diff --git a/databases/metabase/files/metabase.in b/databases/metabase/files/metabase.in
new file mode 100644
index 000000000000..30cc2969d4c2
--- /dev/null
+++ b/databases/metabase/files/metabase.in
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+#
+# PROVIDE: %%PORTNAME%%
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable %%PORTNAME%%
+# %%PORTNAME%%_enable="YES"
+#
+# %%PORTNAME%%_enable (bool): 	Set to YES to enable %%PORTNAME%%
+#				Default: NO
+# %%PORTNAME%%_env_file (str):	%%PORTNAME%% configration file
+#				Default: %%PREFIX%%/etc/%%PORTNAME%%.conf
+# %%PORTNAME%%_user (str):		%%PORTNAME%% daemon user
+#				Default: %%METABASE_USER%%
+# %%PORTNAME%%_group (str):		%%PORTNAME%% daemon group
+#				Default: %%METABASE_GROUP%%
+
+. /etc/rc.subr
+
+name="%%PORTNAME%%"
+rcvar=%%PORTNAME%%_enable
+load_rc_config $name
+
+: ${%%PORTNAME%%_enable:="NO"}
+: ${%%PORTNAME%%_user:="%%METABASE_USER%%"}
+: ${%%PORTNAME%%_group:="%%METABASE_GROUP%%"}
+: ${%%PORTNAME%%_flags=""}
+: ${%%PORTNAME%%_java_opts=""}
+: ${%%PORTNAME%%_java_home="%%JAVA_HOME%%"}
+: ${%%PORTNAME%%_env_file:="%%PREFIX%%/etc/${name}.conf"}
+: ${%%PORTNAME%%_log:="/var/log/${name}.log"}
+: ${%%PORTNAME%%_pidfile:="/var/run/${name}.pid"}
+: ${%%PORTNAME%%_datadir:="%%METABASEDATADIR%%"}
+
+required_files=${%%PORTNAME%%_env_file}
+java_command="${%%PORTNAME%%_java_home}/bin/java"
+procname="${java_command}"
+pidfile=${%%PORTNAME%%_pidfile}
+command=/usr/sbin/daemon
+command_args="-f -t ${name} -p ${pidfile} -o ${%%PORTNAME%%_log} ${java_command} ${%%PORTNAME%%_java_opts} -jar %%PREFIX%%/libexec/%%PORTNAME%%.jar ${%%PORTNAME%%_flags}"
+start_precmd="%%PORTNAME%%_precmd"
+
+%%PORTNAME%%_chdir=${%%PORTNAME%%_datadir}
+
+%%PORTNAME%%_precmd()
+{
+	if [ ! -d "${%%PORTNAME%%_datadir}/." ]; then
+		%%PORTNAME%%_create_datadir || return 1
+	fi
+
+	install -o ${%%PORTNAME%%_user} /dev/null ${%%PORTNAME%%_pidfile}
+
+	if [ ! -f "${%%PORTNAME%%_log}" ]; then
+		touch "${%%PORTNAME%%_log}"
+		chown "${%%PORTNAME%%_user}:${%%PORTNAME%%_group}" "${%%PORTNAME%%_log}"
+		chmod 640 "${%%PORTNAME%%_log}"
+	fi
+}
+
+%%PORTNAME%%_create_datadir()
+{
+	echo "Creating data directory"
+	eval mkdir -p ${%%PORTNAME%%_datadir}
+	[ $? -eq 0 ] && chown -R ${%%PORTNAME%%_user}:${%%PORTNAME%%_group} ${%%PORTNAME%%_datadir}
+}
+
+run_rc_command "$1"
diff --git a/databases/metabase/files/pkg-message.in b/databases/metabase/files/pkg-message.in
new file mode 100644
index 000000000000..d86f4ac55c20
--- /dev/null
+++ b/databases/metabase/files/pkg-message.in
@@ -0,0 +1,18 @@
+[
+{ type: install
+  message: <<EOM
+To configure %%PORTNAME%% please edit:
+%%PREFIX%%/etc/%%PORTNAME%%.conf
+
+To run %%PORTNAME%% at startup, enable it
+in your /etc/rc.conf:
+
+sysrc %%PORTNAME%%_enable="YES"
+
+To start %%PORTNAME%%:
+
+service %%PORTNAME%% start
+EOM
+}
+]
+
diff --git a/databases/metabase/pkg-descr b/databases/metabase/pkg-descr
new file mode 100644
index 000000000000..1597159de9c8
--- /dev/null
+++ b/databases/metabase/pkg-descr
@@ -0,0 +1,9 @@
+Metabase is an open source business intelligence tool. It lets you ask
+questions about your data and displays answers in formats that
+make sense, whether that's a bar graph or a detailed table.
+
+Your questions can be saved for later, making it easy to come back to them,
+or you can group questions into great looking dashboards. Metabase also
+makes it easy to share questions and dashboards with the rest of your team.
+
+WWW: https://metabase.com/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107312129.16VLT3DP032341>