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: Steve Long <slong@...>
Subject: Re: Default src_install for EAPI-2 or following EAPI
Date: Sat, 20 Sep 2008 13:12:21 +0100
Thomas Sachau wrote:

> I see, we have a default src_unpack and a default src_compile but a
> default src_install is still missing. Here is my suggestion (taken and
> modified from bug 33544):
> 
> src_install() {
> if [ -f Makefile -o -f GNUmakefile -o -f makefile ]; then
> emake DESTDIR=${D} install || die "emake install failed"

You need to quote $D there, eg: DESTDIR="$D" as it's a parameter to a
command there, not a temporary export (as: DESTDIR=$D emake.. would be.)

> [[ -n ${DOCS} ]] && dodoc ${DOCS}
> else
> einstall || die "einstall failed"
> [[ -n ${DOCS} ]] && dodoc ${DOCS}
> fi
> }
> 
> Any comments?

It might be wise to use an array for DOCS there, so that filenames with
spaces are dealt with correctly. (I'm thinking of all those lovely GUI
apps.)

To keep compatibility with space-separated values, I use this function:

isArr() [[ $(declare -p "$1" 2>/dev/null) = 'declare -a'* ]]

(Yes I know, it's fugly.)

So this kinda logic deals with both:
if isArr DOCS; then
   ((${#DOCS[@]})) && dodoc "${DOCS[@]}"
else [[ $DOCS ]] && dodoc $DOCS
fi

(There's no need to repeat it, just move it to after the previous if.)

That can easily be initialised with a glob, eg DOCS=("$S"/doc/*) (although I
recommend nullglob if doing so.)

[See http://wooledge.org:8000/BashFAQ/073 (half way down) if you need to
strip prefixes or the like.]




References:
Bugzilla3 and Bugzilla Survey 2008
-- Robin H. Johnson
Default src_install for EAPI-2 or following EAPI
-- Thomas Sachau
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Default src_install for EAPI-2 or following EAPI
Next by thread:
Re: Default src_install for EAPI-2 or following EAPI
Previous by date:
Default src_install for EAPI-2 or following EAPI
Next by date:
Making built_with_use die by default with EAPI 2


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.