Re: SPEC file question

Matthias Saou <thias@spam.spam.spam.spam.spam.spam.spam.egg.and.spam.freshrpms.net>
Newsgroups gmane.linux.freshrpms.user,gmane.spam.detected
Message-ID <20051215115347.57fdb3db@python2>
Kevin DeKorte wrote :

> So this goes back to my original questions
> 
> 1. Can I use a single BuildRequires to specify packages on an 'or'
> condition and how would I phrase that?
> 
> 2. If the defines are there can I use them to specify different
> BuildRequires?

If what Rex said is true for the mock you are using (which is possible, I
modified the config a lot so I don't really remember the defaults), then
the macros might already be defined for you to use like this :

-- snip --

# Make the default if no "fedora" is defined, the behavior for FC4
%{!?fedora: %define fedora 4}

%if %{fedora} == 5
BuildRequires: libX11-devel etc.
%else
BuildRequires: xorg-x11-devel
%endif

-- snip --

Of course, this is always a bit tricky as there is no "%elseif" type of
statement, and you should always make sure that the default case is
handled nicely (i.e. that someone rebuilding without mach/mock will have
it work too). Here it'll get more complicated once more than one FC
release will have the modular X packages.

In this case, mock (with the Fedora Extras type of defines) should do the
right thing, and people building with mach or rpmbuild can just pass
"--define 'fedora 5'" in order to get the new modular X requirements. If
you want to default to the modular X requirements if no "fedora" is
defined, just change the "4" above to "5" and you're done.

> As for mach, I was never able to get it to build things for me.. maybe
> the newer versions work now.

They work much better, yes, and since it can now use mach too, things are
much smoother.

HTH,
Matthias

-- 
Clean custom Red Hat Linux rpm packages : http://freshrpms.net/
Fedora Core release 4 (Stentz) - Linux kernel 2.6.14-1.1644_FC4
Load : 0.04 0.24 0.29
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.