public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Stanislav Brabec <utx@gentoo.org>
To: gentoo-dev@gentoo.org
Subject: Re: [gentoo-dev] How to fix pathnames in .ebuilds
Date: 13 Jul 2003 00:40:17 +0200	[thread overview]
Message-ID: <1058049617.2565.0.camel@utx.utx.cz> (raw)
In-Reply-To: <1057840805.8047.10.camel@huggins.eng.cam.ac.uk>

Alastair Tse wrote:
> On Thu, 2003-07-10 at 13:16, Martin Lesser wrote:

> make DESTDIR=${D} install || die "install failed"
> 
Yes, it is the correct and recommended solution! See "info automake" for
more.

But einstall still uses ancient way:

                make prefix=${D}/usr \
                    datadir=${D}/usr/share \
                    infodir=${D}/usr/share/info \
                    localstatedir=${D}/var/lib \
                    mandir=${D}/usr/share/man \
                    sysconfdir=${D}/etc \
                    "$@" install

This way works for many packages and in past it was the only way, but it
is basically incorrect - those values has influence to compiler and
linker, not only for destination paths! This is the reason why automake
developers has added DESTDIR, which is designed to have no influence to
compiler.

Please change the default in portage and rename current einstall to
old_einstall.

Well, there are some bad projects, which installs OK with this old way,
but not with DESTDIR, but it's better to use autoreconf or write a fix.

Why?

Changing prefix-based dirs is very dangerous way to install automake
based projects and can lead to access violation or even to mis-compiled
projects!

1) Many paths (e. g. PIXMAPS_DIR) are evaluated in configure time and
this install hack does not change it.

2) Purpose of all these variables is definition of default paths for
compiler and linker. If package recompiles/links something during
install process, it changes default path compiled into binary/library.


OT:
Similar problem exists also for libraries:

Do not use LDFLAGS and CPPFLAGS for references to build root - use
LIBRARY_PATH and CPATH (C_INCLUDE_PATH, CPLUS_INCLUDE_PATH,
OBJC_INCLUDE_PATH). Otherwise you will get library with incorrect
hardwired paths either to binary/library or to la file.
It is security hole, if la file points to /var/tmp.

-- 
Stanislav Brabec
http://www.penguin.cz/~utx


--
gentoo-dev@gentoo.org mailing list


      parent reply	other threads:[~2003-07-12 22:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-10 12:16 [gentoo-dev] How to fix pathnames in .ebuilds Martin Lesser
2003-07-10 12:40 ` Alastair Tse
2003-07-10 16:31   ` Martin Lesser
2003-07-11  5:40     ` Patrick Kursawe
2003-07-11  9:16       ` Paul de Vrieze
2003-07-12 22:40   ` Stanislav Brabec [this message]

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=1058049617.2565.0.camel@utx.utx.cz \
    --to=utx@gentoo.org \
    --cc=gentoo-dev@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