]>
Commit | Line | Data |
---|---|---|
1504bca3 JK |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6 | %define module wrapt | |
7 | Summary: A Python module for decorators, wrappers and monkey patching | |
8 | Name: python-%{module} | |
9 | Version: 1.10.5 | |
10 | Release: 1 | |
11 | License: BSD | |
12 | Group: Libraries/Python | |
13 | Source0: https://pypi.python.org/packages/source/w/wrapt/%{module}-%{version}.tar.gz | |
14 | # Source0-md5: 79732bbc096235704e7523d3bacd202c | |
15 | URL: https://github.com/GrahamDumpleton/wrapt | |
16 | BuildRequires: rpm-pythonprov | |
17 | BuildRequires: rpmbuild(macros) >= 1.714 | |
18 | %if %{with python2} | |
19 | BuildRequires: python-devel | |
20 | %endif | |
21 | %if %{with python3} | |
22 | BuildRequires: python3-devel | |
23 | %endif | |
24 | Requires: python-modules | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %description | |
28 | The aim of the wrapt module is to provide a transparent object proxy | |
29 | for Python, which can be used as the basis for the construction of | |
30 | function wrappers and decorator functions. | |
31 | ||
32 | The wrapt module focuses very much on correctness. It therefore goes | |
33 | way beyond existing mechanisms such as functools.wraps() to ensure | |
34 | that decorators preserve introspectability, signatures, type checking | |
35 | abilities etc. The decorators that can be constructed using this | |
36 | module will work in far more scenarios than typical decorators and | |
37 | provide more predictable and consistent behaviour. | |
38 | ||
39 | %package -n python3-%{module} | |
40 | Summary: A Python module for decorators, wrappers and monkey patching | |
41 | Group: Libraries/Python | |
42 | Requires: python3-modules | |
43 | ||
44 | %description -n python3-%{module} | |
45 | The aim of the wrapt module is to provide a transparent object proxy | |
46 | for Python, which can be used as the basis for the construction of | |
47 | function wrappers and decorator functions. | |
48 | ||
49 | The wrapt module focuses very much on correctness. It therefore goes | |
50 | way beyond existing mechanisms such as functools.wraps() to ensure | |
51 | that decorators preserve introspectability, signatures, type checking | |
52 | abilities etc. The decorators that can be constructed using this | |
53 | module will work in far more scenarios than typical decorators and | |
54 | provide more predictable and consistent behaviour. | |
55 | ||
56 | %prep | |
57 | %setup -q -n %{module}-%{version} | |
58 | ||
59 | %build | |
60 | %if %{with python2} | |
61 | %py_build | |
62 | %endif | |
63 | ||
64 | %if %{with python3} | |
65 | %py3_build | |
66 | %endif | |
67 | ||
68 | %install | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | ||
71 | %if %{with python2} | |
72 | %py_install | |
73 | ||
74 | %py_postclean | |
75 | %endif | |
76 | ||
77 | %if %{with python3} | |
78 | %py3_install | |
79 | %endif | |
80 | ||
81 | %clean | |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | ||
84 | %if %{with python2} | |
85 | %files | |
86 | %defattr(644,root,root,755) | |
87 | %doc README | |
88 | %dir %{py_sitedir}/%{module} | |
89 | %{py_sitedir}/%{module}/*.py[co] | |
90 | %attr(755,root,root) %{py_sitedir}/%{module}/*.so | |
91 | %{py_sitedir}/%{module}-%{version}-py*.egg-info | |
92 | %endif | |
93 | ||
94 | %if %{with python3} | |
95 | %files -n python3-%{module} | |
96 | %defattr(644,root,root,755) | |
97 | %doc README | |
98 | %dir %{py3_sitedir}/%{module} | |
99 | %{py3_sitedir}/%{module}/*.py | |
100 | %attr(755,root,root) %{py3_sitedir}/%{module}/*.so | |
101 | %{py3_sitedir}/%{module}/__pycache__ | |
102 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info | |
103 | %endif |