From: Steve Long <slong@rathaus.eclipse.co.uk>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] Re: Default src_install for EAPI-2 or following EAPI
Date: Sat, 20 Sep 2008 13:12:21 +0100 [thread overview]
Message-ID: <gb2pq0$srk$1@ger.gmane.org> (raw)
In-Reply-To: 48D4DEF8.10202@gentoo.org
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.]
next prev parent reply other threads:[~2008-09-20 12:20 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-16 0:01 [gentoo-dev] Bugzilla3 and Bugzilla Survey 2008 Robin H. Johnson
2008-09-20 11:31 ` [gentoo-dev] Default src_install for EAPI-2 or following EAPI Thomas Sachau
2008-09-20 12:12 ` Steve Long [this message]
2008-09-20 19:07 ` Petteri Räty
2008-09-21 0:47 ` Thomas Sachau
2008-09-21 7:55 ` Fabian Groffen
[not found] <bcwiO-7zO-1@gated-at.bofh.it>
[not found] ` <be8YL-33V-3@gated-at.bofh.it>
[not found] ` <be9Lf-478-5@gated-at.bofh.it>
2008-09-21 6:18 ` [gentoo-dev] " Vaeth
2008-09-21 11:44 ` Thomas Anderson
2008-09-21 12:03 ` [gentoo-dev] " Steve Long
2008-09-21 13:04 ` [gentoo-dev] " Ulrich Mueller
2008-09-21 17:30 ` Kent Fredric
2008-09-21 18:50 ` Ulrich Mueller
2008-09-21 20:23 ` Steve Long
2008-09-21 20:46 ` Ulrich Mueller
2008-09-21 21:10 ` Steve Long
2008-09-23 19:39 ` Thomas Sachau
2008-09-23 23:21 ` Bo Ørsted Andresen
2008-09-24 5:28 ` Alec Warner
2008-09-24 9:01 ` Bo Ørsted Andresen
2008-09-24 7:46 ` Nirbheek Chauhan
2008-09-27 10:17 ` Thomas Sachau
2008-09-29 5:16 ` Nirbheek Chauhan
2008-09-30 17:05 ` Petteri Räty
2008-09-24 0:35 ` Robert Buchholz
2008-09-24 8:26 ` Santiago M. Mola
2008-09-24 1:34 ` [gentoo-dev] " Steve Long
2008-09-24 6:38 ` [gentoo-dev] " Ulrich Mueller
2008-09-24 6:40 ` Duncan
2008-09-22 1:35 ` Alec Warner
2008-09-22 8:22 ` Duncan
[not found] <beqsE-8pJ-13@gated-at.bofh.it>
[not found] ` <beqsE-8pJ-15@gated-at.bofh.it>
[not found] ` <beqsE-8pJ-17@gated-at.bofh.it>
[not found] ` <beqsD-8pJ-11@gated-at.bofh.it>
[not found] ` <bew51-7fR-11@gated-at.bofh.it>
2008-09-21 22:11 ` [gentoo-dev] " Vaeth
2008-09-22 0:35 ` [gentoo-dev] " Steve Long
2008-09-22 8:25 ` [gentoo-dev] " Duncan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='gb2pq0$srk$1@ger.gmane.org' \
--to=slong@rathaus.eclipse.co.uk \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox