Subject: Re: Ordering of variables in Makefile
To: grant beattie <grant@NetBSD.org>
From: Roland Illig <rillig@NetBSD.org>
List: tech-pkg
Date: 11/07/2005 23:06:26
grant beattie wrote:
> On Mon, Nov 07, 2005 at 02:22:33AM +0100, Roland Illig wrote:
> 
> 
>>See for example the misc/openoffice-bin package. It starts with defining
>>PKGNAME instead of DISTNAME, as DISTNAME highly depends on the
>>architecture. Should such a variable really be the one that is mandatory
>>for each package and mentioned at the top? I still prefer PKGNAME.
> 
> 
> it seems to me that more often than not, PKGNAME is derived from
> DISTNAME, not the other way around, so defining DISTNAME seems to be
> the right thing to do...

Of course it is. Back in 1997, this was the way it was done, and since 
1999 pkglint has required DISTNAME to be always defined. So it's no 
surprise that almost every package starts with DISTNAME and then derives 
PKGNAME from it.

I have generated some files that show how both variables are generated 
from each other:

ftp://ftp.netbsd.org/pub/pkgsrc/misc/rillig/pkg-from-dist-types
ftp://ftp.netbsd.org/pub/pkgsrc/misc/rillig/dist-from-pkg-types

The important thing is not the number of lines in each file, it's the 
complexity of the substitutions. Most of them are equally complicated in 
both directions. Some are simpler in one direction, some others are 
simpler in the other one.

Roland