]> git.pld-linux.org Git - packages/python-recommonmark.git/blob - python-recommonmark.spec
66454d0f1ae24ffb2545864497c36679bc0e4207
[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.6.0
12 Release:        1
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:  sphinx-pdg
48 %endif
49 Requires:       python-modules >= 1:2.7
50 BuildArch:      noarch
51 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53 %description
54 This allows you to write CommonMark inside of Docutils & Sphinx
55 projects.
56
57 %description -l pl.UTF-8
58 Ten moduł pozwala na pisanie z użyciem CommonMark wewnątrz projektów
59 Docutils i Sphinksa.
60
61 %package -n python3-recommonmark
62 Summary:        docutils-compatibility bridge to CommonMark
63 Summary(pl.UTF-8):      Pomost zgodności z docutils dla CommonMark
64 Group:          Libraries/Python
65 Requires:       python3-modules >= 1:3.3
66
67 %description -n python3-recommonmark
68 This allows you to write CommonMark inside of Docutils & Sphinx
69 projects.
70
71 %description -n python3-recommonmark -l pl.UTF-8
72 Ten moduł pozwala na pisanie z użyciem CommonMark wewnątrz projektów
73 Docutils i Sphinksa.
74
75 %package apidocs
76 Summary:        Documentation for Python recommonmark module
77 Summary(pl.UTF-8):      Dokumentacja modułu Pythona recommonmark
78 Group:          Documentation
79
80 %description apidocs
81 Documentation for Python recommonmark module.
82
83 %description apidocs -l pl.UTF-8
84 Dokumentacja modułu Pythona recommonmark.
85
86 %prep
87 %setup -q -n recommonmark-%{version}
88 %patch0 -p1
89
90 %build
91 %if %{with python2}
92 %py_build
93
94 %if %{with tests} && 0
95 # skip: python2 uses different XML formatting, tests expect python3 formatting
96 %{__python} -m pytest tests
97 %endif
98 %endif
99
100 %if %{with python3}
101 %py3_build
102
103 %if %{with tests}
104 %{__python3} -m pytest tests
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.055858 seconds and 2 git commands to generate.