]>
Commit | Line | Data |
---|---|---|
e825b753 | 1 | # |
a5443def | 2 | # Conditional build: |
e825b753 | 3 | %bcond_without tests # unit tests |
a5443def MK |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define module simplegeneric | |
8 | Summary: Simple generic functions | |
e825b753 | 9 | Summary(pl.UTF-8): Proste funkcje generyczne |
a5443def MK |
10 | Name: python-%{module} |
11 | Version: 0.8.1 | |
855fd103 | 12 | Release: 6 |
e825b753 | 13 | License: ZPL v2.1 |
a5443def | 14 | Group: Libraries/Python |
e825b753 JB |
15 | #Source0Download: https://pypi.org/simple/simplegeneric/ |
16 | Source0: https://files.pythonhosted.org/packages/source/s/simplegeneric/simplegeneric-%{version}.zip | |
a5443def | 17 | # Source0-md5: f9c1fab00fd981be588fc32759f474e3 |
e825b753 | 18 | URL: https://pypi.org/project/simplegeneric/ |
a5443def MK |
19 | BuildRequires: rpm-pythonprov |
20 | BuildRequires: rpmbuild(macros) >= 1.714 | |
21 | %if %{with python2} | |
e825b753 | 22 | BuildRequires: python-modules >= 1:2.5 |
a5443def MK |
23 | BuildRequires: python-setuptools |
24 | %endif | |
25 | %if %{with python3} | |
e825b753 | 26 | BuildRequires: python3-modules >= 1:3.2 |
a5443def MK |
27 | BuildRequires: python3-setuptools |
28 | %endif | |
e825b753 | 29 | Requires: python-modules >= 1:2.5 |
a5443def MK |
30 | BuildArch: noarch |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | The simplegeneric module lets you define simple single-dispatch | |
e825b753 | 35 | generic functions, akin to Python's built-in generic functions like |
a5443def MK |
36 | len(), iter() and so on. However, instead of using specially-named |
37 | methods, these generic functions use simple lookup tables, akin to | |
38 | those used by e.g. pickle.dump() and other generic functions found in | |
39 | the Python standard library. | |
40 | ||
e825b753 JB |
41 | %description -l pl.UTF-8 |
42 | Moduł simplegeneric pozwala definiować proste funkcje generyczne | |
43 | pojedynczego wyboru, podobne do wbudowanych funkcji generycznych | |
44 | Pythona, takich jak len(), iter() itp. Jednak, zamiast używania | |
45 | specjalnie nazwanych metod, te funkcje generyczne używają | |
46 | pojedynczych tabel wyszukiwania, podobnie do tych używanych przez np. | |
47 | pickle.dump() czy inne funkcje generyczne w bibliotece standardowej | |
48 | Pythona. | |
a5443def MK |
49 | |
50 | %package -n python3-%{module} | |
e825b753 JB |
51 | Summary: Simple generic functions |
52 | Summary(pl.UTF-8): Proste funkcje generyczne | |
a5443def | 53 | Group: Libraries/Python |
e825b753 | 54 | Requires: python3-modules >= 1:3.2 |
a5443def MK |
55 | |
56 | %description -n python3-%{module} | |
57 | The simplegeneric module lets you define simple single-dispatch | |
58 | generic functions, akin to Python’s built-in generic functions like | |
59 | len(), iter() and so on. However, instead of using specially-named | |
60 | methods, these generic functions use simple lookup tables, akin to | |
61 | those used by e.g. pickle.dump() and other generic functions found in | |
62 | the Python standard library. | |
63 | ||
e825b753 JB |
64 | %description -n python3-%{module} -l pl.UTF-8 |
65 | Moduł simplegeneric pozwala definiować proste funkcje generyczne | |
66 | pojedynczego wyboru, podobne do wbudowanych funkcji generycznych | |
67 | Pythona, takich jak len(), iter() itp. Jednak, zamiast używania | |
68 | specjalnie nazwanych metod, te funkcje generyczne używają | |
69 | pojedynczych tabel wyszukiwania, podobnie do tych używanych przez np. | |
70 | pickle.dump() czy inne funkcje generyczne w bibliotece standardowej | |
71 | Pythona. | |
a5443def MK |
72 | |
73 | %prep | |
74 | %setup -q -n %{module}-%{version} | |
75 | ||
76 | %build | |
77 | %if %{with python2} | |
78 | %py_build %{?with_tests:test} | |
79 | %endif | |
80 | ||
81 | %if %{with python3} | |
82 | %py3_build %{?with_tests:test} | |
83 | %endif | |
84 | ||
a5443def MK |
85 | %install |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
88 | %if %{with python2} | |
89 | %py_install | |
90 | ||
a5443def MK |
91 | %py_postclean |
92 | %endif | |
93 | ||
94 | %if %{with python3} | |
95 | %py3_install | |
96 | %endif | |
97 | ||
98 | %clean | |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | ||
101 | %if %{with python2} | |
102 | %files | |
103 | %defattr(644,root,root,755) | |
104 | %doc README.txt | |
e825b753 JB |
105 | %{py_sitescriptdir}/simplegeneric.py[co] |
106 | %{py_sitescriptdir}/simplegeneric-%{version}-py*.egg-info | |
a5443def MK |
107 | %endif |
108 | ||
109 | %if %{with python3} | |
110 | %files -n python3-%{module} | |
111 | %defattr(644,root,root,755) | |
112 | %doc README.txt | |
e825b753 JB |
113 | %{py3_sitescriptdir}/simplegeneric.py |
114 | %{py3_sitescriptdir}/__pycache__/simplegeneric.cpython-*.py[co] | |
115 | %{py3_sitescriptdir}/simplegeneric-%{version}-py*.egg-info | |
a5443def | 116 | %endif |