Setting *some* packages to use /etc

View: New views
3 Messages — Rating Filter:   Alert me  

Setting *some* packages to use /etc

by David Brownlee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a set of packages which I want to use /etc for their config files (pretty much only those which have config I change and care about/backedup if $PREFIX was blown away), but most I want to leave in $PREFIX/etc

I currently have the below in mk.conf - can anyone think of a saner way of doing this?

I'm actually half tempted to switch to a post package update script which just checks to see if files already exists in /etc and moves the matching entries from $PREFIX/etc if not, and creates symlinks, which would remove some of the 'magic' from my local package builds (if not my package deploys)

PKG_USE_ETC=\
    audio/mserv_irman \
    audio/musicpd \
    lang/pear \
    lang/php5 \
    mail/re-alpine \
    mail/dovecot \
    mail/exim \
    mail/roundcube \
    mail/spamassassin \
    net/dante \
    net/openvpn \
    net/samba \
    net/vsftpd \
    security/msu \
    security/msudir \
    security/nessus \
    security/nessus-core \
    security/nessus-libraries \
    security/nessus-plugins \
    security/sudo \
    shells/zsh \
    sysutils/dirvish \
    sysutils/libirman \
    sysutils/munin-node \
    sysutils/munin-server \
    sysutils/ups-nut \
    www/apache22 \
    www/squid \
    www/thttpd \
    x11/xdm
. if !empty(PKG_USE_ETC:M${PKGPATH})
PKG_SYSCONFBASE?=/etc
. endif


Re: Setting *some* packages to use /etc

by Greg A. Woods; Planix, Inc. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At Fri, 23 Oct 2009 13:05:17 +0100, David Brownlee <abs@...> wrote:
Subject: Setting *some* packages to use /etc
>
> I have a set of packages which I want to use /etc for their config files
> (pretty much only those which have config I change and care about/backedup
> if $PREFIX was blown away), but most I want to leave in $PREFIX/etc
>
> I currently have the below in mk.conf - can anyone think of a saner way of
> doing this?

Actually I think it's not really very sane to try to do this in the
first place.  :-)

If you don't care about the config files for some packages then I would
think that keeping them in /etc should in theory be equally OK for you.

If you do want to cleanly update package config files when you upgrade
your packages then you should always run "pkg_delete -r \*" to delete
them all instead of simply "blowing away" $PREFIX, no matte where you
point PKG_SYSCONFBASE.  This will both help you to remember what
packages did have custom local configurations, as well as help debug
pkgsrc!

I think pkgsrc has way too much freedom (and thus way far too much
unnecessary complexity) in how it allows individual packages to be
configured differently from each other.

This is particularly perturbing when it comes to packages which might
actually have some inter-relationships between each other.

Personally I would say that pkgrsrc should only allow PKG_SYSCONFBASE to
be set once, i.e. with one consistent setting, for all binary packages
intended to be installed together on the same machine.  There should be
no support at all for changing this for individual packages.

--
                                                Greg A. Woods
                                                Planix, Inc.

<woods@...>       +1 416 218 0099        http://www.planix.com/


attachment0 (193 bytes) Download Attachment

Re: Setting *some* packages to use /etc

by obache :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 23 Oct 2009 21:05:17 +0900, David Brownlee <abs@...> wrote:

> I have a set of packages which I want to use /etc for their config files
> (pretty much only those which have config I change and care about/backedup
> if $PREFIX was blown away), but most I want to leave in $PREFIX/etc
>
> I currently have the below in mk.conf - can anyone think of a saner way of
> doing this?

You can use PKG_SYSCONFDIR.${PKG_SYSCONFVAR} (${PKG_SYSCONFVAR} == ${PKGBASE} by default).
ex. PKG_SYSCONFDIR.php=/etc

--
"Of course I love NetBSD":-)
OBATA Akio / obache@...