[packagers] noob help needed with %{dist}

Dag Wieers dag at wieers.com
Fri May 4 13:58:11 CEST 2007


On Fri, 4 May 2007, Martin Hamant wrote:

> Le Fri, 4 May 2007 11:25:59 +0200 (CEST)
> Dag Wieers <dag at wieers.com> écrivait:
> 
> > On Fri, 4 May 2007, Martin Hamant wrote:
> > 
> > > I don't understand how does it works. My target is to make a RPM
> > > (for private use) that could be built on different distro, and so i
> > > have questions:
> > > 
> > > - Is %{dist} internally defined by RPM engine (seems not! I tried
> > > some echo %{dist}... ) , or do I need a special macro to get it
> > > defined before the build ?
> > 
> > We update the SPEC file for each build. So the disttag is added to
> > the Release tag before building.
> 
> You mean that you use a temporary spec file, a parsed copy of the
> original one in which you append the disttag on the Release line just
> before building it ?

Correct.


> > > - I know rpmforge packagers use %{dist} to dynamically name their
> > > package (in release) : Why can't i see any {%dist} references in
> > > specfiles ?
> > 
> > Our buildsystem provides the dist macro when building, like:
> > 
> > 	--define "dist el4"
> > 
> > If it would be hardcoded in the SPEC file, there would not be an
> > advantage to have a macro.
> > 
> > Beware though, we invented the %{dist} macro, but sadly Fedora took
> > the idea and used it in an incompatible manner. Fedora defines the
> > dist macro as being '.fc6' or '.el5'. While we defined it as being
> > 'fc6' and 'el5.
> > 
> > The reason for this is that we use the dist macro to have
> > conditionals in the SPEC file that allows us to build from the same
> > SPEC file. Fedora however uses the dist macro only for tagging the
> > Release.
> > 
> > Sadly, both uses are not compatible.
> 
> Yes, I read that on
> http://fedoraproject.org/wiki/Packaging/DistTag?action=show&redirect=DistTag
> 
> more sadly, they don't specify how they feed the tag value ... or I
> don't understand what they mean by "When you run make tag or make
> build the values for %{dist} and its helper variables are assigned
> according to the cvs branch that you are working in. You do NOT need to
> define these variables in your spec file."
> 
> Thank you for the --define tip, I will use that !

I guess that is what Fedora is doing as well. The only difference is the 
dot (and how they use it).


> :) I have more question about the way you use SVN with your build
> system... but that's off-topic ; maybe I could open another thread about
> it if you're ok ?

Sure, I'm interested in feedback and we're looking for people to help out 
as well.

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 packagers mailing list