On Tue, 10 May 2016 14:44:58 +0200, J. Roeleveld wrote:

> > You can define hooks in /etc/portage/bashrc and /etc/portage/env that
> > are run at various stages of the ebuild. A post_install hook in
> > /etc/portage/env/cat/ftp-server should do what you want.
> > 
> > https://dev.gentoo.org/~zmedico/portage/doc/portage.html#config-bashrc-ebuil
> > d-phase-hooks  
> 
> Thank you for the reply. It gave me the keywords to search for.
> 
> If anyone else ever needs to write something similar, here is how I got
> it to work:
> 
> =====
> # cat /etc/portage/bashrc 
> 
> #!/bin/bash
> 
> if [ "${EBUILD_PHASE}" = "postinst" ]
> then
>   if [ "${CATEGORY}/${PN}" = "net-ftp/pure-ftpd" ]
>   then
>     cp /etc/openldap/schema/pureftpd.schema 
> /opt/packages/SHARED/etc/openldap/schema/pureftpd.schema
>     echo "NOTE: LDAP Schema File copied."
>   fi
> fi
> 
> ======

Couldn't you do it with register_install_hook? I've not done it with that
phase, but I have used hooks like this.

> 
> This should be easy to adjust to needs.
> 
> Using /etc/portage/env doesn't work.

I think the approach there is to define pkg_postinst()
in /etc/portage/cat/pkg, then that function is run after the install
phase of the ebuild.

Something like


pkg_postinst() {
  cp /etc/openldap/schema/pureftpd.schema 
  /opt/packages/SHARED/etc/openldap/schema/pureftpd.schema
  einfo "NOTE: LDAP Schema File copied."
}

in /etc/portage/env/net-ftp/pure-ftpd


-- 
Neil Bothwick

"Doing it right is no excuse for not meeting the schedule."

Attachment: pgpuNJ0rft9jX.pgp
Description: OpenPGP digital signature

Reply via email to