@ -27,98 +27,50 @@
%global github_owner os-autoinst
%global github_owner os-autoinst
%global github_name os-autoinst
%global github_name os-autoinst
%global github_version 4.5
%global github_version 4.6
%global github_commit 3391d604ae36c0db0cda1d38f170137aef486a0c
%global github_commit 447dab862096c5fb871fe06f61c3e5249ec0d5c1
# if set, will be a post-release snapshot build, otherwise a 'normal' build
# if set, will be a post-release snapshot build, otherwise a 'normal' build
%global github_date 20190807
%global github_date 20191029
%global shortcommit %(c=%{github_commit}; echo ${c:0:7})
%global shortcommit %(c=%{github_commit}; echo ${c:0:7})
Name: os-autoinst
Name: os-autoinst
Version: %{github_version}
Version: %{github_version}
Release: 26 %{?github_date:.%{github_date}git%{shortcommit}}%{?dist}
Release: 1 %{?github_date:.%{github_date}git%{shortcommit}}%{?dist}
Summary: OS-level test automation
Summary: OS-level test automation
License: GPLv2+
License: GPLv2+
URL: https://os-autoinst.github.io/openQA/
URL: https://os-autoinst.github.io/openQA/
Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{github_name}-%{github_commit}.tar.gz
Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{github_name}-%{github_commit}.tar.gz
# diff from SUSE: added perl(ExtUtils::MakeMaker) and perl(ExtUtils::Embed)
# which I've found necessary before
%define build_requires autoconf automake gcc-c++ libtool pkgconfig(opencv) pkg-config perl(ExtUtils::MakeMaker) perl(ExtUtils::Embed) perl(Module::CPANfile) pkgconfig(fftw3) pkgconfig(libpng) pkgconfig(sndfile) pkgconfig(theoraenc) make
# diff from SUSE: dropped perl-base which does not exist in Fedora, we have
# the perl(:MODULE_COMPAT) require below
%define requires perl(B::Deparse) perl(Mojolicious) >= 7.92, perl(Mojo::IOLoop::ReadWriteProcess) >= 0.23, perl(Carp::Always) perl(Data::Dump) perl(Data::Dumper) perl(Crypt::DES) perl(JSON) perl(autodie) perl(Class::Accessor::Fast) perl(Exception::Class) perl(File::Touch) perl(File::Which) perl(IPC::Run::Debug) perl(Net::DBus) perl(Net::SNMP) perl(Net::IP) perl(IPC::System::Simple) perl(Net::SSH2) perl(XML::LibXML) perl(XML::SemanticDiff) perl(JSON::XS) perl(List::MoreUtils) perl(Mojo::IOLoop::ReadWriteProcess) perl(Socket::MsgHdr) perl(Cpanel::JSON::XS) perl(IO::Scalar) perl(Try::Tiny)
%define requires_not_needed_in_tests git-core
# all requirements needed by the tests, do not require on this in the package
# itself or any sub-packages
# diff from SUSE: added perl(Test::Mojo) and perl(Test::More), replaced
# qemu-tools with qemu-img, added /usr/bin/qemu-system-i386 which
# 'fullstack' and 'qemu-options' tests use on all arches (SUSE has
# these disabled as qemu can't run in OBS apparently)
%define test_requires %build_requires %requires perl(Perl::Tidy) perl(Test::Compile) >= 1.1.0, perl(Test::Exception) perl(Test::Mojo) perl(Test::More) perl(Test::Output) perl(Test::Fatal) perl(Test::Warnings) perl(Pod::Coverage) perl(Test::Pod) perl(Test::MockModule) perl(Test::MockObject) perl(Devel::Cover) perl(Test::Mock::Time) /usr/bin/qemu-img /usr/bin/qemu-system-i386
%define devel_requires %test_requires %requires_not_needed_in_tests
# https://github.com/os-autoinst/os-autoinst/pull/1202
# Handle PXE boot only once with 'PXEBOOT=once'
Patch0: 0001-Allow-special-value-once-for-PXEBOOT-to-PXE-boot.onc.patch
# https://github.com/os-autoinst/os-autoinst/pull/1199
# Improve validate_script_output result display
# spec file block dropped as it doesn't apply and doesn't matter
Patch1: 1199-edited.patch
# Useful new feature from upstream we want to use in a test
# drop next time we bump git snapshot
Patch2: 0001-Factor-out-click-functionality-from-assert_and_click.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: opencv-devel
BuildRequires: perl-devel
BuildRequires: perl-devel
BuildRequires: perl-generators
BuildRequires: perl-generators
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(ExtUtils::Embed)
BuildRequires: perl(Module::CPANfile)
BuildRequires: perl(Perl::Critic)
BuildRequires: perl(Perl::Tidy)
BuildRequires: perl(Pod::Html)
BuildRequires: pkgconfig
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(fftw3)
BuildRequires: pkgconfig(sndfile)
BuildRequires: pkgconfig(theoraenc)
BuildRequires: systemd
BuildRequires: systemd
BuildRequires: perl(Devel::Cover)
BuildRequires: perl(Pod::Coverage)
# The OO interface to Test::Compile only appeared in 1.1.0
BuildRequires: perl(Test::Compile) >= 1.1.0
BuildRequires: perl(Test::Exception)
BuildRequires: perl(Test::Fatal)
BuildRequires: perl(Test::MockModule)
BuildRequires: perl(Test::Mock::Time)
BuildRequires: perl(Test::Mojo)
BuildRequires: perl(Test::More)
BuildRequires: perl(Test::Output)
BuildRequires: perl(Test::Pod)
BuildRequires: perl(Test::Warnings)
BuildRequires: perl(Try::Tiny)
BuildRequires: /usr/bin/qemu-img
# 'fullstack' and 'qemu-options' tests use this (even on other arches)
BuildRequires: /usr/bin/qemu-system-i386
%if 0%{?no_fullstack}
%if 0%{?no_fullstack}
%else
%else
BuildRequires: perl(Mojo::File)
BuildRequires: perl(Mojo::File)
%endif # no_fullstack
%endif # no_fullstack
Requires: /usr/bin/qemu-img
Requires: optipng
# tinycv is a compiled public module, so we should have this
# tinycv is a compiled public module, so we should have this
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: qemu >= 2.0.0
Requires: qemu-kvm
Recommends: tesseract
Recommends: tesseract
# Not really needed, but you get non-fatal error messages in test
Recommends: qemu >= 2.0.0
# logs without it: https://bugzilla.redhat.com/show_bug.cgi?id=1467086
Recommends: qemu-kvm
Recommends: git
Recommends: /usr/bin/qemu-img
# these are both runtime and test requires. For Fedora, we get auto
BuildRequires: %test_requires
# Requires: for most of them, but we'd still have to add BuildRequires,
Requires: %requires %requires_not_needed_in_tests
# so we may as well follow the SUSE spec's approach here to make it
# easier to resync with SUSE's spec...
%define t_requires perl(B::Deparse) perl(Carp::Always) perl(Data::Dump) perl(Data::Dumper) perl(Crypt::DES) perl(JSON) perl(autodie) perl(Class::Accessor::Fast) perl(Exception::Class) perl(File::Touch) perl(File::Which) perl(IPC::Run::Debug) perl(Net::DBus) perl(Net::SNMP) perl(Net::IP) perl(IPC::System::Simple) perl(Net::SSH2) perl(XML::LibXML) perl(XML::SemanticDiff) perl(JSON::XS) perl(List::MoreUtils) perl(Socket::MsgHdr) perl(Cpanel::JSON::XS) perl(IO::Scalar)
# [note from openSUSE spec regarding JSON::XS dependency]:
# we shuffle around a lot of JSON, so make sure this is fast
# and the JSON modules have subtle differences and we only test against XS in production
# [adamw note]: fullstack test fails with JSON:PP
BuildRequires: %{t_requires}
Requires: %{t_requires}
# specifically versioned things that would otherwise be in t_requires
BuildRequires: perl(Mojolicious) >= 7.92
Requires: perl(Mojolicious) >= 7.92
BuildRequires: perl(Mojo::IOLoop::ReadWriteProcess) >= 0.23
Requires: perl(Mojo::IOLoop::ReadWriteProcess) >= 0.23
#Recommends: eatmydata /usr/bin/multimon
Requires(pre): %{_bindir}/getent
Requires(pre): %{_bindir}/getent
Requires(pre): %{_sbindir}/useradd
Requires(pre): %{_sbindir}/useradd
@ -130,6 +82,13 @@ upgrade, which can not easily and safely be tested with other
automated testing frameworks. However, it can just as well be used to
automated testing frameworks. However, it can just as well be used to
test applications on top of a newly installed OS.
test applications on top of a newly installed OS.
%package devel
Summary: Development package pulling in all build+test dependencies
Requires: %devel_requires
%description devel
Development package pulling in all build+test dependencies.
%package openvswitch
%package openvswitch
Summary: Open vSwitch support for os-autoinst
Summary: Open vSwitch support for os-autoinst
Requires: openvswitch
Requires: openvswitch
@ -144,6 +103,8 @@ This package contains Open vSwitch support for os-autoinst.
%prep
%prep
%autosetup -n %{github_name}-%{github_commit} -p1
%autosetup -n %{github_name}-%{github_commit} -p1
# Replace version number from git to what's reported by the package
sed -i 's/ my $thisversion = qx{git.*rev-parse HEAD}.*;/ my $thisversion = "%{version}";/' isotovideo
%if 0%{?no_fullstack}
%if 0%{?no_fullstack}
rm -f t/99-full-stack.t
rm -f t/99-full-stack.t
sed -i -e 's, 99-full-stack.t,,g' t/Makefile.am
sed -i -e 's, 99-full-stack.t,,g' t/Makefile.am
@ -168,13 +129,9 @@ make INSTALLDIRS=vendor %{?_smp_mflags}
%install
%install
%make_install INSTALLDIRS=vendor
%make_install INSTALLDIRS=vendor
# Replace version number from git to what's reported by the package
sed -i 's/ my $thisversion = qx{git rev-parse HEAD};/ my $thisversion = "%{version}-%{release}";/' %{buildroot}%{_bindir}/isotovideo
# only internal stuff
# only internal stuff
rm %{buildroot}%{_libexecdir}/os-autoinst/tools/tidy
rm %{buildroot}%{_libexecdir}/os-autoinst/tools/{tidy,check_coverage,absolutize}
rm -r %{buildroot}%{_libexecdir}/os-autoinst/tools/lib/perlcritic
rm -r %{buildroot}%{_libexecdir}/os-autoinst/tools/lib/perlcritic
rm %{buildroot}%{_libexecdir}/os-autoinst/tools/absolutize
rm %{buildroot}%{_libexecdir}/os-autoinst/tools/check_coverage
# we don't really need to ship this in the package, usually the web UI
# we don't really need to ship this in the package, usually the web UI
# is much better for needle editing
# is much better for needle editing
rm %{buildroot}%{_libexecdir}/os-autoinst/crop.py*
rm %{buildroot}%{_libexecdir}/os-autoinst/crop.py*
@ -190,10 +147,11 @@ find %{buildroot} -depth -type d -and -not -name distri -exec rmdir {} \;
export NO_BRP_STALE_LINK_ERROR=yes
export NO_BRP_STALE_LINK_ERROR=yes
%check
%check
# there's no point in checking code style at package build time,
# disable code quality checks - not worth the time for package builds
# and different versions of 'tidy' have different opinions so the
sed '/perlcritic/d' -i Makefile
# same code can pass for one Fedora release but fail for another
sed '/Perl::Critic/d' -i cpanfile
sed -i -e '/tidy --check/d' Makefile
sed '/tidy/d' -i Makefile
rm tools/lib/perlcritic/Perl/Critic/Policy/*.pm
make check VERBOSE=1
make check VERBOSE=1
%post openvswitch
%post openvswitch
@ -243,6 +201,10 @@ make check VERBOSE=1
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.opensuse.os_autoinst.switch.conf
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.opensuse.os_autoinst.switch.conf
%changelog
%changelog
* Wed Oct 30 2019 Adam Williamson <awilliam@redhat.com> - 4.6-1.20191029git447dab86
- Bump to latest upstream git snapshot (new version 4.6 declared)
- Resync spec with upstream
* Sat Oct 19 2019 Adam Williamson <awilliam@redhat.com> - 4.5-26.20190806git3391d60
* Sat Oct 19 2019 Adam Williamson <awilliam@redhat.com> - 4.5-26.20190806git3391d60
- Backport 'click_lastmatch' feature from upstream git master
- Backport 'click_lastmatch' feature from upstream git master