Blob Blame History Raw
# Fedora spec initially based on upstream spec file from OBS:
# https://build.opensuse.org/package/view_file/devel:openQA/os-autoinst/os-autoinst.spec
# License: GPLv2+

# Full stack test only runs reliably on x86
%ifnarch %{ix86} x86_64
%global no_fullstack 1
%endif

# os-autoinst has a bunch of annoyingly-badly-named private modules,
# we do not want automatic provides or requires for these
# ref https://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering#Perl
# but per https://fedorahosted.org/fpc/ticket/591 , these have been
# improved, and contrary to the wiki it is safe to set them first and
# then call perl_default_filter, the values will be properly merged.
# I tried to sell upstream on naming these properly and installing
# them to the perl vendor dir, but they wouldn't bite.
# https://github.com/os-autoinst/os-autoinst/issues/387
%global __provides_exclude_from %{_libexecdir}/os-autoinst
%global __requires_exclude perl\\((autotest|backend|basetest|bmwqemu|commands|consoles|cv|distribution|lockapi|mmapi|myjsonrpc|needle|ocr|osutils|testapi|OpenQA::Exceptions|OpenQA::Benchmark::Stopwatch)
%{?perl_default_filter}

%global github_owner    os-autoinst
%global github_name     os-autoinst
%global github_version  4.5
%global github_commit   ab8eedab3cbf930dafd1c0c69133d8c52e872bb4
# if set, will be a post-release snapshot build, otherwise a 'normal' build
%global github_date     20180208
%global shortcommit     %(c=%{github_commit}; echo ${c:0:7})

Name:           os-autoinst
Version:        %{github_version}
Release:        4%{?github_date:.%{github_date}git%{shortcommit}}%{?dist}
Summary:        OS-level test automation
License:        GPLv2+
Group:          Development/System
URL:            https://os-autoinst.github.io/openQA/
Source0:        https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{github_name}-%{github_commit}.tar.gz

BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  opencv-devel
BuildRequires:  perl-devel
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:  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::Fatal)
BuildRequires:  perl(Test::MockModule)
BuildRequires:  perl(Test::Mock::Time)
BuildRequires:  perl(Test::More)
BuildRequires:  perl(Test::Output)
BuildRequires:  perl(Test::Pod)
BuildRequires:  perl(Test::Warnings)
BuildRequires:  perl(Try::Tiny)
# 'fullstack' test uses these
BuildRequires:  /usr/bin/qemu-system-i386
BuildRequires:  /usr/bin/qemu-img
%if 0%{?no_fullstack}
%else
BuildRequires:  perl(Mojo::File)
%endif # no_fullstack
Requires:       /usr/bin/qemu-img
Requires:       optipng
# tinycv is a compiled public module, so we should have this
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires:       qemu >= 2.0.0
Requires:       qemu-kvm
Requires:       tesseract
Requires:       withlock
# Not really needed, but you get non-fatal error messages in test
# logs without it: https://bugzilla.redhat.com/show_bug.cgi?id=1467086
Recommends:     git
# these are both runtime and test requires. For Fedora, we get auto
# Requires: for most of them, but we'd still have to add BuildRequires,
# 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(Carp::Always) perl(Data::Dump) perl(Crypt::DES) perl(JSON) perl(JSON::XS) perl(autodie) perl(Class::Accessor::Fast) perl(Exception::Class) 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)
# [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}
BuildRequires:  perl(Mojolicious)
Requires:       perl(Mojolicious) >= 5.60
#Recommends:     eatmydata /usr/bin/multimon
Requires(pre):  %{_bindir}/getent
Requires(pre):  %{_sbindir}/useradd

%description
The OS-autoinst project aims at providing a means to run fully
automated tests. Especially to run tests of basic and low-level
operating system components such as bootloader, kernel, installer and
upgrade, which can not easily and safely be tested with other
automated testing frameworks. However, it can just as well be used to
test applications on top of a newly installed OS.

