]> git.pld-linux.org Git - SPECS.git/blob - python-recommonmark.spec
SPECS updated Sun 1 Aug 11:02:02 CEST 2021
[SPECS.git] / python-recommonmark.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  doc     # Sphinx documentation
6 %bcond_without  tests   # unit tests
7
8 Summary:        docutils-compatibility bridge to CommonMark
9 Summary(pl.UTF-8):      Pomost zgodności z docutils dla CommonMark
10 Name:           python-recommonmark
11 Version:        0.6.0
12 Release:        2
13 License:        MIT
14 Group:          Libraries/Python
15 # in case snapshot is required:
16 #Source0:       https://github.com/rtfd/recommonmark/archive/%{commit}/recommonmark-%{commit}.tar.gz
17 #Source0Download: https://pypi.org/simple/recommonmark/
18 Source0:        https://files.pythonhosted.org/packages/source/r/recommonmark/recommonmark-%{version}.tar.gz
19 # Source0-md5:  41edafd4f92392f2b49a1443bab27b90
20 # from https://github.com/readthedocs/recommonmark/pull/124
21 # https://github.com/readthedocs/recommonmark/commit/917e0359fa93acd9b22d7122e2c03d994d9fda44.patch
22 Patch0:         %{name}-math.patch
23 URL:            https://recommonmark.readthedocs.io/en/latest/
24 %if %{with python2}
25 BuildRequires:  python-modules >= 1:2.7
26 BuildRequires:  python-setuptools
27 %if %{with tests}
28 BuildRequires:  python-Sphinx >= 1.3.1
29 BuildRequires:  python-commonmark >= 0.8.1
30 BuildRequires:  python-docutils >= 0.11
31 BuildRequires:  python-pytest
32 %endif
33 %endif
34 %if %{with python3}
35 BuildRequires:  python3-modules >= 1:3.3
36 BuildRequires:  python3-setuptools
37 %if %{with tests}
38 BuildRequires:  python3-Sphinx >= 1.3.1
39 BuildRequires:  python3-commonmark >= 0.8.1
40 BuildRequires:  python3-docutils >= 0.11
41 BuildRequires:  python3-pytest
42 %endif
43 %endif
44 BuildRequires:  rpm-pythonprov
45 BuildRequires:  rpmbuild(macros) >= 1.714
46 %if %{with doc}
47 BuildRequires:  python3-commonmark >= 0.8.1
48 BuildRequires:  sphinx-pdg
49 %endif
50 Requires:       python-modules >= 1:2.7
51 BuildArch:      noarch
52 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53
54 %description
55 This allows you to write CommonMark inside of Docutils & Sphinx
56 projects.
57
58 %description -l pl.UTF-8
59 Ten moduł pozwala na pisanie z użyciem CommonMark wewnątrz projektów
60 Docutils i Sphinksa.
61
62 %package -n python3-recommonmark
63 Summary:        docutils-compatibility bridge to CommonMark
64 Summary(pl.UTF-8):      Pomost zgodności z docutils dla CommonMark
65 Group:          Libraries/Python
66 Requires:       python3-modules >= 1:3.3
67
68 %description -n python3-recommonmark
69 This allows you to write CommonMark inside of Docutils & Sphinx
70 projects.
71
72 %description -n python3-recommonmark -l pl.UTF-8
73 Ten moduł pozwala na pisanie z użyciem CommonMark wewnątrz projektów
74 Docutils i Sphinksa.
75
76 %package apidocs
77 Summary:        Documentation for Python recommonmark module
78 Summary(pl.UTF-8):      Dokumentacja modułu Pythona recommonmark
79 Group:          Documentation
80
81 %description apidocs
82 Documentation for Python recommonmark module.
83
84 %description apidocs -l pl.UTF-8
85 Dokumentacja modułu Pythona recommonmark.
86
87 %prep
88 %setup -q -n recommonmark-%{version}
89 %patch0 -p1
90
91 %build
92 %if %{with python2}
93 %py_build
94
95 %if %{with tests} && 0
96 # skip: python2 uses different XML formatting, tests expect python3 formatting
97 %{__python} -m pytest tests
98 %endif
99 %endif
100
101 %if %{with python3}
102 %py3_build
103
104 %if %{with tests}
105 %{__python3} -m pytest tests
106 %endif
107 %endif
108
109 %if %{with doc}
110 PYTHONPATH=$(pwd) \
111 %{__make} -C docs html
112 %endif
113
114 %install
115 rm -rf $RPM_BUILD_ROOT
116
117 %if %{with python2}
118 %py_install
119
120 %py_postclean
121
122 for f in cm2{html,latex,man,pseudoxml,xetex,xml} ; do
123         %{__mv} $RPM_BUILD_ROOT%{_bindir}/${f} $RPM_BUILD_ROOT%{_bindir}/${f}-2
124 done
125 %endif
126
127 %if %{with python3}
128 %py3_install
129
130 for f in cm2{html,latex,man,pseudoxml,xetex,xml} ; do
131         %{__mv} $RPM_BUILD_ROOT%{_bindir}/${f} $RPM_BUILD_ROOT%{_bindir}/${f}-3
132         ln -sf ${f}-3 $RPM_BUILD_ROOT%{_bindir}/${f}
133 done
134 %endif
135
136 %clean
137 rm -rf $RPM_BUILD_ROOT
138
139 %if %{with python2}
140 %files
141 %defattr(644,root,root,755)
142 %doc CHANGELOG.md README.md license.md
143 %attr(755,root,root) %{_bindir}/cm2html-2
144 %attr(755,root,root) %{_bindir}/cm2latex-2
145 %attr(755,root,root) %{_bindir}/cm2man-2
146 %attr(755,root,root) %{_bindir}/cm2pseudoxml-2
147 %attr(755,root,root) %{_bindir}/cm2xetex-2
148 %attr(755,root,root) %{_bindir}/cm2xml-2
149 %{py_sitescriptdir}/recommonmark
150 %{py_sitescriptdir}/recommonmark-%{version}-py*.egg-info
151 %endif
152
153 %if %{with python3}
154 %files -n python3-recommonmark
155 %defattr(644,root,root,755)
156 %doc CHANGELOG.md README.md license.md
157 %attr(755,root,root) %{_bindir}/cm2html
158 %attr(755,root,root) %{_bindir}/cm2latex
159 %attr(755,root,root) %{_bindir}/cm2man
160 %attr(755,root,root) %{_bindir}/cm2pseudoxml
161 %attr(755,root,root) %{_bindir}/cm2xetex
162 %attr(755,root,root) %{_bindir}/cm2xml
163 %attr(755,root,root) %{_bindir}/cm2html-3
164 %attr(755,root,root) %{_bindir}/cm2latex-3
165 %attr(755,root,root) %{_bindir}/cm2man-3
166 %attr(755,root,root) %{_bindir}/cm2pseudoxml-3
167 %attr(755,root,root) %{_bindir}/cm2xetex-3
168 %attr(755,root,root) %{_bindir}/cm2xml-3
169 %{py3_sitescriptdir}/recommonmark
170 %{py3_sitescriptdir}/recommonmark-%{version}-py*.egg-info
171 %endif
172
173 %if %{with doc}
174 %files apidocs
175 %defattr(644,root,root,755)
176 %doc docs/_build/html/{_static,*.html,*.js}
177 %endif
This page took 0.18887 seconds and 3 git commands to generate.