rubygem-power_assert/rubygem-power_assert.spec
2020-09-04 23:10:49 +08:00

78 lines
1.9 KiB
RPMSpec

%global gem_name power_assert
Name: rubygem-%{gem_name}
Version: 1.1.6
Release: 1
Summary: Power Assert for Ruby
License: Ruby or BSD
URL: https://github.com/k-tsj/power_assert
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Source1: https://github.com/k-tsj/power_assert/archive/v%{version}/%{gem_name}-%{version}.tar.gz
BuildRequires: rubygems-devel rubygem(test-unit) rubygem(byebug) rubygem(pry)
BuildArch: noarch
%description
Power Assert for Ruby. Power Assert shows each value of variables and method
calls in the expression. It is useful for testing, providing which value
wasn't correct when the condition is not satisfied.
%package doc
Summary: Documentation for %{name}
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
tar xf %{SOURCE1}
%build
gem build %{gem_name}.gemspec
%gem_install
# no test file
#cp -a ./test ./%{gem_instdir}/
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
pushd %{buildroot}%{gem_instdir}
rm -rf \
.gitignore .travis.yml \
Gemfile LEGAL \
Rakefile \
*gemspec \
benchmarks \
bin/ \
test/ \
%{nil}
popd
%check
pushd .%{gem_instdir}
LANG=C.utf8
ruby -Ilib:. \
-e \
'Dir.glob("test/**/*_test.rb").each {|f| require f}'
popd
%files
%dir %{gem_instdir}
%license %{gem_instdir}/BSDL
%license %{gem_instdir}/COPYING
%doc %{gem_instdir}/README.rdoc
%{gem_libdir}
%{gem_spec}
%exclude %{gem_cache}
%files doc
%doc %{gem_docdir}
%changelog
* Thu Jul 30 2020 maminjie <maminjie1@huawei.com> - 1.1.6-1
- package init