Subject: Re: CHECK_FILES=yes and CHECK_FILES_SKIP
To: Martti Kuparinen <martti.kuparinen@iki.fi>
From: Johnny C. Lam <jlam@pkgsrc.org>
List: tech-pkg
Date: 11/14/2005 09:42:26
On Fri, Oct 28, 2005 at 04:23:59PM +0200, Martti Kuparinen wrote:
> 
> Any ideas what this means?
> 
> ===> Registering installation for squirrelmail-1.4.5nb1
> squirrelmail-1.4.5nb1 requires installed package perl-5.8.7nb4
> squirrelmail-1.4.5nb1 requires installed package php-gettext-4.4.0
> ===> Checking for work-directory references in squirrelmail-1.4.5nb1
> ===> Checking file-check results for squirrelmail-1.4.5nb1
> *** The PLIST does not match installed files!
> *** The following files are in both the PLIST and CHECK_FILES_SKIP:
>         /usr/pkg/share/squirrelmail/AUTHORS
>         /usr/pkg/share/squirrelmail/COPYING
>         /usr/pkg/share/squirrelmail/ChangeLog
>         /usr/pkg/share/squirrelmail/INSTALL

This happens for many of the PHP application packages because of one
of two things:

(1) PKG_SYSCONFDIR is being set to the directory that contains the
    *.php files.

(2) The directory which holds the *.php files is being added to either
    MAKE_DIRS or OWN_DIRS.

(1) is actually a special case of (2) because ${PKG_SYSCONFDIR} is
added to MAKE_DIRS automatically.  Usually, this is being done because
these directories contain a config.inc file that serves as the config
file for the application.  To be completely truthful, this was done
by me in several of the PHP application packages, and the techniques
were subsequently picked up in other PHP packages by their maintainers.

What is happening here is that the CHECK_FILES implementation does
not think files inside of directories listed in OWN_DIRS or MAKE_DIRS
should ever be in the PLIST because those directories should hold
files that may be changed by the user or by the application.  The way
to fix this is to use REQD_DIRS instead of OWN_DIRS or MAKE_DIRS if
the listed directory is under ${PREFIX}.  Directories listed in
REQD_DIRS are created at PRE-INSTALL time by the +INSTALL script, and
are removed at POST-DEINSTALL time by the +DEINSTALL script.  The
difference between REQD_DIRS and MAKE_DIRS is that the former are
always created and removed, while the latter can be controlled by
setting PKG_CONFIG to yes/no.  Also, the directories listed in REQD_DIRS
are scanned by the CHECK_FILES implementation, and so they can contain
files that are in the PLIST.

As a concrete example, for the squirrelmail package, the ${SMDIR} and
${SMDIR}/config directories should be listed in REQD_DIRS instead of
OWN_DIRS, which should fix the bulk build of this package.

	Cheers,

	-- Johnny Lam <jlam@pkgsrc.org>