From Fedora Project Wiki

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Purpose: There are some additional macros for DistTag that make it much easier to conditionalize inside of spec files.

Specifically, I propose that the following helper macros be added and the DistTag documentation updated accordingly:


%{?fedora: %{expand: %%define fc%{fedora} 1}}
%{?rhel: %{expand: %%define el%{rhel} 1}}

This means that if %{fedora} is set to 7, the following macro is set:

%define fc7 1

This permits easier conditionalization in spec files. For example, with these defines, you can do:

%{?el5: a}
%{?el4: b}
%{?el3: c}
%{?el2: d}

Without these macros, you have to resort to:

%if "%rhel" == "5"
a
%endif

%if "%rhel" == "4"
b
%endif

%if "%rhel" == "3"
c
%endif

%if "%rhel" == "2"
d
%endif