On Tuesday 23 September 2008, Thomas Sachau wrote:
> Ulrich Mueller schrieb:
> > And I still don't see why we would need the most general solution
> > for a *default* function. There's always the possibility to write
> > your own src_install() for the few ebuilds that need it.
> >
> > Ulrich
>
> I aggree with Ulrich in this case. This is just a suggestion for a
> default src_install funcion, nothing that should cover every possible
> case. So if you have some special DOC that does not work with the
> default install, you can still do it the normal way. So my suggestion
> for a default src_install:
>
> default_src_install() {
>         if [ -f Makefile -o -f GNUmakefile -o -f makefile ]; then
>                 if emake DESTDIR="${D} install || einstall ; then
>                         die "install failed"
>                 else
>                         if [[ -n ${DOCS} ]]; then
>                                 dodoc ${DOCS} || die "dodoc failed"
>                         fi
>                 fi
>         fi
> }
>
> Any more comments? Good? Bad? Interested?

Let's go with an even simpler default implementation:

default_src_install() {
        if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
                emake DESTDIR="${D}" install || die "emake install failed"
        fi
        if [ -n "${DOCS}" ]; then
                dodoc ${DOCS} || die "dodoc failed"
        fi
}

It addresses the following issues:
* Do not run einstall if emake fails
* Run dodoc even if no Makefile is present, this might come in handy for
  ebuilds calling default()
* die dodoc failure case
* hopefully fix the flaws (not really) pointed out by zlin


Robert

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to