selinux/scripts
Nicolas Iooss e505694406 scripts/env_use_destdir: fix Fedora support
libselinux and libsemanage use:

    PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig
    import *; print(get_python_lib(plat_specific=1,
    prefix='$(PREFIX)'))")

while python/semanage and python/sepolgen/src/sepolgen use:

    PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig
    import *; print(get_python_lib(prefix='$(PREFIX)'))")

This is right: libselinux and libsemanage's Python bindings use native
code (thus "plat_specific=1") while the others only install Python
files.

Nevertheless `scripts/env_use_destdir` only runs the second command
when computing `$PYTHONPATH`. When using this script to run `make test`
in a minimal Fedora 31 environment, this leads to an error such as:

    make[2]: Entering directory '/code/python/sepolicy'
    Traceback (most recent call last):
      File "test_sepolicy.py", line 117, in <module>
        import selinux
    ModuleNotFoundError: No module named 'selinux'

Fix this by also adding `get_python_lib(plat_specific=1)` to the
computed `$PYTHONPATH`.

While at it, preserve `$PYTHONPATH` instead of resetting it. This makes
it easier to work with Python virtual environments.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2020-05-05 15:18:46 +02:00
..
.gitignore scripts: add a helper script to run clang's static analyzer 2018-06-15 09:03:17 -04:00
Lindent Update to latest Lindent script from kernel tree. 2013-10-30 14:34:25 -04:00
env_use_destdir scripts/env_use_destdir: fix Fedora support 2020-05-05 15:18:46 +02:00
make-update Add make-update script and fix release script. 2013-10-31 14:34:02 -04:00
release scripts/release: Update links to use release assets instead of wiki links 2019-02-05 09:56:34 +01:00
run-flake8 scripts/run-flake8: run on Python scripts not ending with .py 2019-01-08 13:21:09 +01:00
run-scan-build libsepol, libsemanage: add a macro to silence static analyzer warnings in tests 2019-09-30 08:43:41 -04:00