python-avocado.spec 12.3 KB
Newer Older
1
%global srcname avocado
2 3 4

# Conditional for release vs. snapshot builds. Set to 1 for release build.
%if ! 0%{?rel_build:1}
5
    %global rel_build 1
6 7 8 9
%endif

# Settings used for build from snapshots.
%if 0%{?rel_build}
10
    %global gittar		%{srcname}-%{version}.tar.gz
11
%else
12
    %if ! 0%{?commit:1}
C
Cleber Rosa 已提交
13
        %global commit		72f8069f1ae3def8d2eca47cba554660411ab045
14 15 16 17
    %endif
    %if ! 0%{?commit_date:1}
        %global commit_date	20170518
    %endif
A
Amador Pahim 已提交
18
    %global shortcommit	%(c=%{commit};echo ${c:0:8})
19 20
    %global gitrel		.%{commit_date}git%{shortcommit}
    %global gittar		%{srcname}-%{shortcommit}.tar.gz
21 22
%endif

23 24 25
# Selftests are provided but may need to be skipped because many of
# the functional tests are time and resource sensitive and can
# cause race conditions and random build failures. They are
26 27 28
# enabled by default.
%global with_tests 1

29
Summary: Framework with tools and libraries for Automated Testing
30
Name: python-%{srcname}
C
Cleber Rosa 已提交
31
Version: 53.0
32
Release: 1%{?gitrel}%{?dist}
33 34
License: GPLv2
Group: Development/Tools
35
URL: http://avocado-framework.github.io/
36 37 38 39 40
%if 0%{?rel_build}
Source0: https://github.com/avocado-framework/%{srcname}/archive/%{version}.tar.gz#/%{gittar}
%else
Source0: https://github.com/avocado-framework/%{srcname}/archive/%{commit}.tar.gz#/%{gittar}
%endif
41
BuildArch: noarch
42 43 44 45 46 47 48 49 50
BuildRequires: fabric
BuildRequires: procps-ng
BuildRequires: pystache
BuildRequires: python-docutils
BuildRequires: python-flexmock
BuildRequires: python-lxml
BuildRequires: python-mock
BuildRequires: python-psutil
BuildRequires: python-requests
51
BuildRequires: python-resultsdb_api
52 53 54 55 56
BuildRequires: python-setuptools
BuildRequires: python-sphinx
BuildRequires: python-stevedore
BuildRequires: python2-devel
BuildRequires: yum
57
BuildRequires: python-aexpect
58 59 60 61

%if %{with_tests}
BuildRequires: libvirt-python
BuildRequires: perl-Test-Harness
62 63 64 65 66
%if 0%{?rhel}
BuildRequires: python-yaml
%else
BuildRequires: python2-yaml
%endif
67 68
%endif

69 70 71 72 73 74 75 76
Requires: gdb
Requires: gdb-gdbserver
Requires: procps-ng
Requires: pyliblzma
Requires: python
Requires: python-requests
Requires: python-setuptools
Requires: python-stevedore
77

78 79 80 81 82 83 84 85 86
# For compatibility reasons, let's mark this package as one that
# provides the same functionality as the old package name and also
# one that obsoletes the old package name, so that the new name is
# favored.  These could (and should) be removed in the future.
# These changes are backed by the following guidelines:
# https://fedoraproject.org/wiki/Upgrade_paths_%E2%80%94_renaming_or_splitting_packages
Obsoletes: %{srcname} < 47.0-1
Provides: %{srcname} = %{version}-%{release}

87 88 89 90 91 92 93 94 95
# For some strange reason, fabric on Fedora 24 does not require the
# python-crypto package, but the fabric code always imports it.  Newer
# fabric versions, such from Fedora 25 do conditional imports (try:
# from Crypto import Random; except: Random = None) and thus do not
# need this requirement.
%if 0%{?fedora} == 24
BuildRequires: python-crypto
%endif

96 97 98 99 100 101 102
%if 0%{?fedora} >= 25
BuildRequires: kmod
%endif
%if 0%{?rhel} >= 7
BuildRequires: kmod
%endif

103
%description
104 105
Avocado is a set of tools and libraries (what people call
these days a framework) to perform automated testing.
106 107