%package openvswitch
Summary:        Open vSwitch support for os-autoinst
Requires:       openvswitch
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires(post):     systemd
Requires(preun):    systemd
Requires(postun):   systemd
BuildRequires:      systemd

%description openvswitch
This package contains Open vSwitch support for os-autoinst.

%prep
%autosetup -n %{github_name}-%{github_commit} -p1
%if 0%{?no_fullstack}
rm -f t/99-full-stack.t
sed -i -e 's, 99-full-stack.t,,g' t/Makefile.am
%endif # no_fullstack

%build
mkdir -p m4
autoreconf -f -i
%configure --docdir=%{_pkgdocdir}
make INSTALLDIRS=vendor %{?_smp_mflags}

%install
%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
rm %{buildroot}%{_libexecdir}/os-autoinst/tools/tidy
rm -r %{buildroot}%{_libexecdir}/os-autoinst/tools/lib/perlcritic
rm %{buildroot}%{_libexecdir}/os-autoinst/tools/check_coverage
# we don't really need to ship this in the package, usually the web UI
# is much better for needle editing
rm %{buildroot}%{_libexecdir}/os-autoinst/crop.py*
# we're going to %%license this
rm %{buildroot}%{_pkgdocdir}/COPYING
# This is no use for package users
rm %{buildroot}%{_pkgdocdir}/INSTALL.asciidoc
ls -lR %buildroot
find %{buildroot} -type f -name .packlist -exec rm -f {} \;
find %{buildroot} -depth -type d -and -not -name distri -exec rmdir {} \;

# we need the stale symlinks to point to git
export NO_BRP_STALE_LINK_ERROR=yes

%check
# there's no point in checking code style at package build time,
# and different versions of 'tidy' have different opinions so the
# same code can pass for one Fedora release but fail for another
sed -i -e '/tidy --check/d' Makefile
make check VERBOSE=1

%post openvswitch
%systemd_post os-autoinst-openvswitch.service

%preun openvswitch
%systemd_preun os-autoinst-openvswitch.service

%postun openvswitch
%systemd_postun_with_restart os-autoinst-openvswitch.service

%files
%{_pkgdocdir}
%license COPYING
%{perl_vendorarch}/tinycv.pm
%{perl_vendorarch}/auto/tinycv
%dir %{_libexecdir}/os-autoinst
%{_libexecdir}/os-autoinst/videoencoder
%{_libexecdir}/os-autoinst/basetest.pm
#
%{_libexecdir}/os-autoinst/dmidata
#
%{_libexecdir}/os-autoinst/bmwqemu.pm
%{_libexecdir}/os-autoinst/commands.pm
%{_libexecdir}/os-autoinst/distribution.pm
%{_libexecdir}/os-autoinst/testapi.pm
%{_libexecdir}/os-autoinst/mmapi.pm
%{_libexecdir}/os-autoinst/myjsonrpc.pm
%{_libexecdir}/os-autoinst/lockapi.pm
%{_libexecdir}/os-autoinst/cv.pm
%{_libexecdir}/os-autoinst/ocr.pm
%{_libexecdir}/os-autoinst/osutils.pm
%{_libexecdir}/os-autoinst/needle.pm
%{_libexecdir}/os-autoinst/backend
%{_libexecdir}/os-autoinst/OpenQA
%{_libexecdir}/os-autoinst/consoles
%dir %{_libexecdir}/os-autoinst/tools
%{_libexecdir}/os-autoinst/tools/absolutize
%{_libexecdir}/os-autoinst/tools/preparepool
%{_libexecdir}/os-autoinst/autotest.pm
%{_bindir}/isotovideo
%{_bindir}/debugviewer
%{_bindir}/snd2png

%files openvswitch
%{_libexecdir}/os-autoinst/os-autoinst-openvswitch
%{_unitdir}/os-autoinst-openvswitch.service
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.opensuse.os_autoinst.switch.conf

