Subject: Re: OWN_DIRS and PKG_CONFIG
To: None <tech-pkg@NetBSD.org>
From: Johnny C. Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 07/31/2004 20:18:38
On Sat, Jul 31, 2004 at 09:00:52PM +0200, Klaus Heinz wrote:
> 
> some time ago I switched to using OWN_DIRS in mail/spamassassin to create 
> some directories under /usr/pkg/share/. But it seems I cannot I rely on
> their existence because PKG_CONFIG=no turns off the creation of those
> directories. As a consequence install targets in the package Makefile
> as well as the PLIST are not correct.
> 
> Is this really the intended behaviour of PKG_CONFIG? If yes, then
> OWN_DIRS is not really useful to me and I will have to create the
> directories in the package Makefile again. In this case I wonder when
> OWN_DIRS/MAKE_DIRS should be used at all.
> 
> Or did I misunderstand the purpose of OWN_DIRS completely?

Your understanding of how PKG_CONFIG works is correct.  OWN_DIRS/MAKE_DIRS
is useful for directories where it's acceptable whether we create them
in the INSTALL script or we ask the user to create them for us before
using the package.  This is typically directories under /var, or
subdirectories of ${PKG_SYSCONFDIR}.

I took a look at mail/spamassassin/Makefile, and instead of:

	OWN_DIRS+= ${EGDIR} ${DOCDIR} ${DOCDIR}/spamd ${HTMLDIR}

you can replace that with:

	INSTALLATION_DIRS= ${EGDIR} ${DOCDIR} ${DOCDIR}/spamd ${HTMLDIR}

INSTALLATION_DIRS is an efficient way to pre-create directories for
you during do-install before descending into ${WRKSRC} and running
"make install".  You are still responsible for adding the appropriate
@dirrm lines in the PLIST if you use this.

	Cheers,

	-- Johnny Lam <jlam@NetBSD.org>