Subject: Re: hardcoded etc/rc.d in PLISTs instead of RCD_SCRIPTS_EXAMPLEDIR
To: Julio Merino <jmmv@menta.net>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 03/21/2003 08:14:34
On Fri, 21 Mar 2003, Julio Merino wrote:

> I could simply set RCD_SCRIPTS_EXAMPLEDIR to /usr/pkg/share/examples/rc.d
> and then fix the packages.  Anyway, the examples location is not tunable,
> nor the documentation, nor "anything". We have PKG_RCD_SCRIPTS to place the
> rc.d scripts wherever we want, after they are installed.

I don't understand.

The default, as defined in mk/bsd.pkg.install.mk, is:

RCD_SCRIPTS_EXAMPLEDIR?=      ${PREFIX}/etc/rc.d

I don't understand why you say to change it to one thing and then say it
is not tunable.

Also, if it is not tunable, why does it have "?=" (and maybe I overlooked
that documentation).

I understand the PKG_RCD_SCRIPTS is used to copy the rc.d files into
place.

And it works fine (for the several packages I have tried) even when I
set my RCD_SCRIPTS_EXAMPLEDIR.

The only minor problem is that many PLISTs assume that the examples are
installed to etc/rc.d.

The fix is easy.

In mk/bsd.pkg.mk:

PLIST_SUBST+= RCD_SCRIPTS_EXAMPLEDIR=${RCD_SCRIPTS_EXAMPLEDIR}

And in the individual PLISTs, just have:

${RCD_SCRIPTS_EXAMPLEDIR}/whatever

Or don't have them in the PLIST at all and just have the PKG_RCD_SCRIPTS
mechanism register them itself.

   Jeremy C. Reed
   http://bsd.reedmedia.net/