Please note that this kind of packages are not yet used in testing and the test packaging guidelines are subject to change.
This page describes an example RPM spec file used to create RPM packages that are used in automated testing.
The fist part of the spec file describes the general information about the software being packaged.
Name: someapp Version: 1.0 Release: 1% Summary: Someapp summary Group: programming License: gpl URL: http://www.meego.com Source0: %{name}_%{version}.tar.gz BuildRoot: %(mktemp -ud %{_tmppath}/%{name}_%{version}-%{release}-root} BuildRequires: libsomething-devel Requires: libsomething %description Long description of the package in multiple lines.
The second part describes the packages that are created from the sources. The important part for test automation's point of view is in the someapp-test package definition. We are using RPM Provides definitions to tell OTS what level of testing the package is intended for.
%package someapp Summary: Short summary Requires: libsomething %description someapp Long description of the package in multiple lines. %package doc Summary: Someapp documentation %description doc Long description of the package in multiple lines. %package tests Provides: OTS-Packages(someapp) Provides: OTS-Stage(staging) Provides: OTS-Stage(acceptance) Summary: testrunner-lite tests Requires: eat, someapp %description tests Long description of the package in multiple lines.
The specified provides have the following meaning:
OTS-Packages([package name]) Tells OTS what package(s) the tests are run against.
OTS-Stage([stage]) Tells OTS what stage of automated testing the tests are run.
The last part of the spec file describes how to build the software, what files to install to packages and the changelog. The most important part of this is where to install the Test Plan Definition XML.
%prep
%setup -q -n %{name}-%{version}
%build
qmake-qt4 someapp.pro PREFIX=/usr DESTDIR=$RPM_BUILD_ROOT
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc
%{_bindir}/someapp
%{_mandir}/man1/someapp.1*
%files doc
%defattr(-,root,root,-)
%{_datadir}/doc/someapp/html/*
%files tests
%defattr(-,root,root,-)
# tests.xml needs to be in /usr/share/<package>-tests/
%{_datadir}/someapp-tests/tests.xml
%{_libdir}/someapp-tests/*
%changelog
* Wed Apr 21 2010 Some one <some.one@...> 1.0
- Initial RPM test packaging
For more detailed information on creating RPM packages for MeeGo see Packaging