From nobody Wed Dec 07 00:30:33 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 4NRdVL0rBZz4j7bT; Wed, 7 Dec 2022 00:30:34 +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 4NRdVL0Nnhz3n7G; Wed, 7 Dec 2022 00:30:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670373034; 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=G6I7xY6DOt2xQNfslkofD9FWWUMe7jfV4K1FY3jECaY=; b=WCQqZV2yomAFrr1cOi05BQdS6VT/nk8uW+cmtbLQ9AP+jWyH4boAIiZmJ4jIkFflU8XqOi u9/SzuC6pd2/Y0i4j1Aa8Q+8i7eK4gP6Xewbk/XDPIOP4L1XIFi/gAxXqrb9o4/jYNcm+2 uEj3lpK6GO12nDU/av7FYiaUSsW4QhrQDR+5nh0GBUklw8v4s/lJFIHj6T66saoNOsmPq3 f9S4KZW2elnzMAUUtuXbmXO0hjRLByhrJnshJe7yQYUUmgY3bV8dwdL2Li4lrm/SSLAqgj QfOXRhuNUJLh8dQziWM315vZhMXHY7nTLKznARdnmOUmtjcBicePVoArfgPi8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670373034; 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=G6I7xY6DOt2xQNfslkofD9FWWUMe7jfV4K1FY3jECaY=; b=LLSQ+hJ+Qo02i0MoOMw9fDLShxVU4IxvjT83OPt5z9ZMJeu6yoAJeO4+8PphiEaCeB3tAS +x3jvXqD0/bw894wwyf8R6Jd6u4LFmkQ9aFICm59REerknNsBlS2GHv3G0ORL9cBtXj4IZ 8g3/fGDdG2asb7xBZia92bV2BMSEXYSaysvX+7QyF/uGv4QLE+PtgKsnRejPZOrAPudznn UukkTEvEnOrXjF3x/A3ErOrmC44cCSCTHb0RdHyX+5aM999JvT0te3ZAKfu/pIpcP+WLhR 285Q3O6v+Jbhz06wJY9yNxdsxGXSWBBtCPq1NAP9ZCi24+6F3vLThZgvSGkL0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670373034; a=rsa-sha256; cv=none; b=JL7SKgOOeZAMHuGQKnLwnk4uTeM3xmnblz1yeax8ARaz86rN4EL29PEG/0eWx6ZFTVhvn0 UReb74HtP7wda3/kSl+0UmsDc0RRiCKO9uBsOZg4NqgGvgk7I6VOZ7bi7occ6HIIUftKuR Mg5PkI5WxEEP0cH4vvEHVqzkVm9ZbtekfpXTYsdtPvN6xD3HEtHRrmLhJl/bX/RRz9tECP RUPHNxcdCU7ZuzaymdBTCY9KpX5evPawYlbf2AFN1HXYxUJps/qaB0O7b0vir3zVV8vx1y 2wgpPXKL+sIMh1F++EDNUP8UOVm9wRH+TPGrddLtWBUmP63kJXzrZi8FIgOeQg== 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 4NRdVK6YQdzxDT; Wed, 7 Dec 2022 00:30:33 +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 2B70UXIs069562; Wed, 7 Dec 2022 00:30:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B70UXv6069561; Wed, 7 Dec 2022 00:30:33 GMT (envelope-from git) Date: Wed, 7 Dec 2022 00:30:33 GMT Message-Id: <202212070030.2B70UXv6069561@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: b69832321910 - main - textproc/opensearch13: New port: Full-text search engine for Java (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: b69832321910ef0ba87db154929c6ade328f9787 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by acm: URL: https://cgit.FreeBSD.org/ports/commit/?id=b69832321910ef0ba87db154929c6ade328f9787 commit b69832321910ef0ba87db154929c6ade328f9787 Author: Jose Alonso Cardenas Marquez AuthorDate: 2022-12-07 00:25:36 +0000 Commit: Jose Alonso Cardenas Marquez CommitDate: 2022-12-07 00:30:12 +0000 textproc/opensearch13: New port: Full-text search engine for Java (1.3.x branch) OpenSearch is a fork of Elasticsearch which aims to be a Distributed, RESTful, Search Engine built on top of Apache Lucene. --- textproc/Makefile | 1 + textproc/opensearch13/Makefile | 112 ++++++++++++++++++++ textproc/opensearch13/distinfo | 3 + textproc/opensearch13/files/opensearch.in | 115 +++++++++++++++++++++ .../opensearch13/files/patch-config_jvm.options | 23 +++++ .../opensearch13/files/patch-config_opensearch.yml | 15 +++ textproc/opensearch13/files/pkg-message.in | 27 +++++ textproc/opensearch13/pkg-descr | 2 + 8 files changed, 298 insertions(+) diff --git a/textproc/Makefile b/textproc/Makefile index df4c556129db..60eb897c983d 100644 --- a/textproc/Makefile +++ b/textproc/Makefile @@ -503,6 +503,7 @@ SUBDIR += openfts SUBDIR += openjade SUBDIR += opensearch + SUBDIR += opensearch13 SUBDIR += opensearch-dashboards SUBDIR += opensp SUBDIR += openvanilla-framework diff --git a/textproc/opensearch13/Makefile b/textproc/opensearch13/Makefile new file mode 100644 index 000000000000..85edb72ba84f --- /dev/null +++ b/textproc/opensearch13/Makefile @@ -0,0 +1,112 @@ +PORTNAME= opensearch +DISTVERSION= 1.3.6 +DISTVERSIONSUFFIX= -linux-x64 +CATEGORIES= textproc java devel +MASTER_SITES= https://artifacts.opensearch.org/releases/bundle/${PORTNAME}/${DISTVERSION}/ +PKGNAMESUFFIX= 13 + +MAINTAINER= opensearch@FreeBSD.org +COMMENT?= Full-text search engine for Java +WWW= https://opensearch.org + +LICENSE= APACHE20 + +BUILD_DEPENDS= jna>0:devel/jna +RUN_DEPENDS= bash>0:shells/bash \ + jna>0:devel/jna + +CONFLICTS= opensearch + +USES= cpe shebangfix +USE_JAVA= yes +JAVA_VERSION= 11+ +USE_RC_SUBR= ${PORTNAME} + +SHEBANG_FILES= bin/opensearch bin/opensearch-cli \ + bin/opensearch-env bin/opensearch-env-from-file \ + bin/opensearch-keystore bin/opensearch-node \ + bin/opensearch-plugin bin/opensearch-shard \ + plugins/opensearch-security/tools/audit_config_migrater.sh \ + plugins/opensearch-security/tools/hash.sh \ + plugins/opensearch-security/tools/install_demo_configuration.sh \ + plugins/opensearch-security/tools/securityadmin.sh + +NO_BUILD= yes +WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} + +OPTIONS_DEFINE= PLUGINS +OPTIONS_DEFAULT=PLUGINS + +.include + +CONFIG_FILES= opensearch.yml jvm.options log4j2.properties + +PLUGINS_CONFIG_FILES?= \ + opensearch-observability/observability.yml \ + opensearch-performance-analyzer/agent-stats-metadata \ + opensearch-performance-analyzer/log4j2.xml \ + opensearch-performance-analyzer/opensearch_security.policy \ + opensearch-performance-analyzer/performance-analyzer.properties \ + opensearch-performance-analyzer/plugin-stats-metadata \ + opensearch-performance-analyzer/rca.conf \ + opensearch-performance-analyzer/rca_idle_master.conf \ + opensearch-performance-analyzer/rca_master.conf \ + opensearch-performance-analyzer/supervisord.conf \ + opensearch-reports-scheduler/reports-scheduler.yml \ + +BINS= opensearch opensearch-cli opensearch-env \ + opensearch-env-from-file opensearch-keystore \ + opensearch-node opensearch-plugin \ + opensearch-shard + +SEARCHUSER?= opensearch +SEARCHGROUP?= ${SEARCHUSER} +USERS= ${SEARCHUSER} +GROUPS= ${SEARCHGROUP} + +SUB_FILES= pkg-message +SUB_LIST= ETCDIR=${ETCDIR} \ + JAVA_HOME=${JAVA_HOME} + +post-patch: + ${RM} ${WRKSRC}/lib/jna-*.jar + +do-install: + ${MKDIR} ${STAGEDIR}${PREFIX}/etc/opensearch +.for f in ${CONFIG_FILES} + ${INSTALL} ${WRKSRC}/config/${f} ${STAGEDIR}${ETCDIR}/${f}.sample +.endfor + ${MKDIR} ${STAGEDIR}${PREFIX}/lib/opensearch/bin +.for f in ${BINS} + ${INSTALL_SCRIPT} ${WRKSRC}/bin/${f} ${STAGEDIR}${PREFIX}/lib/opensearch/bin +.endfor + ${MKDIR} ${STAGEDIR}${PREFIX}/lib/opensearch/lib + (cd ${WRKSRC}/ && ${COPYTREE_SHARE} "lib modules" ${STAGEDIR}${PREFIX}/lib/opensearch/) + ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/opensearch + ${INSTALL} -lrs ${STAGEDIR}${ETCDIR} ${STAGEDIR}${PREFIX}/lib/opensearch/config + ${LN} -s ${JAVASHAREDIR}/classes/jna.jar ${STAGEDIR}${PREFIX}/lib/opensearch/lib/jna.jar + +do-install-PLUGINS-on: + ${MKDIR} ${STAGEDIR}${ETCDIR}/opensearch-notifications-core \ + ${STAGEDIR}${ETCDIR}/opensearch-notifications \ + ${STAGEDIR}${ETCDIR}/opensearch-observability \ + ${STAGEDIR}${ETCDIR}/opensearch-performance-analyzer \ + ${STAGEDIR}${ETCDIR}/opensearch-reports-scheduler +.for f in ${PLUGINS_CONFIG_FILES} + ${INSTALL} ${WRKSRC}/config/${f} ${STAGEDIR}${ETCDIR}/${f}.sample + ${ECHO} "@sample ${ETCDIR}/${f}.sample" >> ${TMPPLIST} +.endfor + (cd ${WRKSRC}/ && ${COPYTREE_SHARE} "plugins" ${STAGEDIR}${PREFIX}/lib/opensearch/) + (cd ${WRKSRC}/plugins/opensearch-security/tools && ${COPYTREE_BIN} "*.sh" ${STAGEDIR}${PREFIX}/lib/opensearch/plugins/opensearch-security/tools) + +post-install: +.for f in ${CONFIG_FILES} + ${ECHO} "@sample ${ETCDIR}/${f}.sample" >> ${TMPPLIST} +.endfor + ${FIND} -s ${STAGEDIR}${PREFIX}/lib/opensearch -not -type d | ${SORT} | \ + ${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST} + ${ECHO} "@dir lib/opensearch/plugins" >> ${TMPPLIST} + ${ECHO} "@dir libexec/opensearch" >> ${TMPPLIST} + ${ECHO} "@dir(opensearch,opensearch,0755) ${ETCDIR}" >> ${TMPPLIST} + +.include diff --git a/textproc/opensearch13/distinfo b/textproc/opensearch13/distinfo new file mode 100644 index 000000000000..ce98a5e2c7ea --- /dev/null +++ b/textproc/opensearch13/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1670283394 +SHA256 (opensearch-1.3.6-linux-x64.tar.gz) = 0784cc05ec03dc9cac17dca923272ae08ebc9a43fbbbb61397024f1c90cdb024 +SIZE (opensearch-1.3.6-linux-x64.tar.gz) = 421906066 diff --git a/textproc/opensearch13/files/opensearch.in b/textproc/opensearch13/files/opensearch.in new file mode 100644 index 000000000000..71334ce1ee01 --- /dev/null +++ b/textproc/opensearch13/files/opensearch.in @@ -0,0 +1,115 @@ +#!/bin/sh + +# PROVIDE: opensearch +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf to enable opensearch: +# +# opensearch_enable="YES" +# +# opensearch_user (username): Set to opensearch by default. +# Set it to required username. +# opensearch_group (group): Set to opensearch by default. +# Set it to required group. +# opensearch_config (path): Set to %%PREFIX%%/etc/opensearch/opensearch.yml by default. +# Set it to the config file location. +# opensearch_java_home (path): Set to %%JAVA_HOME%% by default. +# Set it to the root of the JDK to use. +# +. /etc/rc.subr + +name=opensearch +rcvar=opensearch_enable + +load_rc_config ${name} + +: ${opensearch_enable:=NO} +: ${opensearch_user=opensearch} +: ${opensearch_group=opensearch} +: ${opensearch_config=%%PREFIX%%/etc/opensearch} +: ${opensearch_login_class=root} +: ${opensearch_java_home="%%JAVA_HOME%%"} + +required_files="${opensearch_config}/opensearch.yml" +_pidprefix=/var/run/opensearch/opensearch +pidfile=${_pidprefix}.pid +procname=${opensearch_java_home}/bin/java + +extra_commands="console status" +console_cmd=opensearch_console +start_precmd=opensearch_precmd +command=%%PREFIX%%/lib/opensearch/bin/opensearch +command_args="-d --pidfile=${pidfile}" + +export OPENSEARCH_PATH_CONF=${opensearch_config} +export JAVA_HOME=${opensearch_java_home} + +opensearch_precmd() +{ + /usr/bin/install -d -o ${opensearch_user} -g ${opensearch_group} -m 755 ${pidfile%/*} + /usr/bin/install -d -o ${opensearch_user} -g ${opensearch_group} -m 755 /var/db/opensearch + /usr/bin/install -d -o ${opensearch_user} -g ${opensearch_group} -m 755 /var/log/opensearch +} + +opensearch_console() +{ + command_args="" + run_rc_command "start" +} + +if [ -n "$2" ]; then + profile="$2" + if [ "x${opensearch_profiles}" != "x" ]; then + eval opensearch_config="\${opensearch_${profile}_config:-}" + if [ "x${opensearch_config}" = "x" ]; then + echo "You must define a configuration (opensearch_${profile}_config)" + exit 1 + fi + export OPENSEARCH_PATH_CONF=${opensearch_config} + required_files="${opensearch_config}/opensearch.yml" + required_files="${opensearch_config}/jvm.options" + eval opensearch_enable="\${opensearch_${profile}_enable:-${opensearch_enable}}" + pidfile="${_pidprefix}.${profile}.pid" + command_args="-d --pidfile=${pidfile}" + echo "===> opensearch profile: ${profile}" + else + echo "$0: extra argument ignored" + fi +else + if [ "x${opensearch_profiles}" != "x" -a "x$1" != "x" ]; then + for profile in ${opensearch_profiles}; do + eval _enable="\${opensearch_${profile}_enable}" + case "x${_enable:-${opensearch_enable}}" in + x|x[Nn][Oo]|x[Nn][Oo][Nn][Ee]) + continue + ;; + x[Yy][Ee][Ss]) + ;; + *) + if test -z "$_enable"; then + _var=opensearch_enable + else + _var=opensearch_"${profile}"_enable + fi + echo "Bad value" \ + "'${_enable:-${opensearch_enable}}'" \ + "for ${_var}. " \ + "Profile ${profile} skipped." + continue + ;; + esac + %%PREFIX%%/etc/rc.d/opensearch $1 ${profile} + retcode="$?" + if [ "0${retcode}" -ne 0 ]; then + failed="${profile} (${retcode}) ${failed:-}" + else + success="${profile} ${success:-}" + fi + done + exit 0 + fi +fi + +run_rc_command "$1" diff --git a/textproc/opensearch13/files/patch-config_jvm.options b/textproc/opensearch13/files/patch-config_jvm.options new file mode 100644 index 000000000000..f6276944b6db --- /dev/null +++ b/textproc/opensearch13/files/patch-config_jvm.options @@ -0,0 +1,23 @@ +--- config/jvm.options.orig 2021-07-30 14:01:34 UTC ++++ config/jvm.options +@@ -61,17 +61,17 @@ + -XX:HeapDumpPath=data + + # specify an alternative path for JVM fatal error logs +--XX:ErrorFile=logs/hs_err_pid%p.log ++-XX:ErrorFile=/hs_err_pid%p.log + + ## JDK 8 GC logging + 8:-XX:+PrintGCDetails + 8:-XX:+PrintGCDateStamps + 8:-XX:+PrintTenuringDistribution + 8:-XX:+PrintGCApplicationStoppedTime +-8:-Xloggc:logs/gc.log ++8:-Xloggc:${OPENSEARCH_TMPDIR}/gc.log + 8:-XX:+UseGCLogFileRotation + 8:-XX:NumberOfGCLogFiles=32 + 8:-XX:GCLogFileSize=64m + + # JDK 9+ GC logging +-9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m ++9-:-Xlog:gc*,gc+age=trace,safepoint:file=${OPENSEARCH_TMPDIR}/gc.log:utctime,pid,tags:filecount=32,filesize=64m diff --git a/textproc/opensearch13/files/patch-config_opensearch.yml b/textproc/opensearch13/files/patch-config_opensearch.yml new file mode 100644 index 000000000000..f5aa3ed1a80e --- /dev/null +++ b/textproc/opensearch13/files/patch-config_opensearch.yml @@ -0,0 +1,15 @@ +--- config/opensearch.yml.orig 2021-07-02 23:22:08 UTC ++++ config/opensearch.yml +@@ -31,10 +31,12 @@ + # Path to directory where to store the data (separate multiple locations by comma): + # + #path.data: /path/to/data ++path.data: /var/db/opensearch + # + # Path to log files: + # + #path.logs: /path/to/logs ++path.logs: /var/log/opensearch + # + # ----------------------------------- Memory ----------------------------------- + # diff --git a/textproc/opensearch13/files/pkg-message.in b/textproc/opensearch13/files/pkg-message.in new file mode 100644 index 000000000000..fd18e5ddc571 --- /dev/null +++ b/textproc/opensearch13/files/pkg-message.in @@ -0,0 +1,27 @@ +[ +{ type: install + message: <