2013-05-02 18:12:32

Tito and Software Collections

Build package in Software Collection using Tito

Definition

Tito (github)
is tool to easy building and releasing projects in rpm packages.
Software Collection (wiki, guide)
is way how to have multiple versions of software in one distribution. For example: in RHEL6 is Ruby 1.8, which you want to preserve there, but for some reason you want to have on same machine Ruby 1.9 as well.

Prerequisites

I will assume that you have spec file that works with Ruby 1.9 on Fedora 18 and you want to build it in software collection (SCL) for RHEL6.

You will need to have installed package scl-utils-build. It is available in both Fedora and in Red Hat Enterprise Linux (in "Red Hat Developer Toolset for RHEL X" channel).

How To

If you do not want to convert spec by hand, I recommend you to install spec2scl package and run:

  spec2scl -i foo.spec

and you are done.

If you are building package into SCL using rpmbuild, you have to have installed meta package or specify the scl definition manually. If you are using Tito it is not needed.

With Tito (since version 0.4.12) when you specify:

  tito build --rpm

or

  tito build --srpm

it will always build non-SCL package. Even if you have meta package installed. Technically Tito will always undefine %scl macro.

If you want to build package for SCL you can define it on command line.

  tito build --rpm --scl=ruby193

or

  tito build --srpm --scl=ruby193

and it will build package for SCL. Even if you do not have meta package installed. Note: ruby193 is name of the collection here.

This works for local builds. But if you are e.g. KojiReleaser and you have defined in releaser.conf

[koji]
releaser = tito.release.KojiReleaser
autobuild_tags = katello-nightly-rhel6 katello-nightly-fedora18

while in tito.props:

[katello-nightly-rhel6]
disttag = .el6
blacklist =

[katello-nightly-fedora18]
disttag = .fc18
blacklist =

and when you run:

  tito release koji

you are simultaneously releasing el6 and fc18 version. But with SCL in place you want to build one srpm with SCL enable and one srpm with SCL disabled.

The solution is to add scl option to rhel6 tag:

[katello-nightly-rhel6]
disttag = .el6
blacklist =
scl = ruby193

[katello-nightly-fedora18]
disttag = .fc18
blacklist =

This will prepare SCL enabled srpm for el6 and regular package for fc18 and send them to Koji. Note that you still have to have Koji or Mock prepared for SCL.


Posted by Miroslav Suchý | Permanent link
Comments
comments powered by Disqus