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