%global gem_name nenv # tests require rspec >= 3.1 %if 0%{?fedora} && 0%{?fedora} <= 21 || 0%{?rhel} && 0%{?rhel} <= 7 %global with_tests 0 %else %global with_tests 1 %endif Name: rubygem-%{gem_name} Version: 0.2.0 Release: 1%{?dist} Summary: Convenience wrapper for Ruby's ENV Group: Development/Languages License: MIT URL: https://github.com/e2/nenv Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # git clone https://github.com/e2/nenv && cd nenv # git checkout v0.2.0 # tar -czf rubygem-nenv-0.2.0-specs.tgz spec/ Source1: %{name}-%{version}-specs.tgz BuildArch: noarch BuildRequires: rubygems-devel %if 0%{?with_tests} BuildRequires: rubygem(coveralls) BuildRequires: rubygem(rspec) => 3.1 BuildRequires: rubygem(rspec) < 4 %endif %description Using ENV is like using raw SQL statements in your code. We all know how that ends... %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} -a1 gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec %build gem build %{gem_name}.gemspec %gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ %check %if 0%{?with_tests} cp -pr spec/ .%{gem_instdir} pushd .%{gem_instdir} rspec -r spec_helper rm -rf spec popd %endif %files %dir %{gem_instdir}/ %license %{gem_instdir}/LICENSE.txt %{gem_libdir}/ %{gem_spec} %exclude %{gem_instdir}/.gitignore %exclude %{gem_instdir}/%{gem_name}.gemspec %exclude %{gem_cache} %files doc %doc %{gem_docdir}/ %doc %{gem_instdir}/README.md %changelog * Mon Mar 09 2015 František Dvořák - 0.2.0-1 - Initial package