textproc/elasticsearch6: Update to 6.2.2

- Take maintainership
- Sync up with work done on textproc/elasticsearch5 port

Approved by:	maintainer (private email)
This commit is contained in:
Mark Felder 2018-02-24 15:42:11 +00:00
parent e13ecb84ac
commit 63b1b5104d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=462845
5 changed files with 70 additions and 202 deletions

View file

@ -2,13 +2,14 @@
# $FreeBSD$
PORTNAME= elasticsearch
PORTVERSION= 6.0.1
PORTVERSION= 6.2.2
PORTREVISION= 0
CATEGORIES= textproc java devel
MASTER_SITES= https://artifacts.elastic.co/downloads/${PORTNAME}/ \
http://mirrors.rit.edu/zi/
PKGNAMESUFFIX= 6
MAINTAINER= pi@FreeBSD.org
MAINTAINER= feld@FreeBSD.org
COMMENT= Full-text search engine for Java
LICENSE= APACHE20
@ -30,12 +31,11 @@ OPTIONS_DEFINE= DOCS
.include <bsd.port.options.mk>
LUCENEVER= 6.4.1
CONFIG_FILES= elasticsearch.yml log4j2.properties jvm.options
BINS= elasticsearch \
elasticsearch-plugin
DOCS= LICENSE.txt \
PORTDOCS= LICENSE.txt \
NOTICE.txt \
README.textile
@ -44,47 +44,46 @@ SEARCHUSER?= elasticsearch
SEARCHGROUP?= ${SEARCHUSER}
USERS= ${SEARCHUSER}
GROUPS= ${SEARCHGROUP}
ELASTIC_DBDIR= /var/db/elasticsearch
ELASTIC_LOGDIR= /var/log/elasticsearch
SUB_LIST= SEARCHUSER=${SEARCHUSER} \
SEARCHGROUP=${SEARCHGROUP} \
PORTVERSION=${PORTVERSION}
SUB_LIST= ETCDIR=${ETCDIR} JAVA=${JAVA}
SUB_FILES= pkg-message
PLIST_SUB+= SEARCHUSER=${SEARCHUSER} \
SEARCHGROUP=${SEARCHGROUP} \
LUCENEVER=${LUCENEVER} \
PORTVERSION=${PORTVERSION} \
ELASTIC_DBDIR=${ELASTIC_DBDIR} \
ELASTIC_LOGDIR=${ELASTIC_LOGDIR}
post-patch:
${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/config/elasticsearch.yml
${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/bin/elasticsearch
do-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/etc/elasticsearch
${MKDIR} ${STAGEDIR}${PREFIX}/etc/elasticsearch
.for f in ${CONFIG_FILES}
${INSTALL} -m 440 ${WRKSRC}/config/${f} ${STAGEDIR}${ETCDIR}/${f}.sample
${INSTALL} ${WRKSRC}/config/${f} ${STAGEDIR}${ETCDIR}/${f}.sample
.endfor
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/elasticsearch/bin
${MKDIR} ${STAGEDIR}${PREFIX}/lib/elasticsearch/bin
.for f in ${BINS}
${INSTALL_SCRIPT} ${WRKSRC}/bin/${f} ${STAGEDIR}${PREFIX}/lib/elasticsearch/bin
.endfor
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/elasticsearch/lib
${MKDIR} ${STAGEDIR}${PREFIX}/lib/elasticsearch/lib
(cd ${WRKSRC}/lib && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/lib/elasticsearch/lib/ "-name *\.jar")
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/elasticsearch/modules
${MKDIR} ${STAGEDIR}${PREFIX}/lib/elasticsearch/modules
(cd ${WRKSRC}/modules && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/lib/elasticsearch/modules/)
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/elasticsearch/plugins
@${MKDIR} ${STAGEDIR}${PREFIX}/libexec/elasticsearch
@${MKDIR} ${STAGEDIR}${ELASTIC_DBDIR} ${STAGEDIR}${ELASTIC_LOGDIR}
cd ${STAGEDIR}${PREFIX}/bin && ${LN} -s ${PREFIX}/lib/elasticsearch/bin/elasticsearch-plugin elasticsearch-plugin
${MKDIR} ${STAGEDIR}${PREFIX}/lib/elasticsearch/plugins
${MKDIR} ${STAGEDIR}${PREFIX}/libexec/elasticsearch
${INSTALL} -lrs ${STAGEDIR}${PREFIX}/lib/elasticsearch/bin/elasticsearch-plugin ${STAGEDIR}${PREFIX}/bin/elasticsearch-plugin
do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
.for f in ${DOCS}
${MKDIR} ${STAGEDIR}${DOCSDIR}
.for f in ${PORTDOCS}
${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}
.endfor
post-install:
${ECHO} "@sample ${ETCDIR}/elasticsearch.yml.sample" >> ${TMPPLIST}
${ECHO} "@sample ${ETCDIR}/log4j2.properties.sample" >> ${TMPPLIST}
${ECHO} "@sample ${ETCDIR}/jvm.options.sample" >> ${TMPPLIST}
${ECHO} "bin/elasticsearch-plugin" >> ${TMPPLIST}
${FIND} -s ${STAGEDIR}${PREFIX}/lib/elasticsearch -not -type d | ${SORT} | \
${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST}
${ECHO} "@dir lib/elasticsearch/plugins" >> ${TMPPLIST}
${ECHO} "@dir libexec/elasticsearch" >> ${TMPPLIST}
.include <bsd.port.mk>

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1518385033
SHA256 (elasticsearch-6.0.1.tar.gz) = efaf32aba41e1b7fd086639c0f062c39e1f28b360a78d5c2b8deed797a4c5c57
SIZE (elasticsearch-6.0.1.tar.gz) = 28026460
TIMESTAMP = 1519482605
SHA256 (elasticsearch-6.2.2.tar.gz) = b26e3546784b39ce3eacc10411e68ada427c5764bcda3064e9bb284eca907983
SIZE (elasticsearch-6.2.2.tar.gz) = 29049540

View file

@ -15,7 +15,7 @@
# Set it to required username.
# elasticsearch_group (group): Set to elasticsearch by default.
# Set it to required group.
# elasticsearch_config (path): Set to /usr/local/etc/elasticsearch/elasticsearch.yml by default.
# elasticsearch_config (path): Set to %%PREFIX%%/etc/elasticsearch/elasticsearch.yml by default.
# Set it to the config file location.
# elasticsearch_tmp (path): Set to /var/tmp/elasticsearch by default.
# Set it to the path to be used for temp files.
@ -27,31 +27,29 @@ rcvar=elasticsearch_enable
load_rc_config ${name}
: ${elasticsearch_enable:="NO"}
: ${elasticsearch_user:=%%SEARCHUSER%%}
: ${elasticsearch_group:=%%SEARCHGROUP%%}
: ${elasticsearch_config:="%%PREFIX%%/etc/elasticsearch"}
: ${elasticsearch_tmp:="/var/tmp/elasticsearch"}
: ${elasticsearch_enable:=NO}
: ${elasticsearch_user=elasticsearch}
: ${elasticsearch_group=elasticsearch}
: ${elasticsearch_config=%%PREFIX%%/etc/elasticsearch}
: ${elasticsearch_tmp=/var/tmp/elasticsearch}
required_files="${elasticsearch_config}/elasticsearch.yml"
_pidprefix="/var/run/elasticsearch"
pidfile="${_pidprefix}.pid"
_pidprefix=/var/run/elasticsearch
pidfile=${_pidprefix}.pid
procname=%%JAVA%%
extra_commands="console status"
console_cmd="elasticsearch_console"
start_precmd="elasticsearch_precmd"
status_cmd="elasticsearch_status"
stop_cmd="elasticsearch_stop"
command="%%PREFIX%%/lib/elasticsearch/bin/elasticsearch"
command_args="-d --pidfile=${pidfile}"
console_cmd=elasticsearch_console
start_precmd=elasticsearch_precmd
command=%%PREFIX%%/lib/elasticsearch/bin/elasticsearch
command_args="-d --pidfile=${pidfile} -Epath.conf=${elasticsearch_config}"
elasticsearch_precmd()
{
touch ${pidfile}
chown ${elasticsearch_user}:${elasticsearch_group} ${pidfile}
/usr/bin/install -d -o ${elasticsearch_user} -g ${elasticsearch_group} -m 750 ${elasticsearch_tmp}
/usr/bin/install -d -o ${elasticsearch_user} -g ${elasticsearch_group} -m 750 /var/db/elasticsearch
/usr/bin/install -d -o ${elasticsearch_user} -g ${elasticsearch_group} -m 750 /var/log/elasticsearch
/usr/bin/install -o ${elasticsearch_user} -g ${elasticsearch_group} /dev/null ${pidfile}
/usr/bin/install -d -o ${elasticsearch_user} -g ${elasticsearch_group} -m 755 ${elasticsearch_tmp}
/usr/bin/install -d -o ${elasticsearch_user} -g ${elasticsearch_group} -m 755 /var/db/elasticsearch
/usr/bin/install -d -o ${elasticsearch_user} -g ${elasticsearch_group} -m 755 /var/log/elasticsearch
}
elasticsearch_console()
@ -60,57 +58,9 @@ elasticsearch_console()
run_rc_command "start"
}
elasticsearch_stop()
{
rc_pid=$(elasticsearch_check_pidfile $pidfile)
if [ -z "$rc_pid" ]; then
[ -n "$rc_fast" ] && return 0
echo "${name} not running? (check $pidfile)."
return 1
fi
echo "Stopping ${name}."
kill ${rc_pid} 2> /dev/null
}
elasticsearch_status()
{
rc_pid=$(elasticsearch_check_pidfile $pidfile)
if [ -z "$rc_pid" ]; then
[ -n "$rc_fast" ] && return 0
echo "${name} not running? (check $pidfile)."
return 1
fi
echo "${name} is running as pid ${rc_pid}."
}
elasticsearch_check_pidfile()
{
_pidfile=$1
if [ -z "$_pidfile" ]; then
err 3 'USAGE: elasticsearch_check_pidfile pidfile'
fi
if [ ! -f $_pidfile ]; then
debug "pid file ($_pidfile): not readable."
return
fi
read _pid _junk < $_pidfile
if [ -z "$_pid" ]; then
debug "pid file ($_pidfile): no pid in file."
return
fi
if [ -n "`%%LOCALBASE%%/bin/jps -l | grep -e "^$_pid"`" ]; then
echo -n $_pid
fi
}
if [ -n "$2" ]; then
profile="$2"
if [ "x${elasticsearch_profiles}" != "x" ]; then
pidfile="${_pidprefix}.${profile}.pid"
command_args="-d --pidfile=${pidfile}"
eval elasticsearch_config="\${elasticsearch_${profile}_config:-}"
if [ "x${elasticsearch_config}" = "x" ]; then
echo "You must define a configuration (elasticsearch_${profile}_config)"
@ -120,6 +70,12 @@ if [ -n "$2" ]; then
required_files="${elasticsearch_config}/jvm.options"
eval elasticsearch_enable="\${elasticsearch_${profile}_enable:-${elasticsearch_enable}}"
eval elasticsearch_tmp="\${elasticsearch_${profile}_args:-${elasticsearch_tmp}}"
pidfile="${_pidprefix}.${profile}.pid"
if [ -e ${elasticsearch_config}/jvm.options ]; then
export ES_JVM_OPTIONS=${elasticsearch_config}/jvm.options
fi
command_args="-d --pidfile=${pidfile} -Epath.conf=${elasticsearch_config}"
echo "===> elasticsearch profile: ${profile}"
else
echo "$0: extra argument ignored"
fi
@ -146,8 +102,7 @@ else
continue
;;
esac
echo "===> elasticsearch profile: ${profile}"
/usr/local/etc/rc.d/elasticsearch $1 ${profile}
%%PREFIX%%/etc/rc.d/elasticsearch $1 ${profile}
retcode="$?"
if [ "0${retcode}" -ne 0 ]; then
failed="${profile} (${retcode}) ${failed:-}"

View file

@ -3,4 +3,22 @@
Please see %%ETCDIR%% for sample versions of
elasticsearch.yml and logging.yml.
ElasticSearch requires memory locking of large amounts of RAM.
You will either need to set:
sysrc elasticsearch_login_class="root"
or
sysctl security.bsd.unprivileged_mlock=1
to prevent the process from failing the bootstrap.
Do note that you need to set
bootstrap.system_call_filter: false
in your elasticsearch.yml file to successfully bootstrap on non-Linux
OSes now.
======================================================================

View file

@ -1,104 +0,0 @@
@sample(%%SEARCHUSER%%,%%SEARCHGROUP%%,440) %%ETCDIR%%/elasticsearch.yml.sample
@sample(%%SEARCHUSER%%,%%SEARCHGROUP%%,440) %%ETCDIR%%/log4j2.properties.sample
@sample(%%SEARCHUSER%%,%%SEARCHGROUP%%,440) %%ETCDIR%%/jvm.options.sample
bin/%%SEARCHUSER%%-plugin
lib/%%SEARCHUSER%%/bin/%%SEARCHUSER%%
lib/%%SEARCHUSER%%/bin/%%SEARCHUSER%%-plugin
lib/%%SEARCHUSER%%/lib/HdrHistogram-2.1.9.jar
lib/%%SEARCHUSER%%/lib/%%SEARCHUSER%%-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/lib/hppc-0.7.1.jar
lib/%%SEARCHUSER%%/lib/jackson-core-2.8.6.jar
lib/%%SEARCHUSER%%/lib/jackson-dataformat-cbor-2.8.6.jar
lib/%%SEARCHUSER%%/lib/jackson-dataformat-smile-2.8.6.jar
lib/%%SEARCHUSER%%/lib/jackson-dataformat-yaml-2.8.6.jar
lib/%%SEARCHUSER%%/lib/java-version-checker-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/lib/jna-4.4.0-1.jar
lib/%%SEARCHUSER%%/lib/joda-time-2.9.5.jar
lib/%%SEARCHUSER%%/lib/jopt-simple-5.0.2.jar
lib/%%SEARCHUSER%%/lib/jts-1.13.jar
lib/%%SEARCHUSER%%/lib/log4j-1.2-api-2.9.1.jar
lib/%%SEARCHUSER%%/lib/log4j-api-2.9.1.jar
lib/%%SEARCHUSER%%/lib/log4j-core-2.9.1.jar
lib/%%SEARCHUSER%%/lib/lucene-analyzers-common-7.0.1.jar
lib/%%SEARCHUSER%%/lib/lucene-backward-codecs-7.0.1.jar
lib/%%SEARCHUSER%%/lib/lucene-core-7.0.1.jar
lib/%%SEARCHUSER%%/lib/lucene-grouping-7.0.1.jar
lib/%%SEARCHUSER%%/lib/lucene-highlighter-7.0.1.jar
lib/%%SEARCHUSER%%/lib/lucene-join-7.0.1.jar
lib/%%SEARCHUSER%%/lib/lucene-memory-7.0.1.jar
lib/%%SEARCHUSER%%/lib/lucene-misc-7.0.1.jar
lib/%%SEARCHUSER%%/lib/lucene-queries-7.0.1.jar
lib/%%SEARCHUSER%%/lib/lucene-queryparser-7.0.1.jar
lib/%%SEARCHUSER%%/lib/lucene-sandbox-7.0.1.jar
lib/%%SEARCHUSER%%/lib/lucene-spatial-7.0.1.jar
lib/%%SEARCHUSER%%/lib/lucene-spatial-extras-7.0.1.jar
lib/%%SEARCHUSER%%/lib/lucene-spatial3d-7.0.1.jar
lib/%%SEARCHUSER%%/lib/lucene-suggest-7.0.1.jar
lib/%%SEARCHUSER%%/lib/plugin-cli-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/lib/securesm-1.2.jar
lib/%%SEARCHUSER%%/lib/snakeyaml-1.15.jar
lib/%%SEARCHUSER%%/lib/spatial4j-0.6.jar
lib/%%SEARCHUSER%%/lib/t-digest-3.0.jar
lib/%%SEARCHUSER%%/modules/aggs-matrix-stats/aggs-matrix-stats-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/modules/aggs-matrix-stats/plugin-descriptor.properties
lib/%%SEARCHUSER%%/modules/analysis-common/analysis-common-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/modules/analysis-common/plugin-descriptor.properties
lib/%%SEARCHUSER%%/modules/ingest-common/ingest-common-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/modules/ingest-common/jcodings-1.0.12.jar
lib/%%SEARCHUSER%%/modules/ingest-common/joni-2.1.6.jar
lib/%%SEARCHUSER%%/modules/ingest-common/plugin-descriptor.properties
lib/%%SEARCHUSER%%/modules/lang-expression/antlr4-runtime-4.5.1-1.jar
lib/%%SEARCHUSER%%/modules/lang-expression/asm-5.0.4.jar
lib/%%SEARCHUSER%%/modules/lang-expression/asm-commons-5.0.4.jar
lib/%%SEARCHUSER%%/modules/lang-expression/asm-tree-5.0.4.jar
lib/%%SEARCHUSER%%/modules/lang-expression/lang-expression-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/modules/lang-expression/lucene-expressions-7.0.1.jar
lib/%%SEARCHUSER%%/modules/lang-expression/plugin-descriptor.properties
lib/%%SEARCHUSER%%/modules/lang-expression/plugin-security.policy
lib/%%SEARCHUSER%%/modules/lang-mustache/compiler-0.9.3.jar
lib/%%SEARCHUSER%%/modules/lang-mustache/lang-mustache-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/modules/lang-mustache/plugin-descriptor.properties
lib/%%SEARCHUSER%%/modules/lang-mustache/plugin-security.policy
lib/%%SEARCHUSER%%/modules/lang-painless/antlr4-runtime-4.5.1-1.jar
lib/%%SEARCHUSER%%/modules/lang-painless/asm-debug-all-5.1.jar
lib/%%SEARCHUSER%%/modules/lang-painless/lang-painless-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/modules/lang-painless/plugin-descriptor.properties
lib/%%SEARCHUSER%%/modules/lang-painless/plugin-security.policy
lib/%%SEARCHUSER%%/modules/parent-join/parent-join-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/modules/parent-join/plugin-descriptor.properties
lib/%%SEARCHUSER%%/modules/percolator/percolator-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/modules/percolator/plugin-descriptor.properties
lib/%%SEARCHUSER%%/modules/reindex/commons-codec-1.10.jar
lib/%%SEARCHUSER%%/modules/reindex/commons-logging-1.1.3.jar
lib/%%SEARCHUSER%%/modules/reindex/%%SEARCHUSER%%-rest-client-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/modules/reindex/httpasyncclient-4.1.2.jar
lib/%%SEARCHUSER%%/modules/reindex/httpclient-4.5.2.jar
lib/%%SEARCHUSER%%/modules/reindex/httpcore-4.4.5.jar
lib/%%SEARCHUSER%%/modules/reindex/httpcore-nio-4.4.5.jar
lib/%%SEARCHUSER%%/modules/reindex/plugin-descriptor.properties
lib/%%SEARCHUSER%%/modules/reindex/plugin-security.policy
lib/%%SEARCHUSER%%/modules/reindex/reindex-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/modules/repository-url/plugin-descriptor.properties
lib/%%SEARCHUSER%%/modules/repository-url/plugin-security.policy
lib/%%SEARCHUSER%%/modules/repository-url/repository-url-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/modules/transport-netty4/netty-buffer-4.1.13.Final.jar
lib/%%SEARCHUSER%%/modules/transport-netty4/netty-codec-4.1.13.Final.jar
lib/%%SEARCHUSER%%/modules/transport-netty4/netty-codec-http-4.1.13.Final.jar
lib/%%SEARCHUSER%%/modules/transport-netty4/netty-common-4.1.13.Final.jar
lib/%%SEARCHUSER%%/modules/transport-netty4/netty-handler-4.1.13.Final.jar
lib/%%SEARCHUSER%%/modules/transport-netty4/netty-resolver-4.1.13.Final.jar
lib/%%SEARCHUSER%%/modules/transport-netty4/netty-transport-4.1.13.Final.jar
lib/%%SEARCHUSER%%/modules/transport-netty4/plugin-descriptor.properties
lib/%%SEARCHUSER%%/modules/transport-netty4/plugin-security.policy
lib/%%SEARCHUSER%%/modules/transport-netty4/transport-netty4-%%PORTVERSION%%.jar
lib/%%SEARCHUSER%%/modules/tribe/plugin-descriptor.properties
lib/%%SEARCHUSER%%/modules/tribe/tribe-%%PORTVERSION%%.jar
%%PORTDOCS%%%%DOCSDIR%%/LICENSE.txt
%%PORTDOCS%%%%DOCSDIR%%/NOTICE.txt
%%PORTDOCS%%%%DOCSDIR%%/README.textile
@dir lib/%%SEARCHUSER%%/plugins
@dir libexec/%%SEARCHUSER%%
@dir(%%SEARCHUSER%%,%%SEARCHGROUP%%,750) %%ELASTIC_LOGDIR%%
@dir(%%SEARCHUSER%%,%%SEARCHGROUP%%,750) %%ELASTIC_DBDIR%%
@postunexec if [ -d %%ELASTIC_LOGDIR%% ]; then echo "You should remove %%ELASTIC_LOGDIR%% if you don't need it any more."; fi
@postunexec if [ -d %%ELASTIC_DBDIR%% ]; then echo "You should remove %%ELASTIC_DBDIR%% if you don't need it any more."; fi