]>
Commit | Line | Data |
---|---|---|
8b356bab JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # MkDocs documentation | |
4 | %bcond_without tests # unit tests | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | Summary: Extension pack for Python Markdown | |
9 | Summary(pl.UTF-8): Zestaw rozszerzeń do pakietu Python Markdown | |
10 | Name: python-pymdown-extensions | |
11 | Version: 5.0 | |
ec88fea8 | 12 | Release: 5 |
8b356bab JB |
13 | License: MIT, BSD |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://pypi.org/simple/pymdown-extensions/ | |
16 | Source0: https://files.pythonhosted.org/packages/source/p/pymdown-extensions/pymdown-extensions-%{version}.tar.gz | |
17 | # Source0-md5: 158931bf0b6eef56896743c0af1f5c19 | |
18 | URL: https://github.com/facelessuser/pymdown-extensions | |
19 | %if %{with doc} | |
20 | BuildRequires: python-mkdocs | |
21 | BuildRequires: python-mkdocs-material | |
22 | %endif | |
23 | %if %{with python2} | |
24 | BuildRequires: python-modules >= 1:2.7 | |
25 | BuildRequires: python-setuptools | |
26 | %if %{with tests} | |
27 | BuildRequires: python-PyYAML >= 3.10 | |
28 | BuildRequires: python-markdown >= 2.6.10 | |
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-PyYAML >= 3.10 | |
37 | BuildRequires: python3-markdown >= 2.6.10 | |
38 | BuildRequires: python3-pytest | |
39 | %endif | |
40 | %endif | |
41 | BuildRequires: rpm-pythonprov | |
42 | BuildRequires: rpmbuild(macros) >= 1.714 | |
43 | Requires: python-modules >= 1:2.7 | |
44 | BuildArch: noarch | |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
46 | ||
47 | %description | |
48 | Extension pack for Python Markdown. | |
49 | ||
50 | %description -l pl.UTF-8 | |
51 | Zestaw rozszerzeń do pakietu Python Markdown. | |
52 | ||
53 | %package -n python3-pymdown-extensions | |
54 | Summary: Extension pack for Python Markdown | |
55 | Summary(pl.UTF-8): Zestaw rozszerzeń do pakietu Python Markdown | |
56 | Group: Libraries/Python | |
57 | Requires: python3-modules >= 1:3.3 | |
58 | ||
59 | %description -n python3-pymdown-extensions | |
60 | Extension pack for Python Markdown. | |
61 | ||
62 | %description -n python3-pymdown-extensions -l pl.UTF-8 | |
63 | Zestaw rozszerzeń do pakietu Python Markdown. | |
64 | ||
65 | %package apidocs | |
66 | Summary: API documentation for Python pymdown-extensions module | |
67 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona pymdown-extensions | |
68 | Group: Documentation | |
69 | ||
70 | %description apidocs | |
71 | API documentation for Python pymdown-extensions module. | |
72 | ||
73 | %description apidocs -l pl.UTF-8 | |
74 | Dokumentacja API modułu Pythona pymdown-extensions. | |
75 | ||
76 | %prep | |
77 | %setup -q -n pymdown-extensions-%{version} | |
78 | ||
79 | %build | |
80 | %if %{with python2} | |
81 | %py_build %{?with_tests:test} | |
82 | %endif | |
83 | ||
84 | %if %{with python3} | |
85 | %py3_build %{?with_tests:test} | |
86 | %endif | |
87 | ||
88 | %if %{with doc} | |
89 | PYTHONPATH=$(pwd) \ | |
90 | mkdocs build --clean --verbose --strict | |
91 | ||
92 | %{__rm} site/{__init__.py*,sitemap.xml*} | |
93 | %endif | |
94 | ||
95 | %install | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
98 | %if %{with python2} | |
99 | %py_install | |
100 | ||
101 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/tests | |
102 | ||
103 | %py_postclean | |
104 | %endif | |
105 | ||
106 | %if %{with python3} | |
107 | %py3_install | |
108 | ||
109 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/tests | |
110 | %endif | |
111 | ||
112 | %clean | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | ||
115 | %if %{with python2} | |
116 | %files | |
117 | %defattr(644,root,root,755) | |
118 | %doc LICENSE.md README.md | |
119 | %{py_sitescriptdir}/pymdownx | |
120 | %{py_sitescriptdir}/pymdown_extensions-%{version}-py*.egg-info | |
121 | %endif | |
122 | ||
123 | %if %{with python3} | |
124 | %files -n python3-pymdown-extensions | |
125 | %defattr(644,root,root,755) | |
126 | %doc LICENSE.md README.md | |
127 | %{py3_sitescriptdir}/pymdownx | |
128 | %{py3_sitescriptdir}/pymdown_extensions-%{version}-py*.egg-info | |
129 | %endif | |
130 | ||
131 | %if %{with doc} | |
132 | %files apidocs | |
133 | %defattr(644,root,root,755) | |
134 | %doc site/* | |
135 | %endif |