From: Ladislav Michl <oss-lists@triops.cz>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH v3 11/18] libsemanage: version bump 2.1.9 -> 3.11
Date: Mon, 16 Nov 2026 08:26:31 +0100 [thread overview]
Message-ID: <20261116072639.3157459-12-oss-lists@triops.cz> (raw)
In-Reply-To: <20261116072639.3157459-1-oss-lists@triops.cz>
From: Ladislav Michl <ladis@triops.cz>
Signed-off-by: Ladislav Michl <ladis@triops.cz>
---
CHANGES:
- v2: make python wrapper depend on PYTHON3 instead of selecting it.
- v3: select PYTHON3 again, libsemanage is not part of the
PYTHON3 -> LIBUUID -> UTIL_LINUX -> LIBSELINUX chain. Pass PYCEXT
from target sysconfig, otherwise the extension gets the host
suffix. Build pywrap in the default compile stage. Byte-compile
the python module and install only .pyc files using install_glob.
rules/libsemanage.in | 13 ++++-------
rules/libsemanage.make | 51 +++++++++++++++++++++++++++++++-----------
2 files changed, 42 insertions(+), 22 deletions(-)
diff --git a/rules/libsemanage.in b/rules/libsemanage.in
index 9d7ebf03d..e11efaaed 100644
--- a/rules/libsemanage.in
+++ b/rules/libsemanage.in
@@ -1,29 +1,24 @@
-## SECTION=staging
-## old section:
-### SECTION=selinux
+## SECTION=selinux
menuconfig LIBSEMANAGE
tristate
prompt "libsemanage "
+ select AUDIT
select BZIP2
select BZIP2_LIBBZ2
select LIBSEPOL
select LIBSELINUX
- select USTR
- select PYTHON if LIBSEMANAGE_PYTHON
+ select HOST_FLEX
+ select PYTHON3 if LIBSEMANAGE_PYTHON
select HOST_SWIG if LIBSEMANAGE_PYTHON
help
This package provides the shared libraries for SELinux policy management.
It uses libsepol for binary policy manipulation and libselinux for
interacting with the SELinux system.
- STAGING: remove in ptxdist-2020.12.0
- Old version that need to be updated. Moved to staging with libselinux.
-
if LIBSEMANAGE
config LIBSEMANAGE_PYTHON
bool "python wrapper"
- depends on STAGING
endif
diff --git a/rules/libsemanage.make b/rules/libsemanage.make
index 9e8a641e9..05b46680d 100644
--- a/rules/libsemanage.make
+++ b/rules/libsemanage.make
@@ -14,29 +14,40 @@ PACKAGES-$(PTXCONF_LIBSEMANAGE) += libsemanage
#
# Paths and names
#
-LIBSEMANAGE_VERSION := 2.1.9
-LIBSEMANAGE_MD5 := 209e11da5b36c595a796751583f016f8
+LIBSEMANAGE_VERSION := $(SELINUX_VERSION)
+LIBSEMANAGE_SHA256 := e76160286bbfb0821602c6c0c3220ebcf366ad3246d3b9d0a0fbefcd35e86043
LIBSEMANAGE := libsemanage-$(LIBSEMANAGE_VERSION)
LIBSEMANAGE_SUFFIX := tar.gz
-LIBSEMANAGE_URL := https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20120924/$(LIBSEMANAGE).$(LIBSEMANAGE_SUFFIX)
+LIBSEMANAGE_URL := $(SELINUX_URL)/$(LIBSEMANAGE).$(LIBSEMANAGE_SUFFIX)
LIBSEMANAGE_SOURCE := $(SRCDIR)/$(LIBSEMANAGE).$(LIBSEMANAGE_SUFFIX)
LIBSEMANAGE_DIR := $(BUILDDIR)/$(LIBSEMANAGE)
LIBSEMANAGE_LICENSE := LGPL-2.1-or-later
+LIBSEMANAGE_LICENSE_FILES := file://LICENSE;md5=03068f550c635f6520e0f0252da412fc
+LIBSEMANAGE_CVE_PRODUCT := selinuxproject:libsemanage
# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------
-LIBSEMANAGE_CONF_TOOL := NO
-# no := due to CROSS_PYTHON
-LIBSEMANAGE_MAKE_ENV = \
- $(CROSS_ENV) \
- CFLAGS="-O2 -Wall -g" \
- PYTHON=$(CROSS_PYTHON)
+LIBSEMANAGE_CONF_TOOL := NO
+LIBSEMANAGE_MAKE_ENV := $(CROSS_ENV)
+LIBSEMANAGE_MAKE_OPT = \
+ PREFIX=/usr \
+ LIBDIR=/usr/lib \
+ INCLUDEDIR=/usr/include \
+ SYSCONFDIR=/etc \
+ DISABLE_SHARED=n \
+ CFLAGS="-O2 -Wall -g"
-LIBSEMANAGE_MAKE_OPT := \
- LIBDIR=$(PTXDIST_SYSROOT_TARGET)/usr/lib
-LIBSEMANAGE_INSTALL_OPT := \
+ifdef PTXCONF_LIBSEMANAGE_PYTHON
+LIBSEMANAGE_MAKE_OPT += \
+ PYTHON=$(CROSS_PYTHON3) \
+ PYTHONLIBDIR=$(PYTHON3_SITEPACKAGES) \
+ PYCEXT=$(shell $(CROSS_PYTHON3) -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))')
+endif
+
+LIBSEMANAGE_INSTALL_OPT = \
+ $(LIBSEMANAGE_MAKE_OPT) \
install
ifdef PTXCONF_LIBSEMANAGE_PYTHON
@@ -44,6 +55,20 @@ LIBSEMANAGE_MAKE_OPT += pywrap
LIBSEMANAGE_INSTALL_OPT += install-pywrap
endif
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libsemanage.install:
+ @$(call targetinfo)
+ @$(call world/install, LIBSEMANAGE)
+ifdef PTXCONF_LIBSEMANAGE_PYTHON
+ @$(CROSS_PYTHON3) -m compileall -q -d $(PYTHON3_SITEPACKAGES) \
+ $(LIBSEMANAGE_PKGDIR)$(PYTHON3_SITEPACKAGES)
+ @$(call world/env, LIBSEMANAGE) ptxd_make_world_install_python_cleanup
+endif
+ @$(call touch)
+
# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------
@@ -61,7 +86,7 @@ $(STATEDIR)/libsemanage.targetinstall:
@$(call install_alternative, libsemanage, 0, 0, 0644, /etc/selinux/semanage.conf)
ifdef PTXCONF_LIBSEMANAGE_PYTHON
- @$(call install_tree, libsemanage, 0, 0, -, $(PYTHON_SITEPACKAGES))
+ @$(call install_glob, libsemanage, 0, 0, -, $(PYTHON3_SITEPACKAGES),, *.py)
endif
@$(call install_finish, libsemanage)
--
2.47.3
next prev parent reply other threads:[~2026-11-16 7:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 7:26 [ptxdist] [PATCH v3 00/18] selinux: back at version 3.11 Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 01/18] selinux: add common version and URL Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 02/18] Revert "python: remove after more than one year in staging" Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 03/18] host-swig: version bump 4.0.1 -> 4.5.1 Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 04/18] Revert "*libsepol: remove" Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 05/18] libsepol: version bump 2.1.8 -> 3.11 Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 06/18] Revert "libselinux: remove after more than one year in staging" Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 07/18] libselinux: version bump 2.1.12 -> 3.11 Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 08/18] python3-libselinux: new package Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 09/18] audit: " Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 10/18] Revert "libsemanage: remove after more than one year in staging" Ladislav Michl
2026-11-16 7:26 ` Ladislav Michl [this message]
2026-11-16 7:26 ` [ptxdist] [PATCH v3 12/18] Revert "checkpolicy: " Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 13/18] checkpolicy: version bump 2.1.11 -> 3.11 Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 14/18] Revert "policycoreutils: remove after more than one year in staging" Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 15/18] policycoreutils: version bump 2.1.13 -> 3.11 Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 16/18] Revert "sepolgen: remove after one year in staging" Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 17/18] sepolgen: version bump 1.1.8 -> 3.11 Ladislav Michl
2026-11-16 7:26 ` [ptxdist] [PATCH v3 18/18] selinux: restore the global option Ladislav Michl
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=20261116072639.3157459-12-oss-lists@triops.cz \
--to=oss-lists@triops.cz \
--cc=ptxdist@pengutronix.de \
/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