%{?scl:%scl_package rubygem-%{gem_name}} %{!?scl:%global pkg_name %{name}} %global gem_name coderay Summary: Fast syntax highlighter engine for many programming languages Name: %{?scl_prefix}rubygem-%{gem_name} Version: 1.1.0 Release: 8%{?dist} Group: Development/Languages License: MIT URL: http://coderay.rubychan.de Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem Source1: MIT-LICENSE.txt # git clone https://github.com/rubychan/coderay.git && cd coderay # git checkout v1.1.0 && tar czvf coderay-1.1.0-tests.tgz test/ Source2: %{gem_name}-%{version}-tests.tgz BuildRoot: %{_tmppath}/%{pkg_name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: %{?scl_prefix_ruby}ruby(release) Requires: %{?scl_prefix_ruby}ruby(rubygems) #BuildRequires: %{?scl_prefix}rubygem(term-ansicolor) BuildRequires: %{?scl_prefix_ruby}rubygems-devel BuildRequires: %{?scl_prefix_ruby}rubygem(test-unit) BuildArch: noarch Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version} # Explicitly require runtime subpackage, as long as older scl-utils do not generate it %{?scl:Requires: %{?scl_prefix}runtime} %description Coderay is a Ruby library for syntax highlighting. CodeRay is build to be easy to use and intuitive, but at the same time fully featured, complete, fast and efficient. %prep %setup -n %{pkg_name}-%{version} -q -c -T %{?scl:scl enable %{scl} - << \EOF} set -e %gem_install -n %{SOURCE0} %{?scl:EOF} %build %install mkdir -p %{buildroot}%{gem_dir} cp -pa .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ mkdir -p %{buildroot}%{_bindir} cp -pa .%{_bindir}/* \ %{buildroot}%{_bindir}/ rm -rf %{buildroot}/%{gem_libdir}/term find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x find %{buildroot}/%{gem_instdir}/bin -type f | xargs sed -i 's/\r//' $FILES # License file is not included in the gem. # https://github.com/rubychan/coderay/pull/204 cp -p %{SOURCE1} %{buildroot}%{gem_instdir} %check pushd .%{gem_instdir} # Bundled test is not enough. rm -rf test tar xzvf %{SOURCE2} LANG=en_US.UTF-8 %{?scl:scl enable %{scl} - << \EOF} set -e ruby ./test/functional/suite.rb ruby ./test/functional/for_redcloth.rb %{?scl:EOF} popd %files # There is no %%license macro on RHEL6. # https://bugzilla.redhat.com/show_bug.cgi?id=1386246 %{!?_licensedir:%global license %%doc} %{_bindir}/coderay %dir %{gem_instdir}/ %license %{gem_instdir}/MIT-LICENSE.txt %dir %{gem_libdir} %dir %{gem_instdir}/test %{gem_instdir}/test/* %{gem_instdir}/bin %{gem_libdir}/[cC]* %doc %{gem_docdir} %doc %{gem_instdir}/Rakefile %doc %{gem_instdir}/README_INDEX.rdoc %exclude %{gem_cache} %{gem_spec} %changelog * Thu Feb 02 2017 Jun Aruga - 1.1.0-8 - Enable tests * Wed Feb 24 2016 Pavel Valena - 1.1.0-7 - Add scl macros * Thu Feb 04 2016 Fedora Release Engineering - 1.1.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Thu Jun 18 2015 Fedora Release Engineering - 1.1.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sun Jun 08 2014 Fedora Release Engineering - 1.1.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Sat Mar 15 2014 Jan Klepek -1.1.0-3 - dropped dependency on term-ansicolor completely * Mon Mar 3 2014 Jan Klepek - 1.1.0-2 - term-ansicolor no longer run-time dependency, only build dependency * Thu Feb 27 2014 Jan Klepek - 1.1.0-1 - update to new version * Mon Aug 19 2013 Jan Klepek - 1.0.7-1 - update to new version * Sun Aug 04 2013 Fedora Release Engineering - 1.0.6-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Tue Mar 05 2013 Vít Ondruch - 1.0.6-4 - Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0 * Thu Feb 14 2013 Fedora Release Engineering - 1.0.6-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Sat Jul 21 2012 Fedora Release Engineering - 1.0.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Sun Apr 08 2012 Jan Klepek - 1.0.6-1 - Update to new version * Mon Feb 06 2012 Vít Ondruch - 1.0.4-3 - Rebuilt for Ruby 1.9.3. * Sat Jan 14 2012 Fedora Release Engineering - 1.0.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Thu Nov 17 2011 Jan Klepek - 1.0.4-1 - new version * Sat Oct 15 2011 Jan Klepek - 1.0.0-1 - new version * Sat Jul 23 2011 Jan Klepek - 0.9.8-1 - new version * Thu Mar 10 2011 Jan Klepek - 0.9.7-1 - updated to 0.9.7 * Wed Feb 09 2011 Fedora Release Engineering - 0.8.312-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Sun Jul 26 2009 Fedora Release Engineering - 0.8.312-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Fri Jul 03 2009 Jan Klepek - 0.8.312-3 - correct directory ownership, fixed license * Wed Jun 24 2009 Jan Klepek - 0.8.312-2 - consistent macro usage, rewritten description, removed term-ansicolor during install * Sun Jun 14 2009 Jan Klepek - 0.8.312-1 - Initial package