# 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|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 ff760a31dbdd8a96bd92683bd5ff45633ee149cd # if set, will be a post-release snapshot build, otherwise a 'normal' build %global github_date 20160408 %global shortcommit %(c=%{github_commit}; echo ${c:0:7}) Name: os-autoinst Version: %{github_version} Release: 10%{?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 # Fix a hardcoding of libexecdir in the openvswitch service file # https://github.com/os-autoinst/os-autoinst/pull/487 Patch0: 0001-don-t-hardcode-libexecdir-in-openvswitch-service-fil.patch # Add an option to prevent test dying if upload_logs fails # https://github.com/os-autoinst/os-autoinst/pull/490 Patch1: 0001-add-an-option-to-upload_logs-to-avoid-dying-on-failu.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++ BuildRequires: libtool BuildRequires: opencv-devel 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(Pod::Coverage) BuildRequires: perl(Test::Compile) >= 1.1.0 BuildRequires: perl(Test::Fatal) BuildRequires: perl(Test::Output) BuildRequires: perl(Test::Pod) %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 # 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/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 * Fri Apr 29 2016 Adam Williamson - 4.3-10.20160408gitff760a3 - add an option to prevent test dying if upload_logs fails (PR #490) * Tue Apr 26 2016 Adam Williamson - 4.3-9.20160408gitff760a3 - fix incorrect binary path in openvswitch service file (PR #487) * Sat Apr 23 2016 Adam Williamson - 4.3-8.20160408gitff760a3 - rebuild against updated opencv * Fri Apr 08 2016 Adam Williamson - 4.3-7.20160408gitff760a3 - bump to current git (to go along with openQA; patch load was getting huge) * Thu Mar 31 2016 Adam Williamson - 4.3-6 - backport: allow needles to be in nested directories (jskladan) * Thu Feb 04 2016 Fedora Release Engineering - 4.3-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Fri Jan 15 2016 Adam Williamson - 4.3-4 - simplify requires/provides excludes (thanks Zbigniew) * Fri Jan 15 2016 Adam Williamson - 4.3-3 - add perl(:MODULE_COMPAT require * Fri Jan 15 2016 Adam Williamson - 4.3-2 - exclude provides and requires from the private modules * Thu Jan 14 2016 Adam Williamson - 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 - 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 - 4.2.1-5 - fix a bug in the UEFI patch * Thu Dec 03 2015 Adam Williamson - 4.2.1-4 - support Fedora UEFI firmware location (submitted upstream) * Mon Nov 2 2015 Adam Williamson - 4.2.1-3 - tweak hardcoded path patch a little (upstream request) * Sat Oct 24 2015 Adam Williamson - 4.2.1-2 - fix a hardcoded path which is incorrect on Fedora * Thu Oct 15 2015 Adam Williamson - 4.2.1-1 - new release 4.2.1 - merge changes from upstream * Thu Apr 23 2015 Adam Williamson - 4.1-1.20150423git24609047 - initial Fedora package, based on OBS package