Gentoo Archives: gentoo-dev

From: Thomas Sachau <tommy@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: Default src_install for EAPI-2 or following EAPI
Date: Sat, 27 Sep 2008 10:17:19
Message-Id: 48DE0825.1010009@gentoo.org
In Reply to: Re: [gentoo-dev] Re: Default src_install for EAPI-2 or following EAPI by Nirbheek Chauhan
1 Nirbheek Chauhan schrieb:
2 > On Wed, Sep 24, 2008 at 4:51 AM, Bo Ørsted Andresen <bo.andresen@××××.dk> wrote:
3 >> On Tuesday 23 September 2008 21:39:52 Thomas Sachau wrote:
4 >
5 >>> if [ -f Makefile -o -f GNUmakefile -o -f makefile ]; then
6 > [...]
7 >>> fi
8 >
9 > - So if those makefiles don't exist, the package should just carry on
10 > without installing anything?
11
12 This is imho a good idea, else virtuals and meta packages would need an extra (empty) src_install().
13
14 >
15 >>> if emake DESTDIR="${D} install || einstall ; then
16 >>> die "install failed"
17 >
18 > - The above code will cause a die when either one of emake install or
19 > einstall are *successful*. The opposite behaviour is desired.
20
21 Eh, sure, my mistake.
22
23 >
24 >>> else
25 >>> if [[ -n ${DOCS} ]]; then
26 >>> dodoc ${DOCS} || die "dodoc failed"
27 >>> fi
28 >
29 > - So, if emake install || einstall fails, one should just install the
30 > docs? The opposite behaviour is desired.
31
32 see above
33
34 >
35 > If a default src_install is desired, it should cater to the most
36 > common use-cases and leave it to the maintainer to override it if
37 > desired.
38 >
39 > default_src_install() {
40 > emake DESTDIR="${D}" install || die "emake install failed"
41 > if [ -n "${DOCS}" ]; then
42 > dodoc ${DOCS} || die "dodoc failed"
43 > else
44 > # No die here because we don't know if any of these exist
45 > dodoc AUTHORS ChangeLog NEWS README
46 > fi
47 > }
48 >
49
50 So what about this one?
51
52 default_src_install() {
53 if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
54 emake DESTDIR="${D}" install || die "emake install failed"
55 fi
56 if [ -n "${DOCS}" ]; then
57 dodoc ${DOCS} || die "dodoc failed"
58 else
59 # No die here because we don't know if any of these exist
60 dodoc AUTHORS ChangeLog NEWS README
61 fi
62 }
63
64
65 --
66 Thomas Sachau
67
68 Gentoo Linux Developer

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
[gentoo-dev] Usage of econf with an additional || die Thomas Sachau <tommy@g.o>
Re: [gentoo-dev] Re: Default src_install for EAPI-2 or following EAPI Nirbheek Chauhan <nirbheek.chauhan@×××××.com>