f973828
From 0e0a738cbe1a361e548a31a5a9aaf9b4acfec7cb Mon Sep 17 00:00:00 2001
f973828
From: Ondrej Mular <omular@redhat.com>
f973828
Date: Sat, 1 Jul 2017 20:21:26 +0200
2fc0ad8
Subject: [PATCH] fedfix
21e433b
21e433b
---
0a8dade
 pcs/pcs                  |  2 +-
195f96a
 pcs/test/suite.py        |  2 +-
f973828
 pcsd/Makefile            | 30 +++---------------------------
0a8dade
 pcsd/pcsd.rb             |  1 +
0a8dade
 pcsd/pcsd.service-runner |  3 ++-
f973828
 5 files changed, 8 insertions(+), 30 deletions(-)
21e433b
0a8dade
diff --git a/pcs/pcs b/pcs/pcs
f973828
index 4585fd5..d35933e 100755
0a8dade
--- a/pcs/pcs
0a8dade
+++ b/pcs/pcs
0a8dade
@@ -1,4 +1,4 @@
0a8dade
-#!/usr/bin/env python
0a8dade
+#!/usr/bin/env python3
b23d2bf
 
0a8dade
 from __future__ import absolute_import
0a8dade
 import os.path
195f96a
diff --git a/pcs/test/suite.py b/pcs/test/suite.py
f973828
index fcac586..ec4b864 100755
195f96a
--- a/pcs/test/suite.py
195f96a
+++ b/pcs/test/suite.py
195f96a
@@ -1,4 +1,4 @@
195f96a
-#!/usr/bin/env python
195f96a
+#!/usr/bin/env python3
195f96a
 from __future__ import (
195f96a
     absolute_import,
195f96a
     division,
21e433b
diff --git a/pcsd/Makefile b/pcsd/Makefile
f973828
index 2ecd4de..24ce1fe 100644
21e433b
--- a/pcsd/Makefile
21e433b
+++ b/pcsd/Makefile
f973828
@@ -1,33 +1,9 @@
f973828
-FFI_VERSION="1.9.17"
f973828
-FFI_C_DIR=vendor/bundle/ruby/gems/ffi-${FFI_VERSION}/ext/ffi_c
f973828
-
a80e8a1
-build_gems: get_gems
21e433b
-	bundle install --local --deployment
f973828
-	#ffi makes symlink with absolute path. Let's change it to relative path.
f973828
-	for fname in `ls ${FFI_C_DIR}/libffi-*/include/ffitarget.h`; do \
f973828
-		if [[ -L "$$fname" ]]; then \
f973828
-			target=$$(readlink $$fname | sed "s~.*/${FFI_C_DIR}\(/libffi/src/[^/]\+/ffitarget.h\)~../..\1~"); \
f973828
-			rm $$fname; \
f973828
-			ln -s $$target $$fname; \
f973828
-		fi; \
f973828
-	done;
0a8dade
-
0a8dade
-# RHEL6 needs special rpam-ruby19 gem to work with 1.8.7
0a8dade
-# also bundler is not available on RHEL6 in rpm
0a8dade
-build_gems_rhel6:
a80e8a1
+build_gems:
0a8dade
 	mkdir -p vendor/bundle/ruby
0a8dade
-	gem install --verbose --no-rdoc --no-ri -l -i vendor/bundle/ruby \
0a8dade
-	vendor/cache/backports-3.6.8.gem \
195f96a
-	vendor/cache/ethon-0.9.1.gem \
f973828
-	vendor/cache/ffi-${FFI_VERSION}.gem \
195f96a
-	vendor/cache/json-2.0.3.gem \
195f96a
-	vendor/cache/multi_json-1.12.1.gem \
0a8dade
-	vendor/cache/open4-1.3.4.gem \
0a8dade
+	gem install --force --verbose --no-rdoc --no-ri -l -i vendor/bundle/ruby \
0a8dade
 	vendor/cache/orderedhash-0.0.6.gem \
0a8dade
 	vendor/cache/rack-1.6.4.gem \
0a8dade
-	vendor/cache/rack-protection-1.5.3.gem \
0a8dade
-	vendor/cache/rack-test-0.6.3.gem \
0a8dade
-	vendor/cache/rpam-ruby19-feist-1.2.1.1.gem \
0a8dade
+	vendor/cache/rpam-ruby19-1.2.1.gem \
195f96a
 	vendor/cache/sinatra-1.4.8.gem \
0a8dade
 	vendor/cache/sinatra-contrib-1.4.7.gem \
f973828
 	vendor/cache/tilt-2.0.6.gem \
0a8dade
diff --git a/pcsd/pcsd.rb b/pcsd/pcsd.rb
f973828
index 1026a36..ac1b3b9 100644
0a8dade
--- a/pcsd/pcsd.rb
0a8dade
+++ b/pcsd/pcsd.rb
0a8dade
@@ -1,3 +1,4 @@
195f96a
+gem 'sinatra', '= 1.4.8'
0a8dade
 require 'sinatra'
0a8dade
 require 'sinatra/reloader' if development?
0a8dade
 require 'sinatra/cookies'
0a8dade
diff --git a/pcsd/pcsd.service-runner b/pcsd/pcsd.service-runner
f973828
index 883d290..712913e 100644
0a8dade
--- a/pcsd/pcsd.service-runner
0a8dade
+++ b/pcsd/pcsd.service-runner
0a8dade
@@ -3,8 +3,9 @@
0a8dade
 # it also serves as a holder of a selinux context
21e433b
 
0a8dade
 begin
0a8dade
-  # add pcsd to the load path (ruby -I)
0a8dade
+  # add pcsd and bundled gems to the load path (ruby -I)
0a8dade
   libdir = File.dirname(__FILE__)
0a8dade
+  $LOAD_PATH.unshift(*Dir[libdir + '/vendor/bundle/ruby/gems/*/lib'])
0a8dade
   $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
0a8dade
 
0a8dade
   # change current directory (ruby -C)
21e433b
-- 
f973828
2.9.4
21e433b