]>
Commit | Line | Data |
---|---|---|
b0e53726 JB |
1 | # TODO: tests + dependencies |
2 | # | |
3 | # Conditional build: | |
4 | %bcond_without doc # ri/rdoc documentation | |
5 | ||
6 | Summary: Implementation of the AsciiDoc text processor and publishing toolchain | |
7 | Summary(pl.UTF-8): Implementacja procesora tekstu i systemu publikacji AsciiDoc | |
8 | Name: ruby-asciidoctor | |
43b0e057 | 9 | Version: 2.0.20 |
8ee36388 | 10 | Release: 1 |
b0e53726 JB |
11 | License: MIT |
12 | #Source0Download: https://github.com/asciidoctor/asciidoctor/releases | |
13 | Source0: https://github.com/asciidoctor/asciidoctor/archive/v%{version}/asciidoctor-%{version}.tar.gz | |
43b0e057 | 14 | # Source0-md5: 11f40bda9a2c07f6b632a0fc91b43a13 |
b0e53726 JB |
15 | Group: Development/Languages |
16 | URL: https://asciidoctor.org/ | |
17 | BuildRequires: ruby >= 1:2.3 | |
18 | BuildRequires: ruby-rubygems | |
19 | BuildRequires: rpm-rubyprov | |
20 | BuildRequires: rpmbuild(macros) >= 1.665 | |
21 | %if %{with doc} | |
22 | BuildRequires: ruby-rdoc | |
23 | %endif | |
08525bff | 24 | BuildArch: noarch |
b0e53726 JB |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
26 | ||
27 | %description | |
28 | A fast, open source text processor and publishing toolchain for | |
29 | converting AsciiDoc content to HTML 5, DocBook 5, and other formats. | |
30 | ||
31 | %description -l pl.UTF-8 | |
32 | Szybki, mający otwarte źródła procesor tekstu i system publikowania do | |
33 | konwersji treści AsciiDoc do HTML-a 5, DocBooka 5 i innych formatów. | |
34 | ||
35 | %package rdoc | |
36 | Summary: HTML documentation for Ruby asciidoctor module | |
37 | Summary(pl.UTF-8): Dokumentacja w formacie HTML dla modułu języka Ruby asciidoctor | |
38 | Group: Documentation | |
39 | Requires: ruby >= 1:1.8.7-4 | |
40 | ||
41 | %description rdoc | |
42 | HTML documentation for Ruby asciidoctor module. | |
43 | ||
44 | %description rdoc -l pl.UTF-8 | |
45 | Dokumentacja w formacie HTML dla modułu języka Ruby asciidoctor. | |
46 | ||
47 | %package ri | |
48 | Summary: ri documentation for Ruby asciidoctor module | |
49 | Summary(pl.UTF-8): Dokumentacja w formacie ri dla modułu języka Ruby asciidoctor | |
50 | Group: Documentation | |
51 | Requires: ruby | |
52 | ||
53 | %description ri | |
54 | ri documentation for Ruby asciidoctor module. | |
55 | ||
56 | %description ri -l pl.UTF-8 | |
57 | Dokumentacja w formacie ri dla modułu języka Ruby asciidoctor. | |
58 | ||
59 | %prep | |
60 | %setup -q -n asciidoctor-%{version} | |
61 | ||
62 | %{__sed} -i -e '1s,/usr/bin/env ruby,%{__ruby},' bin/asciidoctor | |
63 | ||
64 | %build | |
65 | gem build asciidoctor.gemspec | |
66 | ||
67 | gem install asciidoctor-%{version}.gem --install-dir $(pwd)/.gem | |
68 | %{__rm} -r .gem/gems/asciidoctor-%{version}/{LICENSE,*.adoc,*.gemspec,man} | |
69 | ||
70 | %if %{with doc} | |
71 | rdoc --ri --op ri lib | |
72 | rdoc --op rdoc lib | |
73 | %endif | |
74 | ||
75 | %install | |
76 | rm -rf $RPM_BUILD_ROOT | |
77 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{ruby_gemdir}/gems,%{ruby_specdir}} | |
78 | ||
79 | install .gem/bin/asciidoctor $RPM_BUILD_ROOT%{_bindir} | |
80 | cp -p man/asciidoctor.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
81 | ||
82 | cp -pr .gem/gems/asciidoctor-%{version} $RPM_BUILD_ROOT%{ruby_gemdir}/gems | |
83 | cp -p .gem/specifications/asciidoctor-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir} | |
84 | ||
85 | %if %{with doc} | |
86 | install -d $RPM_BUILD_ROOT{%{ruby_rdocdir}/%{name}-%{version},%{ruby_ridir}} | |
87 | cp -a rdoc/* $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version} | |
88 | cp -a ri/Asciidoctor $RPM_BUILD_ROOT%{ruby_ridir} | |
89 | %endif | |
90 | ||
91 | %clean | |
92 | rm -rf $RPM_BUILD_ROOT | |
93 | ||
94 | %files | |
95 | %defattr(644,root,root,755) | |
96 | %doc CHANGELOG.adoc LICENSE README.adoc | |
97 | %lang(de) %doc README-de.adoc | |
98 | %lang(fr) %doc README-fr.adoc | |
99 | %lang(jp) %doc README-jp.adoc | |
100 | %lang(zh_CN) %doc README-zh_CN.adoc | |
101 | %attr(755,root,root) %{_bindir}/asciidoctor | |
102 | %dir %{ruby_gemdir}/gems/asciidoctor-%{version} | |
103 | %dir %{ruby_gemdir}/gems/asciidoctor-%{version}/bin | |
104 | %attr(755,root,root) %{ruby_gemdir}/gems/asciidoctor-%{version}/bin/asciidoctor | |
105 | %{ruby_gemdir}/gems/asciidoctor-%{version}/data | |
106 | %{ruby_gemdir}/gems/asciidoctor-%{version}/lib | |
107 | %{ruby_specdir}/asciidoctor-%{version}.gemspec | |
108 | %{_mandir}/man1/asciidoctor.1* | |
109 | ||
110 | %if %{with doc} | |
111 | %files rdoc | |
112 | %defattr(644,root,root,755) | |
113 | %{ruby_rdocdir}/%{name}-%{version} | |
114 | ||
115 | %files ri | |
116 | %defattr(644,root,root,755) | |
117 | %{ruby_ridir}/Asciidoctor | |
118 | %endif |