]>
Commit | Line | Data |
---|---|---|
9b444434 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx 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: Python 2 module for development of flexible plugin systems in Python | |
9 | Summary(pl.UTF-8): Moduł Pythona 2 do tworzenia elastycznych systemów wtyczek w Pythonie | |
10 | Name: python-pluginbase | |
11 | Version: 1.0.0 | |
87ee4d1b | 12 | Release: 4 |
9b444434 JB |
13 | License: BSD |
14 | Group: Libraries/Python | |
15 | #Source0Download: https://pypi.org/simple/pluginbase/ | |
16 | Source0: https://files.pythonhosted.org/packages/source/p/pluginbase/pluginbase-%{version}.tar.gz | |
17 | # Source0-md5: f85d8c9cb4d30e90da157a22d11dc727 | |
18 | URL: https://pypi.org/project/pluginbase/ | |
19 | %if %{with python2} | |
20 | BuildRequires: python-modules >= 1:2.6 | |
21 | BuildRequires: python-setuptools | |
22 | %if %{with tests} | |
23 | BuildRequires: python-pytest | |
24 | %endif | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-modules >= 1:3.3 | |
28 | BuildRequires: python3-setuptools | |
29 | %if %{with tests} | |
30 | BuildRequires: python3-pytest | |
31 | %endif | |
32 | %endif | |
33 | BuildRequires: rpm-pythonprov | |
34 | BuildRequires: rpmbuild(macros) >= 1.714 | |
35 | %if %{with doc} | |
36 | BuildRequires: sphinx-pdg | |
37 | %endif | |
38 | Requires: python-modules >= 1:2.6 | |
39 | BuildArch: noarch | |
40 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
41 | ||
42 | %description | |
43 | PluginBase is a module for Python that enables the development of | |
44 | flexible plugin systems in Python. | |
45 | ||
46 | %description -l pl.UTF-8 | |
47 | PluginBase to moduł Pythona pozwalający na tworzenie elastycznych | |
48 | systemów wtyczek w Pythonie. | |
49 | ||
50 | %package -n python3-pluginbase | |
51 | Summary: Python 3 module for development of flexible plugin systems in Python | |
52 | Summary(pl.UTF-8): Moduł Pythona 3 do tworzenia elastycznych systemów wtyczek w Pythonie | |
53 | Group: Libraries/Python | |
54 | Requires: python3-modules >= 1:3.3 | |
55 | ||
56 | %description -n python3-pluginbase | |
57 | PluginBase is a module for Python that enables the development of | |
58 | flexible plugin systems in Python. | |
59 | ||
60 | %description -n python3-pluginbase -l pl.UTF-8 | |
61 | PluginBase to moduł Pythona pozwalający na tworzenie elastycznych | |
62 | systemów wtyczek w Pythonie. | |
63 | ||
64 | %package apidocs | |
65 | Summary: API documentation for Python pluginbase module | |
66 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona pluginbase | |
67 | Group: Documentation | |
68 | ||
69 | %description apidocs | |
70 | API documentation for Python pluginbase module. | |
71 | ||
72 | %description apidocs -l pl.UTF-8 | |
73 | Dokumentacja API modułu Pythona pluginbase. | |
74 | ||
75 | %prep | |
76 | %setup -q -n pluginbase-%{version} | |
77 | ||
78 | %build | |
79 | %if %{with python2} | |
80 | %py_build | |
81 | ||
82 | %if %{with tests} | |
83 | cd tests | |
84 | PYTHONPATH=.. \ | |
85 | %{__python} -m pytest | |
86 | cd .. | |
87 | %endif | |
88 | %endif | |
89 | ||
90 | %if %{with python3} | |
91 | %py3_build | |
92 | ||
93 | %if %{with tests} | |
94 | cd tests | |
95 | PYTHONPATH=.. \ | |
96 | %{__python3} -m pytest | |
97 | cd .. | |
98 | %endif | |
99 | %endif | |
100 | ||
101 | %if %{with doc} | |
102 | %{__make} -C docs html | |
103 | %endif | |
104 | ||
105 | %install | |
106 | rm -rf $RPM_BUILD_ROOT | |
107 | ||
108 | %if %{with python2} | |
109 | %py_install | |
110 | ||
111 | %py_postclean | |
112 | %endif | |
113 | ||
114 | %if %{with python3} | |
115 | %py3_install | |
116 | %endif | |
117 | ||
118 | %clean | |
119 | rm -rf $RPM_BUILD_ROOT | |
120 | ||
121 | %if %{with python2} | |
122 | %files | |
123 | %defattr(644,root,root,755) | |
124 | %doc LICENSE README.md | |
125 | %{py_sitescriptdir}/pluginbase.py[co] | |
126 | %{py_sitescriptdir}/pluginbase-%{version}-py*.egg-info | |
127 | %endif | |
128 | ||
129 | %if %{with python3} | |
130 | %files -n python3-pluginbase | |
131 | %defattr(644,root,root,755) | |
132 | %doc LICENSE README.md | |
133 | %{py3_sitescriptdir}/pluginbase.py | |
134 | %{py3_sitescriptdir}/__pycache__/pluginbase.cpython-*.py[co] | |
135 | %{py3_sitescriptdir}/pluginbase-%{version}-py*.egg-info | |
136 | %endif | |
137 | ||
138 | %if %{with doc} | |
139 | %files apidocs | |
140 | %defattr(644,root,root,755) | |
141 | %doc docs/_build/html/{_static,*.html,*.js} | |
142 | %endif |