rubygem-rr/rubygem-rr.spec

78 lines
1.8 KiB
RPMSpec
Raw Permalink Normal View History

2022-03-03 15:14:20 +08:00
%global gem_name rr
Name: rubygem-%{gem_name}
Version: 1.2.1
Release: 1
Summary: RR is a test double framework with a terse syntax
License: MIT
URL: https://rr.github.io/rr
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# git clone https://github.com/rr/rr.git && cd rr
# git checkout v1.2.1 && tar czvf rr-1.2.1-tests.tgz test/
Source1: %{gem_name}-%{version}-tests.tgz
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby
# The following are for running test suite
BuildRequires: rubygem(test-unit)
BuildRequires: rubygem(test-unit-rr)
BuildArch: noarch
%description
RR is a test double framework that features a rich selection of double
techniques and a terse syntax.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version}
%build
# Create the gem as gem install only works on a gem file
gem build ../%{gem_name}-%{version}.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 -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
%check
pushd .%{gem_instdir}
tar xvzf %{SOURCE1}
ruby test/run-test.rb
popd
%files
%dir %{gem_instdir}
%license %{gem_instdir}/LICENSE
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%{gem_instdir}/Appraisals
%{gem_instdir}/CHANGES.md
%{gem_instdir}/CREDITS.md
%{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.md
%{gem_instdir}/Rakefile
%doc %{gem_instdir}/doc
%{gem_instdir}/gemfiles
%{gem_instdir}/rr.gemspec
%{gem_instdir}/spec
%changelog
* Thu Mar 3 2022 caodongxia<caodongxia@huawei.com> - 1.2.1-1
- Init package