rubygem-pry/rubygem-pry.spec

91 lines
2.9 KiB
RPMSpec
Raw Normal View History

2020-08-28 12:09:05 +08:00
%global gem_name pry
Name: rubygem-%{gem_name}
Version: 0.10.4
Release: 1
Summary: An IRB alternative and runtime developer console
License: MIT
URL: https://rubygems.org/gems/pry
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Source1: https://github.com/pry/%{gem_name}/archive/v%{version}.tar.gz
# rm stray openstruct reference. Upstream at
# https://github.com/pry/pry/commit/70942ad3b2d93e028fc3e8bfe1c6bd11ec79ffad
Patch0: rubygem-pry-0.10.1-rm-openstruct.patch
# Fix Ruby 2.4 compatibility.
# https://github.com/pry/pry/pull/1586
Patch1: pry-0.10.4-support-custom-implementation-of-BasicObject-inspect.patch
Patch2: pry-0.10.4-Avoid-calling-Ruby-2.4-String-pretty_print-in-ColorPrinter.patch
Patch3: pry-0.10.4-Fixnum-and-Bignum-are-unified-into-Integer-since-Ruby-2.4.patch
%if 0%{?fc19} || 0%{?fc20} || 0%{?el7}
Requires: ruby(release) ruby(rubygems) rubygem(coderay) => 1.1.0 rubygem(coderay) < 1.2
Requires: rubygem(slop) => 3.4 rubygem(slop) < 4 rubygem(method_source) => 0.8.1
Requires: rubygem(method_source) < 0.9
%endif
BuildRequires: ruby(release) rubygems-devel ruby rubygem(rspec) rubygem(coderay) => 1.1.0
BuildRequires: rubygem(slop) => 3.4 rubygem(method_source) => 0.8.1 vi
BuildArch: noarch
%if 0%{?fc19} || 0%{?fc20} || 0%{?el7}
Provides: rubygem(%{gem_name}) = %{version}
%endif
%description
An IRB alternative and runtime developer console.
%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
%patch1 -p1
%patch2 -p1
%build
gem build %{gem_name}.gemspec
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
mkdir -p %{buildroot}%{_bindir}
cp -a .%{_bindir}/* \
%{buildroot}%{_bindir}/
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
%check
pushd .%{gem_instdir}
tar xvf %{SOURCE1}
ln -s %{gem_name}-%{version}/spec spec
cat %{PATCH0} | patch -p1
cat %{PATCH3} | patch -p1
touch Rakefile
sed -i '/gist --login/i pending "rubygem-gist is not in Fedora yet."' \
spec/commands/gist_spec.rb
sed -e "/require 'bundler\/setup'/ s/^/#/" -i spec/helper.rb
sed -e "/Bundler.require/ s/^/#/" -i spec/helper.rb
rspec spec
popd
%files
%{!?_licensedir:%global license %%doc}
%dir %{gem_instdir}
%{_bindir}/pry
%license %{gem_instdir}/LICENSE
%{gem_instdir}/bin
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.md
%doc %{gem_instdir}/README.md
%changelog
* Thu Aug 20 2020 luoshengwei <luoshengwei@huawei.com> - 0.10.4-1
- package init