From Fedora Project Wiki

fp-wiki>ImportUser
(Imported from MoinMoin)
 
m (PackagingDrafts/ExtraDistTagConditionalMacros moved to Archive:PackagingDrafts/ExtraDistTagConditionalMacros: (no revisions since import from MoinMoin May 2008) Appears to already be applied to Packaging:DistTag#Conditionals)
 
(2 intermediate revisions by 2 users not shown)
Line 42: Line 42:
%endif
%endif
</pre>
</pre>
[[Category:Archived packaging guideline drafts]]

Latest revision as of 21:16, 21 February 2009

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