patch only if dependent version < x? (rpm spec)

Mattias Ellert mattias.ellert at fysast.uu.se
Tue Jun 7 08:52:42 UTC 2011


fre 2011-06-03 klockan 07:19 -0400 skrev Neal Becker:
> > 
> 
> So it is ultimately conditioned on fedora version, not foo-devel version.
> 
> OK.
> 
> It seems more direct to condition on foo-devel version.  Is that unreasonable?  
> Or just too difficult?

You can do it on the version of the software. If it has a pkg-config
file you can do something like this (taken from an existing specfile in
Fedora):

%prep
%setup -q
%if %(pkg-config --max-version 2.1.2 ftgl 2>/dev/null && echo 1 || echo 0)
%patch0 -p1
%endif
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1

	Mattias

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5734 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20110607/da431135/attachment-0001.bin 


More information about the devel mailing list