%prep
108 109 110
%if 0%{?rel_build}
%setup -q -n %{srcname}-%{version}
%else
111
%setup -q -n %{srcname}-%{commit}
112
%endif
113 114 115 116
# package plugins-runner-vm requires libvirt-python, but the RPM
# version of libvirt-python does not publish the egg info and this
# causes that dep to be attempted to be installed by pip
sed -e "s/'libvirt-python'//" -i optional_plugins/runner_vm/setup.py
117 118 119

%build
%{__python} setup.py build
120
pushd optional_plugins/html
121
%{__python} setup.py build
122 123
popd
pushd optional_plugins/runner_remote
124
%{__python} setup.py build
125 126
popd
pushd optional_plugins/runner_vm
127
%{__python} setup.py build
128 129
popd
pushd optional_plugins/runner_docker
130
%{__python} setup.py build
131
popd
132 133 134
pushd optional_plugins/resultsdb
%{__python} setup.py build
popd
135 136 137
pushd optional_plugins/varianter_yaml_to_mux
%{__python} setup.py build
popd
138 139 140
pushd optional_plugins/loader_yaml
%{__python} setup.py build
popd
141
%{__make} man
142 143 144

%install
%{__python} setup.py install --root %{buildroot} --skip-build
145
pushd optional_plugins/html
146
%{__python} setup.py install --root %{buildroot} --skip-build
147 148
popd
pushd optional_plugins/runner_remote
149
%{__python} setup.py install --root %{buildroot} --skip-build
150 151
popd
pushd optional_plugins/runner_vm
152
%{__python} setup.py install --root %{buildroot} --skip-build
153 154
popd
pushd optional_plugins/runner_docker
155
%{__python} setup.py install --root %{buildroot} --skip-build
156
popd
157 158 159
pushd optional_plugins/resultsdb
%{__python} setup.py install --root %{buildroot} --skip-build
popd
160 161 162
pushd optional_plugins/varianter_yaml_to_mux
%{__python} setup.py install --root %{buildroot} --skip-build
popd
163 164 165
pushd optional_plugins/loader_yaml
%{__python} setup.py install --root %{buildroot} --skip-build
popd
C
Cleber Rosa 已提交
166 167
%{__mkdir} -p %{buildroot}%{_mandir}/man1
%{__install} -m 0644 man/avocado.1 %{buildroot}%{_mandir}/man1/avocado.1
168
%{__install} -m 0644 man/avocado-rest-client.1 %{buildroot}%{_mandir}/man1/avocado-rest-client.1
169
%{__install} -d -m 0755 %{buildroot}%{_sharedstatedir}/avocado/data
170

171
%check
172
%if %{with_tests}
173
%{__python} setup.py develop --user
174
pushd optional_plugins/html
175
%{__python} setup.py develop --user
176 177
popd
pushd optional_plugins/runner_remote
178
%{__python} setup.py develop --user
179 180
popd
pushd optional_plugins/runner_vm
181
%{__python} setup.py develop --user
182 183
popd
pushd optional_plugins/runner_docker
184
%{__python} setup.py develop --user
185
popd
186 187 188
pushd optional_plugins/resultsdb
%{__python} setup.py develop --user
popd
189 190 191
pushd optional_plugins/varianter_yaml_to_mux
%{__python} setup.py develop --user
popd
192 193 194
pushd optional_plugins/loader_yaml
%{__python} setup.py develop --user
popd
195 196 197 198
# Package build environments have the least amount of resources
# we have observed so far.  Let's avoid tests that require too
# much resources or are time sensitive
AVOCADO_CHECK_LEVEL=0 selftests/run
199
%endif
200

