]>
Commit | Line | Data |
---|---|---|
818060cb JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # manual and documentation | |
4 | ||
5 | Summary: Convert reStructured Text to PDF via ReportLab | |
6 | Summary(pl.UTF-8): Konwersja formatu reStructured Text do PDF przy użyciu ReportLaba | |
7 | Name: python3-rst2pdf | |
8 | Version: 0.98 | |
2a7af4a2 | 9 | Release: 3 |
818060cb JB |
10 | License: MIT |
11 | Group: Libraries/Python | |
12 | #Source0Download: https://pypi.org/simple/rst2pdf/ | |
13 | Source0: https://files.pythonhosted.org/packages/source/r/rst2pdf/rst2pdf-%{version}.tar.gz | |
14 | # Source0-md5: e69ec43a091024e62f375e471c5c2c81 | |
15 | URL: https://rst2pdf.org/ | |
16 | BuildRequires: python3-modules >= 1:3.6 | |
17 | BuildRequires: python3-setuptools | |
18 | BuildRequires: rpm-pythonprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.714 | |
20 | BuildRequires: sed >= 4.0 | |
21 | %if %{with doc} | |
22 | BuildRequires: docutils | |
23 | BuildRequires: python3-ReportLab | |
24 | BuildRequires: python3-docutils | |
25 | BuildRequires: python3-importlib_metadata | |
26 | BuildRequires: python3-jinja2 | |
27 | BuildRequires: python3-packaging | |
28 | BuildRequires: python3-pygments | |
29 | # gen_docs.sh calls rst2pdf from $PATH | |
30 | BuildRequires: python3-rst2pdf | |
31 | BuildRequires: python3-smartypants | |
32 | %endif | |
33 | Requires: python3-modules >= 1:3.6 | |
34 | BuildArch: noarch | |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %description | |
38 | The usual way of creating PDF from reStructuredText is by going | |
39 | through LaTeX. This tool provides an alternative by producing PDF | |
40 | directly using the ReportLab library. | |
41 | ||
42 | %description -l pl.UTF-8 | |
43 | Najczęstszym sposobem tworzenia dokumentów PDF z formatu | |
44 | reStructuredText jest przejście przez LaTeX. To narzędzie udostępnia | |
45 | alternatywną metodę, tworząc PDF bezpośrednio przy użyciu biblioteki | |
46 | ReportLab. | |
47 | ||
48 | %package doc | |
49 | Summary: Manual for rst2pdf library | |
50 | Summary(pl.UTF-8): Podręcznik do biblioteki rst2pdf | |
51 | Group: Documentation | |
52 | ||
53 | %description doc | |
54 | Manual for rst2pdf library. | |
55 | ||
56 | %description doc -l pl.UTF-8 | |
57 | Podręcznik do biblioteki rst2pdf. | |
58 | ||
59 | %prep | |
60 | %setup -q -n rst2pdf-%{version} | |
61 | ||
62 | %{__sed} -i -e 's,python ,%{__python3} ,' doc/gen_docs.sh | |
63 | ||
64 | %build | |
65 | %py3_build | |
66 | ||
67 | %if %{with doc} | |
68 | cd doc | |
69 | ./gen_docs.sh | |
70 | %endif | |
71 | ||
72 | %install | |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %py3_install | |
76 | ||
77 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/rst2pdf{,-3} | |
78 | ln -sf rst2pdf-3 $RPM_BUILD_ROOT%{_bindir}/rst2pdf | |
79 | ||
80 | %if %{with doc} | |
81 | install -d $RPM_BUILD_ROOT%{_mandir}/man1 | |
82 | cp -p doc/output/rst2pdf.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
83 | %endif | |
84 | ||
85 | %clean | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
88 | %files | |
89 | %defattr(644,root,root,755) | |
90 | %doc README.rst | |
91 | %attr(755,root,root) %{_bindir}/rst2pdf | |
92 | %attr(755,root,root) %{_bindir}/rst2pdf-3 | |
93 | %{py3_sitescriptdir}/rst2pdf | |
94 | %{py3_sitescriptdir}/rst2pdf-%{version}-py*.egg-info | |
95 | %if %{with doc} | |
96 | %{_mandir}/man1/rst2pdf.1* | |
97 | %endif | |
98 | ||
99 | %if %{with doc} | |
100 | %files doc | |
101 | %defattr(644,root,root,755) | |
102 | %doc doc/output/html/{assets,manual.html} doc/output/pdf/manual.pdf | |
103 | %endif |