From 76751bb5483683ef7c928878fe3307e13b3e4ee3 Mon Sep 17 00:00:00 2001 From: Tomas Jelinek Date: Thu, 22 Sep 2016 12:55:20 +0200 Subject: [PATCH] fedfix --- pcs/pcs | 2 +- pcs/test/suite.py | 2 +- pcsd/Makefile | 25 +++---------------------- pcsd/pcsd.rb | 1 + pcsd/pcsd.service-runner | 3 ++- 5 files changed, 8 insertions(+), 25 deletions(-) diff --git a/pcs/pcs b/pcs/pcs index 4585fd57..d35933e4 100755 --- a/pcs/pcs +++ b/pcs/pcs @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import absolute_import import os.path diff --git a/pcs/test/suite.py b/pcs/test/suite.py index 064b47e0..cf660d9e 100755 --- a/pcs/test/suite.py +++ b/pcs/test/suite.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import ( absolute_import, division, diff --git a/pcsd/Makefile b/pcsd/Makefile index 4b197669..ad21cb3d 100644 --- a/pcsd/Makefile +++ b/pcsd/Makefile @@ -1,30 +1,11 @@ -build_gems: get_gems - bundle install --local --deployment -#ffi makes symlink with absolute path. Let's change it to relative path. - rm vendor/bundle/ruby/gems/ffi-1.9.17/ext/ffi_c/libffi-x86_64-linux/include/ffitarget.h - ln -s \ - ../../libffi/src/x86/ffitarget.h \ - vendor/bundle/ruby/gems/ffi-1.9.17/ext/ffi_c/libffi-x86_64-linux/include/ffitarget.h - -# RHEL6 needs special rpam-ruby19 gem to work with 1.8.7 -# also bundler is not available on RHEL6 in rpm -build_gems_rhel6: +build_gems: mkdir -p vendor/bundle/ruby - gem install --verbose --no-rdoc --no-ri -l -i vendor/bundle/ruby \ - vendor/cache/backports-3.6.8.gem \ - vendor/cache/ethon-0.9.1.gem \ - vendor/cache/ffi-1.9.14.gem \ - vendor/cache/json-2.0.3.gem \ - vendor/cache/multi_json-1.12.1.gem \ - vendor/cache/open4-1.3.4.gem \ + gem install --force --verbose --no-rdoc --no-ri -l -i vendor/bundle/ruby \ vendor/cache/orderedhash-0.0.6.gem \ vendor/cache/rack-1.6.4.gem \ - vendor/cache/rack-protection-1.5.3.gem \ - vendor/cache/rack-test-0.6.3.gem \ - vendor/cache/rpam-ruby19-feist-1.2.1.1.gem \ + vendor/cache/rpam-ruby19-1.2.1.gem \ vendor/cache/sinatra-1.4.8.gem \ vendor/cache/sinatra-contrib-1.4.7.gem \ - vendor/cache/tilt-2.0.6.gem \ -- '--with-ldflags="-Wl,-z,now -Wl,-z,relro"' get_gems: diff --git a/pcsd/pcsd.rb b/pcsd/pcsd.rb index f45011e0..a07fc3c3 100644 --- a/pcsd/pcsd.rb +++ b/pcsd/pcsd.rb @@ -1,3 +1,4 @@ +gem 'sinatra', '= 1.4.8' require 'sinatra' require 'sinatra/reloader' if development? require 'sinatra/cookies' diff --git a/pcsd/pcsd.service-runner b/pcsd/pcsd.service-runner index 883d2908..712913ea 100644 --- a/pcsd/pcsd.service-runner +++ b/pcsd/pcsd.service-runner @@ -3,8 +3,9 @@ # it also serves as a holder of a selinux context begin - # add pcsd to the load path (ruby -I) + # add pcsd and bundled gems to the load path (ruby -I) libdir = File.dirname(__FILE__) + $LOAD_PATH.unshift(*Dir[libdir + '/vendor/bundle/ruby/gems/*/lib']) $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir) # change current directory (ruby -C) -- 2.11.0