]> git.pld-linux.org Git - SPECS.git/blob - python-gunicorn.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / python-gunicorn.spec
1 # NOTE: for versions >= 20 (for python 3.5+) see python3-gunicorn.spec
2 #
3 # Conditional build:
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
7
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
13 Version:        19.10.0
14 Release:        1
15 License:        MIT
16 Group:          Daemons
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/
23 %if %{with python2}
24 BuildRequires:  python-devel >= 1:2.6
25 BuildRequires:  python-setuptools
26 %if %{with tests}
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
33 %endif
34 %endif
35 %endif
36 %if %{with python3}
37 BuildRequires:  python3-devel >= 1:3.2
38 BuildRequires:  python3-setuptools
39 %if %{with tests}
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
45 %endif
46 %endif
47 %endif
48 BuildRequires:  rpm-pythonprov
49 BuildRequires:  rpmbuild(macros) >= 1.714
50 BuildRequires:  sed >= 4.0
51 %if %{with doc}
52 BuildRequires:  sphinx-pdg
53 BuildRequires:  python3-sphinx_rtd_theme
54 %endif
55 Requires:       python-setuptools
56 BuildArch:      noarch
57 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58
59 %description
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.
63
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.
69
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
75
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.
80
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.
86
87 %prep
88 %setup -q -n %{module}-%{version}
89 %patch100 -p1
90
91 %{__sed} -i -e 's/==/>=/; s/,<4\.4//' requirements_test.txt
92
93 %build
94 export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTEST_PLUGINS="pytest_cov.plugin"
95
96 %if %{with python2}
97 %py_build %{?with_tests:test}
98 %endif
99
100 %if %{with python3}
101 %py3_build %{?with_tests:test}
102 %endif
103
104 %install
105 rm -rf $RPM_BUILD_ROOT
106
107 %if %{with python3}
108 %py3_install
109
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
113 done
114 %endif
115
116 %if %{with python2}
117 %py_install
118 %endif
119
120 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %if %{with python2}
124 %files
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
131 %endif
132
133 %if %{with python3}
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
141 %endif
This page took 0.673754 seconds and 3 git commands to generate.