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+

# Tests require perl-Test-Compile >= 1.1.0, currently only available
# on Fedora > 21 (and I'm guessing RHEL > 7)
%if 0%{?fedora} > 21 || 0%{?rhel} > 7
%global with_tests 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|testapi|OpenQA::Exceptions)
%{?perl_default_filter}

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

Name:           os-autoinst
Version:        %{github_version}
Release:        25%{?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
%if 0%{?with_tests}
# The OO interface to Test::Compile only appeared in 1.1.0
BuildRequires:  perl(Devel::Cover)
BuildRequires:  perl(Pod::Coverage)
BuildRequires:  perl(Test::Compile) >= 1.1.0
BuildRequires:  perl(Test::Fatal)
BuildRequires:  perl(Test::Output)
BuildRequires:  perl(Test::Pod)
BuildRequires:  perl(Test::MockModule)
%endif # with_tests
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
# 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(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)
BuildRequires:  %{t_requires}
Requires:       %{t_requires}
BuildRequires:  perl(Mojolicious)
Requires:       perl(Mojolicious) >= 5.60
# [note from openSUSE spec]:
# 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
Requires:       perl(JSON::XS)
#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

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

%install
%make_install INSTALLDIRS=vendor
# only internal stuff
rm %{buildroot}%{_libexecdir}/os-autoinst/tools/tidy
rm -r %{buildroot}%{_libexecdir}/os-autoinst/tools/lib/perlcritic
rm 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
%if 0%{?with_tests}
make check VERBOSE=1
%endif # with_tests

%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/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
* 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