%global gem_name settingslogic %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} Name: rubygem-%{gem_name} Version: 2.0.9 Release: 2%{?dist} Summary: Simple settings solution for Ruby Group: Development/Languages License: MIT URL: https://github.com/binarylogic/settingslogic Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem BuildArch: noarch BuildRequires: rubygems-devel BuildRequires: rubygem(rake) BuildRequires: rubygem(rspec) BuildRequires: rubygem(rspec-core) %if 0%{?rhel} && 0%{?rhel} <= 6 Requires: ruby(abi) = 1.8 %else Requires: ruby(release) %endif %if 0%{?fedora} && 0%{?fedora} <= 20 || 0%{?rhel} && 0%{?rhel} <= 7 Requires: ruby(rubygems) Provides: rubygem(%{gem_name}) = %{version} %endif %description Settingslogic is a simple configuration and settings solution that uses an ERB enabled YAML file. Settingslogic works with Rails, Sinatra, or any Ruby project. %package doc Summary: Documentation for %{name} Group: Documentation Requires: %{name} = %{version}-%{release} BuildArch: noarch %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 # patch out .gitignore sed -i 's/".gitignore",\s*//' %{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}/ mkdir -p %{buildroot}%{_pkgdocdir} mv %{buildroot}%{gem_instdir}/LICENSE %{buildroot}%{_pkgdocdir}/ %check rspec -Ilib spec %files %doc %{_pkgdocdir} %dir %{gem_instdir} %{gem_libdir} %exclude %{gem_cache} %exclude %{gem_instdir}/spec %exclude %{gem_instdir}/Gemfile* %exclude %{gem_instdir}/README.rdoc %exclude %{gem_instdir}/Rakefile %exclude %{gem_instdir}/%{gem_name}.gemspec %{gem_spec} %files doc %doc %{gem_docdir} %changelog * Sun Jun 01 2014 František Dvořák - 2.0.9-2 - Update BR/R for EPEL and Fedora >= 20 * Sun Mar 16 2014 František Dvořák - 2.0.9-1 - Initial package