Disable bundler.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 10 Sep 2014 23:28:48 +0000 (01:28 +0200)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 10 Sep 2014 23:28:48 +0000 (01:28 +0200)
rOCCI-server.spec
rocci-server-gemfile.diff [deleted file]
rocci-server-requires.diff [new file with mode: 0644]

index a79b70b..51b59c4 100644 (file)
@@ -1,7 +1,6 @@
 %global gem_name occi-server
 %global app_root %{_datadir}/%{name}
 %global semodule_name rocci_server
-%global use_bundler 1
 
 %global commit e142d83fc4214fdfd7498209e68491eb913cd1cf
 %global shortcommit %(c=%{commit}; echo ${c:0:7})
@@ -19,16 +18,16 @@ Source1:        %{semodule_name}.te
 Source2:        %{semodule_name}.fc
 Source3:        %{name}.logrotate
 Source4:        README.Fedora
-Patch0:         rocci-server-gemfile.diff
-Patch1:         rocci-server-unbundle.diff
+# kill bundler
+# (not intended for upstream)
+Patch0:         rocci-server-unbundle.diff
+# missing requires in code (needed when bundler is not used)
+Patch1:         rocci-server-requires.diff
 
 BuildArch:      noarch
 BuildRequires:  policycoreutils-python
 BuildRequires:  ruby(release) >= 1.9.3
 BuildRequires:  rubygems-devel
-%if %{use_bundler}
-BuildRequires:  rubygem(bundler)
-%endif
 BuildRequires:  rubygem(rdoc)
 # tests (plus all runtimes)
 #BuildRequires:  rubygem(rspec)
@@ -40,9 +39,6 @@ Requires(postun): policycoreutils
 Requires:       logrotate
 Requires:       memcached
 Requires:       mod_passenger
-%if %{use_bundler}
-Requires:       rubygem(bundler)
-%endif
 Requires:       rubygem(dalli)
 Requires:       rubygem(hashie)
 Requires:       rubygem(ice_nine)
@@ -94,24 +90,9 @@ Documentation for %{name}.
 %prep
 %setup -q -n %{name}-%{commit}
 
-# correct openssl_cms dependency:
-# - remove reference to git
-# - keep only one openssl_cms gem
-%if 0%{?fedora} && 0%{?fedora} <= 20
-echo 'gem "openssl_cms_2_0_0", require: false, platforms: :ruby_20' > lib/authentication_strategies/bundles/Gemfile.keystone
-%else
-echo 'gem "openssl_cms_2_1", require: false, platforms: :ruby_21' > lib/authentication_strategies/bundles/Gemfile.keystone
-%endif
-
-# tweak Gemfile
-%patch0 -p1
 # kill bundler
-%if ! %{use_bundler}
+%patch0 -p1
 %patch1 -p1
-%endif
-
-# always use the system gems
-sed -i .bundle/config -e '/.*BUNDLE_DISABLE_SHARED_GEMS.*/d'
 
 # apache >= 2.4, applicaton prefix
 sed -i examples/etc/apache2/sites-available/occi-ssl \
@@ -148,16 +129,6 @@ rm -rf %{buildroot}/%{app_root}/log
 ln -s %{_localstatedir}/log/rocci-server %{buildroot}/%{app_root}/log
 install -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
 
