]> git.pld-linux.org Git - packages/python-locust.git/blob - python-locust.spec
b03feb7f4835b6e8c68241e5d382b80daa9af4f7
[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-distribute
31 BuildRequires:  python3-gevent >= 1.0.1
32 BuildRequires:  python3-modules
33 BuildRequires:  python3-msgpack
34 %endif
35 # Below Rs only work for main package (python2)
36 #Requires:              python-libs
37 Requires:       python-modules
38 BuildArch:      noarch
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41 %description
42 Allows to define user behaviour with Python code, and swarm your
43 system with millions of simultaneous users.
44
45 %description -l pl.UTF-8
46 Pozwala na zdefiniowanie zachowań użytkowników w Pythonie i testować
47 wydajnościowo serwer www milionami równoczesnych użytkowników.
48
49 %package -n python3-%{module}
50 Summary:        Easy-to-use, distributed, user load www servers testing tool
51 Summary(pl.UTF-8):      Łatwe do użycia, rozproszone narzędzie do testowania obciążeniem serwerów www
52 Group:          Libraries/Python
53 Requires:       python3-modules
54
55 %description -n python3-%{module}
56 Allows to define user behaviour with Python code, and swarm your
57 system with millions of simultaneous users.
58
59 %description -n python3-%{module} -l pl.UTF-8
60 Pozwala na zdefiniowanie zachowań użytkowników w Pythonie i testować
61 wydajnościowo serwer www milionami równoczesnych użytkowników.
62
63 %package apidocs
64 Summary:        %{module} API documentation
65 Summary(pl.UTF-8):      Dokumentacja API %{module}
66 Group:          Documentation
67
68 %description apidocs
69 API documentation for %{module}.
70
71 %description apidocs -l pl.UTF-8
72 Dokumentacja API %{module}.
73
74 %prep
75 %setup -q -n %{module}-%{version}
76 %patch0 -p1
77
78 %build
79 %if %{with python2}
80 ## %py_build %{?with_tests:test}
81 %py_build %{?with_tests:test}
82 %endif
83
84 %if %{with python3}
85 %py3_build %{?with_tests:test}
86 %endif
87
88 %if %{with doc}
89 cd docs
90 %{__make} -j1 html
91 rm -rf _build/html/_sources
92 %endif
93
94 %install
95 rm -rf $RPM_BUILD_ROOT
96
97 %if %{with python2}
98 #       build --build-base build-2 \
99 %py_install
100
101 %py_postclean
102 %endif
103
104 %if %{with python3}
105 %py3_install
106 %endif
107
108 # in case there are examples provided
109 %if %{with python2}
110 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
111 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
112 %endif
113 %if %{with python3}
114 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
115 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
116 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
117         | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
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 %attr(755,root,root) %{_bindir}/locust
127 %doc README
128 %dir %{py_sitescriptdir}/%{module}
129 %{py_sitescriptdir}/%{module}/*.py[co]
130 %dir %{py_sitescriptdir}/%{module}/rpc
131 %{py_sitescriptdir}/%{module}/rpc/*.py[co]
132 %{py_sitescriptdir}/%{module}/static
133 %{py_sitescriptdir}/%{module}/templates
134 %dir %{py_sitescriptdir}/%{module}/test
135 %{py_sitescriptdir}/%{module}/test/*.py[co]
136 %if "%{py_ver}" > "2.4"
137 %{py_sitescriptdir}/locustio-%{version}-py*.egg-info
138 %endif
139 %{_examplesdir}/%{name}-%{version}
140 %endif
141
142 %if %{with python3}
143 %files -n python3-%{module}
144 %defattr(644,root,root,755)
145 %doc README
146 %{py3_sitescriptdir}/%{module}
147 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
148 %{_examplesdir}/python3-%{module}-%{version}
149 %endif
150
151 %if %{with doc}
152 %files apidocs
153 %defattr(644,root,root,755)
154 %doc docs/_build/html/*
155 %endif
This page took 0.278307 seconds and 2 git commands to generate.