[Fedora-packaging] Re: Macro question for rpm gurus

Enrico Scholz enrico.scholz at informatik.tu-chemnitz.de
Mon May 4 09:53:55 UTC 2009


Gagadget <gagadget at gmail.com> writes:

> %define VERSION 9.6.0
> %define PATCHVER 1
> [ ... ]
> %if %{PATCHVER}
> Source0:
> ftp://ftp.isc.org/isc/bind9/%{VERSION}-P%{PATCHVER}/bind-%{VERSION}-P%{PATCHVER}.tar.gz
> %else
> Source0:
> ftp://ftp.isc.org/isc/bind9/%{VERSION}/bind-%{VERSION}.tar.gz
> %endif
>
> It works, but I'd like to know if there is a more recursive way to avoid
> if/else ? Using "?" macro or something like that ?

%global XVER      %VERSION%{?PATCHVER:-P%PATCHVER}
Source0:          ftp://ftp.isc.org/isc/bind9/%XVER/bind-%XVER.tar.gz

and do not define 'PATCHVER 0'


Enrico




More information about the Fedora-packaging mailing list