%global gem_name occi-core # a slight incompatibility in activesupport 4.1.x %if 0%{?fedora} && 0%{?fedora} <= 20 || 0%{?rhel} && 0%{?rhel} <= 7 %global have_rails_4_1 0 %else %global have_rails_4_1 1 %endif Name: rubygem-%{gem_name} Version: 4.2.16 Release: 1%{?dist} Summary: OCCI toolkit Group: Development/Languages License: ASL 2.0 URL: https://github.com/gwdg/rOCCI-core Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # to build with activesupport >= 4.1.x, # apply the patch *only* with the activesupport >= 4.1.x Patch0: occi-core-active41.patch BuildArch: noarch BuildRequires: ruby(release) >= 1.9.3 BuildRequires: rubygems-devel BuildRequires: rubygem(activesupport) => 4.0.0 BuildRequires: rubygem(hashie) BuildRequires: rubygem(json_spec) BuildRequires: rubygem(rspec) BuildRequires: rubygem(settingslogic) BuildRequires: rubygem(uuidtools) >= 2.1.3 %if 0%{?fedora} && 0%{?fedora} <= 20 || 0%{?rhel} && 0%{?rhel} <= 7 Requires: ruby(release) >= 1.9.3 Requires: ruby(rubygems) Requires: rubygem(activesupport) => 4.0.0 Requires: rubygem(hashie) Requires: rubygem(json) Requires: rubygem(settingslogic) Requires: rubygem(uuidtools) >= 2.1.3 Provides: rubygem(%{gem_name}) = %{version} %endif %description OCCI is a collection of classes to simplify the implementation of the Open Cloud Computing API in Ruby. %package doc Summary: Documentation for %{name} Group: Documentation BuildArch: noarch Requires: %{name} = %{version}-%{release} %description doc Documentation for %{name}. %prep gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} %if 0%{?have_rails_4_1} %patch0 -p1 %endif gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec # enable newer rubygem-activesupport (4.1.x) %if 0%{?have_rails_4_1} sed -i -e 's|\(%q,\) \[.*\]|\1 [">= 4.1.0"]|' %{gem_name}.gemspec %endif %build gem build %{gem_name}.gemspec %gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ %check # UTF-8 characters in test scripts # https://github.com/EGI-FCTF/rOCCI-core/issues/20 pushd .%{gem_instdir} LANG=cs_CZ.UTF-8 rspec -Ilib spec popd %files %doc %{gem_instdir}/AUTHORS %doc %{gem_instdir}/LICENSE %dir %{gem_instdir} %{gem_libdir} %{gem_instdir}/config %exclude %{gem_cache} %exclude %{gem_instdir}/.gitignore %exclude %{gem_instdir}/.rspec %exclude %{gem_instdir}/.travis.yml %exclude %{gem_instdir}/.yardopts %{gem_spec} %files doc %doc %{gem_docdir} %doc %{gem_instdir}/README.md %{gem_instdir}/spec %{gem_instdir}/Gemfile %{gem_instdir}/Rakefile %{gem_instdir}/%{gem_name}.gemspec %changelog * Thu Sep 4 2014 František Dvořák - 4.2.16-1 - Initial package