meta-selinux/recipes-security/selinux/libselinux/0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch
Yi Zhao 979b3caf98 selinux: upgrade 3.8.1 -> 3.9
ChangeLog:
https://github.com/SELinuxProject/selinux/releases/tag/3.9

* Support static-only builds with DISABLE_SHARED=y
* Add restore option to modify user and role portions
* setfiles: Add -U option to modify user and role portions
* semanage.conf: Add relabel_store config option
* semodule: Add [-g PATH |--config=PATH] for an alternate path for the
  semanage config
* libselinux: Fix local literal fcontext definitions priority
* libselinux: Fix order for path substitutions
* libsepol: Add new 'netif_wildcard' policy capability
* checkpolicy: Add support for wildcard netifcon names
* libsepol: Allow multiple policycap statements
* libsepol: Support genfs_seclabel_wildcard
* Replace all links to selinuxproject.org
* Bug fixes

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
2025-08-07 21:06:27 +08:00

53 lines
2.6 KiB
Diff

From 1bb35bc277129c976bb480a05de91dab346c84c9 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Fri, 25 Oct 2019 13:37:14 +0200
Subject: [PATCH] Do not use PYCEXT, and rely on the installed file name
PYCEXT is computed by asking the Python intrepreter what is the
file extension used for native Python modules.
Unfortunately, when cross-compiling, the host Python doesn't give the
proper result: it gives the result matching the build machine, and not
the target machine. Due to this, the symlink has an incorrect name,
and doesn't point to the .so file that was actually built/installed.
To address this and keep things simple, this patch just changes the ln
invocation to rely on the name of the _selinux*.so Python module that
was installed.
[Upstream: https://github.com/SELinuxProject/selinux/pull/184]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Upstream-Status: Denied [https://patchwork.kernel.org/patch/11212405/]
[Refreshed for 3.0]
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
libselinux/src/Makefile | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
index edb3ca06..8da3f542 100644
--- a/libselinux/src/Makefile
+++ b/libselinux/src/Makefile
@@ -15,7 +15,6 @@ INCLUDEDIR ?= $(PREFIX)/include
PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX))
PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX))
PYTHONLIBDIR ?= $(shell $(PYTHON) -c "import sysconfig; print(sysconfig.get_path('platlib', vars={'platbase': '$(PREFIX)', 'base': '$(PREFIX)'}))")
-PYCEXT ?= $(shell $(PYTHON) -c 'import importlib.machinery;print(importlib.machinery.EXTENSION_SUFFIXES[0])')
RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" + RbConfig::CONFIG["rubyarchhdrdir"] + " -I" + RbConfig::CONFIG["rubyhdrdir"]')
RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" + RbConfig::CONFIG["libdir"] + " -L" + RbConfig::CONFIG["archlibdir"] + " " + RbConfig::CONFIG["LIBRUBYARG_SHARED"]')
RUBYINSTALL ?= $(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]')
@@ -200,7 +199,7 @@ endif
install-pywrap: pywrap
CFLAGS="$(CPPFLAGS) $(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) -m pip install --prefix=$(PREFIX) --root $(DESTDIR) --ignore-installed --no-deps $(PYTHON_SETUP_ARGS) .
install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py
- ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT)
+ ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux*.so $(DESTDIR)$(PYTHONLIBDIR)/
install-rubywrap: rubywrap
test -d $(DESTDIR)$(RUBYINSTALL) || install -m 755 -d $(DESTDIR)$(RUBYINSTALL)
--
2.34.1