%changelog
* Thu Feb 08 2018 Adam Williamson <awilliam@redhat.com> - 4.5-4.20180208gitab8eeda
- Bump to latest git

* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.5-3.20171222git1c7bb3f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Tue Jan 02 2018 Adam Williamson <awilliam@redhat.com> - 4.5-2.20171222git1c7bb3f
- Bump to latest git, with an upstream bugfix (#901)
- Rebuild for opencv soname bump (Rawhide)

* Wed Dec 20 2017 Adam Williamson <awilliam@redhat.com> - 4.5-1.20171220git25191d5
- Bump to latest git again, bump version to 4.5 (per upstream)

* Thu Aug 17 2017 Adam Williamson <awilliam@redhat.com> - 4.4-26.20170807gitcf2d051
- Bump to latest git again (wait_screen_change enhancement looks nice)

* Tue Aug 15 2017 Adam Williamson <awilliam@redhat.com> - 4.4-25.20170725git734682a
- Revert typing speed change, didn't help and we found the real bug

* Tue Aug 15 2017 Adam Williamson <awilliam@redhat.com> - 4.4-24.20170725git734682a
- Make the default typing speed slower to work around typing fails

* Mon Jul 31 2017 Adam Williamson <awilliam@redhat.com> - 4.4-23.20170725git734682a
- Bump to latest git

* Mon Jul 31 2017 Florian Weimer <fweimer@redhat.com> - 4.4-22.20170410git97928a2
- Rebuild with binutils fix for ppc64le (#1475636)

* Tue Jul 25 2017 Adam Williamson <awilliam@redhat.com> - 4.4-21.20170410git97928a2
- Recommend git to avoid error messages in logs (RHBZ #1467086)

* Thu Jul 20 2017 Adam Williamson <awilliam@redhat.com> - 4.4-20.20170410git97928a2
- Rebuild for new gdal (for new mariadb)
- Downstream patch the full-stack test to type a bit slower

* Tue Jun 06 2017 Jitka Plesnikova <jplesnik@redhat.com> - 4.4-19.20170410git97928a2
- Perl 5.26 rebuild
- Fixed tests to build on Perl without dot in INC

* Mon Apr 10 2017 Adam Williamson <awilliam@redhat.com> - 4.4-18.20170410git97928a2
- Bump to latest git again
- Adjust isotovideo self-reported version at build time (as did SUSE)

* Tue Mar 28 2017 Adam Williamson <awilliam@redhat.com> - 4.4-17.20170329gitd8f75d2
- Bump again to fix assert_and_click mouse repositioning (see #744)
- Disable full-stack test on non-x86 arches

* Thu Mar 02 2017 Adam Williamson <awilliam@redhat.com> - 4.4-16.20170327git201dc4e
- Update to latest git (many useful fixes)

* Tue Feb 28 2017 Adam Williamson <awilliam@redhat.com> - 4.4-15.20170126gitc29555c
- Rebuild for new opencv

* Mon Jan 30 2017 Adam Williamson <awilliam@redhat.com> - 4.4-14.20170126gitc29555c
- Update to latest git, drop merged patch

* Wed Jan 18 2017 Adam Williamson <awilliam@redhat.com> - 4.4-13.20170104git84d91e6
- Backport fix for duplicated qemu vga options (broke ARM jobs)

* Wed Jan 04 2017 Adam Williamson <awilliam@redhat.com> - 4.4-12.20170104git84d91e6
- Update to latest git, drop merged #686 patch

* Wed Jan 04 2017 Adam Williamson <awilliam@redhat.com> - 4.4-11.20170103git26171f4
- Backport #686 to fix os-autoinst on 32-bit arches, re-enable them

* Tue Jan 03 2017 Adam Williamson <awilliam@redhat.com> - 4.4-10.20170103git26171f4
- Filter out another bogus openQA provide

* Tue Jan 03 2017 Adam Williamson <awilliam@redhat.com> - 4.4-9.20170103git26171f4
- Bump to latest git again
- Add some additional test requirements
- Disable build entirely on arches broken by POO #13822 for now

* Tue Dec 13 2016 Adam Williamson <awilliam@redhat.com> - 4.4-8.20161213git3050cfa
- bump to latest git again

* Mon Nov 28 2016 Adam Williamson <awilliam@redhat.com> - 4.4-7.20161123gitdb6d2ef
- bump to latest git (inc. garretraziel's UEFI boot order patches)
- drop patches merged upstream

* Tue Oct 25 2016 Adam Williamson <awilliam@redhat.com> - 4.4-6.20161021git9672031
- bump to latest git
- backport a couple of small fixes for perl errors
- backport #625 so we can use the distro-packaged EDK2

* Mon Sep 19 2016 Adam Williamson <awilliam@redhat.com> - 4.4-5.20160915gitba7ea22
- disable a failing test on 32-bit x86

* Thu Sep 15 2016 Adam Williamson <awilliam@redhat.com> - 4.4-4.20160915gitba7ea22
- bump to git master again, drop merged patch

* Wed Sep 14 2016 Adam Williamson <awilliam@redhat.com> - 4.4-3.20160912git62f67e7
- final version of POO #13722 fix

* Wed Sep 14 2016 Adam Williamson <awilliam@redhat.com> - 4.4-2.20160912git62f67e7
- test fix for POO #13722

* Mon Sep 12 2016 Adam Williamson <awilliam@redhat.com> - 4.4-1.20160912git62f67e7
- try a new git snapshot again, let's see how it's going
- SUSE started calling this 4.4 at some point, so let's follow along

* Sun Sep 04 2016 Adam Williamson <awilliam@redhat.com> - 4.3-26.20160902git1962d68
- slightly older git snapshot, may fix issues seen in last build

* Sat Sep 03 2016 Adam Williamson <awilliam@redhat.com> - 4.3-25.20160902git0b5d885
- bump to latest git again, drop merged patches

* Wed Aug 31 2016 Adam Williamson <awilliam@redhat.com> - 4.3-24.20160826gitcd35b40
- don't sha1sum qcow assets on shutdown (slow, blocks worker process)

* Mon Aug 29 2016 Adam Williamson <awilliam@redhat.com> - 4.3-23.20160826gitcd35b40
- apply PR #571 to try and fix POO #13456 / #12680

* Fri Aug 26 2016 Adam Williamson <awilliam@redhat.com> - 4.3-22.20160826gitcd35b40
- bump to latest git (to get bug fixes, disable verbose JSON logging)

* Tue Aug 09 2016 Adam Williamson <awilliam@redhat.com> - 4.3-21.20160712gitf5bb0fe
- fix an issue with cursor reset after assert_and_click triggering overview

* Tue Jul 12 2016 Adam Williamson <awilliam@redhat.com> - 4.3-20.20160712gitf5bb0fe
- git bump again (still fixing issues related to the shutdown rewrite)

* Mon Jul 11 2016 Adam Williamson <awilliam@redhat.com> - 4.3-19.20160711git243c036
- bump to git master one more time for PR #536 (more shutdown stuff)

* Sun Jul 10 2016 Adam Williamson <awilliam@redhat.com> - 4.3-18.20160710gitc5e11ab
- bump to git master once more with merged (updated) PR #534

* Sun Jul 10 2016 Adam Williamson <awilliam@redhat.com> - 4.3-17.20160708gitcb0f4a8
- bump to current git master again to make PR apply cleanly
- backport PR #534 to fix #535 and openQA #781

* Fri Jul 08 2016 Adam Williamson <awilliam@redhat.com> - 4.3-16.20160708git7a1901d
- bump to latest git
- drop merged PR #524 patch

* Wed Jul 06 2016 Adam Williamson <awilliam@redhat.com> - 4.3-15.20160624gitfe19b00
- include the whole of PR #524 to help fix multiple interactive mode issues

* Mon Jul 04 2016 Adam Williamson <awilliam@redhat.com> - 4.3-14.20160624gitfe19b00
- fix worker crash on job cancel (#530) with a single commit from PR #524

* Tue Jun 28 2016 Adam Williamson <awilliam@redhat.com> - 4.3-13.20160624gitfe19b00
- bump to latest upstream git, drop merged patches

* Mon May 16 2016 Jitka Plesnikova <jplesnik@redhat.com> - 4.3-12.20160408gitff760a3
- Perl 5.24 rebuild

* Tue May 03 2016 Adam Williamson <awilliam@redhat.com> - 4.3-11.20160408gitff760a3
- update the upload_logs patch to the version merged upstream

* Fri Apr 29 2016 Adam Williamson <awilliam@redhat.com> - 4.3-10.20160408gitff760a3
- add an option to prevent test dying if upload_logs fails (PR #490)

* Tue Apr 26 2016 Adam Williamson <awilliam@redhat.com> - 4.3-9.20160408gitff760a3
- fix incorrect binary path in openvswitch service file (PR #487)

* Sat Apr 23 2016 Adam Williamson <awilliam@redhat.com> - 4.3-8.20160408gitff760a3
- rebuild against updated opencv

* Fri Apr 08 2016 Adam Williamson <awilliam@redhat.com> - 4.3-7.20160408gitff760a3
- bump to current git (to go along with openQA; patch load was getting huge)

* Thu Mar 31 2016 Adam Williamson <awilliam@redhat.com> - 4.3-6
- backport: allow needles to be in nested directories (jskladan)

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Jan 15 2016 Adam Williamson <awilliam@redhat.com> - 4.3-4
- simplify requires/provides excludes (thanks Zbigniew)

* Fri Jan 15 2016 Adam Williamson <awilliam@redhat.com> - 4.3-3
- add perl(:MODULE_COMPAT require

* Fri Jan 15 2016 Adam Williamson <awilliam@redhat.com> - 4.3-2
- exclude provides and requires from the private modules

* Thu Jan 14 2016 Adam Williamson <awilliam@redhat.com> - 4.3-1
- new release 4.3, drop patches merged upstream
- resync with upstream spec changes
- some package review cleanups
- fix 'format not a literal' errors in new snd2png (submitted upstream)

* Tue Dec 22 2015 Adam Williamson <awilliam@redhat.com> - 4.2.1-6
- changes requested in package review:
  + improve 'find and destroy' commands
  + drop tests/ directory (upstream did this too)
  + drop git dependency (seems to be ancient stuff)
  + use %%license
  + mark dbus config file as (noreplace)
  + 'Open vSwitch' not 'openvswitch' in summary/description
  + systemd snippets for openvswitch service
  + drop useless python scripts to avoid automatic python requirements

* Thu Dec 03 2015 Adam Williamson <awilliam@redhat.com> - 4.2.1-5
- fix a bug in the UEFI patch

* Thu Dec 03 2015 Adam Williamson <awilliam@redhat.com> - 4.2.1-4
- support Fedora UEFI firmware location (submitted upstream)

* Mon Nov  2 2015 Adam Williamson <awilliam@redhat.com> - 4.2.1-3
- tweak hardcoded path patch a little (upstream request)

* Sat Oct 24 2015 Adam Williamson <awilliam@redhat.com> - 4.2.1-2
- fix a hardcoded path which is incorrect on Fedora

* Thu Oct 15 2015 Adam Williamson <awilliam@redhat.com> - 4.2.1-1
- new release 4.2.1
- merge changes from upstream

* Thu Apr 23 2015 Adam Williamson <awilliam@redhat.com> - 4.1-1.20150423git24609047
- initial Fedora package, based on OBS package