Macros available in Fedora but not RHEL <= 4: Create epel-rpm-config?

Dag Wieers dag at wieers.com
Tue Mar 20 15:00:04 UTC 2007


On Tue, 20 Mar 2007, Patrice Dumas wrote:

> On Tue, Mar 20, 2007 at 03:24:18PM +0100, Dag Wieers wrote:
> > 
> > Also, would it be possible to have macros per distribution like RPMforge 
> > is doing ?
> > 
> > So that something like this becomes possible:
> > 
> >   %{?el3:%define _without_alsa 1}
> > 
> >   %{!?_without_alsa:BuildRequires: alsa-lib-devel}
> > 
> > I understand this is another item that may cause a fierce battle between 
> > proponents and opponents. It makes it much shorter and less obtrusive to 
> > use these macros.
> 
> Unless I'm wrong this is already accepted and used. See 
> http://fedoraproject.org/wiki/Packaging/DistTag?action=show&redirect=DistTag#head-1c550109af0705ccb71329619b99428af2fd3e25
> 
> Or is it something else that you have in mind?

Yes, this is something different. Our use of %dist predates Fedora's 
standard. What we generally do in this context is set:

	%{?dist: %{expand: %%define %dist 1}}

What matthias does to map Fedora's %fedora macro to what we use, he adds:

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

So that if fedora is set to 7, the following macro is set:

	%define fc7 1

In RPMforge %dist is set to either fcX or elY, _and_ a macro fcX or elY is 
set to 1 so that the above becomes possible. That way one does not have to 
use %if and %endif and makes things straight forward.

Fedora is using a dot in the dist-tag, which makes the above not work.

What currently is possible with the standard in the URL you gave me is to 
make a distinction by using the existence of the fedora or rhel macro, or 
use %if's to specify something else. Which makes it very hard to define 
what capabilities each distribution has and use the capability where it is 
required.

So while you can do:

	%{?rhel: }

you cannot do:

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

and have to do something like:

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

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

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

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

Plus, you can't do these inline.

Kind regards,
--   dag wieers,  dag at wieers.com,  http://dag.wieers.com/   --
[all I want is a warm bed and a kind word and unlimited power]




More information about the epel-devel-list mailing list