svn commit: r462845 - in head/textproc/elasticsearch6: . files
Mark Felder
feld at FreeBSD.org
Sat Feb 24 15:42:13 UTC 2018
Author: feld
Date: Sat Feb 24 15:42:11 2018
New Revision: 462845
URL: https://svnweb.freebsd.org/changeset/ports/462845
Log:
textproc/elasticsearch6: Update to 6.2.2
- Take maintainership
- Sync up with work done on textproc/elasticsearch5 port
Approved by: maintainer (private email)
Deleted:
head/textproc/elasticsearch6/pkg-plist
Modified:
head/textproc/elasticsearch6/Makefile
head/textproc/elasticsearch6/distinfo
head/textproc/elasticsearch6/files/elasticsearch.in
head/textproc/elasticsearch6/files/pkg-message.in
Modified: head/textproc/elasticsearch6/Makefile
==============================================================================
--- head/textproc/elasticsearch6/Makefile Sat Feb 24 15:25:48 2018 (r462844)
+++ head/textproc/elasticsearch6/Makefile Sat Feb 24 15:42:11 2018 (r462845)
@@ -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 at FreeBSD.org
+MAINTAINER= feld at 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>
Modified: head/textproc/elasticsearch6/distinfo
==============================================================================
--- head/textproc/elasticsearch6/distinfo Sat Feb 24 15:25:48 2018 (r462844)
+++ head/textproc/elasticsearch6/distinfo Sat Feb 24 15:42:11 2018 (r462845)
@@ -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
Modified: head/textproc/elasticsearch6/files/elasticsearch.in
==============================================================================
--- head/textproc/elasticsearch6/files/elasticsearch.in Sat Feb 24 15:25:48 2018 (r462844)
+++ head/textproc/elasticsearch6/files/elasticsearch.in Sat Feb 24 15:42:11 2018 (r462845)
@@ -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:-}"
Modified: head/textproc/elasticsearch6/files/pkg-message.in
==============================================================================
--- head/textproc/elasticsearch6/files/pkg-message.in Sat Feb 24 15:25:48 2018 (r462844)
+++ head/textproc/elasticsearch6/files/pkg-message.in Sat Feb 24 15:42:11 2018 (r462845)
@@ -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.
+
======================================================================
More information about the svn-ports-head
mailing list