Subject: Re: how can a package detect it is getting built with pkgsrc?
To: Klaus Heinz <>
From: Jeremy C. Reed <>
List: tech-pkg
Date: 04/11/2007 23:06:25
On Thu, 12 Apr 2007, Klaus Heinz wrote:

> is there a way to reliable detect that a package is getting built with
> pkgsrc?
> Sometimes you can detect the OS by testing for files like
> /etc/redhat-release or using "uname" but since pkgsrc can be used on
> many different systems this is not sufficient.
> How about introducing ${LOCALBASE}/{etc,share}/.using_pkgsrc and defining an
> environment variable like PKG_USING_PKGSRC during the package build?

Building from pkgsrc has two unique make variables: PKGMANDIR and 
PKG_SYSCONFDIR. Maybe check if they exist?

I am curious: what do you need this for?

  Jeremy C. Reed