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