RFC: spec preprocessor

Artur Frysiak wiget at pld.org.pl
Tue May 20 14:59:32 CEST 2003

W liście z wto, 20-05-2003, godz. 10:56, Jakub Bogusz pisze: 
> On Tue, May 20, 2003 at 10:36:51AM +0200, Artur Frysiak wrote:
> > > Maybe implementing %ifdef and %ifndef (to be used instead of
> > > 0%{?...:1} and 0%{!?...:1}) would be worth... but it would make many
> > > specs incompatible with rpm from Ra :/
> > 
> > %ifdef and %ifndef .... hmm, look in rpm-list archive for jbj
> > proposition about implementing it as macro (with sample implementation).
> Is the archive accessible to non-members?

Sorry, its members only.
>From archive:

%define defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
%define undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}}

%define ifdef() %if %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
%define ifndef() %if %{expand:%%{?%{1}:0}%%{!?%{1}:1}}

And additionaly (by me, not tested yet):
%define ifwith() %if %{expand:%%{?_with_%{1}:1}0}
%define ifwithout() %if %{expand:%%{?_without_%{1}:1}0}

Artur Frysiak <wiget at pld.org.pl>

More information about the pld-devel-en mailing list