201 202 203
%files
%defattr(-,root,root,-)
%doc README.rst LICENSE
204 205 206 207 208
%dir %{_sysconfdir}/avocado
%dir %{_sysconfdir}/avocado/conf.d
%dir %{_sysconfdir}/avocado/sysinfo
%dir %{_sysconfdir}/avocado/scripts/job/pre.d
%dir %{_sysconfdir}/avocado/scripts/job/post.d
209
%dir %{_sharedstatedir}/avocado
210 211 212 213 214 215 216 217
%config(noreplace)%{_sysconfdir}/avocado/avocado.conf
%config(noreplace)%{_sysconfdir}/avocado/conf.d/README
%config(noreplace)%{_sysconfdir}/avocado/conf.d/gdb.conf
%config(noreplace)%{_sysconfdir}/avocado/sysinfo/commands
%config(noreplace)%{_sysconfdir}/avocado/sysinfo/files
%config(noreplace)%{_sysconfdir}/avocado/sysinfo/profilers
%config(noreplace)%{_sysconfdir}/avocado/scripts/job/pre.d/README
%config(noreplace)%{_sysconfdir}/avocado/scripts/job/post.d/README
218
%{python_sitelib}/avocado*
219
%{_bindir}/avocado
220
%{_bindir}/avocado-rest-client
C
Cleber Rosa 已提交
221
%{_mandir}/man1/avocado.1.gz
222
%{_mandir}/man1/avocado-rest-client.1.gz
223 224
%{_docdir}/avocado/avocado.rst
%{_docdir}/avocado/avocado-rest-client.rst
225 226 227 228
%exclude %{python_sitelib}/avocado_result_html*
%exclude %{python_sitelib}/avocado_runner_remote*
%exclude %{python_sitelib}/avocado_runner_vm*
%exclude %{python_sitelib}/avocado_runner_docker*
229
%exclude %{python_sitelib}/avocado_resultsdb*
230
%exclude %{python_sitelib}/avocado_varianter_yaml_to_mux*
231 232 233 234
%exclude %{python_sitelib}/avocado_framework_plugin_result_html*
%exclude %{python_sitelib}/avocado_framework_plugin_runner_remote*
%exclude %{python_sitelib}/avocado_framework_plugin_runner_vm*
%exclude %{python_sitelib}/avocado_framework_plugin_runner_docker*
235
%exclude %{python_sitelib}/avocado_framework_plugin_resultsdb*
236
%exclude %{python_sitelib}/avocado_framework_plugin_varianter_yaml_to_mux*
237
%exclude %{python_sitelib}/avocado_framework_plugin_loader_yaml*
238 239 240 241 242
%{_libexecdir}/avocado/avocado-bash-utils
%{_libexecdir}/avocado/avocado_debug
%{_libexecdir}/avocado/avocado_error
%{_libexecdir}/avocado/avocado_info
%{_libexecdir}/avocado/avocado_warn
243

244 245
%package plugins-output-html
Summary: Avocado HTML report plugin
246 247 248
Requires: %{name} == %{version}, pystache
Obsoletes: %{srcname}-plugins-output-html < 47.0-1
Provides: %{srcname}-plugins-output-html = %{version}-%{release}
249 250 251 252 253 254 255

%description plugins-output-html
Adds to avocado the ability to generate an HTML report at every job results
directory. It also gives the user the ability to write a report on an
arbitrary filesystem location.

%files plugins-output-html
256
%{python_sitelib}/avocado_result_html*
257
%{python_sitelib}/avocado_framework_plugin_result_html*
258

259 260
%package plugins-runner-remote
Summary: Avocado Runner for Remote Execution
261 262
Requires: %{name} == %{version}
Requires: fabric
263 264 265 266
%if 0%{?fedora} == 24
Requires: python-crypto
BuildRequires: python-crypto
%endif
267 268
Obsoletes: %{srcname}-plugins-runner-remote < 47.0-1
Provides: %{srcname}-plugins-runner-remote = %{version}-%{release}
269 270 271 272 273 274

%description plugins-runner-remote
Allows Avocado to run jobs on a remote machine, by means of an SSH
connection.  Avocado must be previously installed on the remote machine.

%files plugins-runner-remote
275
%{python_sitelib}/avocado_runner_remote*
276
%{python_sitelib}/avocado_framework_plugin_runner_remote*
277 278 279

%package plugins-runner-vm
Summary: Avocado Runner for libvirt VM Execution
280 281
Requires: %{name} == %{version}
Requires: %{name}-plugins-runner-remote == %{version}
282
Requires: libvirt-python
283 284
Obsoletes: %{srcname}-plugins-runner-vm < 47.0-1
Provides: %{srcname}-plugins-runner-vm = %{version}-%{release}
285 286 287 288 289 290 291

