Subject: Re: IMPORTANT user-visible change to pkgsrc related to config files
To: Johnny Lam <jlam@jgrind.org>
From: Sean Davis <dive@endersgame.net>
List: tech-pkg
Date: 11/25/2001 18:10:06
Okay, this raises a question I was thinking about yesterday while writing
some code to check what packages are out of date. Yes, I know pkg_chk does
this, but it's slow. So, I'm writing a utility in C, and I'm wondering:

Is it feasable to add something to <package>/Makefile that will contain the
full string name of the package? for example, perl-5.6.1nb6? That would help
me a lot, and I imagine other programs that check pkgsrc stuff would find it
useful too.

On Sun, Nov 25, 2001 at 01:12:22PM -0800, Johnny Lam wrote:
> Hi,
> 
> I've committed changes to bsd.pkg.mk and friends to implement a variable
> PKG_SYSCONFDIR, used to specify the location where the configuration files
> for a package may be found.  The is to help resolve those arguments that
> look like:
> 
> 	Config files are host-specific...they should go into /etc.
> 
> 	No!  All package stuff should be in /usr/pkg; config files are no
> 	exception.
> 
> 	But I want to share my /usr/pkg, but not my config files.
> 
> 	Well, use symlinks.
> 
> 	Why?
> 
> 	Why not?
> 
> 	Because my way is correct.
> 
> 	No, my way is correct.
> 
> 	[flamewar follows]
> 
> Now, those who want their config files in /etc should set PKG_SYSCONFBASE
> to /etc in /etc/mk.conf, while those who want it in ${PREFIX}/etc don't have
> to do anything (the default is for config files to be in ${PREFIX}/etc).
> Also, the config directory for a particular package may be set in /etc/mk.conf
> by setting PKG_SYSCONFDIR.<pkgname>, e.g. PKG_SYSCONFDIR.apache=/etc/apache.
> 
> Please note that not all packages have been converted to use PKG_SYSCONFDIR.
> 
> For package constructors, the PKG_SYSCONFDIR variable may be customized with
> the following variables:
> 
> * PKG_SYSCONFBASE is the main config directory under which all package
>   configuration files are to be found.  This defaults to ${PREFIX}/etc, but
>   may be overridden in /etc/mk.conf.
> 
> * PKG_SYSCONFSUBDIR is the subdirectory of PKG_SYSCONFBASE under which the
>   configuration files for a particular package may be found, e.g. the
>   Apache configuration files may all be found under the "httpd" subdirectory
>   of ${PKG_SYSCONFBASE}.
> 
> Packages should be taught to look for their configuration files in
> ${PKG_SYSCONFDIR}, which is passed through to the configure and build
> processes.  This is typically done for GNU packages by passing
> --sysconfdir=${PKG_SYSCONFDIR} to the configure script, but please check to
> make sure.
> 
> 	Cheers,
> 
> 	-- Johnny Lam <jlam@jgrind.org>

-- 
/~\ The ASCII                       Sean Davis
\ / Ribbon Campaign                 aka dive-o
 X  Against HTML
/ \ Email!                      dive@endersgame.net