Spec file cleanup following package review.

Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
This commit is contained in:
Merlin Mathesius 2021-03-18 16:51:26 -05:00
commit eef3dc2740

View file

@ -1,6 +1,3 @@
%global srcname avocado
%global pkgname avocado
# Conditional for release vs. snapshot builds. Set to 1 for release build.
%if ! 0%{?rel_build:1}
%global rel_build 1
@ -9,7 +6,7 @@
# Settings used for build from snapshots.
%if 0%{?rel_build}
%global gitref %{version}
%global gittar %{srcname}-%{version}.tar.gz
%global gittar avocado-%{version}.tar.gz
%else
%if ! 0%{?commit:1}
%global commit e97540793998c4f24a16000465dd7fdd213bf2b9
@ -20,7 +17,7 @@
%global shortcommit %(c=%{commit};echo ${c:0:9})
%global gitrel .%{commit_date}git%{shortcommit}
%global gitref %{commit}
%global gittar %{srcname}-%{shortcommit}.tar.gz
%global gittar avocado-%{shortcommit}.tar.gz
%endif
# Selftests are provided but may need to be skipped because many of
@ -29,25 +26,28 @@
# enabled by default.
%global with_tests 1
# resultsdb is only available for Fedora
%if 0%{?fedora}
# resultsdb is not available for RHEL
%if ! 0%{?rhel}
%global with_resultsdb 1
%else
%global with_resultsdb 0
%endif
Name: python-%{pkgname}
Name: python-avocado
Version: 82.0
Release: 2%{?gitrel}%{?dist}
Summary: Framework with tools and libraries for Automated Testing
Group: Development/Tools
# Found licenses:
# avocado/core/tapparser.py: MIT
# avocado/utils/external/gdbmi_parser.py: MIT
# avocado/utils/external/spark.py: MIT
# optional_plugins/html/avocado_result_html/templates/bootstrap.min.css: MIT
# optional_plugins/html/avocado_result_html/templates/bootstrap.min.js: MIT
# selftests/.data/jenkins-junit.xsd: MIT
# Other files: GPLv2 and GPLv2+
License: GPLv2 and MIT
URL: http://avocado-framework.github.io/
Source0: https://github.com/avocado-framework/%{srcname}/archive/%{gitref}.tar.gz#/%{gittar}
License: GPLv2+ and GPLv2 and MIT
URL: https://avocado-framework.github.io/
Source0: https://github.com/avocado-framework/avocado/archive/%{gitref}/%{gittar}
BuildArch: noarch
BuildRequires: kmod
@ -59,23 +59,19 @@ BuildRequires: python3-jinja2
BuildRequires: python3-lxml
BuildRequires: python3-psutil
BuildRequires: python3-setuptools
%if 0%{?fedora}
BuildRequires: python3-pycdlib
%endif
%if %{with_resultsdb}
BuildRequires: python3-resultsdb_api
BuildRequires: python3-pycdlib
%endif
%if 0%{?with_tests}
BuildRequires: genisoimage
BuildRequires: libcdio
BuildRequires: psmisc
%if 0%{?fedora}
%if ! 0%{?rhel}
BuildRequires: perl-Test-Harness
%endif
%if 0%{?fedora} >= 30 || 0%{?rhel}
BuildRequires: glibc-all-langpacks
%endif
BuildRequires: python3-netifaces
BuildRequires: python3-yaml
%endif
@ -87,21 +83,23 @@ these days a framework) to perform automated testing.
%prep
%setup -q -n %{srcname}-%{gitref}
%if (0%{?fedora} && 0%{?fedora} < 29) || 0%{?rhel}
%setup -q -n avocado-%{gitref}
%if 0%{?rhel}
sed -e "s/'PyYAML>=4.2b2'/'PyYAML>=3.12'/" -i optional_plugins/varianter_yaml_to_mux/setup.py
%endif
# drop unnecessary install requirement
sed -e "s/'markupsafe<2.0.0', //" -i optional_plugins/html/setup.py
%build
%py3_build
pushd optional_plugins/html
%py3_build
popd
pushd optional_plugins/resultsdb
%if %{with_resultsdb}
pushd optional_plugins/resultsdb
%py3_build
%endif
popd
%endif
pushd optional_plugins/varianter_yaml_to_mux
%py3_build
popd
@ -123,7 +121,7 @@ popd
pushd optional_plugins/glib
%py3_build
popd
%{__make} man
%make_build man
%install
%py3_install
@ -138,23 +136,26 @@ for exe in \
avocado-runner-tap \
avocado-software-manager
do
%{__mv} %{buildroot}%{_bindir}/$exe %{buildroot}%{_bindir}/$exe-%{python3_version}
%{__ln_s} $exe-%{python3_version} %{buildroot}%{_bindir}/$exe-3
%{__ln_s} $exe-%{python3_version} %{buildroot}%{_bindir}/$exe
mv %{buildroot}%{_bindir}/$exe %{buildroot}%{_bindir}/$exe-%{python3_version}
ln -s $exe-%{python3_version} %{buildroot}%{_bindir}/$exe-3
ln -s $exe-%{python3_version} %{buildroot}%{_bindir}/$exe
done
# configuration is held at /etc/avocado only and part of the
# python-avocado-common package
%{__rm} -rf %{buildroot}%{python3_sitelib}/avocado/etc
rm -rf %{buildroot}%{python3_sitelib}/avocado/etc
# ditto for libexec files
%{__rm} -rf %{buildroot}%{python3_sitelib}/avocado/libexec
rm -rf %{buildroot}%{python3_sitelib}/avocado/libexec
# adjust permissions for file containing shebang line needed for
# spawning tasks in podman containers
chmod -c +x %{buildroot}%{python3_sitelib}/avocado/core/nrunner.py
pushd optional_plugins/html
%py3_install
popd
pushd optional_plugins/resultsdb
%if %{with_resultsdb}
pushd optional_plugins/resultsdb
%py3_install
%endif
popd
%endif
pushd optional_plugins/varianter_yaml_to_mux
%py3_install
popd
@ -177,97 +178,65 @@ pushd optional_plugins/glib
%py3_install
popd
# cleanup plugin test cruft
%{__rm} -rf %{buildroot}%{python3_sitelib}/tests
%{__mkdir} -p %{buildroot}%{_sysconfdir}/avocado
%{__cp} -r avocado/etc/avocado/scripts %{buildroot}%{_sysconfdir}/avocado/scripts
%{__cp} -r avocado/etc/avocado/sysinfo %{buildroot}%{_sysconfdir}/avocado/sysinfo
%{__mkdir} -p %{buildroot}%{_libexecdir}/avocado
%{__cp} avocado/libexec/avocado-bash-utils %{buildroot}%{_libexecdir}/avocado/avocado-bash-utils
%{__cp} avocado/libexec/avocado_debug %{buildroot}%{_libexecdir}/avocado/avocado_debug
%{__cp} avocado/libexec/avocado_error %{buildroot}%{_libexecdir}/avocado/avocado_error
%{__cp} avocado/libexec/avocado_info %{buildroot}%{_libexecdir}/avocado/avocado_info
%{__cp} avocado/libexec/avocado_warn %{buildroot}%{_libexecdir}/avocado/avocado_warn
%{__mkdir_p} %{buildroot}%{_mandir}/man1
%{__install} -m 0644 man/avocado.1 %{buildroot}%{_mandir}/man1/avocado.1
%{__install} -d -m 0755 %{buildroot}%{_sharedstatedir}/avocado/data
rm -rf %{buildroot}%{python3_sitelib}/tests
mkdir -p %{buildroot}%{_sysconfdir}/avocado
cp -r avocado/etc/avocado/scripts %{buildroot}%{_sysconfdir}/avocado/scripts
cp -r avocado/etc/avocado/sysinfo %{buildroot}%{_sysconfdir}/avocado/sysinfo
mkdir -p %{buildroot}%{_libexecdir}/avocado
cp avocado/libexec/avocado-bash-utils %{buildroot}%{_libexecdir}/avocado/avocado-bash-utils
cp avocado/libexec/avocado_debug %{buildroot}%{_libexecdir}/avocado/avocado_debug
cp avocado/libexec/avocado_error %{buildroot}%{_libexecdir}/avocado/avocado_error
cp avocado/libexec/avocado_info %{buildroot}%{_libexecdir}/avocado/avocado_info
cp avocado/libexec/avocado_warn %{buildroot}%{_libexecdir}/avocado/avocado_warn
mkdir -p %{buildroot}%{_mandir}/man1
install -m 0644 man/avocado.1 %{buildroot}%{_mandir}/man1/avocado.1
mkdir -p %{buildroot}%{_pkgdocdir}
install -m 0644 README.rst %{buildroot}%{_pkgdocdir}
install -d -m 0755 %{buildroot}%{_sharedstatedir}/avocado/data
# place examples in documentation directory
%{__install} -d -m 0755 %{buildroot}%{_docdir}/avocado
%{__cp} -r examples/gdb-prerun-scripts %{buildroot}%{_docdir}/avocado/gdb-prerun-scripts
%{__cp} -r examples/plugins %{buildroot}%{_docdir}/avocado/plugins
%{__cp} -r examples/tests %{buildroot}%{_docdir}/avocado/tests
%{__cp} -r examples/varianter_cit %{buildroot}%{_docdir}/avocado/varianter_cit
%{__cp} -r examples/varianter_pict %{buildroot}%{_docdir}/avocado/varianter_pict
%{__cp} -r examples/wrappers %{buildroot}%{_docdir}/avocado/wrappers
%{__cp} -r examples/yaml_to_mux %{buildroot}%{_docdir}/avocado/yaml_to_mux
%{__cp} -r examples/yaml_to_mux_loader %{buildroot}%{_docdir}/avocado/yaml_to_mux_loader
find %{buildroot}%{_docdir}/avocado -type f -name '*.py' -exec %{__chmod} -c -x {} ';'
install -d -m 0755 %{buildroot}%{_docdir}/avocado
cp -r examples/gdb-prerun-scripts %{buildroot}%{_docdir}/avocado/gdb-prerun-scripts
cp -r examples/plugins %{buildroot}%{_docdir}/avocado/plugins
cp -r examples/tests %{buildroot}%{_docdir}/avocado/tests
cp -r examples/varianter_cit %{buildroot}%{_docdir}/avocado/varianter_cit
cp -r examples/varianter_pict %{buildroot}%{_docdir}/avocado/varianter_pict
cp -r examples/wrappers %{buildroot}%{_docdir}/avocado/wrappers
cp -r examples/yaml_to_mux %{buildroot}%{_docdir}/avocado/yaml_to_mux
cp -r examples/yaml_to_mux_loader %{buildroot}%{_docdir}/avocado/yaml_to_mux_loader
find %{buildroot}%{_docdir}/avocado -type f -name '*.py' -exec chmod -c -x {} ';'
%check
%if 0%{?with_tests}
%{__python3} setup.py develop --user
pushd optional_plugins/html
%{__python3} setup.py develop --user
popd
%if %{with_resultsdb}
pushd optional_plugins/resultsdb
%{__python3} setup.py develop --user
popd
%endif
# with_resultsdb
pushd optional_plugins/varianter_yaml_to_mux
%{__python3} setup.py develop --user
popd
pushd optional_plugins/loader_yaml
%{__python3} setup.py develop --user
popd
pushd optional_plugins/golang
%{__python3} setup.py develop --user
popd
pushd optional_plugins/varianter_pict
%{__python3} setup.py develop --user
popd
pushd optional_plugins/varianter_cit
%{__python3} setup.py develop --user
popd
pushd optional_plugins/result_upload
%{__python3} setup.py develop --user
popd
pushd optional_plugins/glib
%{__python3} setup.py develop --user
popd
%check
# LANG: to make the results predictable, we pin the language
# that is used during test execution.
# AVOCADO_CHECK_LEVEL: 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
USER_BASE=`%{__python3} -m site --user-base`
PATH=$USER_BASE/bin:$HOME/bin:$PATH LANG=en_US.UTF-8 AVOCADO_CHECK_LEVEL=0 %{__python3} selftests/run
PATH=%{buildroot}%{_bindir}:%{buildroot}%{_libexecdir}/avocado:$PATH PYTHONPATH=%{buildroot}%{python3_sitelib}:. \
LANG=en_US.UTF-8 \
AVOCADO_CHECK_LEVEL=0 \
%{python3} selftests/run
%endif
%package -n python3-%{pkgname}
%package -n python3-avocado
Summary: %{summary}
License: GPLv2 and MIT
%{?python_provide:%python_provide python3-%{pkgname}}
Requires: python-%{pkgname}-common == %{version}-%{release}
Requires: python-avocado-common == %{version}-%{release}
Requires: gdb
Requires: gdb-gdbserver
Requires: procps-ng
Requires: python3
Requires: python3-setuptools
Requires: python3-six
%if 0%{?fedora}
%if ! 0%{?rhel}
Requires: python3-pycdlib
%endif
%description -n python3-%{pkgname}
%description -n python3-avocado
Avocado is a set of tools and libraries (what people call
these days a framework) to perform automated testing.
%files -n python3-%{pkgname}
%files -n python3-avocado
%license LICENSE
%doc README.rst
%{_pkgdocdir}/README.rst
%{python3_sitelib}/avocado/
%{python3_sitelib}/avocado_framework-%{version}-py%{python3_version}.egg-info
%{_bindir}/avocado-%{python3_version}
@ -299,13 +268,15 @@ these days a framework) to perform automated testing.
%{_bindir}/avocado-software-manager
%package -n python-%{pkgname}-common
%package -n python-avocado-common
Summary: Avocado common files
License: GPLv2+
%description -n python-%{pkgname}-common
%description -n python-avocado-common
Common files (such as configuration) for the Avocado Testing Framework.
%files -n python-%{pkgname}-common
%files -n python-avocado-common
%license LICENSE
%{_mandir}/man1/avocado.1.gz
%dir %{_docdir}/avocado
%dir %{_sharedstatedir}/avocado
@ -322,153 +293,151 @@ Common files (such as configuration) for the Avocado Testing Framework.
%{_sysconfdir}/avocado/scripts/job/post.d/README
%package -n python3-%{pkgname}-plugins-output-html
%package -n python3-avocado-plugins-output-html
Summary: Avocado HTML report plugin
%{?python_provide:%python_provide python3-%{pkgname}-plugins-output-html}
Requires: python3-%{pkgname} == %{version}-%{release}
Requires: python3-jinja2
License: GPLv2+ and MIT
Requires: python3-avocado == %{version}-%{release}
%description -n python3-%{pkgname}-plugins-output-html
%description -n python3-avocado-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 -n python3-%{pkgname}-plugins-output-html
%files -n python3-avocado-plugins-output-html
%{python3_sitelib}/avocado_result_html/
%{python3_sitelib}/avocado_framework_plugin_result_html-%{version}-py%{python3_version}.egg-info
%if %{with_resultsdb}
%package -n python3-%{pkgname}-plugins-resultsdb
%package -n python3-avocado-plugins-resultsdb
Summary: Avocado plugin to propagate job results to ResultsDB
%{?python_provide:%python_provide python3-%{pkgname}-plugins-resultsdb}
Requires: python3-%{pkgname} == %{version}-%{release}
Requires: python3-resultsdb_api
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}
%description -n python3-%{pkgname}-plugins-resultsdb
%description -n python3-avocado-plugins-resultsdb
Allows Avocado to send job results directly to a ResultsDB
server.
%files -n python3-%{pkgname}-plugins-resultsdb
%files -n python3-avocado-plugins-resultsdb
%{python3_sitelib}/avocado_resultsdb/
%{python3_sitelib}/avocado_framework_plugin_resultsdb-%{version}-py%{python3_version}.egg-info
%endif
# with_resultsdb
%package -n python3-%{pkgname}-plugins-varianter-yaml-to-mux
%package -n python3-avocado-plugins-varianter-yaml-to-mux
Summary: Avocado plugin to generate variants out of yaml files
%{?python_provide:%python_provide python3-%{pkgname}-plugins-varianter-yaml-to-mux}
Requires: python3-%{pkgname} == %{version}-%{release}
Requires: python3-yaml
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}
%description -n python3-%{pkgname}-plugins-varianter-yaml-to-mux
%description -n python3-avocado-plugins-varianter-yaml-to-mux
Can be used to produce multiple test variants with test parameters
defined in a yaml file(s).
%files -n python3-%{pkgname}-plugins-varianter-yaml-to-mux
%files -n python3-avocado-plugins-varianter-yaml-to-mux
%{python3_sitelib}/avocado_varianter_yaml_to_mux/
%{python3_sitelib}/avocado_framework_plugin_varianter_yaml_to_mux-%{version}-py%{python3_version}.egg-info
%package -n python3-%{pkgname}-plugins-loader-yaml
%package -n python3-avocado-plugins-loader-yaml
Summary: Avocado plugin that loads tests from YAML files
%{?python_provide:%python_provide python3-%{pkgname}-plugins-loader-yaml}
Requires: python3-%{pkgname}-plugins-varianter-yaml-to-mux == %{version}-%{release}
License: GPLv2+
Requires: python3-avocado-plugins-varianter-yaml-to-mux == %{version}-%{release}
%description -n python3-%{pkgname}-plugins-loader-yaml
%description -n python3-avocado-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 -n python3-%{pkgname}-plugins-loader-yaml
%files -n python3-avocado-plugins-loader-yaml
%{python3_sitelib}/avocado_loader_yaml/
%{python3_sitelib}/avocado_framework_plugin_loader_yaml-%{version}-py%{python3_version}.egg-info
%package -n python3-%{pkgname}-plugins-golang
%package -n python3-avocado-plugins-golang
Summary: Avocado plugin for execution of golang tests
%{?python_provide:%python_provide python3-%{pkgname}-plugins-golang}
Requires: python3-%{pkgname} == %{version}-%{release}
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}
Requires: golang
%description -n python3-%{pkgname}-plugins-golang
%description -n python3-avocado-plugins-golang
Allows Avocado to list golang tests, and if golang is installed,
also run them.
%files -n python3-%{pkgname}-plugins-golang
%files -n python3-avocado-plugins-golang
%{python3_sitelib}/avocado_golang/
%{python3_sitelib}/avocado_framework_plugin_golang-%{version}-py%{python3_version}.egg-info
%package -n python3-%{pkgname}-plugins-varianter-pict
%package -n python3-avocado-plugins-varianter-pict
Summary: Varianter with combinatorial capabilities by PICT
%{?python_provide:%python_provide python3-%{pkgname}-plugins-varianter-pict}
Requires: python3-%{pkgname} == %{version}-%{release}
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}
%description -n python3-%{pkgname}-plugins-varianter-pict
%description -n python3-avocado-plugins-varianter-pict
This plugin uses a third-party tool to provide variants created by
Pair-Wise algorithms, also known as Combinatorial Independent Testing.
%files -n python3-%{pkgname}-plugins-varianter-pict
%files -n python3-avocado-plugins-varianter-pict
%{python3_sitelib}/avocado_varianter_pict/
%{python3_sitelib}/avocado_framework_plugin_varianter_pict-%{version}-py%{python3_version}.egg-info
%package -n python3-%{pkgname}-plugins-varianter-cit
%package -n python3-avocado-plugins-varianter-cit
Summary: Varianter with Combinatorial Independent Testing capabilities
%{?python_provide:%python_provide python3-%{pkgname}-plugins-varianter-cit}
Requires: python3-%{pkgname} == %{version}-%{release}
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}
%description -n python3-%{pkgname}-plugins-varianter-cit
%description -n python3-avocado-plugins-varianter-cit
A varianter plugin that generates variants using Combinatorial
Independent Testing (AKA Pair-Wise) algorithm developed in
collaboration with CVUT Prague.
%files -n python3-%{pkgname}-plugins-varianter-cit
%files -n python3-avocado-plugins-varianter-cit
%{python3_sitelib}/avocado_varianter_cit/
%{python3_sitelib}/avocado_framework_plugin_varianter_cit-%{version}-py%{python3_version}.egg-info
%package -n python3-%{pkgname}-plugins-result-upload
%package -n python3-avocado-plugins-result-upload
Summary: Avocado plugin propagate job results to a remote host
%{?python_provide:%python_provide python3-%{pkgname}-plugins-result-upload}
Requires: python3-%{pkgname} == %{version}-%{release}
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}
%description -n python3-%{pkgname}-plugins-result-upload
%description -n python3-avocado-plugins-result-upload
This optional plugin is intended to upload the Avocado Job results to
a dedicated sever.
%files -n python3-%{pkgname}-plugins-result-upload
%files -n python3-avocado-plugins-result-upload
%{python3_sitelib}/avocado_result_upload/
%{python3_sitelib}/avocado_framework_plugin_result_upload-%{version}-py%{python3_version}.egg-info
%package -n python3-%{pkgname}-plugins-glib
%package -n python3-avocado-plugins-glib
Summary: Avocado plugin for execution of GLib Test Framework tests
%{?python_provide:%python_provide python3-%{pkgname}-plugins-glib}
Requires: python3-%{pkgname} == %{version}-%{release}
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}
%description -n python3-%{pkgname}-plugins-glib
%description -n python3-avocado-plugins-glib
This optional plugin is intended to list and run tests written in the
GLib Test Framework.
%files -n python3-%{pkgname}-plugins-glib
%files -n python3-avocado-plugins-glib
%{python3_sitelib}/avocado_glib/
%{python3_sitelib}/avocado_framework_plugin_glib-%{version}-py%{python3_version}.egg-info
%package -n python-%{pkgname}-examples
%package -n python-avocado-examples
Summary: Avocado Test Framework Example Tests
License: GPLv2
License: GPLv2+
# documentation does not require main package, but needs to be in lock-step if present
Conflicts: python3-%{pkgname} < %{version}-%{release}, python3-%{pkgname} > %{version}-%{release}
Conflicts: python3-avocado < %{version}-%{release}, python3-avocado > %{version}-%{release}
%description -n python-%{pkgname}-examples
%description -n python-avocado-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.
%files -n python-%{pkgname}-examples
%files -n python-avocado-examples
%license LICENSE
%dir %{_docdir}/avocado
%{_docdir}/avocado/gdb-prerun-scripts
%{_docdir}/avocado/plugins
@ -480,15 +449,17 @@ examples of how to write tests on your own.
%{_docdir}/avocado/yaml_to_mux_loader
%package -n python-%{pkgname}-bash
%package -n python-avocado-bash
Summary: Avocado Test Framework Bash Utilities
Requires: python-%{pkgname}-common == %{version}-%{release}
License: GPLv2+ and GPLv2
Requires: python-avocado-common == %{version}-%{release}
%description -n python-%{pkgname}-bash
%description -n python-avocado-bash
A small set of utilities to interact with Avocado from the Bourne
Again Shell code (and possibly other similar shells).
%files -n python-%{pkgname}-bash
%files -n python-avocado-bash
%license LICENSE
%dir %{_libexecdir}/avocado
%{_libexecdir}/avocado/avocado-bash-utils
%{_libexecdir}/avocado/avocado_debug
@ -498,9 +469,10 @@ Again Shell code (and possibly other similar shells).
%changelog
* Thu Feb 19 2021 Merlin Mathesius <mmathesi@redhat.com> - 82.0-2
* Thu Mar 18 2021 Merlin Mathesius <mmathesi@redhat.com> - 82.0-2
- Fix up BuildRequires: add 'make', drop obsolete packages
- Adjust PATH to make sure self-tests find internal modules
- Spec file cleanup following package review.
* Mon Sep 14 2020 Cleber Rosa <cleber@redhat.com> - 82.0-1
- Sync with upstream release 82.0.