Conditionally applying a patch based on a program's EVR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I want to conditionally apply a patch in a spec file based upon the
version of a package. (There's an emacs package that needs a patch to
work with the latest version of xemacs, but this patch shouldn't be
applied for previous versions of xemacs.) I know that for checking
something like Fedora version numbers I can use

%if 0%{?fedora} > 9
...
%endif

but is there an easy way to do this for a version number in say, EVR
form? That is, something like

%if %{program_version} > 1.2.3
...
%endif

(%{program_version} will always be defined)

RPM doesn't seem to support a mechanism like this in %if conditionals
(I believe having a digit first causes rpmbuild to try and interpret
the result as a number), though clearly there is a mechanism for
examining EVRs of this form for other parts of rpmbuild.

One could try something like

%if "%{prorgram_version}" > "1.2.3"

which does string comparison, but this doesn't work for some version
combinations, since, for example, we would want 1.10.1 > 1.9.1

- Alan

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux