7f911b5
# Fedora spec initially based on upstream spec file from OBS:
7f911b5
# https://build.opensuse.org/package/view_file/devel:openQA/os-autoinst/os-autoinst.spec
7f911b5
# License: GPLv2+
7f911b5
7f911b5
# Tests require perl-Test-Compile >= 1.1.0, currently only available
7f911b5
# on Fedora > 21 (and I'm guessing RHEL > 7)
7f911b5
%if 0%{?fedora} > 21 || 0%{?rhel} > 7
7f911b5
%global with_tests 1
7f911b5
%endif
7f911b5
7f911b5
# os-autoinst has a bunch of annoyingly-badly-named private modules,
7f911b5
# we do not want automatic provides or requires for these
7f911b5
# ref https://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering#Perl
7f911b5
# but per https://fedorahosted.org/fpc/ticket/591 , these have been
7f911b5
# improved, and contrary to the wiki it is safe to set them first and
7f911b5
# then call perl_default_filter, the values will be properly merged.
7f911b5
# I tried to sell upstream on naming these properly and installing
7f911b5
# them to the perl vendor dir, but they wouldn't bite.
7f911b5
# https://github.com/os-autoinst/os-autoinst/issues/387
7f911b5
%global __provides_exclude_from %{_libexecdir}/os-autoinst
c4e09dd
%global __requires_exclude perl\\((autotest|backend|basetest|bmwqemu|commands|consoles|cv|distribution|lockapi|mmapi|myjsonrpc|needle|ocr|testapi|OpenQA::Exceptions)
7f911b5
%{?perl_default_filter}
7f911b5
7f911b5
%global github_owner    os-autoinst
7f911b5
%global github_name     os-autoinst
9c57a14
%global github_version  4.4
9e987b7
%global github_commit   26171f41d6cab38e8707f2109663cb14e82a8e9a
7f911b5
# if set, will be a post-release snapshot build, otherwise a 'normal' build
9e987b7
%global github_date     20170103
7f911b5
%global shortcommit     %(c=%{github_commit}; echo ${c:0:7})
7f911b5
7f911b5
Name:           os-autoinst
7f911b5
Version:        %{github_version}
9e987b7
Release:        9%{?github_date:.%{github_date}git%{shortcommit}}%{?dist}
7f911b5
Summary:        OS-level test automation
7f911b5
License:        GPLv2+
7f911b5
Group:          Development/System
7f911b5
URL:            https://os-autoinst.github.io/openQA/
7f911b5
Source0:        https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{github_name}-%{github_commit}.tar.gz
d9603ff
9e987b7
# Does not work on 32-bit arches due to problematic file locking code:
9e987b7
# https://progress.opensuse.org/issues/13822
9e987b7
ExcludeArch:    %{ix86} %{arm}
9e987b7
7f911b5
BuildRequires:  autoconf
7f911b5
BuildRequires:  automake
7f911b5
BuildRequires:  gcc-c++
7f911b5
BuildRequires:  libtool
7f911b5
BuildRequires:  opencv-devel
7ae0dcd
BuildRequires:  perl-devel
7ae0dcd
BuildRequires:  perl-generators
7f911b5
BuildRequires:  perl(ExtUtils::MakeMaker)
7f911b5
BuildRequires:  perl(ExtUtils::Embed)
7f911b5
BuildRequires:  perl(Module::CPANfile)
7f911b5
BuildRequires:  perl(Perl::Critic)
7f911b5
BuildRequires:  perl(Perl::Tidy)
7f911b5
BuildRequires:  perl(Pod::Html)
7f911b5
BuildRequires:  pkgconfig
7f911b5
BuildRequires:  pkgconfig(libpng)
7f911b5
BuildRequires:  pkgconfig(fftw3)
7f911b5
BuildRequires:  pkgconfig(sndfile)
7f911b5
BuildRequires:  pkgconfig(theoraenc)
7f911b5
BuildRequires:  systemd
7f911b5
%if 0%{?with_tests}
7f911b5
# The OO interface to Test::Compile only appeared in 1.1.0
8a3000b
BuildRequires:  perl(Devel::Cover)
7f196d4
BuildRequires:  perl(Pod::Coverage)
7f911b5
BuildRequires:  perl(Test::Compile) >= 1.1.0
7f196d4
BuildRequires:  perl(Test::Fatal)
9e987b7
BuildRequires:  perl(Test::MockModule)
9e987b7
BuildRequires:  perl(Test::More)
7f196d4
BuildRequires:  perl(Test::Output)
7f196d4
BuildRequires:  perl(Test::Pod)
9e987b7
BuildRequires:  perl(Try::Tiny)
9e987b7
# 'fullstack' test uses qemu-system-i386 and qemu-img
9e987b7
BuildRequires:  qemu-system-x86-core
9e987b7
BuildRequires:  /usr/bin/qemu-img
7f911b5
%endif # with_tests
7f911b5
Requires:       /usr/bin/qemu-img
7f911b5
Requires:       optipng
7f911b5
# tinycv is a compiled public module, so we should have this
7f911b5
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
7f911b5
Requires:       qemu >= 2.0.0
7f911b5
Requires:       qemu-kvm
7f911b5
Requires:       tesseract
7f911b5
Requires:       withlock
7f911b5
# these are both runtime and test requires. For Fedora, we get auto
7f911b5
# Requires: for most of them, but we'd still have to add BuildRequires,
7f911b5
# so we may as well follow the SUSE spec's approach here to make it
7f911b5
# easier to resync with SUSE's spec...
9e987b7
%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)
9e987b7
# [note from openSUSE spec regarding JSON::XS dependency]:
9e987b7
# we shuffle around a lot of JSON, so make sure this is fast
9e987b7
# and the JSON modules have subtle differences and we only test against XS in production
9e987b7
# [adamw note]: fullstack test fails with JSON:PP
7f911b5
BuildRequires:  %{t_requires}
7f911b5
Requires:       %{t_requires}
7f911b5
BuildRequires:  perl(Mojolicious)
7f911b5
Requires:       perl(Mojolicious) >= 5.60
7f911b5
#Recommends:     eatmydata /usr/bin/multimon
7f911b5
Requires(pre):  %{_bindir}/getent
7f911b5
Requires(pre):  %{_sbindir}/useradd
7f911b5
7f911b5
%description
7f911b5
The OS-autoinst project aims at providing a means to run fully
7f911b5
automated tests. Especially to run tests of basic and low-level
7f911b5
operating system components such as bootloader, kernel, installer and
7f911b5
upgrade, which can not easily and safely be tested with other
7f911b5
automated testing frameworks. However, it can just as well be used to
7f911b5
test applications on top of a newly installed OS.
7f911b5
7f911b5
%package openvswitch
7f911b5
Summary:        Open vSwitch support for os-autoinst
7f911b5
Requires:       openvswitch
7f911b5
Requires:       %{name}%{?_isa} = %{version}-%{release}
7f911b5
Requires(post):     systemd
7f911b5
Requires(preun):    systemd
7f911b5
Requires(postun):   systemd
7f911b5
BuildRequires:      systemd
7f911b5
7f911b5
%description openvswitch
7f911b5
This package contains Open vSwitch support for os-autoinst.
7f911b5
7f911b5
%prep
7f911b5
%autosetup -n %{github_name}-%{github_commit} -p1
7f911b5
7f911b5
%build
7f911b5
mkdir -p m4
7f911b5
autoreconf -f -i
7f911b5
%configure --docdir=%{_pkgdocdir}
7f911b5
make INSTALLDIRS=vendor %{?_smp_mflags}
7f911b5
7f911b5
%install
7f911b5
%make_install INSTALLDIRS=vendor
7f911b5
# only internal stuff
7f911b5
rm %{buildroot}%{_libexecdir}/os-autoinst/tools/tidy
7f911b5
rm -r %{buildroot}%{_libexecdir}/os-autoinst/tools/lib/perlcritic
9c57a14
rm %{buildroot}%{_libexecdir}/os-autoinst/tools/check_coverage
7f911b5
# we don't really need to ship this in the package, usually the web UI
7f911b5
# is much better for needle editing
7f911b5
rm %{buildroot}%{_libexecdir}/os-autoinst/crop.py*
7f911b5
# we're going to %%license this
7f911b5
rm %{buildroot}%{_pkgdocdir}/COPYING
7f911b5
# This is no use for package users
7f911b5
rm %{buildroot}%{_pkgdocdir}/INSTALL.asciidoc
7f911b5
ls -lR %buildroot
7f911b5
find %{buildroot} -type f -name .packlist -exec rm -f {} \;
7f911b5
find %{buildroot} -depth -type d -and -not -name distri -exec rmdir {} \;
7f911b5
7f911b5
# we need the stale symlinks to point to git
7f911b5
export NO_BRP_STALE_LINK_ERROR=yes
7f911b5
7f911b5
%check
7f911b5
%if 0%{?with_tests}
7f911b5
make check VERBOSE=1
7f911b5
%endif # with_tests
7f911b5
7f911b5
%post openvswitch
7f911b5
%systemd_post os-autoinst-openvswitch.service
7f911b5
7f911b5
%preun openvswitch
7f911b5
%systemd_preun os-autoinst-openvswitch.service
7f911b5
7f911b5
%postun openvswitch
7f911b5
%systemd_postun_with_restart os-autoinst-openvswitch.service
7f911b5
7f911b5
%files
7f911b5
%{_pkgdocdir}
7f911b5
%license COPYING
7f911b5
%{perl_vendorarch}/tinycv.pm
7f911b5
%{perl_vendorarch}/auto/tinycv
7f911b5
%dir %{_libexecdir}/os-autoinst
7f911b5
%{_libexecdir}/os-autoinst/videoencoder
7f911b5
%{_libexecdir}/os-autoinst/basetest.pm
7f911b5
#
7f911b5
%{_libexecdir}/os-autoinst/dmidata
7f911b5
#
7f911b5
%{_libexecdir}/os-autoinst/bmwqemu.pm
7f911b5
%{_libexecdir}/os-autoinst/commands.pm
7f911b5
%{_libexecdir}/os-autoinst/distribution.pm
7f911b5
%{_libexecdir}/os-autoinst/testapi.pm
7f911b5
%{_libexecdir}/os-autoinst/mmapi.pm
c4e09dd
%{_libexecdir}/os-autoinst/myjsonrpc.pm
7f911b5
%{_libexecdir}/os-autoinst/lockapi.pm
7f911b5
%{_libexecdir}/os-autoinst/cv.pm
7f911b5
%{_libexecdir}/os-autoinst/ocr.pm
7f911b5
%{_libexecdir}/os-autoinst/needle.pm
7f911b5
%{_libexecdir}/os-autoinst/backend
7f196d4
%{_libexecdir}/os-autoinst/OpenQA
7f911b5
%{_libexecdir}/os-autoinst/consoles
7f911b5
%dir %{_libexecdir}/os-autoinst/tools
7f911b5
%{_libexecdir}/os-autoinst/tools/absolutize
7f911b5
%{_libexecdir}/os-autoinst/tools/preparepool
7f911b5
%{_libexecdir}/os-autoinst/autotest.pm
7f911b5
%{_bindir}/isotovideo
7f911b5
%{_bindir}/debugviewer
7f911b5
%{_bindir}/snd2png
7f911b5
7f911b5
%files openvswitch
7f911b5
%{_libexecdir}/os-autoinst/os-autoinst-openvswitch
7f911b5
%{_unitdir}/os-autoinst-openvswitch.service
7f911b5
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.opensuse.os_autoinst.switch.conf
7f911b5
7f911b5
%changelog
9e987b7
* Tue Jan 03 2017 Adam Williamson <awilliam@redhat.com> - 4.4-9.20170103git26171f4
9e987b7
- Bump to latest git again
9e987b7
- Add some additional test requirements
9e987b7
- Disable build entirely on arches broken by POO #13822 for now
9e987b7
0ae49c2
* Tue Dec 13 2016 Adam Williamson <awilliam@redhat.com> - 4.4-8.20161213git3050cfa
0ae49c2
- bump to latest git again
0ae49c2
db48380
* Mon Nov 28 2016 Adam Williamson <awilliam@redhat.com> - 4.4-7.20161123gitdb6d2ef
db48380
- bump to latest git (inc. garretraziel's UEFI boot order patches)
db48380
- drop patches merged upstream
db48380
bbaab5d
* Tue Oct 25 2016 Adam Williamson <awilliam@redhat.com> - 4.4-6.20161021git9672031
bbaab5d
- bump to latest git
bbaab5d
- backport a couple of small fixes for perl errors
bbaab5d
- backport #625 so we can use the distro-packaged EDK2
bbaab5d
75c2d42
* Mon Sep 19 2016 Adam Williamson <awilliam@redhat.com> - 4.4-5.20160915gitba7ea22
75c2d42
- disable a failing test on 32-bit x86
75c2d42
9c57a14
* Thu Sep 15 2016 Adam Williamson <awilliam@redhat.com> - 4.4-4.20160915gitba7ea22
9c57a14
- bump to git master again, drop merged patch
9c57a14
9c57a14
* Wed Sep 14 2016 Adam Williamson <awilliam@redhat.com> - 4.4-3.20160912git62f67e7
9c57a14
- final version of POO #13722 fix
9c57a14
9c57a14
* Wed Sep 14 2016 Adam Williamson <awilliam@redhat.com> - 4.4-2.20160912git62f67e7
9c57a14
- test fix for POO #13722
9c57a14
9c57a14
* Mon Sep 12 2016 Adam Williamson <awilliam@redhat.com> - 4.4-1.20160912git62f67e7
9c57a14
- try a new git snapshot again, let's see how it's going
9c57a14
- SUSE started calling this 4.4 at some point, so let's follow along
9c57a14
9c57a14
* Sun Sep 04 2016 Adam Williamson <awilliam@redhat.com> - 4.3-26.20160902git1962d68
1c4b93e
- slightly older git snapshot, may fix issues seen in last build
1c4b93e
5d84c71
* Sat Sep 03 2016 Adam Williamson <awilliam@redhat.com> - 4.3-25.20160902git0b5d885
5d84c71
- bump to latest git again, drop merged patches
5d84c71
5d84c71
* Wed Aug 31 2016 Adam Williamson <awilliam@redhat.com> - 4.3-24.20160826gitcd35b40
5d84c71
- don't sha1sum qcow assets on shutdown (slow, blocks worker process)
5d84c71
5d84c71
* Mon Aug 29 2016 Adam Williamson <awilliam@redhat.com> - 4.3-23.20160826gitcd35b40
5d84c71
- apply PR #571 to try and fix POO #13456 / #12680
5d84c71
5d84c71
* Fri Aug 26 2016 Adam Williamson <awilliam@redhat.com> - 4.3-22.20160826gitcd35b40
5d84c71
- bump to latest git (to get bug fixes, disable verbose JSON logging)
5d84c71
5d84c71
* Tue Aug 09 2016 Adam Williamson <awilliam@redhat.com> - 4.3-21.20160712gitf5bb0fe
95983e6
- fix an issue with cursor reset after assert_and_click triggering overview
95983e6
5d84c71
* Tue Jul 12 2016 Adam Williamson <awilliam@redhat.com> - 4.3-20.20160712gitf5bb0fe
d84fe45
- git bump again (still fixing issues related to the shutdown rewrite)
d84fe45
5d84c71
* Mon Jul 11 2016 Adam Williamson <awilliam@redhat.com> - 4.3-19.20160711git243c036
a617464
- bump to git master one more time for PR #536 (more shutdown stuff)
a617464
5d84c71
* Sun Jul 10 2016 Adam Williamson <awilliam@redhat.com> - 4.3-18.20160710gitc5e11ab
a89e8f0
- bump to git master once more with merged (updated) PR #534
a89e8f0
5d84c71
* Sun Jul 10 2016 Adam Williamson <awilliam@redhat.com> - 4.3-17.20160708gitcb0f4a8
d3cd75b
- bump to current git master again to make PR apply cleanly
f502cfd
- backport PR #534 to fix #535 and openQA #781
f502cfd
f502cfd
* Fri Jul 08 2016 Adam Williamson <awilliam@redhat.com> - 4.3-16.20160708git7a1901d
c4e09dd
- bump to latest git
c4e09dd
- drop merged PR #524 patch
c4e09dd
c4e09dd
* Wed Jul 06 2016 Adam Williamson <awilliam@redhat.com> - 4.3-15.20160624gitfe19b00
c4e09dd
- include the whole of PR #524 to help fix multiple interactive mode issues
c4e09dd
c75b1b0
* Mon Jul 04 2016 Adam Williamson <awilliam@redhat.com> - 4.3-14.20160624gitfe19b00
c75b1b0
- fix worker crash on job cancel (#530) with a single commit from PR #524
c75b1b0
94ca9c1
* Tue Jun 28 2016 Adam Williamson <awilliam@redhat.com> - 4.3-13.20160624gitfe19b00
94ca9c1
- bump to latest upstream git, drop merged patches
94ca9c1
17a89ec
* Mon May 16 2016 Jitka Plesnikova <jplesnik@redhat.com> - 4.3-12.20160408gitff760a3
17a89ec
- Perl 5.24 rebuild
17a89ec
b2aa686
* Tue May 03 2016 Adam Williamson <awilliam@redhat.com> - 4.3-11.20160408gitff760a3
b2aa686
- update the upload_logs patch to the version merged upstream
b2aa686
3fc4814
* Fri Apr 29 2016 Adam Williamson <awilliam@redhat.com> - 4.3-10.20160408gitff760a3
3fc4814
- add an option to prevent test dying if upload_logs fails (PR #490)
3fc4814
6a1b496
* Tue Apr 26 2016 Adam Williamson <awilliam@redhat.com> - 4.3-9.20160408gitff760a3
6a1b496
- fix incorrect binary path in openvswitch service file (PR #487)
6a1b496
b278606
* Sat Apr 23 2016 Adam Williamson <awilliam@redhat.com> - 4.3-8.20160408gitff760a3
b278606
- rebuild against updated opencv
b278606
7f196d4
* Fri Apr 08 2016 Adam Williamson <awilliam@redhat.com> - 4.3-7.20160408gitff760a3
7f196d4
- bump to current git (to go along with openQA; patch load was getting huge)
7f196d4
d9603ff
* Thu Mar 31 2016 Adam Williamson <awilliam@redhat.com> - 4.3-6
d9603ff
- backport: allow needles to be in nested directories (jskladan)
d9603ff
218c0d7
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.3-5
218c0d7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
218c0d7
7f911b5
* Fri Jan 15 2016 Adam Williamson <awilliam@redhat.com> - 4.3-4
7f911b5
- simplify requires/provides excludes (thanks Zbigniew)
7f911b5
7f911b5
* Fri Jan 15 2016 Adam Williamson <awilliam@redhat.com> - 4.3-3
7f911b5
- add perl(:MODULE_COMPAT require
7f911b5
7f911b5
* Fri Jan 15 2016 Adam Williamson <awilliam@redhat.com> - 4.3-2
7f911b5
- exclude provides and requires from the private modules
7f911b5
7f911b5
* Thu Jan 14 2016 Adam Williamson <awilliam@redhat.com> - 4.3-1
7f911b5
- new release 4.3, drop patches merged upstream
7f911b5
- resync with upstream spec changes
7f911b5
- some package review cleanups
7f911b5
- fix 'format not a literal' errors in new snd2png (submitted upstream)
7f911b5
7f911b5
* Tue Dec 22 2015 Adam Williamson <awilliam@redhat.com> - 4.2.1-6
7f911b5
- changes requested in package review:
7f911b5
  + improve 'find and destroy' commands
7f911b5
  + drop tests/ directory (upstream did this too)
7f911b5
  + drop git dependency (seems to be ancient stuff)
7f911b5
  + use %%license
7f911b5
  + mark dbus config file as (noreplace)
7f911b5
  + 'Open vSwitch' not 'openvswitch' in summary/description
7f911b5
  + systemd snippets for openvswitch service
7f911b5
  + drop useless python scripts to avoid automatic python requirements
7f911b5
7f911b5
* Thu Dec 03 2015 Adam Williamson <awilliam@redhat.com> - 4.2.1-5
7f911b5
- fix a bug in the UEFI patch
7f911b5
7f911b5
* Thu Dec 03 2015 Adam Williamson <awilliam@redhat.com> - 4.2.1-4
7f911b5
- support Fedora UEFI firmware location (submitted upstream)
7f911b5
7f911b5
* Mon Nov  2 2015 Adam Williamson <awilliam@redhat.com> - 4.2.1-3
7f911b5
- tweak hardcoded path patch a little (upstream request)
7f911b5
7f911b5
* Sat Oct 24 2015 Adam Williamson <awilliam@redhat.com> - 4.2.1-2
7f911b5
- fix a hardcoded path which is incorrect on Fedora
7f911b5
7f911b5
* Thu Oct 15 2015 Adam Williamson <awilliam@redhat.com> - 4.2.1-1
7f911b5
- new release 4.2.1
7f911b5
- merge changes from upstream
7f911b5
7f911b5
* Thu Apr 23 2015 Adam Williamson <awilliam@redhat.com> - 4.1-1.20150423git24609047
7f911b5
- initial Fedora package, based on OBS package