Subject: Using BSD-style Makefiles & pkgsrc
To: None <>
From: Peter Bex <>
List: netbsd-users
Date: 11/03/2004 15:32:55
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello all,

I'm writing a portable program with BSD-style Makefiles (I believe pmake
is available for Non-BSD Unixen, which can deal with these Makefiles).
When the program's finished, its source can be downloaded from a site as
tarball and installed to /usr/local for example, but it should also work
from pkgsrc, preferably without patches.

How would I go about to make the installation work out-of-the-box on pkgsrc
and non-pkgsrc systems?

For example, I know pkgsrc sets PREFIX and with DESTDIR I can control where
BSD-style Makefiles see the `root' for installation (although it expects
that there is a /usr dir, which isn't under /usr/local usually), so I
currently have something that looks like this in

PREFIX?=3D	/usr/local

LIBDIR?=3D	/lib
BINDIR?=3D	/bin

This appears to work outside pkgsrc.  I haven't checked that it also works
from pkgsrc yet, but I think it should.  It feels like I'm abusing these
variables, though.  I haven't yet found another program which does this.

Is this the correct way to do this or is this something I should not want (=
isn't even possible)?

Bozohttpd for example ( doesn't really
do anything to support installing under /usr/local, and it seems to
`just work' from pkgsrc.  IMHO installing straight-from-source builds
to /usr isn't a very good idea.

"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
							-- Donald Knuth

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.4 (NetBSD)