From nobody Wed Dec 07 00:30:34 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NRdVM2Vdnz4j7jm; Wed, 7 Dec 2022 00:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NRdVM1QS0z3mmN; Wed, 7 Dec 2022 00:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670373035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c1TJH8z5mtNxiDRVbH+SBngfvm6cbG/3cr3UWS6HiNU=; b=FmNAPTVQp7nVJHsTr1j0GvlajLo86IyWv3Q2kKn3YZwz725oXbTQCYW3rjd3tYMh7kgPAP t1p5k7IOyaFujER325mJWyPO8oFo1sfb0AUqXaPrCjQTRfT48YQ+LHiS08/HYxob4FgW37 c6evGRdqC00DgNtFdfIn1ULVk/Ej3OFZHvUOtnhI3UsvsJsDINI6kLiCzrOST9ryxZSJSe dCdlg4UAowea8Dk4/MXaujKVu21GtLVxSCXvW+V+I//f73pBpZA8iH9px6/e1pmi0YRZfz cQgpoSEOsHmeWJQCIPkcbsz8n/VtNUCN+GpV4ct2l2FEE6r8xxzZSzILRt8JXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670373035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c1TJH8z5mtNxiDRVbH+SBngfvm6cbG/3cr3UWS6HiNU=; b=C0UJTox6Bv77QA5PWDOsBDY2wofpOru0itwGrJe7ZcK2IexG/lOsEK0oj0Nod/hMsFndxq 2gefpRQQqRPDGuxhHOdIhQoTjPY228GqL2r0Esuwzyp/jBIpzI2mIcDI25lXlw4pxhrbuT ttAUowmo/dGWpTI9+6Ng3Sq36oRi50X0JJg9r/2jUQx+qbfAk01CeBfvOcAbP0xniLjw7g JEc8Q91cMEL4Lrtp7nxlOm5raTCeJKNddAuwW0wheQEnSVqZ5uq5vuxVluP7l7JNSkHUd8 JnpYIhBC6LBJSCqjuUI4croS2NkWS/leEbp3VfPk4JLUulXfYTZjyFDDXIgWhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670373035; a=rsa-sha256; cv=none; b=xPVX+xD4UBi5fYr032hVeiL7X7Ky2r72lvBO0lYG9xmnXl2P3Dwu/jkbi/+gbjjeJR65ib 4thLzdDarZJsBq7J2jk2cH3LMg7nvr0BVaQl91qbc6tSoFiNBduLU2sN4bwOj2f6RsV/UP y6CNXZ0zPucAM788LDOfUZRVLXE9TxSm4g1IX8P782Ch1dqNfauW3Yow1qzoMtirTuTf6Y TMou/hhGb0i7ptzWRfOolRG/n9kcOM8dXflu8fx41qlseiLrNCxI2gk8pbNuKnNsYnpvlT ZmGVSrqKeplZASbhpdPcJ/xnl5exT488cxCfk4VGw9yOkShL2LmR152HWVqepg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NRdVM0RvGzxDV; Wed, 7 Dec 2022 00:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2B70UY1W069586; Wed, 7 Dec 2022 00:30:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B70UYpp069585; Wed, 7 Dec 2022 00:30:34 GMT (envelope-from git) Date: Wed, 7 Dec 2022 00:30:34 GMT Message-Id: <202212070030.2B70UYpp069585@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Jose Alonso Cardenas Marquez Subject: git: 53ec2982acd5 - main - textproc/opensearch-dashboards13: New port: Visualization dashboards for OpenSearch (1.3.x branch) List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: acm X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53ec2982acd559856535c6726c23d6e0cbe3fb6b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by acm: URL: https://cgit.FreeBSD.org/ports/commit/?id=53ec2982acd559856535c6726c23d6e0cbe3fb6b commit 53ec2982acd559856535c6726c23d6e0cbe3fb6b Author: Jose Alonso Cardenas Marquez AuthorDate: 2022-12-07 00:28:38 +0000 Commit: Jose Alonso Cardenas Marquez CommitDate: 2022-12-07 00:30:12 +0000 textproc/opensearch-dashboards13: New port: Visualization dashboards for OpenSearch (1.3.x branch) OpenSearch Dashboards is the default visualization tool for data in OpenSearch. It also serves as a user interface for many of the OpenSearch plugins, including security, alerting, Index State Management, SQL, and more. --- textproc/Makefile | 1 + textproc/opensearch-dashboards13/Makefile | 82 ++++++++++++++++++++++ textproc/opensearch-dashboards13/distinfo | 3 + .../files/opensearch-dashboards.in | 79 +++++++++++++++++++++ .../files/patch-bin_opensearch-dashboards-keystore | 13 ++++ .../files/patch-bin_opensearch-dashboards-plugin | 13 ++++ .../files/patch-node__modules_re2_binding.gyp | 21 ++++++ ...ortsDashboards_server_routes_utils_constants.js | 11 +++ .../opensearch-dashboards13/files/pkg-deinstall.in | 20 ++++++ textproc/opensearch-dashboards13/pkg-descr | 3 + 10 files changed, 246 insertions(+) diff --git a/textproc/Makefile b/textproc/Makefile index 60eb897c983d..bf792969324a 100644 --- a/textproc/Makefile +++ b/textproc/Makefile @@ -505,6 +505,7 @@ SUBDIR += opensearch SUBDIR += opensearch13 SUBDIR += opensearch-dashboards + SUBDIR += opensearch-dashboards13 SUBDIR += opensp SUBDIR += openvanilla-framework SUBDIR += or-aspell diff --git a/textproc/opensearch-dashboards13/Makefile b/textproc/opensearch-dashboards13/Makefile new file mode 100644 index 000000000000..ba1474e2557b --- /dev/null +++ b/textproc/opensearch-dashboards13/Makefile @@ -0,0 +1,82 @@ +PORTNAME= opensearch-dashboards +DISTVERSION= 1.3.6 +DISTVERSIONSUFFIX= -linux-x64 +CATEGORIES= textproc www +MASTER_SITES= https://artifacts.opensearch.org/releases/bundle/${PORTNAME}/${DISTVERSION}/ +PKGNAMESUFFIX= 13 + +MAINTAINER= opensearch@FreeBSD.org +COMMENT?= Visualization dashboards for OpenSearch +WWW= https://opensearch.org + +LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/LICENSE.txt + +BUILD_DEPENDS= npm-node14>0:www/npm-node14 + +CONFLICTS= opensearch-dashboards + +USES= nodejs:14,build,run python:build +USE_RC_SUBR= ${PORTNAME} + +WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} + +OPTIONS_DEFINE= CHROME + +CHROME_DESC= Add dependency on www/chromium (required for PDF reports) +CHROME_RUN_DEPENDS=chrome:www/chromium + +_DEVDIR= ${WRKDIR}/.devdir + +post-patch: + @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' -e 's|%%LOCALBASE%%|${LOCALBASE}|' -e 's|%%WRKSRC%%|${WRKSRC}|' \ + ${WRKSRC}/bin/opensearch-dashboards \ + ${WRKSRC}/bin/opensearch-dashboards-keystore \ + ${WRKSRC}/bin/opensearch-dashboards-plugin \ + ${WRKSRC}/node_modules/re2/binding.gyp \ + ${WRKSRC}/plugins/reportsDashboards/server/routes/utils/constants.js + ${RM} \ + ${WRKSRC}/bin/*.orig \ + ${WRKSRC}/bin/*.bak \ + ${WRKSRC}/node_modules/re2/binding.gyp.orig \ + ${WRKSRC}/node_modules/re2/binding.gyp.bak \ + ${WRKSRC}/plugins/reportsDashboards/server/routes/utils/constants.js.orig \ + ${WRKSRC}/plugins/reportsDashboards/server/routes/utils/constants.js.bak + ${RM} -r ${WRKSRC}/plugins/reportsDashboards/.chromium + +do-configure: + (cd ${WRKSRC}/node_modules/re2 && \ + ${SETENV} HOME=${WRKDIR} PYTHONDONTWRITEBYTECODE=1 \ + ${LOCALBASE}/lib/node_modules/npm/bin/node-gyp-bin/node-gyp configure \ + --python=${PYTHON_CMD} \ + --nodedir ${LOCALBASE} \ + --devdir=${_DEVDIR}) + +do-build: + (cd ${WRKSRC}/node_modules/re2 && \ + ${SETENV} HOME=${WRKDIR} PYTHONDONTWRITEBYTECODE=1 \ + ${LOCALBASE}/lib/node_modules/npm/bin/node-gyp-bin/node-gyp build \ + --devdir=${_DEVDIR}) + ${RM} -r ${WRKSRC}/node_modules/re2/build/Release/.deps \ + ${WRKSRC}/node_modules/re2/build/Release/obj.target + +do-install: + ${MKDIR} ${STAGEDIR}${WWWDIR} ${STAGEDIR}${ETCDIR} + ${INSTALL_DATA} ${WRKSRC}/config/opensearch_dashboards.yml ${STAGEDIR}${ETCDIR}/opensearch_dashboards.yml.sample + (cd ${WRKSRC} && \ + ${COPYTREE_SHARE} "data node_modules package.json plugins src" ${STAGEDIR}${WWWDIR} && \ + ${COPYTREE_BIN} bin ${STAGEDIR}${WWWDIR}) + ${STRIP_CMD} ${STAGEDIR}${WWWDIR}/node_modules/re2/build/Release/re2.node + +post-install: + ${ECHO} "@sample ${ETCDIR}/opensearch_dashboards.yml.sample" >> ${TMPPLIST} + ${FIND} -s ${STAGEDIR}${WWWDIR} -not -type d | ${SORT} | \ + ${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST} + ${ECHO} "@dir(www,www) ${WWWDIR}/data" >> ${TMPPLIST} + ${ECHO} "@dir ${WWWDIR}/plugins/reportsDashboards/node_modules/set-interval-async/test/resources/legacy" >> ${TMPPLIST} + ${ECHO} "@dir ${WWWDIR}/plugins/reportsDashboards/node_modules/set-interval-async/test/resources/fixed" >> ${TMPPLIST} + ${ECHO} "@dir ${WWWDIR}/plugins/reportsDashboards/node_modules/set-interval-async/test/resources/dynamic" >> ${TMPPLIST} + ${ECHO} "@dir ${WWWDIR}/plugins/reportsDashboards/node_modules/set-interval-async/examples/fixed" >> ${TMPPLIST} + ${ECHO} "@dir ${WWWDIR}/plugins/reportsDashboards/node_modules/set-interval-async/examples/dynamic" >> ${TMPPLIST} + +.include diff --git a/textproc/opensearch-dashboards13/distinfo b/textproc/opensearch-dashboards13/distinfo new file mode 100644 index 000000000000..c059c4acdffb --- /dev/null +++ b/textproc/opensearch-dashboards13/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1670368957 +SHA256 (opensearch-dashboards-1.3.6-linux-x64.tar.gz) = 4b0cd477fdcbbd54d835d2f60412ea1946eca0c9c1029397139e5852d98d684d +SIZE (opensearch-dashboards-1.3.6-linux-x64.tar.gz) = 250723484 diff --git a/textproc/opensearch-dashboards13/files/opensearch-dashboards.in b/textproc/opensearch-dashboards13/files/opensearch-dashboards.in new file mode 100644 index 000000000000..7043fa9301a9 --- /dev/null +++ b/textproc/opensearch-dashboards13/files/opensearch-dashboards.in @@ -0,0 +1,79 @@ +#!/bin/sh + +# PROVIDE: opensearch_dashboards +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: shutdown + +. /etc/rc.subr + +name=opensearch_dashboards +rcvar=opensearch_dashboards_enable + +load_rc_config $name + +: ${opensearch_dashboards_enable:="NO"} +: ${opensearch_dashboards_config:="%%ETCDIR%%/opensearch_dashboards.yml"} +: ${opensearch_dashboards_user:="www"} +: ${opensearch_dashboards_group:="www"} +: ${opensearch_dashboards_log:="/var/log/opensearch_dashboards.log"} +: ${opensearch_dashboards_syslog_output_enable:="NO"} + +start_precmd="opensearch_dashboards_start_precmd" +reload_cmd="opensearch_dashboards_reload_cmd" +extra_commands="reload" + +if checkyesno opensearch_dashboards_syslog_output_enable; then + if [ -n "${opensearch_dashboards_syslog_output_tag}" ]; then + opensearch_dashboards_syslog_output_flags="-T ${opensearch_dashboards_syslog_output_tag}" + else + opensearch_dashboards_syslog_output_flags="-T ${name}" + fi + if [ -n "${opensearch_dashboards_syslog_output_priority}" ]; then + opensearch_dashboards_syslog_output_flags="${opensearch_dashboards_syslog_output_flags} -s ${opensearch_dashboards_syslog_output_priority}" + fi + if [ -n "${opensearch_dashboards_syslog_output_facility}" ]; then + opensearch_dashboards_syslog_output_flags="${opensearch_dashboards_syslog_output_flags} -l ${opensearch_dashboards_syslog_output_facility}" + fi +fi + +NODE="%%LOCALBASE%%/bin/node" + +required_files="${opensearch_dashboards_config}" +pidfile="/var/run/${name}.pid" + +command="/usr/sbin/daemon" +command_args="-f ${opensearch_dashboards_syslog_output_flags} -P ${pidfile} -t ${name} \ + /usr/bin/env NODE_ENV=production ${opensearch_dashboards_env} \ + ${NODE} %%WWWDIR%%/src/cli/dist serve \ + --config ${opensearch_dashboards_config} --log-file ${opensearch_dashboards_log} \ + ${opensearch_dashboards_args}" + +opensearch_dashboards_start_precmd() +{ + if [ ! -e "${pidfile}" ]; then + install -m 0600 -o ${opensearch_dashboards_user} -g ${opensearch_dashboards_group} /dev/null ${pidfile} + fi + if [ ! -f ${opensearch_dashboards_log} ]; then + install -o ${opensearch_dashboards_user} -g ${opensearch_dashboards_group} -m 640 /dev/null ${opensearch_dashboards_log} + fi + if [ ! -d %%WWWDIR%%/optimize ]; then + install -d -o ${opensearch_dashboards_user} -g ${opensearch_dashboards_group} %%WWWDIR%%/optimize + else + # We may have installed a plugin as root which will cause files in here + # to be owned by root:wheel. Fix with a chown. + chown -R ${opensearch_dashboards_user}:${opensearch_dashboards_group} %%WWWDIR%%/optimize + fi +} + +opensearch_dashboards_reload_cmd() +{ + if [ -z "$rc_pid" ]; then + _run_rc_notrunning + return 1 + else + pkill -HUP -P ${rc_pid} + fi +} + +run_rc_command "$1" diff --git a/textproc/opensearch-dashboards13/files/patch-bin_opensearch-dashboards-keystore b/textproc/opensearch-dashboards13/files/patch-bin_opensearch-dashboards-keystore new file mode 100644 index 000000000000..bf943cba637b --- /dev/null +++ b/textproc/opensearch-dashboards13/files/patch-bin_opensearch-dashboards-keystore @@ -0,0 +1,13 @@ +--- bin/opensearch-dashboards-keystore.orig 2022-06-30 21:38:00 UTC ++++ bin/opensearch-dashboards-keystore +@@ -26,8 +26,8 @@ while [ -h "$SCRIPT" ] ; do + done + + DIR="$(dirname "${SCRIPT}")/.." +-CONFIG_DIR=${OSD_PATH_CONF:-"$DIR/config"} +-NODE="${DIR}/node/bin/node" ++CONFIG_DIR="%%PREFIX%%/etc/opensearch-dashboards" ++NODE="%%LOCALBASE%%/bin/node" + test -x "$NODE" + if [ ! -x "$NODE" ]; then + echo "unable to find usable node.js executable." diff --git a/textproc/opensearch-dashboards13/files/patch-bin_opensearch-dashboards-plugin b/textproc/opensearch-dashboards13/files/patch-bin_opensearch-dashboards-plugin new file mode 100644 index 000000000000..1a3cff5bef3f --- /dev/null +++ b/textproc/opensearch-dashboards13/files/patch-bin_opensearch-dashboards-plugin @@ -0,0 +1,13 @@ +--- bin/opensearch-dashboards-plugin.orig 2022-06-30 21:38:00 UTC ++++ bin/opensearch-dashboards-plugin +@@ -26,8 +26,8 @@ while [ -h "$SCRIPT" ] ; do + done + + DIR="$(dirname "${SCRIPT}")/.." +-CONFIG_DIR=${OSD_PATH_CONF:-"$DIR/config"} +-NODE="${DIR}/node/bin/node" ++CONFIG_DIR="%%PREFIX%%/etc/opensearch-dashboards" ++NODE="%%LOCALBASE%%/bin/node" + test -x "$NODE" + if [ ! -x "$NODE" ]; then + echo "unable to find usable node.js executable." diff --git a/textproc/opensearch-dashboards13/files/patch-node__modules_re2_binding.gyp b/textproc/opensearch-dashboards13/files/patch-node__modules_re2_binding.gyp new file mode 100644 index 000000000000..0ab0b1f203c9 --- /dev/null +++ b/textproc/opensearch-dashboards13/files/patch-node__modules_re2_binding.gyp @@ -0,0 +1,21 @@ +--- node_modules/re2/binding.gyp.orig 2021-07-02 23:30:56 UTC ++++ node_modules/re2/binding.gyp +@@ -45,7 +45,7 @@ + "-Wno-sign-compare", + "-Wno-unused-parameter", + "-Wno-missing-field-initializers", +- "-Wno-cast-function-type", ++ "-Wno-bad-function-cast", + "-O3", + "-g" + ], +@@ -54,7 +54,8 @@ + "NOMINMAX" + ], + "include_dirs": [ +- " { + }; + + exports.replaceBlockedKeywords = replaceBlockedKeywords; +-const CHROMIUM_PATH = `${__dirname}/../../../.chromium/headless_shell`; ++const CHROMIUM_PATH = `%%LOCALBASE%%/bin/chrome`; + /** + * Metric constants + */ diff --git a/textproc/opensearch-dashboards13/files/pkg-deinstall.in b/textproc/opensearch-dashboards13/files/pkg-deinstall.in new file mode 100644 index 000000000000..0699ab559805 --- /dev/null +++ b/textproc/opensearch-dashboards13/files/pkg-deinstall.in @@ -0,0 +1,20 @@ +#!/bin/sh + +case "$2" in +POST-DEINSTALL) + if [ -d %%WWWDIR%%/optimize ]; then + /usr/bin/find %%WWWDIR%%/optimize/ -delete + fi + + cat <