Subject: Using BSD-style Makefiles & pkgsrc
To: None <netbsd-users@netbsd.org>
From: Peter Bex <Peter.Bex@student.kun.nl>
List: netbsd-users
Date: 11/03/2004 15:32:55
--VS++wcV0S1rZb1Fb
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 Makefile.inc:

PREFIX?=3D	/usr/local

DESTDIR?=3D	${PREFIX}
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 (=
or
isn't even possible)?

Bozohttpd for example (http://www.eterna.com.au/bozohttpd) 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.

Regards,
Peter
--=20
http://www.student.kun.nl/peter.bex
--
"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

--VS++wcV0S1rZb1Fb
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (NetBSD)

iD8DBQFBiOwXLg33BXzVMqsRAlkJAJ9JlBHOYddp5P82teKDm1ERBjshoACgxQOh
OIGxC/jYhH/+QpeD1HQyoSA=
=N2H0
-----END PGP SIGNATURE-----

--VS++wcV0S1rZb1Fb--