%global gem_name fedora_darkfish %global gem_plugin %{gem_dir}/plugins/%{name}_plugin.rb Name: rdoc-generator-fedora-darkfish Version: 6.4.0 Release: 1%{?dist} Summary: Darkfish RDoc Generator # BSD-3-Clause: lib/rdoc/generator/darkfish.rb # CC-BY-2.5: lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif License: GPL-2.0-only AND Ruby AND BSD-3-Clause AND CC-BY-2.5 URL: https://ruby.github.io/rdoc Source0: https://rubygems.org/gems/rdoc-%{version}.gem Source1: rdoc_generator_fedora_darkfish.attr Source2: rdoc_generator_fedora_darkfish.req Source3: fedora_darkfish.rb Source4: rubygems_plugin.rb # Because the fonts are not embedded, do not refer to them in the font.css # file. Patch0: rdoc-6.4.0-Drop-the-font-URLs-from-css.patch Requires: %{name}-assets Requires: ruby(rubygems) BuildRequires: rubygems-devel BuildArch: noarch %description Darkfish RDoc generator extracted from RDoc usedfor the purpose of generating documentation of rubygem- packages during their build. Any other use case is not supported. %package assets Summary: Darkfish template shared assets # Originally shipped in lib/rdoc/generator/template/darkfish/fonts # and specified via lib/rdoc/generator/template/darkfish/css/fonts.css Requires: font(lato) Requires: font(sourcecodepro) BuildArch: noarch %description assets This package provides Darkfish template shared assets for documentaion generated for rubygem- packages on Fedora. %prep %setup -q -n rdoc-%{version} %patch0 -p1 %build %install # Install dependency generators. mkdir -p %{buildroot}%{_fileattrsdir} install -m 644 %{SOURCE1} %{buildroot}%{_fileattrsdir} install -m 755 %{SOURCE2} %{buildroot}%{_rpmconfigdir} sed -i \ -e 's|%%{name}|%{name}|' \ -e 's|%%{_datadir}|%{_datadir}|' \ %{buildroot}%{_rpmconfigdir}/*.req pushd lib/rdoc/generator/template/ find . -mindepth 2 -type d \ -exec install -d %{buildroot}%{_datadir}/%{name}/{} \; find . -type f \ -exec install -p -m 644 {} %{buildroot}%{_datadir}/%{name}/{} \; popd rm %{buildroot}%{_datadir}/%{name}/{darkfish,json_index}/.document # Drop fonts. System fonts are going to be pulled in instead. rm -rf %{buildroot}%{_datadir}/%{name}/darkfish/fonts install -p -m 644 %{SOURCE3} %{buildroot}%{_datadir}/%{name}/ install -p -m 644 %{SOURCE4} %{buildroot}%{_datadir}/%{name}/ mkdir -p $(dirname %{buildroot}%{gem_plugin}) echo "require '%{_datadir}/%{name}/rubygems_plugin.rb'" > %{buildroot}%{gem_plugin} %check # Not test ATM. Not clear if there is actually something to test. %files %{_fileattrsdir}/*.attr %{_rpmconfigdir}/*.req %{gem_plugin} %{_datadir}/%{name}/darkfish/*.rhtml %{_datadir}/%{name}/fedora_darkfish.rb %{_datadir}/%{name}/rubygems_plugin.rb %files assets %dir %{_datadir}/%{name}/ %dir %{_datadir}/%{name}/darkfish/ %{_datadir}/%{name}/darkfish/css %{_datadir}/%{name}/darkfish/images %{_datadir}/%{name}/darkfish/js %{_datadir}/%{name}/json_index %changelog * Thu Oct 20 2022 Vít Ondruch - 6.4.0-1 - Initial version of Darfish RDoc Generator as extracted from RDoc 6.4.0.