Gentoo Logo
Gentoo Spaceship

Installation:
Gentoo Handbook
Installation Docs

Documentation:
Home
Listing
About Gentoo
Philosophy
Social Contract

Resources:
Bug Tracker
Developer List
Discussion Forums
Gentoo BitTorrents
Gentoo Linux Enhancement Proposals
IRC Channels
Mailing Lists
Mirrors
Name and Logo Guidelines
Online Package Database
Security Announcements
Staffing Needs
Supporting Vendors
View our CVS

Graphics:
Logos and themes
Icons
ScreenShots

Miscellaneous Resources:
Gentoo Linux Store
Gentoo-hosted projects
IBM dW/Intel article archive




List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Thomas Sachau <tommy@g.o>
Subject: Re: Re: Default src_install for EAPI-2 or following EAPI
Date: Sat, 27 Sep 2008 12:17:09 +0200
Nirbheek Chauhan schrieb:
> On Wed, Sep 24, 2008 at 4:51 AM, Bo Ørsted Andresen <bo.andresen@...> wrote:
>> On Tuesday 23 September 2008 21:39:52 Thomas Sachau wrote:
> 
>>>         if [ -f Makefile -o -f GNUmakefile -o -f makefile ]; then
> [...]
>>>         fi
> 
> - So if those makefiles don't exist, the package should just carry on
> without installing anything?

This is imho a good idea, else virtuals and meta packages would need an extra (empty) src_install().

> 
>>>                 if emake DESTDIR="${D} install || einstall ; then
>>>                         die "install failed"
> 
> - The above code will cause a die when either one of emake install or
> einstall are *successful*. The opposite behaviour is desired.

Eh, sure, my mistake.

> 
>>>                 else
>>>                         if [[ -n ${DOCS} ]]; then
>>>                                 dodoc ${DOCS} || die "dodoc failed"
>>>                         fi
> 
> - So, if emake install || einstall fails, one should just install the
> docs? The opposite behaviour is desired.

see above

> 
> If a default src_install is desired, it should cater to the most
> common use-cases and leave it to the maintainer to override it if
> desired.
> 
> default_src_install() {
>     emake DESTDIR="${D}" install || die "emake install failed"
>     if [ -n "${DOCS}" ]; then
>         dodoc ${DOCS} || die "dodoc failed"
>     else
>         # No die here because we don't know if any of these exist
>         dodoc AUTHORS ChangeLog NEWS README
>     fi
> }
> 

So what about this one?

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"
	else
	        # No die here because we don't know if any of these exist
        	dodoc AUTHORS ChangeLog NEWS README
	fi
}


-- 
Thomas Sachau

Gentoo Linux Developer




Attachment:
signature.asc (OpenPGP digital signature)
Replies:
Re: Re: Default src_install for EAPI-2 or following EAPI
-- Nirbheek Chauhan
Usage of econf with an additional || die
-- Thomas Sachau
References:
Re: Default src_install for EAPI-2 or following EAPI
-- Ulrich Mueller
Re: Re: Default src_install for EAPI-2 or following EAPI
-- Thomas Sachau
Re: Re: Default src_install for EAPI-2 or following EAPI
-- Bo Ørsted Andresen
Re: Re: Default src_install for EAPI-2 or following EAPI
-- Nirbheek Chauhan
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Re: Default src_install for EAPI-2 or following EAPI
Next by thread:
Usage of econf with an additional || die
Previous by date:
Re: [gentoo-commits] gentoo-x86 commit in x11-libs/cairo: cairo-1.8.0.ebuild
Next by date:
Re: Re: [gentoo-commits] gentoo-x86 commit in x11-libs/cairo: cairo-1.8.0.ebuild


Updated Jun 17, 2009

Donate to support our development efforts.

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

php|architect

php|architect

Copyright 2001-2007 Gentoo Foundation, Inc. Questions, Comments? Email www@gentoo.org.