]> git.pld-linux.org Git - packages/python-locust.git/blob - python-locust.spec
- drop python3-distribute deps
[packages/python-locust.git] / python-locust.spec
1 # Conditional build:
2 %bcond_with     doc             # don't build doc
3 %bcond_with     tests   # do not perform "make test"
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_with     python3 # CPython 3.x module  (no python3-gevent)
6
7 %define         module  locust
8 Summary:        Easy-to-use, distributed, user load www servers testing tool
9 Summary(pl.UTF-8):      Łatwe do użycia, rozproszone narzędzie do testowania obciążeniem serwerów www
10 Name:           python-%{module}
11 Version:        0.8
12 Release:        2
13 License:        MIT
14 Group:          Libraries/Python
15 Source0:        https://github.com/locustio/locust/archive/v%{version}.tar.gz
16 # Source0-md5:  7b821f11ebdd0e1bf70396d4571e887b
17 Patch0:         loose-ver.patch
18 URL:            http://locust.io/
19 BuildRequires:  rpm-pythonprov
20 # if py_postclean is used
21 BuildRequires:  rpmbuild(macros) >= 1.710
22 # when using /usr/bin/env or other in-place substitutions
23 #BuildRequires: sed >= 4.0
24 %if %{with python2}
25 BuildRequires:  python-distribute
26 BuildRequires:  python-gevent >= 1.0.1
27 BuildRequires:  python-msgpack
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3-gevent >= 1.0.1
31 BuildRequires:  python3-modules
32 BuildRequires:  python3-msgpack
33 %endif
34 # Below Rs only work for main package (python2)
35 #Requires:              python-libs
36 Requires:       python-modules
37 BuildArch:      noarch
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %description
41 Allows to define user behaviour with Python code, and swarm your
42 system with millions of simultaneous users.
43
44 %description -l pl.UTF-8
45 Pozwala na zdefiniowanie zachowań użytkowników w Pythonie i testować
46 wydajnościowo serwer www milionami równoczesnych użytkowników.
47
48 %package -n python3-%{module}
49 Summary:        Easy-to-use, distributed, user load www servers testing tool
50 Summary(pl.UTF-8):      Łatwe do użycia, rozproszone narzędzie do testowania obciążeniem serwerów www
51 Group:          Libraries/Python
52 Requires:       python3-modules
53
54 %description -n python3-%{module}
55 Allows to define user behaviour with Python code, and swarm your
56 system with millions of simultaneous users.
57
58 %description -n python3-%{module} -l pl.UTF-8
59 Pozwala na zdefiniowanie zachowań użytkowników w Pythonie i testować
60 wydajnościowo serwer www milionami równoczesnych użytkowników.
61
62 %package apidocs
63 Summary:        %{module} API documentation
64 Summary(pl.UTF-8):      Dokumentacja API %{module}
65 Group:          Documentation
66
67 %description apidocs
68 API documentation for %{module}.
69
70 %description apidocs -l pl.UTF-8
71 Dokumentacja API %{module}.
72
73 %prep
74 %setup -q -n %{module}-%{version}
75 %patch0 -p1
76
77 %build
78 %if %{with python2}
79 ## %py_build %{?with_tests:test}
80 %py_build %{?with_tests:test}
81 %endif
82
83 %if %{with python3}
84 %py3_build %{?with_tests:test}
85 %endif
86
87 %if %{with doc}
88 cd docs
89 %{__make} -j1 html
90 rm -rf _build/html/_sources
91 %endif
92
93 %install
94 rm -rf $RPM_BUILD_ROOT
95
96 %if %{with python2}
97 #       build --build-base build-2 \
98 %py_install
99
100 %py_postclean
101 %endif
102
103 %if %{with python3}
104 %py3_install
105 %endif
106
107 # in case there are examples provided
108 %if %{with python2}
109 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
110 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
111 %endif
112 %if %{with python3}
113 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
114 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
115 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
116         | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
117 %endif
118
119 %clean
120 rm -rf $RPM_BUILD_ROOT
121
122 %if %{with python2}
123 %files
124 %defattr(644,root,root,755)
125 %attr(755,root,root) %{_bindir}/locust
126 %doc README
127 %dir %{py_sitescriptdir}/%{module}
128 %{py_sitescriptdir}/%{module}/*.py[co]
129 %dir %{py_sitescriptdir}/%{module}/rpc
130 %{py_sitescriptdir}/%{module}/rpc/*.py[co]
131 %{py_sitescriptdir}/%{module}/static
132 %{py_sitescriptdir}/%{module}/templates
133 %dir %{py_sitescriptdir}/%{module}/test
134 %{py_sitescriptdir}/%{module}/test/*.py[co]
135 %if "%{py_ver}" > "2.4"
136 %{py_sitescriptdir}/locustio-%{version}-py*.egg-info
137 %endif
138 %{_examplesdir}/%{name}-%{version}
139 %endif
140
141 %if %{with python3}
142 %files -n python3-%{module}
143 %defattr(644,root,root,755)
144 %doc README
145 %{py3_sitescriptdir}/%{module}
146 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
147 %{_examplesdir}/python3-%{module}-%{version}
148 %endif
149
150 %if %{with doc}
151 %files apidocs
152 %defattr(644,root,root,755)
153 %doc docs/_build/html/*
154 %endif
This page took 0.079876 seconds and 3 git commands to generate.