1 # NOTE: for versions >= 20 (for python 3.5+) see python3-gunicorn.spec
4 %bcond_without python2 # CPython 2.x module
5 %bcond_with python3 # CPython 3.x module (built from python3-gunicorn.spec)
6 %bcond_without tests # unit tests
8 %define module gunicorn
9 Summary: Python WSGI application server
10 Summary(pl.UTF-8): Pythonowy serwer aplikacji WSGI
11 Name: python-%{module}
12 # keep 19.x here for python2 support
17 #Source0Download: https://pypi.python.org/simple/gunicorn
18 Source0: https://files.pythonhosted.org/packages/source/g/gunicorn/%{module}-%{version}.tar.gz
19 # Source0-md5: dfa07409c60f9dd8501fa0503f0bfbb1
20 # distro-specific, not upstreamable
21 Patch100: %{name}-dev-log.patch
22 URL: http://gunicorn.org/
24 BuildRequires: python-devel >= 1:2.6
25 BuildRequires: python-setuptools
27 BuildRequires: python-coverage >= 4.0
28 BuildRequires: python-mock
29 BuildRequires: python-pytest >= 3.2.5
30 BuildRequires: python-pytest-cov >= 2.5.1
31 %if "%{py_ver}" < "2.7"
32 BuildRequires: python-unittest2
37 BuildRequires: python3-devel >= 1:3.2
38 BuildRequires: python3-setuptools
40 BuildRequires: python3-coverage >= 4.0
41 BuildRequires: python3-pytest >= 3.2.5
42 BuildRequires: python3-pytest-cov >= 2.5.1
43 %if "%{py3_ver}" < "3.3"
44 BuildRequires: python3-mock
48 BuildRequires: rpm-pythonprov
49 BuildRequires: rpmbuild(macros) >= 1.714
50 BuildRequires: sed >= 4.0
52 BuildRequires: sphinx-pdg
53 BuildRequires: python3-sphinx_rtd_theme
55 Requires: python-setuptools
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60 Gunicorn ("Green Unicorn") is a Python WSGI HTTP server for UNIX. It
61 uses the pre-fork worker model, ported from Ruby's Unicorn project. It
62 supports WSGI, Django, and Paster applications.
64 %description -l pl.UTF-8
65 Gunicorn ("Green Unicorn" - zielony jednorożec) to pythonowy serwer
66 HTTP WSGI dla systemów uniksowych. Wykorzystuje model pre-fork,
67 przeniesiony z projektu Unicorn napisanego w języku Ruby. Obsługuje
68 aplikacje WSGI, Django i Paster.
70 %package -n python3-%{module}
71 Summary: Python WSGI application server
72 Summary(pl.UTF-8): Pythonowy serwer aplikacji WSGI
73 Group: Libraries/Python
74 Requires: python3-setuptools
76 %description -n python3-%{module}
77 Gunicorn ("Green Unicorn") is a Python WSGI HTTP server for UNIX. It
78 uses the pre-fork worker model, ported from Ruby's Unicorn project. It
79 supports WSGI, Django, and Paster applications.
81 %description -n python3-%{module} -l pl.UTF-8
82 Gunicorn ("Green Unicorn" - zielony jednorożec) to pythonowy serwer
83 HTTP WSGI dla systemów uniksowych. Wykorzystuje model pre-fork,
84 przeniesiony z projektu Unicorn napisanego w języku Ruby. Obsługuje
85 aplikacje WSGI, Django i Paster.
88 %setup -q -n %{module}-%{version}
91 %{__sed} -i -e 's/==/>=/; s/,<4\.4//' requirements_test.txt
94 export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTEST_PLUGINS="pytest_cov.plugin"
97 %py_build %{?with_tests:test}
101 %py3_build %{?with_tests:test}
105 rm -rf $RPM_BUILD_ROOT
110 # rename executables in %{_bindir} so they don't collide
111 for executable in gunicorn gunicorn_paster; do
112 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{,python3-}$executable
121 rm -rf $RPM_BUILD_ROOT
125 %defattr(644,root,root,755)
126 %doc LICENSE NOTICE README.rst THANKS
127 %attr(755,root,root) %{_bindir}/gunicorn
128 %attr(755,root,root) %{_bindir}/gunicorn_paster
129 %{py_sitescriptdir}/gunicorn
130 %{py_sitescriptdir}/gunicorn-%{version}-py*.egg-info
134 %files -n python3-%{module}
135 %defattr(644,root,root,755)
136 %doc LICENSE NOTICE README.rst THANKS
137 %attr(755,root,root) %{_bindir}/python3-gunicorn
138 %attr(755,root,root) %{_bindir}/python3-gunicorn_paster
139 %{py3_sitescriptdir}/gunicorn
140 %{py3_sitescriptdir}/gunicorn-%{version}-py*.egg-info