rubygem-coderay/rubygem-coderay.spec
starlet-dx 054508fac6 Upgrade rubygem-coderay to 1.1.3 to resolve compilation failures.
(cherry picked from commit faca64d8a0e2c451c3493754ddfa20abc7097858)
2022-03-23 10:01:09 +08:00

93 lines
2.6 KiB
RPMSpec

%global gem_name coderay
Name: rubygem-%{gem_name}
Version: 1.1.3
Release: 1
Summary: Fast syntax highlighting for selected languages
License: MIT
URL: http://coderay.rubychan.de
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# git clone https://github.com/rubychan/coderay --no-checkout
# cd coderay && git archive -v -o coderay-1.1.3-tests.txz v1.1.3 test spec
Source1: %{gem_name}-%{version}-tests.txz
Source2: https://github.com/rubychan/coderay/archive/refs/tags/v1.1.3.tar.gz#/%{gem_name}-%{version}.tar.gz
# Fix test suite for ruby 3.0 change for methods on subclass of Array
# https://github.com/rubychan/coderay/pull/255
Patch0000: rubygem-coderay-1.1.3-fix-tests-Array-on-ruby-3.0.patch
BuildRequires: ruby(release) rubygems-devel ruby >= 1.8.6 rubygem(test-unit)
BuildRequires: rubygem(rspec)
BuildArch: noarch
%description
Fast and easy syntax highlighting for selected languages, written in Ruby.
Comes with RedCloth integration and LOC counter.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version} -b 1
pushd ..
%patch0 -p1
popd
%build
gem build ../%{gem_name}-%{version}.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}
cp -r %{_builddir}/spec .
cp -r %{_builddir}/test .
# Comment out simplecov.
for file in \
spec/spec_helper.rb \
test/executable/suite.rb \
test/functional/for_redcloth.rb \
test/functional/suite.rb \
test/unit/suite.rb; do
sed -i "/^require 'simplecov'/ s/^/#/" "${file}"
done
# See https://github.com/rubychan/coderay/blob/master/rake_tasks/test.rake
LANG=C.UTF-8
ruby ./test/functional/suite.rb
ruby ./test/functional/for_redcloth.rb
ruby ./test/unit/suite.rb
rspec spec
popd
%files
%dir %{gem_instdir}
%{_bindir}/coderay
%license %{gem_instdir}/MIT-LICENSE
%{gem_instdir}/bin
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/README_INDEX.rdoc
%changelog
* Mon Feb 14 2022 yaoxin <yaoxin30@huawei.com> - 1.1.3-1
- Upgrade rubygem-coderay to 1.1.3 to resolve compilation failures.
* Sat Jul 25 2020 wangxiao <wangxiao65@huawei.com> - 1.1.2-1
- package init