Gentoo Archives: gentoo-dev

From: Stanislav Brabec <utx@g.o>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] How to fix pathnames in .ebuilds
Date: Sat, 12 Jul 2003 22:40:49
Message-Id: 1058049617.2565.0.camel@utx.utx.cz
In Reply to: Re: [gentoo-dev] How to fix pathnames in .ebuilds by Alastair Tse
1 Alastair Tse wrote:
2 > On Thu, 2003-07-10 at 13:16, Martin Lesser wrote:
3
4 > make DESTDIR=${D} install || die "install failed"
5 >
6 Yes, it is the correct and recommended solution! See "info automake" for
7 more.
8
9 But einstall still uses ancient way:
10
11 make prefix=${D}/usr \
12 datadir=${D}/usr/share \
13 infodir=${D}/usr/share/info \
14 localstatedir=${D}/var/lib \
15 mandir=${D}/usr/share/man \
16 sysconfdir=${D}/etc \
17 "$@" install
18
19 This way works for many packages and in past it was the only way, but it
20 is basically incorrect - those values has influence to compiler and
21 linker, not only for destination paths! This is the reason why automake
22 developers has added DESTDIR, which is designed to have no influence to
23 compiler.
24
25 Please change the default in portage and rename current einstall to
26 old_einstall.
27
28 Well, there are some bad projects, which installs OK with this old way,
29 but not with DESTDIR, but it's better to use autoreconf or write a fix.
30
31 Why?
32
33 Changing prefix-based dirs is very dangerous way to install automake
34 based projects and can lead to access violation or even to mis-compiled
35 projects!
36
37 1) Many paths (e. g. PIXMAPS_DIR) are evaluated in configure time and
38 this install hack does not change it.
39
40 2) Purpose of all these variables is definition of default paths for
41 compiler and linker. If package recompiles/links something during
42 install process, it changes default path compiled into binary/library.
43
44
45 OT:
46 Similar problem exists also for libraries:
47
48 Do not use LDFLAGS and CPPFLAGS for references to build root - use
49 LIBRARY_PATH and CPATH (C_INCLUDE_PATH, CPLUS_INCLUDE_PATH,
50 OBJC_INCLUDE_PATH). Otherwise you will get library with incorrect
51 hardwired paths either to binary/library or to la file.
52 It is security hole, if la file points to /var/tmp.
53
54 --
55 Stanislav Brabec
56 http://www.penguin.cz/~utx
57
58
59 --
60 gentoo-dev@g.o mailing list