]>
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 | |
5 | ||
6 | %define module gunicorn | |
7 | Summary: Python WSGI application server | |
8 | Name: python-%{module} | |
1998dbc3 | 9 | Version: 19.3.0 |
92ef5e9d | 10 | Release: 2 |
d556a27f ER |
11 | License: MIT |
12 | Group: Daemons | |
13 | URL: http://gunicorn.org/ | |
1998dbc3 MK |
14 | Source0: https://pypi.python.org/packages/source/g/%{module}/%{module}-%{version}.tar.gz |
15 | # Source0-md5: faa3e80661efd67e5e06bba32699af20 | |
d556a27f ER |
16 | # distro-specific, not upstreamable |
17 | Patch100: %{name}-dev-log.patch | |
18 | Requires: python-setuptools | |
19 | %if %{with python2} | |
20 | BuildRequires: python-devel | |
21 | BuildRequires: python-setuptools | |
22 | %endif | |
23 | %if %{with python3} | |
24 | BuildRequires: python3-devel | |
25 | BuildRequires: python3-setuptools | |
26 | %endif | |
27 | BuildArch: noarch | |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
30 | %description | |
31 | Gunicorn ("Green Unicorn") is a Python WSGI HTTP server for UNIX. It | |
32 | uses the pre-fork worker model, ported from Ruby's Unicorn project. It | |
33 | supports WSGI, Django, and Paster applications. | |
34 | ||
35 | %package -n python3-%{module} | |
36 | Summary: Python WSGI application server | |
37 | Group: Libraries/Python | |
38 | Requires: python3-setuptools | |
39 | ||
40 | %description -n python3-%{module} | |
41 | Gunicorn ("Green Unicorn") is a Python WSGI HTTP server for UNIX. It | |
42 | uses the pre-fork worker model, ported from Ruby's Unicorn project. It | |
43 | supports WSGI, Django, and Paster applications. | |
44 | ||
45 | %prep | |
46 | %setup -qc | |
47 | mv %{module}-%{version} py2 | |
48 | cd py2 | |
49 | %patch100 -p1 | |
50 | cd - | |
51 | ||
52 | %if %{with python3} | |
53 | cp -a py2 py3 | |
54 | %endif | |
55 | ||
56 | %build | |
57 | %if %{with python2} | |
58 | cd py2 | |
59 | %{__python} setup.py build | |
60 | cd - | |
61 | %endif | |
62 | ||
63 | %if %{with python3} | |
64 | cd py3 | |
65 | %{__python3} setup.py build | |
66 | %endif | |
67 | ||
68 | %if %{with tests} | |
69 | cd py2 | |
70 | %{__python} setup.py test | |
71 | cd - | |
72 | ||
73 | %if %{with python3} | |
74 | cd py3 | |
75 | %{__python3} setup.py test | |
76 | %endif | |
77 | %endif | |
78 | ||
79 | %install | |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | %if %{with python3} | |
82 | cd py3 | |
83 | %{__python3} setup.py install \ | |
84 | --skip-build \ | |
85 | --optimize=2 \ | |
86 | --root=$RPM_BUILD_ROOT | |
87 | ||
88 | # rename executables in %{_bindir} so they don't collide | |
89 | for executable in %{module} %{module}_django %{module}_paster; do | |
90 | mv $RPM_BUILD_ROOT%{_bindir}/{,python3-}$executable | |
91 | done | |
92 | cd - | |
93 | %endif | |
94 | ||
95 | %if %{with python2} | |
96 | cd py2 | |
97 | %{__python} setup.py install \ | |
98 | --skip-build \ | |
99 | --optimize=2 \ | |
100 | --root=$RPM_BUILD_ROOT | |
101 | %endif | |
102 | ||
103 | %clean | |
104 | rm -rf $RPM_BUILD_ROOT | |
105 | ||
106 | %if %{with python2} | |
107 | %files | |
108 | %defattr(644,root,root,755) | |
109 | %doc py2/{LICENSE,NOTICE,README.rst,THANKS} | |
110 | %attr(755,root,root) %{_bindir}/%{module} | |
111 | %attr(755,root,root) %{_bindir}/%{module}_django | |
112 | %attr(755,root,root) %{_bindir}/%{module}_paster | |
113 | %{py_sitescriptdir}/gunicorn | |
504b28ff | 114 | %{py_sitescriptdir}/gunicorn-%{version}-py*.egg-info |
d556a27f ER |
115 | %endif |
116 | ||
117 | %if %{with python3} | |
118 | %files -n python3-%{module} | |
119 | %defattr(644,root,root,755) | |
120 | %doc py3/{LICENSE,NOTICE,README.rst,THANKS} | |
121 | %attr(755,root,root) %{_bindir}/python3-%{module} | |
122 | %attr(755,root,root) %{_bindir}/python3-%{module}_django | |
123 | %attr(755,root,root) %{_bindir}/python3-%{module}_paster | |
124 | %{py3_sitescriptdir}/gunicorn | |
125 | %{py3_sitescriptdir}/gunicorn-%{version}-py*.egg-info | |
126 | %endif |