All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Lautrbach <plautrba@redhat.com>
To: selinux@vger.kernel.org
Cc: "Christian Göttsche" <cgzones@googlemail.com>
Subject: Re: [PATCH v3] tree-wide: introduce PYTHON_SETUP_ARGS to customize setup.py calls on Debian
Date: Tue, 5 May 2020 10:41:08 +0200	[thread overview]
Message-ID: <20200505084108.GA7308@workstation> (raw)
In-Reply-To: <20200504175501.8114-1-cgzones@googlemail.com>

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

On Mon, May 04, 2020 at 07:55:01PM +0200, Christian Göttsche wrote:
> On Debian the `distutils` module is patched, so `get_python_lib()`
> returns by default `/usr/lib/python3/dist-packages` (no minor version)
> 
> But `setuptools` affecting setup.py is not patched to create the library
> directory at `/usr/lib/python3/dist-packages` by default, rather than a
> command line argument `--install-layout deb` is added
> 
> Add PYTHON_SETUP_ARGS as argument to affected setup.py calls and add a
> note in the global README.md
> 
> See https://www.debian.org/doc/packaging-manuals/python-policy/packaging_tools.html
> Section B.1
> 
> Fixes: https://github.com/SELinuxProject/selinux/issues/187
> 
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>

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

Thanks!


> ---
> v3:
>   - Correctly spell python
>   - wrap commit message
> 
> v2:
>   Use env variable PYTON_SETUP_ARGS instead of internal detection logic
> 
>  README.md                | 2 ++
>  libselinux/src/Makefile  | 2 +-
>  python/sepolicy/Makefile | 2 +-
>  3 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/README.md b/README.md
> index f3257ef5..9d64f0b5 100644
> --- a/README.md
> +++ b/README.md
> @@ -95,6 +95,8 @@ To build and install everything under a private directory, run:
>  
>      make DESTDIR=~/obj install install-rubywrap install-pywrap
>  
> +On Debian `PYTHON_SETUP_ARGS=--install-layout=deb` needs to be set when installing the python wrappers in order to create the correct python directory structure.
> +
>  To run tests with the built libraries and programs, several paths (relative to `$DESTDIR`) need to be added to variables `$LD_LIBRARY_PATH`, `$PATH` and `$PYTHONPATH`.
>  This can be done using [./scripts/env_use_destdir](./scripts/env_use_destdir):
>  
> diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
> index 73303c36..190016e2 100644
> --- a/libselinux/src/Makefile
> +++ b/libselinux/src/Makefile
> @@ -174,7 +174,7 @@ install: all
>  	ln -sf --relative $(DESTDIR)$(SHLIBDIR)/$(LIBSO) $(DESTDIR)$(LIBDIR)/$(TARGET)
>  
>  install-pywrap: pywrap
> -	$(PYTHON) setup.py install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
> +	$(PYTHON) setup.py install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)` $(PYTHON_SETUP_ARGS)
>  	install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py
>  	ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT)
>  
> diff --git a/python/sepolicy/Makefile b/python/sepolicy/Makefile
> index 69f29fa9..3361be4e 100644
> --- a/python/sepolicy/Makefile
> +++ b/python/sepolicy/Makefile
> @@ -27,7 +27,7 @@ test:
>  	@$(PYTHON) test_sepolicy.py -v
>  
>  install:
> -	$(PYTHON) setup.py install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
> +	$(PYTHON) setup.py install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)` $(PYTHON_SETUP_ARGS)
>  	[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR)
>  	install -m 755 sepolicy.py $(DESTDIR)$(BINDIR)/sepolicy
>  	(cd $(DESTDIR)$(BINDIR); ln -sf sepolicy sepolgen)
> -- 
> 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-05  8:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-07 11:45 [PATCH] tree-wide: install python libraries on Debian with appropriate option Christian Göttsche
2020-04-07 13:38 ` Ondrej Mosnacek
2020-05-01 13:46 ` [PATCH v2] tree-wide: introduce PYTON_SETUP_ARGS to customize setup.py calls on Debian Christian Göttsche
2020-05-04 13:03   ` Petr Lautrbach
2020-05-04 14:12     ` Ondrej Mosnacek
2020-05-04 17:55   ` [PATCH v3] tree-wide: introduce PYTHON_SETUP_ARGS " Christian Göttsche
2020-05-05  8:41     ` Petr Lautrbach [this message]
2020-05-06 14:20       ` 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=20200505084108.GA7308@workstation \
    --to=plautrba@redhat.com \
    --cc=cgzones@googlemail.com \
    --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.