sysutils/logstash6: Fix ability to install plugins

- Backport fix for plugin *updates* that upstream hasn't released yet
- Fix an expr syntax error which was really from upstream jruby;
logstash doesn't ship with a new enough jruby that includes this fix yet
This commit is contained in:
Mark Felder 2018-03-14 22:50:27 +00:00
parent 1e7ac4032b
commit 6b9845615d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=464536
6 changed files with 74 additions and 9 deletions

View file

@ -3,7 +3,7 @@
PORTNAME= logstash
PORTVERSION= 6.2.2
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= sysutils java
MASTER_SITES= http://artifacts.elastic.co/downloads/logstash/
PKGNAMESUFFIX= 6
@ -18,7 +18,7 @@ RUN_DEPENDS= ${LOCALBASE}/bin/bash:shells/bash
CONFLICTS= logstash-[0-9]* logstash5-[0-9]*
USES= cpe shebangfix
SHEBANG_FILES= bin/logstash
SHEBANG_FILES= bin/*
CPE_VENDOR= elasticsearch
USE_JAVA= yes
JAVA_VERSION= 1.8+
@ -34,7 +34,6 @@ LOGSTASH_HOME?= ${PREFIX}/${PORTNAME}
SUB_LIST= JAVA_HOME=${JAVA_HOME} \
LOGSTASH_HOME=${LOGSTASH_HOME}
LOGSTASH_BIN_FILES= logstash
LOGSTASH_CONF_FILES= jvm.options log4j2.properties logstash.yml pipelines.yml
LOGSTASH_JRUBY_SUBDIR= vendor/jruby/bin
LOGSTASH_JRUBY_BIN_FILES= ast irb jirb jruby jruby.sh rdoc testrb gem \
@ -42,22 +41,22 @@ LOGSTASH_JRUBY_BIN_FILES= ast irb jirb jruby jruby.sh rdoc testrb gem \
post-patch:
${REINPLACE_CMD} 's|%%ETCDIR%%|${ETCDIR}|g' ${WRKSRC}/config/logstash.yml
${FIND} ${WRKSRC} -name '*.orig' -delete
do-install:
@${FIND} ${WRKSRC} -name '*.bat' -delete
${FIND} ${WRKSRC} -name '*.bat' -delete
${MKDIR} ${STAGEDIR}${ETCDIR}
${INSTALL_DATA} ${FILESDIR}/logstash.conf.sample ${STAGEDIR}${ETCDIR}
.for x in ${LOGSTASH_CONF_FILES}
${INSTALL_DATA} ${WRKSRC}/config/${x} ${STAGEDIR}${ETCDIR}/${x}.sample
.endfor
${RM} -rf ${WRKSRC}/config
@(cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${LOGSTASH_DIR})
.for x in ${LOGSTASH_BIN_FILES}
@${CHMOD} ${BINMODE} ${STAGEDIR}${LOGSTASH_DIR}/bin/${x}
.endfor
(cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${LOGSTASH_DIR})
${CHMOD} ${BINMODE} ${STAGEDIR}${LOGSTASH_DIR}/bin/*
.for x in ${LOGSTASH_JRUBY_BIN_FILES}
@${CHMOD} ${BINMODE} ${STAGEDIR}${LOGSTASH_DIR}/${LOGSTASH_JRUBY_SUBDIR}/${x}
${CHMOD} ${BINMODE} ${STAGEDIR}${LOGSTASH_DIR}/${LOGSTASH_JRUBY_SUBDIR}/${x}
.endfor
${INSTALL} -lrs ${STAGEDIR}${ETCDIR} ${STAGEDIR}${LOGSTASH_DIR}/config
post-install:
${ECHO} "@sample ${ETCDIR}/logstash.conf.sample" >> ${TMPPLIST}

View file

@ -0,0 +1,10 @@
--- Gemfile.orig 2018-03-14 22:38:33 UTC
+++ Gemfile
@@ -4,6 +4,7 @@
source "https://rubygems.org"
gem "logstash-core", :path => "./logstash-core"
gem "logstash-core-plugin-api", :path => "./logstash-core-plugin-api"
+gem "atomic", "<= 1.1.99"
gem "paquet", "~> 0.2.0"
gem "ruby-progressbar", "~> 1.8.1"
gem "builder", "~> 3.2.2"

View file

@ -0,0 +1,10 @@
--- Gemfile.lock.orig 2018-03-14 22:30:17 UTC
+++ Gemfile.lock
@@ -604,6 +604,7 @@ PLATFORMS
java
DEPENDENCIES
+ atomic (<= 1.1.99)
benchmark-ips
builder (~> 3.2.2)
ci_reporter_rspec (= 1.0.0)

View file

@ -0,0 +1,11 @@
--- vendor/jruby/bin/jruby.orig 2018-02-16 20:50:22 UTC
+++ vendor/jruby/bin/jruby
@@ -244,7 +244,7 @@ do
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
-X*)
val=${1:2}
- if expr "$val" : '.*[.]' > /dev/null; then
+ if expr -- "$val" : '.*[.]' > /dev/null; then
java_args=("${java_args[@]}" "-Djruby.${val}")
else
ruby_args=("${ruby_args[@]}" "-X${val}")

View file

@ -0,0 +1,11 @@
--- vendor/jruby/bin/jruby.bash.orig 2018-02-16 20:50:22 UTC
+++ vendor/jruby/bin/jruby.bash
@@ -244,7 +244,7 @@ do
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
-X*)
val=${1:2}
- if expr "$val" : '.*[.]' > /dev/null; then
+ if expr -- "$val" : '.*[.]' > /dev/null; then
java_args=("${java_args[@]}" "-Djruby.${val}")
else
ruby_args=("${ruby_args[@]}" "-X${val}")

View file

@ -0,0 +1,24 @@
--- vendor/jruby/bin/jruby.sh.orig 2018-02-16 20:50:22 UTC
+++ vendor/jruby/bin/jruby.sh
@@ -26,9 +26,9 @@ progname=`basename "$0"`
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '.*/.*' > /dev/null; then
- if expr "$link" : '/' > /dev/null; then
+ link=`expr -- "$ls" : '.*-> \(.*\)$'`
+ if expr -- "$link" : '.*/.*' > /dev/null; then
+ if expr -- "$link" : '/' > /dev/null; then
PRG="$link"
else
PRG="`dirname ${PRG}`/${link}"
@@ -202,7 +202,7 @@ do
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
-X*)
val=${1:2}
- if expr "$val" : '.*[.]' > /dev/null; then
+ if expr -- "$val" : '.*[.]' > /dev/null; then
java_args="${java_args} -Djruby.${val}"
else
ruby_args="${ruby_args} -X${val}"