"A. Khattri" <[EMAIL PROTECTED]> wrote:
> On Fri, 28 Apr 2006, Chris White wrote:
> > On Friday 28 April 2006 12:41 pm, A. Khattri wrote:
> > > In writing and testing a new ebuild, I ran emerge as root and got
> > > ACCESS DENIED errors when it tried writing two config files into
> > > /etc.
> > >
> > > Do I need to do something special for config files in an ebuild?
> >
> > Don't copy files to the live filesystem, instead do:
> >
> > cp whatever.conf whatever2.conf ${D}/etc/
> >
> > or some people like:
> >
> > insinto /etc
> > doins whatever.conf whatever2.conf
> 
> Ah, I see now that the actual make install is trying to do this.
[snip]
> 1. So I need to set --enable-conf-install=no which also implies I need
>    to override src_compile

You shouldn't need to completely override src_compile for just that. All
you'd need to do is set EXTRA_ECONF appropriately.

> 2. And then after the build, override pkg_postinst to copy the sample
>    config files into /etc
> 
> Does this sound right or is there a better (preferred?) way?

As I understand things, it should be done in src_install. One way to do
this is to prevent the package from installing to /etc by using
--enable-conf-install=no and then using one of Chris's two suggestions.

Another way would be to patch the Makefile.in so that it would respect
--prefix=whatever for that portion of the install.

Yet another way would be to patch the Makefile.am and use that to
generate a better Makefile.in. This last method has the added advantage
that you can send the patch upstream for inclusion in the actual package
for some future revision, thereby alleviating the need to deal with this
at all (at some point in the future).

-- 
There are problems in today's world that cannot be
solved by the level of thinking that created them.
  -- Albert Einstein

Attachment: pgpvAa3B6Y6Ft.pgp
Description: PGP signature

Reply via email to