]> git.pld-linux.org Git - packages/python-zope.deferredimport.git/blob - python-zope.deferredimport.spec
- updated to 4.4, added python3 module and apidocs
[packages/python-zope.deferredimport.git] / python-zope.deferredimport.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_without  tests   # unit tests
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 %define module  zope.deferredimport
9 Summary:        Defer Python module import
10 Summary(pl.UTF-8):      Opóźnianie importu modułów Pythona
11 Name:           python-%{module}
12 Version:        4.4
13 Release:        1
14 License:        ZPL v2.1
15 Group:          Libraries/Python
16 Source0:        https://files.pythonhosted.org/packages/source/z/zope.deferredimport/zope.deferredimport-%{version}.tar.gz
17 # Source0-md5:  05db5a4e2129966e510f9b73368cb7d6
18 URL:            https://www.zope.dev/
19 %if %{with python2}
20 BuildRequires:  python >= 1:2.7
21 BuildRequires:  python-devel >= 1:2.7
22 BuildRequires:  python-setuptools
23 %if %{with tests}
24 BuildRequires:  python-zope.proxy
25 BuildRequires:  python-zope.testrunner
26 %endif
27 %endif
28 %if %{with python3}
29 BuildRequires:  python3 >= 1:3.5
30 BuildRequires:  python3-devel >= 1:3.5
31 BuildRequires:  python3-setuptools
32 %if %{with tests}
33 BuildRequires:  python3-zope.proxy
34 BuildRequires:  python3-zope.testrunner
35 %endif
36 %endif
37 BuildRequires:  rpm-pythonprov
38 BuildRequires:  rpmbuild(macros) >= 1.714
39 %if %{with doc}
40 BuildRequires:  sphinx-pdg
41 %endif
42 Requires:       python-modules >= 1:2.7
43 Obsoletes:      Zope-DeferredImport < 3.6.0
44 BuildArch:      noarch
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %description
48 Defer Python module import.
49
50 %description -l pl.UTF-8
51 Opóźnianie importu modułów Pythona.
52
53 %package -n python3-%{module}
54 Summary:        Defer Python module import
55 Summary(pl.UTF-8):      Opóźnianie importu modułów Pythona
56 Group:          Libraries/Python
57 Requires:       python3-modules >= 1:3.5
58
59 %description -n python3-%{module}
60 Defer Python module import.
61
62 %description -n python3-%{module} -l pl.UTF-8
63 Opóźnianie importu modułów Pythona.
64
65 %package apidocs
66 Summary:        API documentation for Python zope.deferredimport module
67 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona zope.deferredimport
68 Group:          Documentation
69
70 %description apidocs
71 API documentation for Python zope.deferredimport module.
72
73 %description apidocs -l pl.UTF-8
74 Dokumentacja API modułu Pythona zope.deferredimport.
75
76 %prep
77 %setup -q -n %{module}-%{version}
78
79 %build
80 %if %{with python2}
81 %py_build
82
83 %if %{with tests}
84 PYTHONPATH=$(pwd)/src \
85 zope-testrunner-2 --test-path=src -v
86 %endif
87 %endif
88
89 %if %{with python3}
90 %py3_build
91
92 %if %{with tests}
93 PYTHONPATH=$(pwd)/src \
94 zope-testrunner-3 --test-path=src -v
95 %endif
96 %endif
97
98 %if %{with doc}
99 PYTHONPATH=$(pwd)/src \
100 %{__make} -C docs html
101 %endif
102
103 %install
104 rm -rf $RPM_BUILD_ROOT
105
106 %if %{with python2}
107 %py_install
108
109 %py_postclean
110 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/zope/deferredimport/tests.*
111 %endif
112
113 %if %{with python3}
114 %py3_install
115
116 %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/zope/deferredimport/tests.*
117 %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/zope/deferredimport/__pycache__/tests.*
118 %endif
119
120 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %if %{with python2}
124 %files
125 %defattr(644,root,root,755)
126 %{py_sitescriptdir}/zope/deferredimport
127 %{py_sitescriptdir}/zope.deferredimport-*.egg-info
128 %{py_sitescriptdir}/zope.deferredimport-*-nspkg.pth
129 %endif
130
131 %if %{with python3}
132 %files -n python3-%{module}
133 %defattr(644,root,root,755)
134 %{py3_sitescriptdir}/zope/deferredimport
135 %{py3_sitescriptdir}/zope.deferredimport-*.egg-info
136 %{py3_sitescriptdir}/zope.deferredimport-*-nspkg.pth
137 %endif
138
139 %if %{with doc}
140 %files apidocs
141 %defattr(644,root,root,755)
142 %doc docs/_build/html/{_modules,_static,*.html,*.js}
143 %endif
This page took 0.047888 seconds and 3 git commands to generate.