%global gem_name hashr %if 0%{?rhel} == 6 %global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) %global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version} %global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem %global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec %global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version} %endif Summary: Simple Hash extension to make working with nested hashes Name: rubygem-%{gem_name} Version: 0.0.21 Release: 3%{?dist} Group: Development/Languages License: MIT URL: http://github.com/svenfuchs/hashr Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem Requires: rubygems %if 0%{?rhel} == 6 || 0%{?fedora} < 17 Requires: ruby(abi) = 1.8 %else Requires: ruby(abi) = 1.9.1 %endif %if 0%{?fedora} BuildRequires: rubygems-devel %endif BuildRequires: rubygems %if 0%{?fedora} > 16 BuildRequires: rubygem(minitest) # test_declarative is only in F17+ BuildRequires: rubygem(test_declarative) %endif BuildArch: noarch Provides: rubygem(%{gem_name}) = %{version} %description Simple Hash extension to make working with nested hashes (e.g. for configuration) easier and less error-prone. %package doc BuildArch: noarch Requires: %{name} = %{version}-%{release} Summary: Documentation for rubygem-%{gem_name} %description doc This package contains documentation for rubygem-%{gem_name}. %prep gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec %build mkdir -p .%{gem_dir} # Create the gem as gem install only works on a gem file gem build %{gem_name}.gemspec gem install -V \ --local \ --install-dir ./%{gem_dir} \ --force \ --rdoc \ %{gem_name}-%{version}.gem rm -rf ./%{gem_dir}/gems/%{gem_name}-%{version}/.yardoc %install mkdir -p %{buildroot}%{gem_dir} cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/ rm %{buildroot}%{gem_instdir}/{README.md,MIT-LICENSE} %files %dir %{gem_instdir} %{gem_instdir}/lib %{gem_cache} %{gem_spec} %doc MIT-LICENSE %files doc %doc %{gem_docdir} %{gem_instdir}/Gemfile* %{gem_instdir}/Rakefile %doc README.md %{gem_instdir}/test %check %if 0%{?fedora} > 16 sed -i '/require.*bundler/d' test/test_helper.rb testrb -Ilib test/*_test.rb %endif %changelog * Wed Aug 08 2012 Miroslav Suchý 0.0.21-3 - 845799 - -doc subpackage require the main package (msuchy@redhat.com) - 845799 - move test/ Gemfile* and Rakefile to -doc subpackage (msuchy@redhat.com) - 845799 - simplify test (msuchy@redhat.com) * Wed Aug 08 2012 Miroslav Suchý 0.0.21-2 - run test only in F17+ (msuchy@redhat.com) - 845799 - use test-suite (msuchy@redhat.com) - 845799 - use rubygems macros (msuchy@redhat.com) - create subpackage rubygem-hashr-doc (msuchy@redhat.com) - rubygem-hashr is released under MIT license (msuchy@redhat.com) - 845799 - use %%global instead %%define (msuchy@redhat.com) * Sat Aug 04 2012 Miroslav Suchý 0.0.21-1 - remove generated yardoc (msuchy@redhat.com) - remove unused macros (msuchy@redhat.com) - make summary shorter (msuchy@redhat.com) - rebase to 0.0.21 (msuchy@redhat.com) * Wed Jul 04 2012 Miroslav Suchý 0.0.19-3 - edit spec for Fedora 17 (msuchy@redhat.com) * Tue Feb 28 2012 Brad Buckingham 0.0.19-2 - hashr - backing down to 0.0.19-2 (bbuckingham@redhat.com) * Tue Feb 28 2012 Brad Buckingham 0.0.20-1 - hashr spec - update content autogenerated by gen2rpm (bbuckingham@redhat.com) * Tue Feb 28 2012 Brad Buckingham - 0.0.19-1 - Initial package