]>
Commit | Line | Data |
---|---|---|
d556a27f ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
872f837a | 5 | %bcond_without tests # unit tests |
d556a27f ER |
6 | |
7 | %define module gunicorn | |
8 | Summary: Python WSGI application server | |
872f837a | 9 | Summary(pl.UTF-8): Pythonowy serwer aplikacji WSGI |
d556a27f | 10 | Name: python-%{module} |
789c1f12 JB |
11 | # keep 19.x here for python2 support |
12 | Version: 19.10.0 | |
cd6129a1 | 13 | Release: 1 |
d556a27f ER |
14 | License: MIT |
15 | Group: Daemons | |
872f837a JB |
16 | #Source0Download: https://pypi.python.org/simple/gunicorn |
17 | Source0: https://files.pythonhosted.org/packages/source/g/gunicorn/%{module}-%{version}.tar.gz | |
789c1f12 | 18 | # Source0-md5: dfa07409c60f9dd8501fa0503f0bfbb1 |
d556a27f ER |
19 | # distro-specific, not upstreamable |
20 | Patch100: %{name}-dev-log.patch | |
872f837a | 21 | URL: http://gunicorn.org/ |
d556a27f | 22 | %if %{with python2} |
872f837a | 23 | BuildRequires: python-devel >= 1:2.6 |
d556a27f | 24 | BuildRequires: python-setuptools |
872f837a | 25 | %if %{with tests} |
789c1f12 | 26 | BuildRequires: python-coverage >= 4.0 |
872f837a | 27 | BuildRequires: python-mock |
789c1f12 JB |
28 | BuildRequires: python-pytest >= 3.2.5 |
29 | BuildRequires: python-pytest-cov >= 2.5.1 | |
872f837a JB |
30 | %if "%{py_ver}" < "2.7" |
31 | BuildRequires: python-unittest2 | |
32 | %endif | |
33 | %endif | |
d556a27f ER |
34 | %endif |
35 | %if %{with python3} | |
872f837a | 36 | BuildRequires: python3-devel >= 1:3.2 |
d556a27f | 37 | BuildRequires: python3-setuptools |
872f837a | 38 | %if %{with tests} |
789c1f12 JB |
39 | BuildRequires: python3-coverage >= 4.0 |
40 | BuildRequires: python3-pytest >= 3.2.5 | |
41 | BuildRequires: python3-pytest-cov >= 2.5.1 | |
872f837a | 42 | %if "%{py3_ver}" < "3.3" |
789c1f12 | 43 | BuildRequires: python3-mock |
872f837a JB |
44 | %endif |
45 | %endif | |
d556a27f | 46 | %endif |
872f837a JB |
47 | BuildRequires: rpm-pythonprov |
48 | BuildRequires: rpmbuild(macros) >= 1.714 | |
49 | BuildRequires: sed >= 4.0 | |
50 | %if %{with doc} | |
51 | BuildRequires: sphinx-pdg | |
52 | BuildRequires: python3-sphinx_rtd_theme | |
53 | %endif | |
54 | Requires: python-setuptools | |
d556a27f ER |
55 | BuildArch: noarch |
56 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
57 | ||
58 | %description | |
59 | Gunicorn ("Green Unicorn") is a Python WSGI HTTP server for UNIX. It | |
60 | uses the pre-fork worker model, ported from Ruby's Unicorn project. It | |
61 | supports WSGI, Django, and Paster applications. | |
62 | ||
872f837a JB |
63 | %description -l pl.UTF-8 |
64 | Gunicorn ("Green Unicorn" - zielony jednorożec) to pythonowy serwer | |
65 | HTTP WSGI dla systemów uniksowych. Wykorzystuje model pre-fork, | |
66 | przeniesiony z projektu Unicorn napisanego w języku Ruby. Obsługuje | |
67 | aplikacje WSGI, Django i Paster. | |
68 | ||
d556a27f ER |
69 | %package -n python3-%{module} |
70 | Summary: Python WSGI application server | |
872f837a | 71 | Summary(pl.UTF-8): Pythonowy serwer aplikacji WSGI |
d556a27f ER |
72 | Group: Libraries/Python |
73 | Requires: python3-setuptools | |
74 | ||
75 | %description -n python3-%{module} | |
76 | Gunicorn ("Green Unicorn") is a Python WSGI HTTP server for UNIX. It | |
77 | uses the pre-fork worker model, ported from Ruby's Unicorn project. It | |
78 | supports WSGI, Django, and Paster applications. | |
79 | ||
872f837a JB |
80 | %description -n python3-%{module} -l pl.UTF-8 |
81 | Gunicorn ("Green Unicorn" - zielony jednorożec) to pythonowy serwer | |
82 | HTTP WSGI dla systemów uniksowych. Wykorzystuje model pre-fork, | |
83 | przeniesiony z projektu Unicorn napisanego w języku Ruby. Obsługuje | |
84 | aplikacje WSGI, Django i Paster. | |
85 | ||
d556a27f | 86 | %prep |
872f837a | 87 | %setup -q -n %{module}-%{version} |
d556a27f | 88 | %patch100 -p1 |
d556a27f | 89 | |
789c1f12 | 90 | %{__sed} -i -e 's/==/>=/; s/,<4\.4//' requirements_test.txt |
d556a27f ER |
91 | |
92 | %build | |
789c1f12 JB |
93 | export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTEST_PLUGINS="pytest_cov.plugin" |
94 | ||
d556a27f | 95 | %if %{with python2} |
872f837a | 96 | %py_build %{?with_tests:test} |
d556a27f ER |
97 | %endif |
98 | ||
99 | %if %{with python3} | |
872f837a | 100 | %py3_build %{?with_tests:test} |
d556a27f ER |
101 | %endif |
102 | ||
103 | %install | |
104 | rm -rf $RPM_BUILD_ROOT | |
872f837a | 105 | |
d556a27f | 106 | %if %{with python3} |
862d8f84 | 107 | %py3_install |
d556a27f ER |
108 | |
109 | # rename executables in %{_bindir} so they don't collide | |
872f837a JB |
110 | for executable in gunicorn gunicorn_paster; do |
111 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/{,python3-}$executable | |
d556a27f | 112 | done |
d556a27f ER |
113 | %endif |
114 | ||
115 | %if %{with python2} | |
862d8f84 | 116 | %py_install |
d556a27f ER |
117 | %endif |
118 | ||
119 | %clean | |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | ||
122 | %if %{with python2} | |
123 | %files | |
124 | %defattr(644,root,root,755) | |
872f837a JB |
125 | %doc LICENSE NOTICE README.rst THANKS |
126 | %attr(755,root,root) %{_bindir}/gunicorn | |
127 | %attr(755,root,root) %{_bindir}/gunicorn_paster | |
d556a27f | 128 | %{py_sitescriptdir}/gunicorn |
504b28ff | 129 | %{py_sitescriptdir}/gunicorn-%{version}-py*.egg-info |
d556a27f ER |
130 | %endif |
131 | ||
132 | %if %{with python3} | |
133 | %files -n python3-%{module} | |
134 | %defattr(644,root,root,755) | |
872f837a JB |
135 | %doc LICENSE NOTICE README.rst THANKS |
136 | %attr(755,root,root) %{_bindir}/python3-gunicorn | |
137 | %attr(755,root,root) %{_bindir}/python3-gunicorn_paster | |
d556a27f ER |
138 | %{py3_sitescriptdir}/gunicorn |
139 | %{py3_sitescriptdir}/gunicorn-%{version}-py*.egg-info | |
140 | %endif |