%global gem_name settingslogic 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(rspec) BuildRequires: rubygem(rspec-core) %if 0%{?fedora} && 0%{?fedora} <= 20 || 0%{?rhel} && 0%{?rhel} <= 7 %if 0%{?rhel} && 0%{?rhel} <= 6 Requires: ruby(abi) = 1.8 %else Requires: ruby(release) %endif 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 # Remove developer-only files. for f in .gitignore Gemfile Gemfile.lock README.rdoc Rakefile; do rm $f sed -i "s|\"$f\",\?||g" %{gem_name}.gemspec done %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 pushd .%{gem_instdir} rspec -Ilib spec popd %files %doc %{gem_instdir}/LICENSE %dir %{gem_instdir} %{gem_libdir} %exclude %{gem_cache} %exclude %{gem_instdir}/spec %exclude %{gem_instdir}/%{gem_name}.gemspec %{gem_spec} %files doc %doc %{gem_docdir} %changelog * Sun Jul 27 2014 František Dvořák - 2.0.9-2 - Update BR/R for EPEL and Fedora >= 20 - Remove development files before build - Run tests inside %%{gem_instdir} * Sun Mar 16 2014 František Dvořák - 2.0.9-1 - Initial package