]>
Commit | Line | Data |
---|---|---|
c9e488a0 | 1 | # |
5f3fb982 MK |
2 | # Conditional build: |
3 | %bcond_with doc # don't build doc | |
4 | %bcond_with tests # do not perform "make test" | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module recordclass | |
9 | Summary: Mutable variant of collections.namedtuple, which supports assignments | |
c9e488a0 | 10 | Summary(pl.UTF-8): Modyfikowalny wariant collections.namedtuple, obsługujący przypisania |
5f3fb982 MK |
11 | Name: python-%{module} |
12 | Version: 0.4.3 | |
6dc559b0 | 13 | Release: 7 |
5f3fb982 MK |
14 | License: MIT |
15 | Group: Libraries/Python | |
c9e488a0 JB |
16 | #Source0Download: https://pypi.org/simple/recordclass/ |
17 | Source0: https://files.pythonhosted.org/packages/source/r/recordclass/recordclass-%{version}.tar.gz | |
5f3fb982 MK |
18 | # Source0-md5: 3e36bba64024b70a49b475fd20b56710 |
19 | URL: http://intellimath.bitbucket.org/recordclass | |
20 | BuildRequires: rpm-pythonprov | |
5f3fb982 MK |
21 | BuildRequires: rpmbuild(macros) >= 1.714 |
22 | %if %{with python2} | |
23 | BuildRequires: python-devel | |
c9e488a0 | 24 | BuildRequires: python-setuptools |
5f3fb982 MK |
25 | %endif |
26 | %if %{with python3} | |
27 | BuildRequires: python3-devel | |
c9e488a0 | 28 | BuildRequires: python3-setuptools |
5f3fb982 MK |
29 | %endif |
30 | Requires: python-modules | |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | ||
35 | %description -l pl.UTF-8 | |
36 | ||
37 | %package -n python3-%{module} | |
c9e488a0 JB |
38 | Summary: Mutable variant of collections.namedtuple, which supports assignments |
39 | Summary(pl.UTF-8): Modyfikowalny wariant collections.namedtuple, obsługujący przypisania | |
5f3fb982 MK |
40 | Group: Libraries/Python |
41 | Requires: python3-modules | |
42 | ||
43 | %description -n python3-%{module} | |
44 | ||
45 | %description -n python3-%{module} -l pl.UTF-8 | |
46 | ||
47 | %package apidocs | |
48 | Summary: %{module} API documentation | |
49 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
50 | Group: Documentation | |
51 | ||
52 | %description apidocs | |
53 | API documentation for %{module}. | |
54 | ||
55 | %description apidocs -l pl.UTF-8 | |
56 | Dokumentacja API %{module}. | |
57 | ||
58 | %prep | |
59 | %setup -q -n %{module}-%{version} | |
60 | ||
61 | %build | |
62 | %if %{with python2} | |
63 | %py_build %{?with_tests:test} | |
64 | %endif | |
65 | ||
66 | %if %{with python3} | |
67 | %py3_build %{?with_tests:test} | |
68 | %endif | |
69 | ||
70 | %if %{with doc} | |
71 | cd docs | |
72 | %{__make} -j1 html | |
73 | rm -rf _build/html/_sources | |
74 | %endif | |
75 | ||
76 | %install | |
77 | rm -rf $RPM_BUILD_ROOT | |
78 | %if %{with python2} | |
79 | %py_install | |
80 | %py_postclean | |
81 | %endif | |
82 | ||
83 | %if %{with python3} | |
84 | %py3_install | |
85 | %endif | |
86 | ||
87 | %clean | |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
90 | %if %{with python2} | |
91 | %files | |
92 | %defattr(644,root,root,755) | |
93 | %doc README.rst | |
94 | %dir %{py_sitedir}/%{module} | |
95 | %{py_sitedir}/%{module}/*.py[co] | |
96 | %dir %{py_sitedir}/%{module}/test | |
97 | %{py_sitedir}/%{module}/test/*.py[co] | |
98 | %attr(755,root,root) %{py_sitedir}/%{module}/*.so | |
99 | %{py_sitedir}/%{module}-%{version}-py*.egg-info | |
100 | %endif | |
101 | ||
102 | %if %{with python3} | |
103 | %files -n python3-%{module} | |
104 | %defattr(644,root,root,755) | |
105 | %doc README.rst | |
106 | %dir %{py3_sitedir}/%{module} | |
107 | %{py3_sitedir}/%{module}/*.py | |
108 | %{py3_sitedir}/%{module}/test | |
109 | %{py3_sitedir}/%{module}/typing | |
110 | %attr(755,root,root) %{py3_sitedir}/%{module}/*.so | |
111 | %{py3_sitedir}/%{module}/__pycache__ | |
112 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info | |
113 | %endif | |
114 | ||
115 | %if %{with doc} | |
116 | %files apidocs | |
117 | %defattr(644,root,root,755) | |
118 | %doc docs/_build/html/* | |
119 | %endif |