%description plugins-runner-vm
Allows Avocado to run jobs on a libvirt based VM, by means of
interaction with a libvirt daemon and an SSH connection to the VM
itself.  Avocado must be previously installed on the VM.

%files plugins-runner-vm
292
%{python_sitelib}/avocado_runner_vm*
293
%{python_sitelib}/avocado_framework_plugin_runner_vm*
294 295 296

%package plugins-runner-docker
Summary: Avocado Runner for Execution on Docker Containers
297 298
Requires: %{name} == %{version}
Requires: %{name}-plugins-runner-remote == %{version}
299
Requires: python-aexpect
300 301
Obsoletes: %{srcname}-plugins-runner-docker < 47.0-1
Provides: %{srcname}-plugins-runner-docker = %{version}-%{release}
302 303 304 305 306 307 308

%description plugins-runner-docker
Allows Avocado to run jobs on a Docker container by interacting with a
Docker daemon and attaching to the container itself.  Avocado must
be previously installed on the container.

%files plugins-runner-docker
C
Cleber Rosa 已提交
309
%{python_sitelib}/avocado_runner_docker*
310
%{python_sitelib}/avocado_framework_plugin_runner_docker*
311

312 313 314 315 316 317 318 319 320 321 322 323 324
%package plugins-resultsdb
Summary: Avocado plugin to propagate job results to ResultsDB
Requires: %{name} == %{version}
Requires: python-resultsdb_api

%description plugins-resultsdb
Allows Avocado to send job results directly to a ResultsDB
server.

%files plugins-resultsdb
%{python_sitelib}/avocado_resultsdb*
%{python_sitelib}/avocado_framework_plugin_resultsdb*

325 326 327
%package plugins-varianter-yaml-to-mux
Summary: Avocado plugin to generate variants out of yaml files
Requires: %{name} == %{version}
328
%if 0%{?rhel}
329
Requires: python-yaml
330 331 332
%else
Requires: python2-yaml
%endif
333 334 335 336 337 338 339 340

%description plugins-varianter-yaml-to-mux
Can be used to produce multiple test variants with test parameters
defined in a yaml file(s).

%files plugins-varianter-yaml-to-mux
%{python_sitelib}/avocado_varianter_yaml_to_mux*
%{python_sitelib}/avocado_framework_plugin_varianter_yaml_to_mux*
341

342 343 344 345 346 347 348 349 350 351 352 353
%package plugins-loader-yaml
Summary: Avocado Plugin that loads tests from YAML files
Requires: %{name}-plugins-varianter-yaml-to-mux == %{version}

%description plugins-loader-yaml
Can be used to produce a test suite from definitions in a YAML file,
similar to the one used in the yaml_to_mux varianter plugin.

%files plugins-loader-yaml
%{python_sitelib}/avocado_loader_yaml*
%{python_sitelib}/avocado_framework_plugin_loader_yaml*

354
%package examples
355
Summary: Avocado Test Framework Example Tests
356
Requires: %{name} == %{version}
357

358 359 360 361
%description examples
The set of example tests present in the upstream tree of the Avocado framework.
Some of them are used as functional tests of the framework, others serve as
examples of how to write tests on your own.
362

363
%files examples
364
%{_datadir}/avocado/tests
365
%{_datadir}/avocado/wrappers
366 367

%changelog
368 369
* Tue Aug 22 2017 Cleber Rosa <cleber@redhat.com> - 53.0-1
- Use variable name for configuration dir
370
- Clean up old changelog entries
371

C
Cleber Rosa 已提交
372 373 374
* Tue Aug 15 2017 Cleber Rosa <cleber@redhat.com> - 53.0-0
- New upstream release

375 376 377
* Mon Aug 14 2017 Cleber Rosa <cleber@redhat.com> - 52.0-2
- Add python[2]-yaml requirements

378 379 380
* Tue Jun 27 2017 Cleber Rosa <cleber@redhat.com> - 52.0-1
- Fix python-aexpect depedency on EL7

C
Cleber Rosa 已提交
381 382
* Mon Jun 26 2017 Cleber Rosa <cleber@redhat.com> - 52.0-0
- New upstream release