File 0003-Use-installed-jruby.patch of Package logstash5

From 4898184f2d3c2fccae21e84e77237b7282d509f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de>
Date: Mon, 30 Jan 2017 21:15:09 +0100
Subject: [PATCH 3/8] Use installed jruby

---
 bin/cpdump               | 2 +-
 bin/logstash.lib.sh      | 2 +-
 rakelib/z_rubycheck.rake | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bin/cpdump b/bin/cpdump
index dd5f09b5c9ba..28435c5fa777 100755
--- a/bin/cpdump
+++ b/bin/cpdump
@@ -1,4 +1,4 @@
-#!/usr/bin/env bin/ruby
+#!/usr/bin/env /usr/bin/jruby
 
 require_relative "../lib/bootstrap/environment"
 LogStash::Bundler.setup!({:without => [:build, :development]})
diff --git a/bin/logstash.lib.sh b/bin/logstash.lib.sh
index 76aa335f5ef6..3c470d6c7ddb 100755
--- a/bin/logstash.lib.sh
+++ b/bin/logstash.lib.sh
@@ -139,7 +139,7 @@ setup_drip() {
 }
 
 setup_vendored_jruby() {
-  JRUBY_BIN="${LOGSTASH_HOME}/vendor/jruby/bin/jruby"
+  JRUBY_BIN="/usr/bin/jruby"
 
   if [ ! -f "${JRUBY_BIN}" ] ; then
     echo "Unable to find JRuby."
diff --git a/rakelib/z_rubycheck.rake b/rakelib/z_rubycheck.rake
index bf077b8700b2..11e3d2efe710 100644
--- a/rakelib/z_rubycheck.rake
+++ b/rakelib/z_rubycheck.rake
@@ -1,6 +1,6 @@
 if ENV['USE_RUBY'] != '1'
-  if RUBY_ENGINE != "jruby" or Gem.ruby !~ /vendor\/jruby\/bin\/jruby/
-    puts "Restarting myself under Vendored JRuby (currently #{RUBY_ENGINE} #{RUBY_VERSION})" if ENV['DEBUG']
+  if RUBY_ENGINE != "jruby" or Gem.ruby !~ /usr\/share\/jruby\/bin\/jruby/
+    puts "Restarting myself under Vendored JRuby (currently #{Gem.ruby} - #{RUBY_ENGINE} #{RUBY_VERSION} )" if ENV['DEBUG']
 
     if ["mingw32", "mswin32"].include?(RbConfig::CONFIG["host_os"])
       # Use our own SSL certs when on Windows
@@ -26,8 +26,8 @@ if ENV['USE_RUBY'] != '1'
 
     # Make sure we have JRuby, then rerun ourselves under jruby.
     Rake::Task["vendor:jruby"].invoke
-    jruby = File.join("vendor", "jruby", "bin", "jruby")
-    rake = File.join("vendor", "jruby", "bin", "rake")
+    jruby = File.join("/usr", "bin", "jruby")
+    rake = File.join("/usr", "bin", "jrake")
 
     # if required at this point system gems can be installed using the system_gem task, for example:
     # Rake::Task["vendor:system_gem"].invoke(jruby, "ffi", "1.9.6")
-- 
2.26.0

openSUSE Build Service is sponsored by