]>
Commit | Line | Data |
---|---|---|
2a5340e9 JK |
1 | # |
2 | # Conditional build: | |
7073dc10 JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
2a5340e9 JK |
5 | %bcond_without python2 # CPython 2.x module |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module zope.deprecation | |
9 | Summary: Deprecation library for Python code | |
10 | Summary(pl.UTF-8): Biblioteka odradzająca dla kodu w Pythonie | |
11 | Name: python-%{module} | |
7073dc10 JB |
12 | Version: 4.4.0 |
13 | Release: 1 | |
14 | License: ZPL v2.1 | |
2a5340e9 | 15 | Group: Libraries/Python |
7073dc10 JB |
16 | Source0: https://files.pythonhosted.org/packages/source/z/zope.deprecation/zope.deprecation-%{version}.tar.gz |
17 | # Source0-md5: 6915a92473e2658b3954f8490938455c | |
18 | URL: https://www.zope.dev/ | |
2a5340e9 | 19 | %if %{with python2} |
7073dc10 | 20 | BuildRequires: python >= 1:2.7 |
2a5340e9 | 21 | BuildRequires: python-setuptools |
7073dc10 JB |
22 | %if %{with tests} |
23 | BuildRequires: python-zope.testrunner | |
24 | %endif | |
2a5340e9 JK |
25 | %endif |
26 | %if %{with python3} | |
7073dc10 | 27 | BuildRequires: python3 >= 1:3.4 |
2a5340e9 | 28 | BuildRequires: python3-setuptools |
7073dc10 JB |
29 | %if %{with tests} |
30 | BuildRequires: python3-zope.testrunner | |
31 | %endif | |
2a5340e9 | 32 | %endif |
7073dc10 JB |
33 | BuildRequires: rpm-pythonprov |
34 | BuildRequires: rpmbuild(macros) >= 1.714 | |
35 | %if %{with doc} | |
36 | BuildRequires: sphinx-pdg | |
37 | %endif | |
38 | Requires: python-modules >= 1:2.7 | |
2a5340e9 | 39 | Provides: Zope-Deprecation |
7073dc10 | 40 | Obsoletes: Zope-Deprecation < 4.1.0 |
7f721943 | 41 | BuildArch: noarch |
2a5340e9 JK |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
43 | ||
44 | %description | |
7073dc10 JB |
45 | This package provides a simple function called deprecated(names, |
46 | reason) to mark deprecated modules, classes, functions, methods and | |
47 | properties. | |
2a5340e9 JK |
48 | |
49 | %description -l pl.UTF-8 | |
7073dc10 JB |
50 | Ten pakiet udostępnia prostą funkcję o nazwie deprecated(names, |
51 | reason), służącą do oznaczania przestarzałych modułów, klas, funkcji, | |
52 | metod i własności. | |
2a5340e9 JK |
53 | |
54 | %package -n python3-%{module} | |
55 | Summary: Deprecation library for Python code | |
56 | Summary(pl.UTF-8): Biblioteka odradzająca dla kodu w Pythonie | |
57 | Group: Libraries/Python | |
7073dc10 | 58 | Requires: python3-modules >= 1:3.4 |
2a5340e9 JK |
59 | |
60 | %description -n python3-%{module} | |
7073dc10 JB |
61 | This package provides a simple function called deprecated(names, |
62 | reason) to mark deprecated modules, classes, functions, methods and | |
63 | properties. | |
2a5340e9 JK |
64 | |
65 | %description -n python3-%{module} -l pl.UTF-8 | |
7073dc10 JB |
66 | Ten pakiet udostępnia prostą funkcję o nazwie deprecated(names, |
67 | reason), służącą do oznaczania przestarzałych modułów, klas, funkcji, | |
68 | metod i własności. | |
69 | ||
70 | %package apidocs | |
71 | Summary: API documentation for Python zope.deprecation module | |
72 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona zope.deprecation | |
73 | Group: Documentation | |
74 | ||
75 | %description apidocs | |
76 | API documentation for Python zope.deprecation module. | |
77 | ||
78 | %description apidocs -l pl.UTF-8 | |
79 | Dokumentacja API modułu Pythona zope.deprecation. | |
2a5340e9 JK |
80 | |
81 | %prep | |
82 | %setup -q -n zope.deprecation-%{version} | |
83 | ||
84 | %build | |
85 | %if %{with python2} | |
86 | %py_build %{?with_tests:test} | |
87 | %endif | |
88 | ||
89 | %if %{with python3} | |
90 | %py3_build %{?with_tests:test} | |
91 | %endif | |
92 | ||
7073dc10 JB |
93 | %if %{with doc} |
94 | PYTHONPATH=$(pwd)/src \ | |
95 | %{__make} -C docs html | |
96 | %endif | |
97 | ||
2a5340e9 JK |
98 | %install |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | ||
101 | %if %{with python2} | |
7073dc10 | 102 | %py_install |
2a5340e9 JK |
103 | |
104 | %py_postclean | |
105 | %endif | |
106 | ||
107 | %if %{with python3} | |
7073dc10 | 108 | %py3_install |
2a5340e9 JK |
109 | %endif |
110 | ||
111 | %clean | |
112 | rm -rf $RPM_BUILD_ROOT | |
113 | ||
114 | %if %{with python2} | |
115 | %files | |
116 | %defattr(644,root,root,755) | |
7073dc10 JB |
117 | %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst |
118 | %{py_sitescriptdir}/zope/deprecation | |
7f721943 JR |
119 | %{py_sitescriptdir}/zope.deprecation-*.egg-info |
120 | %{py_sitescriptdir}/zope.deprecation-*-nspkg.pth | |
2a5340e9 JK |
121 | %endif |
122 | ||
123 | %if %{with python3} | |
124 | %files -n python3-%{module} | |
125 | %defattr(644,root,root,755) | |
7073dc10 | 126 | %doc CHANGES.rst COPYRIGHT.txt LICENSE.txt README.rst |
7f721943 JR |
127 | %{py3_sitescriptdir}/zope/deprecation |
128 | %{py3_sitescriptdir}/zope.deprecation-*.egg-info | |
129 | %{py3_sitescriptdir}/zope.deprecation-*-nspkg.pth | |
2a5340e9 | 130 | %endif |
7073dc10 JB |
131 | |
132 | %if %{with doc} | |
133 | %files apidocs | |
134 | %defattr(644,root,root,755) | |
135 | %doc docs/_build/html/{_static,*.html,*.js} | |
136 | %endif |