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

Kevin Kofler kevin.kofler at
Thu Jun 2 22:06:20 UTC 2011

Neal Becker wrote:
> How can I apply a patch only if the version of a dependency is < x?

I generally do something like:

%if 0%{?fedora} > NN
%global have_foo_MMM 1

%if 0%{?have_foo_MMM}
BuildRequires: foo-devel >= MMM
BuildRequires: foo-devel < MMM


%if 0%{?have_foo_MMM}
%patchPPP -p1 -b .fooMMM

        Kevin Kofler

More information about the devel mailing list