openSUSE Lizards

Authors
Adam Jurkiewicz
Adrian Schröter (5)
Agustin Chavarria (1)
Akhil Laddha
Alex Barrios
Alex Minton
Alexander Naumov
Alexander Orlovskyy (3)
Alexey Eromenko
Alin M Elena (4)
Andrea Florio (14)
Andreas Jaeger (44)
Andreas Stieger (1)
Andreas van dem Helge
Andrej Semen
Andrew Wafaa (25)
Arvin Schnell (6)
Beineri2
Bernhard Wiedemann
Bharath Acharya
Bonnie Kurniawan
Brian G. Merrell
Bruno Friedmann
Carl Fletcher
Casual Programmer
Chang ChiaChin
Christoph Thiel
Christopher Hobbs (15)
Ciaran Farrell (2)
Claes Backstrom
Coly Li
Cristian Rodríguez
Daniel Bornkessel
David Bailey
David C. Rankin
Dean Hilkewich
Dinar Valeev (5)
Dirk Müller (1)
Dmitry Serpokryl (7)
Duncan Mac-Vicar
Enrique Herrera Noya
Eugene Pivnev
FabioMux (1)
Federico Lucifredi
Frank Lee
Gabriele Mohr
Gerrit Beine
Helman Rene Taleno Martinez
Helmut Schaa
Henne (6)
Herbert Graeber
Holgi (2)
Hubert Mantel (1)
Ioan Vancea
J. Daniel Schmidt (1)
Jaime Andrés Vélez Osorio
James Tremblay (7)
Jan Blunck (4)
Jan Loeser (1)
Jan Madsen (1)
Jan Nieuwenhuizen
Jan-Christoph Bornschlegel (3)
Jan-Simon Möller (19)
Javier Llorente (2)
Jigish Gohil (22)
Jiri Srain (1)
Jiří Suchomel (1)
Johan Kotze (5)
John Terpstra
Joop Boonen
José Oramas
Josef Reidinger (8)
Juergen Weigert (1)
Julio Vannini (7)
Justin Haygood
Kálmán Kéménczy
Kayo Hamid
Kevin Yeaux (10)
Klaas Freitag (21)
Klara Cihlarova
Klaus Kämpf
Klaus Singvogel
kl_eisbaer (10)
Lars Marowsky-Bree
Li Bin
Ludwig Nussel (6)
M. Edward (Ed) Borasky
M. Edwin Zakaria
M. Hill
Manuel Trujillo
Marcos David
Marcus Hüwe (8)
Marcus Meissner (1)
Marcus Moeller (1)
Marcus Schaefer (3)
Martin Lasarsch (8)
Martin Mohring (8)
Martin Schmiderer
Martin Schmidkunz
Masim "Vavai" Sugianto (20)
Matt Sealey
Mauro Parra-Miranda
Michael Andres (1)
Michael Löffler (3)
Michael Skiba
Michal Marek (3)
Michal Vyskocil (9)
Michal Zugec
Miguel Angel Barajas Hernandez
Mingxi Wu
mrdocs
Nikanth Karthikesan (2)
Oprea Lucian
Oswin Zulu
Peter Nixon
Peter Pöml (4)
Petr Mladek (32)
Petr Uzel (2)
Philipp Thomas
Pragnesh Radadiya
Raul Libório
Ravi Kumar
Ray Chen
Ray Wang (1)
Renato de Pontes Pereira
Ricardo Chung
Ricardo Varas Santana (6)
Richard Bos (5)
Robert Lihm
Roland Haidl
Roman Drahtmueller
Rossana Motta (1)
Rupert Horstkötter (10)
Sascha Manns (45)
Savin Alex V.
Sebastian Schöbinger (4)
Stanislav Visnovsky (7)
Stefan Haas (1)
Stefan Hundhammer (5)
Stefan Schubert (3)
Steffen Winterfeldt (4)
Stephan Kulow (10)
Suman Manjunath
Suresh Jayaraman (1)
Susanne Oberhauser (2)
Syamsul Qamar Ngabito
Thomas Göttlicher (4)
Thomas Jones
Thomas Schraitle (15)
Thruth Wang
Tuukka (11)
Ulrich Hecht
Vincenzo Barranco
Wilken Gottwalt
Will Stephenson (1)
Xin Wei Hu
Yuri Tsarev





 

Conditional features aka “use flags”

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 3.75 out of 5)
Loading ... Loading ...
Friday, September 12th, 2008 by Ludwig Nussel Digg!

In a coordinated effort with Manfred Tremmel, the xine maintainer at Packman, we’ve reworked the xine spec file. Most of it can now be shared between Packman and openSUSE Factory so packaging work doesn’t need to be duplicated. The spec file now makes heavy use of conditional build macros to enable or disable certain features.
For openSUSE we do not want to (or can’t) ship certain features. For example we decided that the arts plugin isn’t of much use and therefore only adds an unecessary build dependeny on openSUSE. Packman however wants to offer all featues and therefore ship the arts plugin. To resolve that conflict the arts plugin ended up in it’s own subpackage but buidling it is disabled by default. To enable arts support locally Manfred can call rpmbuild (or the openSUSE build script) with the parameters “–with arts” . It’s not necessary to edit the spec file anymore. That –with switch works because the spec file uses some rpm macros that change things depending on whether arts support was requested. Hopefully other packages that can be built with different features but need to be shipped on openSUSE with a certain configuration will pick up this mechanism too. So let’s explain how it works.

The spec file starts with %bcond_with arts
at the top. That basically tells rpmbuild to define a global macro “with_arts” if “–with arts” was specified. Later we have
%if %{with arts}
BuildRequires: arts-devel
%endif

That means we depend on arts-devel only if requested. Similar blocks are used to enable or disable the subpackage, files section etc.

Other features like e.g. pulseaudio are enabled by default but allow disabling using e.g. “rpmbuild –without pulseaudio”. The macro to get that behavior is “%bcond_without pulseaudio”.

So how to make use of that in the build service?

Let’s assume you have a project “artsfans” where you compile packages without pulseaudio but with arts support and want a xine-lib that matches this configuration. First you need to modify your project config and define macros that disable pulseaudio and enable arts. Run meta prjconf artsfans -e and enter the following:
%define _without_pulseaudio 1
%define _with_arts 1
Macros:
%_without_pulseaudio 1
%_with_arts 1

Then link xine-lib from Factory into your project:
osc linkpac openSUSE:Factory xine-lib artsfans and watch your xine building with arts support. Piece of cake, isn’t it? :)


2 Comments

Comment by Marek Stopka
2008-09-13 10:28:30

Really, really nice. :-)

 
Comment by Pascal Bleser
2008-09-14 10:14:39

Yeah, very useful, but it has been there for a very long time ;)

Might be helpful to define canonical macros for the Build Service (yes, I know, there’s %opensuse_bs), for Factory (I mean packages that supposedly go into the distribution) and for Packman (as well as other 3rd party repositories) in order to share spec files.

Let’s have %opensuse_bs, %opensuse_dist and %packman… but OTOH it might be even better to have it on “features” instead;
%define _with_uncrippled 1
in Packman, videolan, …

 

Sorry, the comment form is closed at this time.