From ebf9ed4e9ed10b59333923e0a424e2d35a6bcce8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 13 Mar 2014 22:12:25 +0100 Subject: [PATCH] Simplify and fix integration with Debian: - no patching of Gemfile.lock, just using empty file - Gemfile.lock writable by rocci - remove all :development, :test, :doc unused openssl-cms gems from Gemfile - workaround problem with missing gemspec of passenger - document what to do in the unbundle patch --- rocci-server/debian/README.Debian | 10 + rocci-server/debian/patches/unbundle-all.patch | 399 +++++-------------------- rocci-server/debian/rocci-server.install | 1 - rocci-server/debian/rocci-server.links | 2 - rocci-server/debian/rocci-server.postinst | 1 + rocci-server/debian/rules | 4 +- 6 files changed, 93 insertions(+), 324 deletions(-) delete mode 100644 rocci-server/debian/rocci-server.links diff --git a/rocci-server/debian/README.Debian b/rocci-server/debian/README.Debian index de4055d..967029b 100644 --- a/rocci-server/debian/README.Debian +++ b/rocci-server/debian/README.Debian @@ -25,3 +25,13 @@ a2enmod ssl a2ensite occi-ssl a2enmod passenger service apache2 restart + + +Unstable +======== + +When bundler fails when loading gems (in apache error log), it is possible to +workaround problems by installing missing gems by ruby way. +For example: + +gem install minitest --version '~> 4.2' diff --git a/rocci-server/debian/patches/unbundle-all.patch b/rocci-server/debian/patches/unbundle-all.patch index 2d727bf..77d3ec0 100644 --- a/rocci-server/debian/patches/unbundle-all.patch +++ b/rocci-server/debian/patches/unbundle-all.patch @@ -1,346 +1,105 @@ -commit b7946a7755d6f24511865275a4030683494b91ec +commit 5ca58f72daa7f3169c9fb2d841ccf40fe963b698 Author: František Dvořák -Date: Thu Mar 13 18:31:34 2014 +0100 +Date: Fri Mar 14 14:20:00 2014 +0100 - All gems from the system, no git references in Gemfiles, disable :development and :test. + All gems from the system: + + 1) remove all not installed gems from Gemfiles (openssl_cms_2_0_0, openssl_cms_2_1) + 1b) also :developemnt, :test: and :docs + 1c) alse remove passenger (workarounds problem with missing gemspec for passenger) + 2) remove git references from Gemfiles (logstash, openssl_cms) diff --git a/Gemfile b/Gemfile -index 94a3593..7d2b2f4 100644 +index 27f06f9..d7a9eb1 100644 --- a/Gemfile +++ b/Gemfile -@@ -25,9 +25,6 @@ gem 'debugger', group: [:development, :test] +@@ -7,66 +7,12 @@ gem 'rails-api', '~> 0.2.0' + # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder + gem 'jbuilder', '~> 2.0.0' + +-group :doc do +- # bundle exec rake doc:rails generates the API under doc/api. +- gem 'sdoc', require: false +-end +- + # Use ActiveModel has_secure_password + # gem 'bcrypt-ruby', '~> 3.0.0' + +-# Use Capistrano for deployment +-gem 'capistrano', group: :development +-gem 'rvm-capistrano', group: :development +- +-# Use debugger +-gem 'debugger', group: [:development, :test] +- # Use whenever for scheduled jobs gem 'whenever', require: false -# Use passenger for deployment (standalone or in Apache2) --gem 'passenger', '= 4.0.29' +-gem 'passenger', '~> 4.0.38' - - # Use simplecov for coverage reports - gem 'simplecov', group: [:development, :test] - -@@ -75,7 +72,7 @@ gem 'kgio' - gem 'warden' - - # Sensible logging with LogStash support --gem 'logstasher', git: "git://github.com/arax/logstasher.git", branch: "master" -+gem 'logstasher' - - # Use Hashie::Mash to simplify hash-related stuff - gem 'hashie' -diff --git a/Gemfile.lock b/Gemfile.lock -index 3a6dbbd..e7d0317 100644 ---- a/Gemfile.lock -+++ b/Gemfile.lock -@@ -1,294 +1,21 @@ --GIT -- remote: git://github.com/arax/logstasher.git -- revision: 4ceebbb27b647d7f15776afba4893684c575ce72 -- branch: master -- specs: -- logstasher (0.5.0) -- logstash-event (~> 1.1.0) +-# Use simplecov for coverage reports +-gem 'simplecov', group: [:development, :test] +- +-# Use RSpec for unit tests +-gem 'rspec-rails', group: [:development, :test] +-gem 'fuubar', group: [:development, :test] - --GIT -- remote: https://github.com/arax/openssl-cms.git -- revision: b6d079c076a9b8e15c573bf6660772ee83e34dd4 -- branch: ruby_1_9_3 -- specs: -- openssl_cms_1_9_3 (0.0.2) +-# Use Pry for debugging +-gem 'pry-rails', group: [:development, :test] +-gem 'pry-rescue', group: [:development, :test] +-gem 'pry-stack_explorer', group: [:development, :test] - --GIT -- remote: https://github.com/arax/openssl-cms.git -- revision: 7fea071f542ff1cb57c28dffe623122848ed3f99 -- branch: ruby_2_0_0 -- specs: -- openssl_cms_2_0_0 (0.0.2) +-# Use guard to speed-up devel process +-gem 'guard-bundler', group: :development +-gem 'guard-test', group: :development +-gem 'guard-rails', group: :development - --GIT -- remote: https://github.com/arax/openssl-cms.git -- revision: b789b696d821bd6563dd207fb6b562c06acc835b -- branch: ruby_2_1 -- specs: -- openssl_cms_2_1 (0.0.2) +-# Use notification libs to integrate guard with pop-ups +-gem 'rb-inotify', require: false, group: :development +-gem 'libnotify', group: :development - - GEM - remote: https://rubygems.org/ -- specs: -- actionmailer (4.0.3) -- actionpack (= 4.0.3) -- mail (~> 2.5.4) -- actionpack (4.0.3) -- activesupport (= 4.0.3) -- builder (~> 3.1.0) -- erubis (~> 2.7.0) -- rack (~> 1.5.2) -- rack-test (~> 0.6.2) -- activemodel (4.0.3) -- activesupport (= 4.0.3) -- builder (~> 3.1.0) -- activerecord (4.0.3) -- activemodel (= 4.0.3) -- activerecord-deprecated_finders (~> 1.0.2) -- activesupport (= 4.0.3) -- arel (~> 4.0.0) -- activerecord-deprecated_finders (1.0.3) -- activesupport (4.0.3) -- i18n (~> 0.6, >= 0.6.4) -- minitest (~> 4.2) -- multi_json (~> 1.3) -- thread_safe (~> 0.1) -- tzinfo (~> 0.3.37) -- arel (4.0.2) -- atomic (1.1.15) -- binding_of_caller (0.7.2) -- debug_inspector (>= 0.0.1) -- bond (0.5.1) -- builder (3.1.4) -- capistrano (2.15.5) -- highline -- net-scp (>= 1.0.0) -- net-sftp (>= 2.0.0) -- net-ssh (>= 2.0.14) -- net-ssh-gateway (>= 1.1.0) -- celluloid (0.15.2) -- timers (~> 1.1.0) -- celluloid-io (0.15.0) -- celluloid (>= 0.15.0) -- nio4r (>= 0.5.0) -- chronic (0.10.2) -- coderay (1.1.0) -- columnize (0.3.6) -- daemon_controller (1.2.0) -- dalli (2.7.0) -- debug_inspector (0.0.2) -- debugger (1.6.6) -- columnize (>= 0.3.1) -- debugger-linecache (~> 1.2.0) -- debugger-ruby_core_source (~> 1.3.2) -- debugger-linecache (1.2.0) -- debugger-ruby_core_source (1.3.2) -- diff-lcs (1.2.5) -- docile (1.1.3) -- erubis (2.7.0) -- ffi (1.9.3) -- formatador (0.2.4) -- fuubar (1.3.2) -- rspec (>= 2.14.0, < 3.1.0) -- ruby-progressbar (~> 1.3) -- guard (2.5.1) -- formatador (>= 0.2.4) -- listen (~> 2.6) -- lumberjack (~> 1.0) -- pry (>= 0.9.12) -- thor (>= 0.18.1) -- guard-bundler (2.0.0) -- bundler (~> 1.0) -- guard (~> 2.2) -- guard-rails (0.5.0) -- guard (>= 2.0.0) -- guard-test (2.0.4) -- guard (~> 2.0) -- test-unit (~> 2.2) -- hashie (2.0.5) -- highline (1.6.21) -- hike (1.2.3) -- hirb (0.7.1) -- i18n (0.6.9) -- ice_nine (0.11.0) -- interception (0.5) -- jbuilder (2.0.4) -- activesupport (>= 3.0.0) -- multi_json (>= 1.2.0) -- json (1.8.1) -- kgio (2.9.2) -- libnotify (0.8.2) -- ffi (>= 1.0.11) -- listen (2.7.0) -- celluloid (>= 0.15.2) -- celluloid-io (>= 0.15.0) -- rb-fsevent (>= 0.9.3) -- rb-inotify (>= 0.9) -- logstash-event (1.1.5) -- lumberjack (1.0.4) -- mail (2.5.4) -- mime-types (~> 1.16) -- treetop (~> 1.4.8) -- method_source (0.8.2) -- mime-types (1.25.1) -- mini_portile (0.5.2) -- minitest (4.7.5) -- multi_json (1.9.0) -- net-scp (1.1.2) -- net-ssh (>= 2.6.5) -- net-sftp (2.1.2) -- net-ssh (>= 2.6.5) -- net-ssh (2.8.0) -- net-ssh-gateway (1.2.0) -- net-ssh (>= 2.6.5) -- nio4r (1.0.0) -- nokogiri (1.6.1) -- mini_portile (~> 0.5.0) -- occi-core (4.2.10) -- activesupport (~> 4.0.0) -- hashie -- json -- settingslogic -- uuidtools (>= 2.1.3) -- opennebula (4.4.0) -- json -- nokogiri -- passenger (4.0.29) -- daemon_controller (>= 1.1.0) -- rack -- rake (>= 0.8.1) -- polyglot (0.3.4) -- pry (0.9.12.6) -- coderay (~> 1.0) -- method_source (~> 0.8) -- slop (~> 3.4) -- pry-rails (0.3.2) -- pry (>= 0.9.10) -- pry-rescue (1.4.0) -- interception (>= 0.4) -- pry -- pry-stack_explorer (0.4.9.1) -- binding_of_caller (>= 0.7) -- pry (>= 0.9.11) -- rack (1.5.2) -- rack-test (0.6.2) -- rack (>= 1.0) -- rails (4.0.3) -- actionmailer (= 4.0.3) -- actionpack (= 4.0.3) -- activerecord (= 4.0.3) -- activesupport (= 4.0.3) -- bundler (>= 1.3.0, < 2.0) -- railties (= 4.0.3) -- sprockets-rails (~> 2.0.0) -- rails-api (0.2.0) -- actionpack (>= 3.2.11) -- railties (>= 3.2.11) -- railties (4.0.3) -- actionpack (= 4.0.3) -- activesupport (= 4.0.3) -- rake (>= 0.8.7) -- thor (>= 0.18.1, < 2.0) -- rake (10.1.1) -- rb-fsevent (0.9.4) -- rb-inotify (0.9.3) -- ffi (>= 0.5.0) -- rdoc (4.1.1) -- json (~> 1.4) -- redcarpet (3.1.1) -- rspec (2.14.1) -- rspec-core (~> 2.14.0) -- rspec-expectations (~> 2.14.0) -- rspec-mocks (~> 2.14.0) -- rspec-core (2.14.8) -- rspec-expectations (2.14.5) -- diff-lcs (>= 1.1.3, < 2.0) -- rspec-mocks (2.14.6) -- rspec-rails (2.14.1) -- actionpack (>= 3.0) -- activemodel (>= 3.0) -- activesupport (>= 3.0) -- railties (>= 3.0) -- rspec-core (~> 2.14.0) -- rspec-expectations (~> 2.14.0) -- rspec-mocks (~> 2.14.0) -- ruby-progressbar (1.4.2) -- rvm-capistrano (1.5.1) -- capistrano (~> 2.15.4) -- sdoc (0.4.0) -- json (~> 1.8) -- rdoc (~> 4.0, < 5.0) -- settingslogic (2.0.9) -- simplecov (0.8.2) -- docile (~> 1.1.0) -- multi_json -- simplecov-html (~> 0.8.0) -- simplecov-html (0.8.0) -- slop (3.4.7) -- sprockets (2.11.0) -- hike (~> 1.2) -- multi_json (~> 1.0) -- rack (~> 1.0) -- tilt (~> 1.1, != 1.3.0) -- sprockets-rails (2.0.1) -- actionpack (>= 3.0) -- activesupport (>= 3.0) -- sprockets (~> 2.8) -- test-unit (2.5.5) -- thor (0.18.1) -- thread_safe (0.2.0) -- atomic (>= 1.1.7, < 2) -- tilt (1.4.1) -- timers (1.1.0) -- treetop (1.4.15) -- polyglot -- polyglot (>= 0.3.1) -- tzinfo (0.3.38) -- uuidtools (2.1.4) -- warden (1.2.3) -- rack (>= 1.0) -- whenever (0.9.2) -- activesupport (>= 2.3.4) -- chronic (>= 0.6.3) -- yard (0.8.7.3) +-# Use YARD for documentation +-gem 'yard', group: :development +-gem 'redcarpet', group: :development +- +-# Use bond+hirb to extend irb +-# +-# Add the following to your ~/.irbrc: +-# +-# require 'bond' +-# require 'hirb' +-# +-# Bond.start +-# Hirb.enable +-# +-# Or type it in the current irb session. +-gem 'bond', group: :development +-gem 'hirb', group: :development +- + # Caching stuff + gem 'dalli' + gem 'kgio' +@@ -75,7 +21,7 @@ gem 'kgio' + gem 'warden', '~> 1.2.3' - PLATFORMS - ruby + # Sensible logging with LogStash support +-gem 'logstasher', git: "git://github.com/arax/logstasher.git", branch: "master" ++gem 'logstasher', branch: "master" - DEPENDENCIES -- bond -- capistrano - dalli -- debugger - erubis -- fuubar -- guard-bundler -- guard-rails -- guard-test - hashie -- hirb - ice_nine - jbuilder (~> 2.0.0) - kgio -- libnotify -- logstasher! -+ logstasher - occi-core (~> 4.2.10) - opennebula (~> 4.4.0) -- openssl_cms_1_9_3! -- openssl_cms_2_0_0! -- openssl_cms_2_1! -- passenger (= 4.0.29) -- pry-rails -- pry-rescue -- pry-stack_explorer -+ openssl_cms_1_9_3 - rails (~> 4.0.0) - rails-api (~> 0.2.0) -- rb-inotify -- redcarpet -- rspec-rails -- rvm-capistrano -- sdoc -- simplecov - warden - whenever -- yard + # Use Hashie::Mash to simplify hash-related stuff + gem 'hashie' diff --git a/lib/authentication_strategies/bundles/Gemfile.keystone b/lib/authentication_strategies/bundles/Gemfile.keystone -index 7abebc5..a1de43b 100644 +index 7abebc5..8aaee38 100644 --- a/lib/authentication_strategies/bundles/Gemfile.keystone +++ b/lib/authentication_strategies/bundles/Gemfile.keystone -@@ -1,8 +1,8 @@ +@@ -1,8 +1,4 @@ # Deps for the Keystone auth. strategy #raise "KeystoneStrategy requires CRuby!" unless RUBY_ENGINE == "ruby" -gem "openssl_cms_1_9_3", git: 'https://github.com/arax/openssl-cms.git', branch: 'ruby_1_9_3', require: false, platforms: :ruby_19 -+gem "openssl_cms_1_9_3", require: false, platforms: :ruby_19 - +- -gem "openssl_cms_2_0_0", git: 'https://github.com/arax/openssl-cms.git', branch: 'ruby_2_0_0', require: false, platforms: :ruby_20 -+gem "openssl_cms_2_0_0", require: false, platforms: :ruby_20 - +- -gem "openssl_cms_2_1", git: 'https://github.com/arax/openssl-cms.git', branch: 'ruby_2_1', require: false, platforms: :ruby_21 -+gem "openssl_cms_2_1", require: false, platforms: :ruby_21 ++gem "openssl_cms_1_9_3", require: false, platforms: :ruby_19 diff --git a/rocci-server/debian/rocci-server.install b/rocci-server/debian/rocci-server.install index 892bdad..90825fb 100644 --- a/rocci-server/debian/rocci-server.install +++ b/rocci-server/debian/rocci-server.install @@ -10,7 +10,6 @@ test usr/share/rocci-server Capfile usr/share/rocci-server Rakefile usr/share/rocci-server Gemfile usr/share/rocci-server -Gemfile.lock usr/share/rocci-server Guardfile usr/share/rocci-server config.ru usr/share/rocci-server diff --git a/rocci-server/debian/rocci-server.links b/rocci-server/debian/rocci-server.links deleted file mode 100644 index 53d2222..0000000 --- a/rocci-server/debian/rocci-server.links +++ /dev/null @@ -1,2 +0,0 @@ -# no FHS support, just point to proper place -usr/share/rocci-server/etc etc/rocci-server diff --git a/rocci-server/debian/rocci-server.postinst b/rocci-server/debian/rocci-server.postinst index b3aae0f..4c30ded 100644 --- a/rocci-server/debian/rocci-server.postinst +++ b/rocci-server/debian/rocci-server.postinst @@ -8,5 +8,6 @@ if [ "$1" != "configure" -a "$1" != "reconfigure" ]; then fi chown -R rocci:rocci /var/log/rocci-server +chown rocci:rocci /usr/share/rocci-server/Gemfile.lock exit 0 diff --git a/rocci-server/debian/rules b/rocci-server/debian/rules index 45b4902..3bfcce9 100755 --- a/rocci-server/debian/rules +++ b/rocci-server/debian/rules @@ -16,7 +16,9 @@ binary: override_dh_install: dh_apache2 -procci-server-apache dh_install - rm -rfv debian/rocci-server/usr/bin debian/rocci-server/usr/lib + rm -rfv debian/rocci-server/usr/bin + # let ruby write to the lock file as needed + touch debian/rocci-server/usr/share/rocci-server/Gemfile.lock override_dh_installdocs: dh_installdocs --link-doc=$(p_name) -- 1.8.2.3