All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Lautrbach <plautrba@redhat.com>
To: selinux@vger.kernel.org
Cc: Nicolas Iooss <nicolas.iooss@m4x.org>
Subject: Re: [PATCH 2/2] scripts/env_use_destdir: propagate PREFIX, LIBDIR, BINDIR, etc.
Date: Mon, 4 May 2020 14:31:52 +0200	[thread overview]
Message-ID: <20200504123152.GB251987@workstation> (raw)
In-Reply-To: <20200501092929.1162708-2-nicolas.iooss@m4x.org>

[-- Attachment #1: Type: text/plain, Size: 2252 bytes --]

On Fri, May 01, 2020 at 11:29:29AM +0200, Nicolas Iooss wrote:
> On systems using non-default `PREFIX`, `LIBDIR`, `SHLIBDIR`, `BINDIR`
> or `SBINDIR`, running
> `DESTDIR=/path/to/destdir ./scripts/env_use_destdir make test`
> does not perform the intended behavior, because the testing programs and
> libraries are installed into locations that are not added to
> `LD_LIBRARY_PATH` nor `PATH`.
> 
> More precisely, with `LIBDIR=/usr/lib64 SHLIBDIR=/lib64`, `env_use_destdir`
> does not work. Fix this by adding the installation directories relative
> to `DESTDIR` in `LD_LIBRARY_PATH` and `PATH`.
> 
> Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>

For both patches:

Acked-by: Petr Lautrbach <plautrba@redhat.com>

> ---
>  scripts/env_use_destdir | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/scripts/env_use_destdir b/scripts/env_use_destdir
> index 491da58f9207..8274013e9cf0 100755
> --- a/scripts/env_use_destdir
> +++ b/scripts/env_use_destdir
> @@ -22,7 +22,26 @@ if [ -z "${DESTDIR:-}" ] ; then
>  fi
>  
>  export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib"
> +if [ -n "${PREFIX:-}" ] ; then
> +    LD_LIBRARY_PATH="$DESTDIR$PREFIX/lib:$LD_LIBRARY_PATH"
> +fi
> +if [ -n "${LIBDIR:-}" ] ; then
> +    LD_LIBRARY_PATH="$DESTDIR$LIBDIR:$LD_LIBRARY_PATH"
> +fi
> +if [ -n "${SHLIBDIR:-}" ] ; then
> +    LD_LIBRARY_PATH="$DESTDIR$SHLIBDIR:$LD_LIBRARY_PATH"
> +fi
> +
>  export PATH="$DESTDIR/usr/sbin:$DESTDIR/usr/bin:$DESTDIR/sbin:$DESTDIR/bin:$PATH"
> +if [ -n "${PREFIX:-}" ] ; then
> +    PATH="$DESTDIR$PREFIX/sbin:$DESTDIR$PREFIX/bin:$LD_LIBRARY_PATH"
> +fi
> +if [ -n "${BINDIR:-}" ] ; then
> +    PATH="$DESTDIR$BINDIR:$PATH"
> +fi
> +if [ -n "${SBINDIR:-}" ] ; then
> +    PATH="$DESTDIR$SBINDIR:$PATH"
> +fi
>  
>  NEW_PYTHONPATH="$DESTDIR$(${PYTHON:-python3} -c "from distutils.sysconfig import *;print(get_python_lib(plat_specific=1, prefix='/usr'))"):$DESTDIR$(${PYTHON:-python3} -c "from distutils.sysconfig import *;print(get_python_lib(prefix='/usr'))")"
>  if [ -n "${PYTHONPATH:-}" ] ; then
> -- 
> 2.26.2
> 

-- 
()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-05-04 12:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01  9:29 [PATCH 1/2] scripts/env_use_destdir: fix Fedora support Nicolas Iooss
2020-05-01  9:29 ` [PATCH 2/2] scripts/env_use_destdir: propagate PREFIX, LIBDIR, BINDIR, etc Nicolas Iooss
2020-05-04 12:31   ` Petr Lautrbach [this message]
2020-05-05 13:19     ` Petr Lautrbach

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=20200504123152.GB251987@workstation \
    --to=plautrba@redhat.com \
    --cc=nicolas.iooss@m4x.org \
    --cc=selinux@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.