Subject: Re: pkgsrc & DEPENDS
To: Wayne Cuddy <>
From: Frederick Bruckman <>
List: tech-pkg
Date: 12/19/2001 10:29:23
[Please direct followups to tech-pkg, which I'm cc'ing, as package
construction issues are outside the charter of netbsd-help.]

On Wed, 19 Dec 2001, Wayne Cuddy wrote:

> On Wed, Dec 19, 2001 at 01:45:24PM +0900, Masao Uebayashi wrote:
> > > I am building some packages and have read the Packages.txt and
> > > packages(7) man pages.  I have a package that depends on one package OR
> > > another.  What is the syntax to express this using the DEPENDS macros
> > > in the NetBSD package system?
> >
> >   .if some_confition
> >   DEPENDS+=     one-1.2.3../../foo/one
> >   .else
> >   DEPENDS+=     another-4.5.6:../../bar/another
> >   .endif
> Forgive my ignorance, I am not extactly sure how this helps me, how would I do
> something like:
> DEPENDS+=	pkg-1.2|pkg-2.0

You could use wildcards, as

DEPENDS+=	pkg-{1.2,2.0}:../../cat/pkg

or more simply put

DEPENDS+=	pkg>=1.2:../../cat/pkg

You could even depend on two different packages, as

DEPENDS+=	{pkg_a-1.2,pkg_b-2.0}:../../cat/pkg_a

but think carefully before doing something like that. If eitherof the
two packages depend on, different packages, the sub-dependencies of the
package actually built against will get encoded in the binary package,
which probably isn't what you want. That last is probably only a good
idea if "pkg_a" was just renamed to "pkg_b", and maybe not even then.