]>
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} |
872f837a JB |
11 | Version: 19.7.0 |
12 | Release: 1 | |
d556a27f ER |
13 | License: MIT |
14 | Group: Daemons | |
872f837a JB |
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 | |
d556a27f ER |
18 | # distro-specific, not upstreamable |
19 | Patch100: %{name}-dev-log.patch | |
872f837a | 20 | URL: http://gunicorn.org/ |
d556a27f | 21 | %if %{with python2} |
872f837a | 22 | BuildRequires: python-devel >= 1:2.6 |
d556a27f | 23 | BuildRequires: python-setuptools |
872f837a JB |
24 | %if %{with tests} |
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 | |
30 | %endif | |
31 | %endif | |
d556a27f ER |
32 | %endif |
33 | %if %{with python3} | |
872f837a | 34 | BuildRequires: python3-devel >= 1:3.2 |
d556a27f | 35 | BuildRequires: python3-setuptools |
872f837a JB |
36 | %if %{with tests} |
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 | |
41 | %endif | |
42 | %endif | |
d556a27f | 43 | %endif |
872f837a JB |
44 | BuildRequires: rpm-pythonprov |
45 | BuildRequires: rpmbuild(macros) >= 1.714 | |
46 | BuildRequires: sed >= 4.0 | |
47 | %if %{with doc} | |
48 | BuildRequires: sphinx-pdg | |
49 | BuildRequires: python3-sphinx_rtd_theme | |
50 | %endif | |
51 | Requires: python-setuptools | |
d556a27f ER |
52 | BuildArch: noarch |
53 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
54 | ||
55 | %description | |
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. | |
59 | ||
872f837a JB |
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. | |
65 | ||
d556a27f ER |
66 | %package -n python3-%{module} |
67 | Summary: Python WSGI application server | |
872f837a | 68 | Summary(pl.UTF-8): Pythonowy serwer aplikacji WSGI |
d556a27f ER |
69 | Group: Libraries/Python |
70 | Requires: python3-setuptools | |
71 | ||
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. | |
76 | ||
872f837a JB |
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. | |
82 | ||
d556a27f | 83 | %prep |
872f837a | 84 | %setup -q -n %{module}-%{version} |
d556a27f | 85 | %patch100 -p1 |
d556a27f | 86 | |
872f837a | 87 | %{__sed} -i -e 's/==/>=/' requirements_test.txt |
d556a27f ER |
88 | |
89 | %build | |
90 | %if %{with python2} | |
872f837a | 91 | %py_build %{?with_tests:test} |
d556a27f ER |
92 | %endif |
93 | ||
94 | %if %{with python3} | |
872f837a | 95 | %py3_build %{?with_tests:test} |
d556a27f ER |
96 | %endif |
97 | ||
98 | %install | |
99 | rm -rf $RPM_BUILD_ROOT | |
872f837a | 100 | |
d556a27f | 101 | %if %{with python3} |
862d8f84 | 102 | %py3_install |
d556a27f ER |
103 | |
104 | # rename executables in %{_bindir} so they don't collide | |
872f837a JB |
105 | for executable in gunicorn gunicorn_paster; do |
106 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/{,python3-}$executable | |
d556a27f | 107 | done |
d556a27f ER |
108 | %endif |
109 | ||
110 | %if %{with python2} | |
862d8f84 | 111 | %py_install |
d556a27f ER |
112 | %endif |
113 | ||
114 | %clean | |
115 | rm -rf $RPM_BUILD_ROOT | |
116 | ||
117 | %if %{with python2} | |
118 | %files | |
119 | %defattr(644,root,root,755) | |
872f837a JB |
120 | %doc LICENSE NOTICE README.rst THANKS |
121 | %attr(755,root,root) %{_bindir}/gunicorn | |
122 | %attr(755,root,root) %{_bindir}/gunicorn_paster | |
d556a27f | 123 | %{py_sitescriptdir}/gunicorn |
504b28ff | 124 | %{py_sitescriptdir}/gunicorn-%{version}-py*.egg-info |
d556a27f ER |
125 | %endif |
126 | ||
127 | %if %{with python3} | |
128 | %files -n python3-%{module} | |
129 | %defattr(644,root,root,755) | |
872f837a JB |
130 | %doc LICENSE NOTICE README.rst THANKS |
131 | %attr(755,root,root) %{_bindir}/python3-gunicorn | |
132 | %attr(755,root,root) %{_bindir}/python3-gunicorn_paster | |
d556a27f ER |
133 | %{py3_sitescriptdir}/gunicorn |
134 | %{py3_sitescriptdir}/gunicorn-%{version}-py*.egg-info | |
135 | %endif |