%global gem_name json_spec Name: rubygem-%{gem_name} Version: 1.1.1 Release: 3%{?dist} Summary: Easily handle JSON in RSpec and Cucumber Group: Development/Languages License: MIT URL: https://github.com/collectiveidea/json_spec Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem BuildArch: noarch BuildRequires: ruby(release) BuildRequires: rubygems-devel # in upstream cucumber ~> 1.1 >= 1.1.1 required, # cucumber 1.2 seems OK BuildRequires: rubygem(cucumber) >= 1.1.1 BuildRequires: rubygem(json) BuildRequires: rubygem(multi_json) => 1.0 BuildRequires: rubygem(multi_json) < 2 BuildRequires: rubygem(rspec) => 2.0 BuildRequires: rubygem(rspec) < 3 %if 0%{?fedora} && 0%{?fedora} <= 20 || 0%{?rhel} && 0%{?rhel} <= 7 Requires: ruby(release) Requires: ruby(rubygems) Requires: rubygem(multi_json) => 1.0 Requires: rubygem(multi_json) < 2 Requires: rubygem(rspec) => 2.0 Requires: rubygem(rspec) < 3 Provides: rubygem(%{gem_name}) = %{version} %endif %description RSpec matchers and Cucumber steps for testing JSON content. %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} gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec %build # Create the gem as gem install only works on a gem file gem build %{gem_name}.gemspec # %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir # by default, so that we can move it into the buildroot in %%install %gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -pa .%{gem_dir}/* %{buildroot}%{gem_dir}/ %check cd .%{gem_instdir} rspec -Ilib spec cucumber --tags ~@fail %files %doc %{gem_instdir}/LICENSE %doc %{gem_instdir}/README.md %dir %{gem_instdir} %{gem_libdir} %exclude %{gem_cache} %exclude %{gem_instdir}/features/ %exclude %{gem_instdir}/spec/ %exclude %{gem_instdir}/.gitignore %exclude %{gem_instdir}/.travis.yml %exclude %{gem_instdir}/Gemfile* %exclude %{gem_instdir}/Rakefile %exclude %{gem_instdir}/%{gem_name}.gemspec %{gem_spec} %files doc %doc %{gem_docdir} %changelog * Tue Jun 03 2014 František Dvořák - 1.1.1-3 - Not using rake for tests, remove related dependencies (bundler, rake) - Simplify packaging (documentation in %%{gem_instdir}, no gemspec patching) * Wed Apr 23 2014 František Dvořák - 1.1.1-2 - No Requires since F21 - Remove skipping full cucumber tests for F21 (will be solved in #1054793) * Fri Mar 21 2014 František Dvořák - 1.1.1-1 - Initial package