Summary: Kyua - ATF compatibility tools
Name: kyua-atf-compat
Version: 0.2
Release: 1%{?dist}
License: BSD
Group: Development/Tools
URL: http://code.google.com/p/kyua/
Source0: http://kyua.googlecode.com/files/%{name}-%{version}.tar.gz
Source1: README.Fedora
BuildArch: noarch
BuildRequires: kyua-cli >= 0.5
BuildRequires: libatf-sh-devel >= 0.15
Requires: kyua-cli >= 0.5

%define _testsdir %{_libexecdir}/kyua-atf-compat/tests

%description
Kyua (pronounced Q.A.) is a testing framework for both developers and
users.  Kyua is different from most other testing frameworks in that it
puts the end user experience before anything else.  There are multiple
reasons for users to run the tests themselves, and Kyua ensures that
they can do so in the most convenient way.

This module, kyua-atf-compat, provides tools to ease the transition from
ATF to Kyua.  In particular, this includes is a tool to convert Atffile
files to Kyuafile files in an automated manner, and drop-in replacement
wrappers for atf-run and atf-report.

%prep
%setup -q

# Put the README.Fedora file in the top-level directory of the source tree so
# that the doc macro call below can pick it up.
cp -p %{SOURCE1} README.Fedora

%build
%configure INSTALL="/usr/bin/install -p"
make %{?_smp_mflags} pkgtestsdir=%{_testsdir} testsdir=%{_testsdir}

%check
# The check stage runs the tests using Kyua itself and Kyua accesses the home
# directory to store logs and the database.  Override HOME to a known value to
# ensure these files get discarded.
HOME=$(pwd)/check make check pkgtestsdir=%{_testsdir} testsdir=%{_testsdir}

%install
make install DESTDIR=%{buildroot} doc_DATA= \
             pkgtestsdir=%{_testsdir} testsdir=%{_testsdir}

%files
%doc AUTHORS COPYING NEWS README
%{_bindir}/*
%{_datadir}/kyua-atf-compat
%{_mandir}/man1/*

%package tests
Summary: Run-time tests of the Kyua-based ATF compatibility tools
Requires: %{name} = %{version}-%{release}
Requires: libatf-sh >= 0.15

%description tests
This package installs the run-time tests for the Kyua-based ATF compatibility
tools.  Please see the README.Fedora file in the documentation directory for
further details on how to run the installed tests.

%files tests
%doc README.Fedora
%{_testsdir}

%changelog
* Sat Dec 28 2013 Julio Merino <jmmv@google.com> 0.2-1
- Initial version of the package.
