]> git.pld-linux.org Git - SPECS.git/blob - python-waitress.spec
SPECS updated Sat 31 Jul 20:26:02 CEST 2021
[SPECS.git] / python-waitress.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  doc     # Sphinx documentation
6 %bcond_without  tests   # unit tests
7
8 %define         module  waitress
9 Summary:        Waitress WSGI server
10 Summary(pl.UTF-8):      Serwer WSGI Waitress
11 Name:           python-%{module}
12 Version:        1.4.1
13 Release:        2
14 License:        ZPL v2.1
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.org/simple/waitress/
17 Source0:        https://files.pythonhosted.org/packages/source/w/waitress/%{module}-%{version}.tar.gz
18 # Source0-md5:  e6b9f0406cb4e6fedcc3add96411786d
19 URL:            https://docs.pylonsproject.org/projects/waitress/
20 %if %{with python2}
21 BuildRequires:  python-modules >= 1:2.7
22 BuildRequires:  python-setuptools
23 %endif
24 %if %{with python3}
25 BuildRequires:  python3-modules >= 1:3.3
26 BuildRequires:  python3-setuptools
27 %endif
28 BuildRequires:  rpm-pythonprov
29 BuildRequires:  rpmbuild(macros) >= 1.714
30 %if %{with doc}
31 BuildRequires:  sphinx-pdg-3
32 # >= 1.8.1
33 BuildRequires:  python3-docutils
34 BuildRequires:  python3-pylons-sphinx-themes >= 1.0.9
35 %endif
36 Requires:       python-modules >= 1:2.7
37 BuildArch:      noarch
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %description
41 Waitress is meant to be a production-quality pure-Python WSGI server
42 with very acceptable performance.
43
44 %description -l pl.UTF-8
45 Waitress jest serwerem WSGI tworzonym w czystym Pythonie, z myślą o
46 produkcyjnej jakości i akceptowalnej wydajności.
47
48 %package -n python3-%{module}
49 Summary:        Waitress WSGI server
50 Summary(pl.UTF-8):      Serwer WSGI Waitress
51 Group:          Libraries/Python
52 Requires:       python3-modules >= 1:3.3
53
54 %description -n python3-%{module}
55 Waitress is meant to be a production-quality pure-Python WSGI server
56 with very acceptable performance.
57
58 %description -n python3-%{module} -l pl.UTF-8
59 Waitress jest serwerem WSGI tworzonym w czystym Pythonie, z myślą o
60 produkcyjnej jakości i akceptowalnej wydajności.
61
62 %package apidocs
63 Summary:        API documentation for Python waitress module
64 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona waitress
65 Group:          Documentation
66
67 %description apidocs
68 API documentation for Python waitress module.
69
70 %description apidocs -l pl.UTF-8
71 Dokumentacja API modułu Pythona waitress.
72
73 %prep
74 %setup -q -n %{module}-%{version}
75
76 # 3 tests require IPv6
77 %{__mv} %{module}/tests/test_adjustments.py{,.disable}
78 # gives tcp connect errors
79 %{__mv} %{module}/tests/test_functional.py{,.disable}
80
81 %build
82 %if %{with python2}
83 %py_build
84
85 %if %{with tests}
86 %{__python} -m unittest discover -s waitress/tests
87 %endif
88 %endif
89
90 %if %{with python3}
91 %py3_build
92
93 %if %{with tests}
94 %{__python3} -m unittest discover -s waitress/tests
95 %endif
96 %endif
97
98 %if %{with doc}
99 PYTHONPATH=$(pwd) \
100 %{__make} -C docs html \
101         SPHINXBUILD=sphinx-build-3
102 %endif
103
104 %install
105 rm -rf $RPM_BUILD_ROOT
106
107 %if %{with python2}
108 %py_install
109
110 %{__mv} $RPM_BUILD_ROOT%{_bindir}/waitress-serve{,-2}
111
112 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/%{module}/tests
113 %py_postclean
114 %endif
115
116 %if %{with python3}
117 %py3_install
118
119 %{__mv} $RPM_BUILD_ROOT%{_bindir}/waitress-serve{,-3}
120
121 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/%{module}/tests
122 %endif
123
124 %clean
125 rm -rf $RPM_BUILD_ROOT
126
127 %if %{with python2}
128 %files
129 %defattr(644,root,root,755)
130 %doc CHANGES.txt COPYRIGHT.txt HISTORY.txt LICENSE.txt README.rst TODO.txt
131 %attr(755,root,root) %{_bindir}/waitress-serve-2
132 %{py_sitescriptdir}/waitress
133 %{py_sitescriptdir}/waitress-%{version}-py*.egg-info
134 %endif
135
136 %if %{with python3}
137 %files -n python3-%{module}
138 %defattr(644,root,root,755)
139 %doc CHANGES.txt COPYRIGHT.txt HISTORY.txt LICENSE.txt README.rst TODO.txt
140 %attr(755,root,root) %{_bindir}/waitress-serve-3
141 %{py3_sitescriptdir}/waitress
142 %{py3_sitescriptdir}/waitress-%{version}-py*.egg-info
143 %endif
144
145 %if %{with doc}
146 %files apidocs
147 %defattr(644,root,root,755)
148 %doc docs/_build/html/{_static,*.html,*.js}
149 %endif
This page took 0.275744 seconds and 3 git commands to generate.