-# bundler:
-# - no Gemfile.lock
-# - disable backends dependencies for now
-mv %{buildroot}%{app_root}/Gemfile.lock %{buildroot}%{app_root}/Gemfile.lock.upstream
-touch %{buildroot}%{app_root}/Gemfile.lock
-# disable backend dependencies
-# TODO: get them to Fedora
-mv %{buildroot}%{app_root}/lib/backends/bundles/Gemfile.ec2 %{buildroot}%{app_root}/lib/backends/bundles/upstream-Gemfile.ec2
-mv %{buildroot}%{app_root}/lib/backends/bundles/Gemfile.opennebula %{buildroot}%{app_root}/lib/backends/bundles/upstream-Gemfile.opennebula
-
 rdoc --op %{buildroot}%{_pkgdocdir} lib app *.md
 chmod -x %{buildroot}%{_pkgdocdir}/images/*.png
 
@@ -250,7 +221,6 @@ fi
 %config(noreplace) %{_sysconfdir}/httpd/conf.d/occi-ssl.conf
 %dir %{_datadir}/selinux/packages/%{name}/
 %dir %{app_root}/
-%{app_root}/.bundle/
 %{app_root}/app/
 %{app_root}/config/
 %{app_root}/db/
@@ -261,12 +231,11 @@ fi
 %{app_root}/etc
 %{app_root}/log
 %{app_root}/Capfile
-%{app_root}/Gemfile
 %{app_root}/config.ru
-%attr(-,rocci,rocci) %{app_root}/Gemfile.lock
 %attr(-,rocci,rocci) %{_localstatedir}/log/rocci-server/
 %{_datadir}/selinux/packages/%{name}/%{semodule_name}.pp
 %exclude %{app_root}/bin/
+%exclude %{app_root}/.bundle/
 %exclude %{app_root}/.rspec
 %exclude %{app_root}/.travis.yml
 %exclude %{app_root}/Guardfile
@@ -276,7 +245,8 @@ fi
 %{_pkgdocdir}/
 %{app_root}/spec/
 %{app_root}/test/
-%{app_root}/Gemfile.lock.upstream
+%{app_root}/Gemfile
+%{app_root}/Gemfile.lock
 %{app_root}/README.md
 %{app_root}/Rakefile
 
diff --git a/rocci-server-gemfile.diff b/rocci-server-gemfile.diff
deleted file mode 100644 (file)
index 78456d3..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-Author: František Dvořák <valtri@civ.zcu.cz>
-Date:   Mon Sep 8 00:03:35 2014 +0200
-
-    Helper patch when using rOCCI server with bundler:
-    - relax dependencies for Fedora
-    - remove all development-only dependencies explicitly
-    - logstasher as gem instead of development version from git
-
-diff --git a/Gemfile b/Gemfile
-index fda0f03..1c8e9c8 100644
---- a/Gemfile
-+++ b/Gemfile
-@@ -1,74 +1,26 @@
- source 'https://rubygems.org'
- # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
--gem 'rails', '~> 4.0.8'
--gem 'rails-api', '~> 0.2.0'
-+gem 'rails', '~> 4.0.0'
-+gem 'rails-api', '>= 0.1.0'
- # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
--gem 'jbuilder', '~> 2.1.0'
-+gem 'jbuilder', '~> 1.5.0'
- # Stuff for working with CORS in Rack
- gem 'rack-cors', :require => 'rack/cors'
--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.48'
--
--# Use simplecov for coverage reports
--gem 'simplecov', group: [:development, :test]
-+gem 'passenger', '~> 4.0.18'
- # Use RSpec for unit tests
--gem 'rspec-rails', '~> 2.99.0', group: [:development, :test]
--gem 'fuubar', group: [:development, :test]
--
--# Use Pry for debugging
--gem 'pry-rails', group: [:development, :test]
--gem 'pry-rescue', group: [:development, :test]
--gem 'pry-stack_explorer', group: [:development, :test]
--
--# Use guard to speed-up devel process
--gem 'guard-bundler', group: :development
--gem 'guard-test', group: :development
--gem 'guard-rails', group: :development
--
--# Use notification libs to integrate guard with pop-ups
--gem 'rb-inotify', require: false, group: :development
--gem 'libnotify', group: :development
--
--# 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
-+gem 'rspec-rails', '>= 2.14.0', group: [:development, :test]
- # Caching stuff
- gem 'dalli'
-@@ -78,7 +30,7 @@ gem 'kgio', group: :stuff_breaking_travis_ci
- gem 'warden', '~> 1.2.3'
- # 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/rocci-server-requires.diff b/rocci-server-requires.diff
new file mode 100644 (file)
index 0000000..a8b5339
--- /dev/null
@@ -0,0 +1,73 @@
+Missing requires needed without bundler.
+
+diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
+index 980305c..5d4a179 100644
+--- a/app/controllers/application_controller.rb
++++ b/app/controllers/application_controller.rb
+@@ -1,3 +1,5 @@
++require 'rails-api'
++
+ # Base class for all rOCCI-server's controllers. Implements
+ # parsing and authentication callbacks, exposes user information,
+ # declares supported media formats and handles raised errors.
+diff --git a/config/environments/development.rb b/config/environments/development.rb
+index 687aed9..62f4f5e 100644
+--- a/config/environments/development.rb
++++ b/config/environments/development.rb
+@@ -1,3 +1,5 @@
++require 'logstasher'
++
+ ROCCIServer::Application.configure do
+   # Settings specified here will take precedence over those in config/application.rb.
+diff --git a/config/environments/production.rb b/config/environments/production.rb
+index 0fb04f8..2e49e52 100644
+--- a/config/environments/production.rb
++++ b/config/environments/production.rb
+@@ -1,3 +1,5 @@
++require 'logstasher'
++
+ ROCCIServer::Application.configure do
+   # Settings specified here will take precedence over those in config/application.rb.
+diff --git a/config/environments/test.rb b/config/environments/test.rb
+index f50130e..4081aec 100644
+--- a/config/environments/test.rb
++++ b/config/environments/test.rb
+@@ -1,3 +1,5 @@
++require 'logstasher'
++
+ ROCCIServer::Application.configure do
+   # Settings specified here will take precedence over those in config/application.rb.
+diff --git a/config/initializers/10_configuration.rb b/config/initializers/10_configuration.rb
+index 581f7a7..5d9c72f 100644
+--- a/config/initializers/10_configuration.rb
++++ b/config/initializers/10_configuration.rb
+@@ -1,3 +1,6 @@
++require 'hashie'
++require 'ice_nine'
++
+ # Initialize a Mash
+ ROCCI_SERVER_CONFIG = Hashie::Mash.new
+diff --git a/config/initializers/warden.rb b/config/initializers/warden.rb
+index 8c59a9f..089a361 100644
+--- a/config/initializers/warden.rb
++++ b/config/initializers/warden.rb
+@@ -1,3 +1,5 @@
++require 'warden'
++
+ # Insert Warden::Manager as Rack::Middleware
+ Rails.configuration.middleware.insert_before Rack::Head, Warden::Manager do |manager|
+   manager.default_strategies ROCCI_SERVER_CONFIG.common.authn_strategies.map { |strategy| strategy.to_sym }
+diff --git a/config/version.rb b/config/version.rb
+index a445104..dcd3caf 100644
+--- a/config/version.rb
++++ b/config/version.rb
+@@ -1,3 +1,5 @@
++require 'occi-core'
++
+ module ROCCIServer
+   VERSION = '1.0.5'
+   ROCCI_VERSION = ::Occi::VERSION