summaryrefslogtreecommitdiffstats
path: root/darkfish.spec
blob: 2a38ca0a0deeb8657090b4d76e55e6d65bcf60f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
%global gem_name fedora_darkfish

%global gem_plugin %{gem_dir}/plugins/%{name}_plugin.rb

Name: darkfish-rdoc
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 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: fedora_darkfish.rb
Source2: 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
pushd lib/rdoc/generator/template/
find . -mindepth 2 -type d \
  -exec install -d %{buildroot}%{_datadir}/darkfish-rdoc/{} \;
find . -type f \
  -exec install -p -m 644 {} %{buildroot}%{_datadir}/darkfish-rdoc/{} \;
popd

rm %{buildroot}%{_datadir}/darkfish-rdoc/{darkfish,json_index}/.document

# Drop fonts. System fonts are going to be pulled in instead.
rm -rf %{buildroot}%{_datadir}/darkfish-rdoc/darkfish/fonts

install -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/darkfish-rdoc/
install -p -m 644 %{SOURCE2} %{buildroot}%{_datadir}/darkfish-rdoc/

mkdir -p $(dirname %{buildroot}%{gem_plugin})
echo "require '%{_datadir}/darkfish-rdoc/rubygems_plugin.rb'" > %{buildroot}%{gem_plugin}

%check
# Not test ATM. Not clear if there is actually something to test.

%files
%{gem_plugin}
%{_datadir}/darkfish-rdoc/darkfish/*.rhtml
%{_datadir}/darkfish-rdoc/fedora_darkfish.rb
%{_datadir}/darkfish-rdoc/rubygems_plugin.rb

%files assets
%dir %{_datadir}/darkfish-rdoc/
%dir %{_datadir}/darkfish-rdoc/darkfish/
%{_datadir}/darkfish-rdoc/darkfish/css
%{_datadir}/darkfish-rdoc/darkfish/images
%{_datadir}/darkfish-rdoc/darkfish/js
%{_datadir}/darkfish-rdoc/json_index

%changelog
* Thu Oct 20 2022 Vít Ondruch <vondruch@redhat.com> - 6.4.0-1
- Initial version of Darfish RDoc Generator as extracted from RDoc 6.4.0.