Subject: Re: Package naming and major versions [was Re: CVS commit: pkgsrc/devel/gal20]
To: Alistair Crooks <>
From: Johnny C. Lam <>
List: tech-pkg
Date: 10/04/2004 21:40:40
On Mon, Oct 04, 2004 at 09:47:45PM +0100, Alistair Crooks wrote:
> One thing that we could look at doing is to have a parent directory
> ""-style file, similar to those in src/, which would
> provide a common way of defining _PKGSRCDIR, and include
> appropriately.

What I had in mind was to create files (great minds think
alike, eh, Al?) in all package category directories ("subordinate"
catagories included) that just contain the lines:

	.if exists("../")
	.  include "../"

And then at the top level pkgsrc directory, add a that
looks like:

	# Calculate depth
	.if !defined(_PKGSRC_TOPDIR)
	.  if exists(${.CURDIR}/../../../../mk/
	_PKGSRC_TOPDIR=	${.CURDIR}/../../../..
	.  elif exists(${.CURDIR}/../../../mk/
	_PKGSRC_TOPDIR=	${.CURDIR}/../../..
	.  elif exists(${.CURDIR}/../../mk/
	.  elif exists(${.CURDIR}/../mk/
	.  elif exists(${.CURDIR}/mk/
	.  endif

	.if !defined(PKGSRCDIR)

We could do some sort of autodetection of the path to the pwd executable
by searching for "pwd" in the PATH environment variable if that proves
necessary.  These changes have no impact on the existing package

The next step would be to modify each package Makefile to include
"../" at the top of the Makefile, and to change all
references for including other files from starting with "../.." to
starting with "${PKGSRCDIR}", e.g., change:

	.include "../../devel/gettext-lib/"
	.include "../../mk/"
	.include "../../mk/"


	.include "${PKGSRCDIR}/devel/gettext-lib/"
	.include "${PKGSRCDIR}/mk/"
	.include "${PKGSRCDIR}/mk/"

It's a very simple, mechanical set of changes.  If we approve this
plan of attack, then it's very simple to crank out and commit all of
these changes in one go.


	-- Johnny Lam <>