]>
Commit | Line | Data |
---|---|---|
b1f2c45f JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: Markdown and reStructuredText in a single file | |
8 | Summary(pl.UTF-8): Markdown i reStructuredText w pojedynczym pliku | |
9 | Name: python-m2r | |
10 | Version: 0.2.1 | |
f3daddd9 | 11 | Release: 5 |
b1f2c45f JB |
12 | License: MIT |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.org/simple/m2r/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/m/m2r/m2r-%{version}.tar.gz | |
16 | # Source0-md5: 8bdb45c19e2b59bb5ffb9a0348e81ad8 | |
17 | URL: https://pypi.org/project/m2r/ | |
18 | %if %{with python2} | |
19 | BuildRequires: python-modules >= 1:2.7 | |
20 | BuildRequires: python-setuptools | |
21 | %if %{with tests} | |
22 | BuildRequires: python-docutils | |
2cf22b56 | 23 | BuildRequires: python-mistune < 2 |
b1f2c45f JB |
24 | BuildRequires: python-mock |
25 | BuildRequires: python-pygments | |
26 | %endif | |
27 | %endif | |
28 | %if %{with python3} | |
29 | BuildRequires: python3-modules >= 1:3.4 | |
30 | BuildRequires: python3-setuptools | |
31 | %if %{with tests} | |
32 | BuildRequires: python3-docutils | |
2cf22b56 | 33 | BuildRequires: python3-mistune < 2 |
b1f2c45f JB |
34 | BuildRequires: python3-pygments |
35 | %endif | |
36 | %endif | |
37 | BuildRequires: rpm-pythonprov | |
38 | BuildRequires: rpmbuild(macros) >= 1.714 | |
39 | Requires: python-modules >= 1:2.7 | |
40 | BuildArch: noarch | |
41 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
42 | ||
43 | %description | |
44 | M2R converts a markdown file including reStructuredText (rst) markups | |
45 | to a valid rst format. | |
46 | ||
47 | %description -l pl.UTF-8 | |
48 | M2R konwertuje plik markdown zawierający znaczniki reStructuredText | |
49 | (rst) na poprawny format rst. | |
50 | ||
51 | %package -n python3-m2r | |
52 | Summary: Markdown and reStructuredText in a single file | |
53 | Summary(pl.UTF-8): Markdown i reStructuredText w pojedynczym pliku | |
54 | Group: Libraries/Python | |
55 | Requires: python3-modules >= 1:3.4 | |
56 | ||
57 | %description -n python3-m2r | |
58 | M2R converts a markdown file including reStructuredText (rst) markups | |
59 | to a valid rst format. | |
60 | ||
61 | %description -n python3-m2r -l pl.UTF-8 | |
62 | M2R konwertuje plik markdown zawierający znaczniki reStructuredText | |
63 | (rst) na poprawny format rst. | |
64 | ||
65 | %prep | |
66 | %setup -q -n m2r-%{version} | |
67 | ||
68 | %build | |
69 | %if %{with python2} | |
70 | %py_build | |
71 | ||
72 | %if %{with tests} | |
73 | %{__python} -m unittest discover -s tests | |
74 | %endif | |
75 | %endif | |
76 | ||
77 | %if %{with python3} | |
78 | %py3_build | |
79 | ||
80 | %if %{with tests} | |
81 | %{__python3} -m unittest discover -s tests | |
82 | %endif | |
83 | %endif | |
84 | ||
85 | %install | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
88 | %if %{with python2} | |
89 | %py_install | |
90 | ||
91 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/m2r{,-2} | |
92 | ||
93 | %py_postclean | |
94 | %endif | |
95 | ||
96 | %if %{with python3} | |
97 | %py3_install | |
98 | ||
99 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/m2r{,-3} | |
100 | ln -snf m2r-3 $RPM_BUILD_ROOT%{_bindir}/m2r | |
101 | %endif | |
102 | ||
103 | %clean | |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
106 | %if %{with python2} | |
107 | %files | |
108 | %defattr(644,root,root,755) | |
109 | %doc CHANGES.md LICENSE README.md | |
110 | %attr(755,root,root) %{_bindir}/m2r-2 | |
111 | %{py_sitescriptdir}/m2r.py[co] | |
112 | %{py_sitescriptdir}/m2r-%{version}-py*.egg-info | |
113 | %endif | |
114 | ||
115 | %if %{with python3} | |
116 | %files -n python3-m2r | |
117 | %defattr(644,root,root,755) | |
118 | %doc CHANGES.md LICENSE README.md | |
119 | %attr(755,root,root) %{_bindir}/m2r | |
120 | %attr(755,root,root) %{_bindir}/m2r-3 | |
121 | %{py3_sitescriptdir}/m2r.py | |
122 | %{py3_sitescriptdir}/__pycache__/m2r.cpython-*.py[co] | |
123 | %{py3_sitescriptdir}/m2r-%{version}-py*.egg-info | |
124 | %endif |