3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without tests # unit tests
7 %define module gunicorn
8 Summary: Python WSGI application server
9 Summary(pl.UTF-8): Pythonowy serwer aplikacji WSGI
10 Name: python-%{module}
15 #Source0Download: https://pypi.python.org/simple/gunicorn
16 Source0: https://files.pythonhosted.org/packages/source/g/gunicorn/%{module}-%{version}.tar.gz
17 # Source0-md5: 1a0eef597a5bd55f24086b2597111c94
18 # distro-specific, not upstreamable
19 Patch100: %{name}-dev-log.patch
20 URL: http://gunicorn.org/
22 BuildRequires: python-devel >= 1:2.6
23 BuildRequires: python-setuptools
25 BuildRequires: python-mock
26 BuildRequires: python-pytest >= 3.0.5
27 BuildRequires: python-pytest-cov >= 2.4.0
28 %if "%{py_ver}" < "2.7"
29 BuildRequires: python-unittest2
34 BuildRequires: python3-devel >= 1:3.2
35 BuildRequires: python3-setuptools
37 BuildRequires: python3-pytest >= 3.0.5
38 BuildRequires: python3-pytest-cov >= 2.4.0
39 %if "%{py3_ver}" < "3.3"
40 BuildRequires: python-mock
44 BuildRequires: rpm-pythonprov
45 BuildRequires: rpmbuild(macros) >= 1.714
46 BuildRequires: sed >= 4.0
48 BuildRequires: sphinx-pdg
49 BuildRequires: python3-sphinx_rtd_theme
51 Requires: python-setuptools
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 Gunicorn ("Green Unicorn") is a Python WSGI HTTP server for UNIX. It
57 uses the pre-fork worker model, ported from Ruby's Unicorn project. It
58 supports WSGI, Django, and Paster applications.
60 %description -l pl.UTF-8
61 Gunicorn ("Green Unicorn" - zielony jednorożec) to pythonowy serwer
62 HTTP WSGI dla systemów uniksowych. Wykorzystuje model pre-fork,
63 przeniesiony z projektu Unicorn napisanego w języku Ruby. Obsługuje
64 aplikacje WSGI, Django i Paster.
66 %package -n python3-%{module}
67 Summary: Python WSGI application server
68 Summary(pl.UTF-8): Pythonowy serwer aplikacji WSGI
69 Group: Libraries/Python
70 Requires: python3-setuptools
72 %description -n python3-%{module}
73 Gunicorn ("Green Unicorn") is a Python WSGI HTTP server for UNIX. It
74 uses the pre-fork worker model, ported from Ruby's Unicorn project. It
75 supports WSGI, Django, and Paster applications.
77 %description -n python3-%{module} -l pl.UTF-8
78 Gunicorn ("Green Unicorn" - zielony jednorożec) to pythonowy serwer
79 HTTP WSGI dla systemów uniksowych. Wykorzystuje model pre-fork,
80 przeniesiony z projektu Unicorn napisanego w języku Ruby. Obsługuje
81 aplikacje WSGI, Django i Paster.
84 %setup -q -n %{module}-%{version}
87 %{__sed} -i -e 's/==/>=/' requirements_test.txt
91 %py_build %{?with_tests:test}
95 %py3_build %{?with_tests:test}
99 rm -rf $RPM_BUILD_ROOT
104 # rename executables in %{_bindir} so they don't collide
105 for executable in gunicorn gunicorn_paster; do
106 %{__mv} $RPM_BUILD_ROOT%{_bindir}/{,python3-}$executable
115 rm -rf $RPM_BUILD_ROOT
119 %defattr(644,root,root,755)
120 %doc LICENSE NOTICE README.rst THANKS
121 %attr(755,root,root) %{_bindir}/gunicorn
122 %attr(755,root,root) %{_bindir}/gunicorn_paster
123 %{py_sitescriptdir}/gunicorn
124 %{py_sitescriptdir}/gunicorn-%{version}-py*.egg-info
128 %files -n python3-%{module}
129 %defattr(644,root,root,755)
130 %doc LICENSE NOTICE README.rst THANKS
131 %attr(755,root,root) %{_bindir}/python3-gunicorn
132 %attr(755,root,root) %{_bindir}/python3-gunicorn_paster
133 %{py3_sitescriptdir}/gunicorn
134 %{py3_sitescriptdir}/gunicorn-%{version}-py*.egg-info