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