%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})
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)
Requires: logrotate
Requires: memcached
Requires: mod_passenger
-%if %{use_bundler}
-Requires: rubygem(bundler)
-%endif
Requires: rubygem(dalli)
Requires: rubygem(hashie)
Requires: rubygem(ice_nine)
%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 \
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
%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/
%{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
%{_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
+++ /dev/null
-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'
--- /dev/null
+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