]>
Commit | Line | Data |
---|---|---|
9f1dcfe7 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
3ca93b97 | 5 | %bcond_without tests # test suite |
9f1dcfe7 | 6 | |
8520a43a | 7 | %define module decorator |
9f1dcfe7 JB |
8 | Summary: Bunch of nice decorators for Python 2 |
9 | Summary(pl.UTF-8): Zbiór ładnych dekoratorów dla Pythona 2 | |
8f90b112 | 10 | Name: python-%{module} |
157fcc19 | 11 | # keep 4.x here for python2 support |
293a5994 | 12 | Version: 4.4.2 |
742869e0 | 13 | Release: 5 |
1767f406 | 14 | License: BSD |
8520a43a | 15 | Group: Libraries/Python |
a505c87c | 16 | #Source0Download: https://pypi.org/simple/decorator/ |
3ca93b97 | 17 | Source0: https://files.pythonhosted.org/packages/source/d/decorator/%{module}-%{version}.tar.gz |
293a5994 | 18 | # Source0-md5: d83c624cce93e6bdfab144821b526e1d |
a4fd0b0a | 19 | Source1: https://raw.githubusercontent.com/micheles/decorator/%{version}/docs/documentation.md |
293a5994 | 20 | # Source1-md5: e98a2c67526f4fb98053399c2de83f11 |
a505c87c | 21 | URL: https://pypi.org/project/decorator/ |
9f1dcfe7 | 22 | %if %{with python2} |
a505c87c JB |
23 | BuildRequires: python-devel >= 1:2.6 |
24 | BuildRequires: python-modules >= 1:2.6 | |
a3525a95 | 25 | BuildRequires: python-setuptools |
9f1dcfe7 JB |
26 | %endif |
27 | %if %{with python3} | |
a3525a95 JB |
28 | BuildRequires: python3-devel >= 1:3.2 |
29 | BuildRequires: python3-modules >= 1:3.2 | |
30 | BuildRequires: python3-setuptools | |
9f1dcfe7 | 31 | %endif |
22a4cdb6 | 32 | BuildRequires: rpm-pythonprov |
a505c87c | 33 | BuildRequires: rpmbuild(macros) >= 1.714 |
8f90b112 | 34 | BuildArch: noarch |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %description | |
9f1dcfe7 | 38 | Bunch of nice decorators for Python 2 like memoize, tracing, |
8f90b112 | 39 | redirecting_stdout, locked. |
40 | ||
a6b812b0 | 41 | %description -l pl.UTF-8 |
9f1dcfe7 JB |
42 | Zbiór ładnych dekoratorów dla Pythona 2: memoize, tracing, |
43 | redirecting_stdout, locked... | |
44 | ||
45 | %package -n python3-%{module} | |
46 | Summary: Bunch of nice decorators for Python 3 | |
47 | Summary(pl.UTF-8): Zbiór ładnych dekoratorów dla Pythona 3 | |
48 | Group: Libraries/Python | |
49 | ||
50 | %description -n python3-%{module} | |
51 | Bunch of nice decorators for Python 3 like memoize, tracing, | |
52 | redirecting_stdout, locked. | |
53 | ||
54 | %description -n python3-%{module} -l pl.UTF-8 | |
55 | Zbiór ładnych dekoratorów dla Pythona 3: memoize, tracing, | |
a6b812b0 JB |
56 | redirecting_stdout, locked... |
57 | ||
a3525a95 JB |
58 | %package doc |
59 | Summary: Documentation for decorator module in PDF format | |
60 | Summary(pl.UTF-8): Dokumentacja modułu decorator w formacie PDF | |
61 | Group: Documentation | |
62 | ||
63 | %description doc | |
64 | Documentation for decorator module in PDF format. | |
65 | ||
66 | %description doc -l pl.UTF-8 | |
67 | Dokumentacja modułu decorator w formacie PDF. | |
68 | ||
8f90b112 | 69 | %prep |
8a1c3358 | 70 | %setup -q -n %{module}-%{version} |
8f90b112 | 71 | |
a4fd0b0a | 72 | cp -p %{SOURCE1} . |
a505c87c | 73 | |
8f90b112 | 74 | %build |
9f1dcfe7 | 75 | %if %{with python2} |
3ca93b97 | 76 | %py_build %{?with_tests:test} |
9f1dcfe7 | 77 | %endif |
3ca93b97 | 78 | |
9f1dcfe7 | 79 | %if %{with python3} |
3ca93b97 | 80 | %py3_build %{?with_tests:test} |
9f1dcfe7 | 81 | %endif |
8f90b112 | 82 | |
83 | %install | |
84 | rm -rf $RPM_BUILD_ROOT | |
9f1dcfe7 JB |
85 | |
86 | %if %{with python2} | |
56db354d | 87 | %py_install |
8f90b112 | 88 | |
89 | %py_postclean | |
9f1dcfe7 JB |
90 | %endif |
91 | ||
92 | %if %{with python3} | |
56db354d | 93 | %py3_install |
9f1dcfe7 | 94 | %endif |
8f90b112 | 95 | |
96 | %clean | |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | ||
9f1dcfe7 | 99 | %if %{with python2} |
8f90b112 | 100 | %files |
101 | %defattr(644,root,root,755) | |
293a5994 | 102 | %doc CHANGES.md LICENSE.txt README.rst |
fb66e5d5 JB |
103 | %{py_sitescriptdir}/decorator.py[co] |
104 | %{py_sitescriptdir}/decorator-%{version}-py*.egg-info | |
9f1dcfe7 JB |
105 | %endif |
106 | ||
107 | %if %{with python3} | |
108 | %files -n python3-%{module} | |
109 | %defattr(644,root,root,755) | |
293a5994 | 110 | %doc CHANGES.md LICENSE.txt README.rst |
9f1dcfe7 | 111 | %{py3_sitescriptdir}/decorator.py |
a4fd0b0a | 112 | %{py3_sitescriptdir}/__pycache__/decorator.cpython-*.py[co] |
9f1dcfe7 JB |
113 | %{py3_sitescriptdir}/decorator-%{version}-py*.egg-info |
114 | %endif | |
a3525a95 JB |
115 | |
116 | %files doc | |
117 | %defattr(644,root,root,755) | |
a4fd0b0a | 118 | %doc documentation.md |