From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 16 Nov 2026 08:53:41 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xSrX3-0000KQ-00 for lore@lore.pengutronix.de; Mon, 16 Nov 2026 08:53:41 +0100 Received: from [127.0.0.1] (helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1xSr7g-0000Lo-Bg; Mon, 16 Nov 2026 08:27:28 +0100 Received: from mx1.white.stw.pengutronix.de ([2a0a:edc0:0:b01:1d::107]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1xSr6y-0006JA-9D for ptxdist@pengutronix.de; Mon, 16 Nov 2026 08:26:44 +0100 Received: from h3.cmg1.smtp.forpsi.com (h3.cmg1.smtp.forpsi.com [185.129.138.162]) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPS id 2AC8D200F60 for ; Mon, 16 Nov 2026 08:26:44 +0100 (CET) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=pengutronix.de; s=20260414; t=1794814004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tR0IT612Gu7hyYa1LbW13+CuHA/MWv5ZaLkR9T7WEQg=; b=ObnhiBe/v9VpNg7ZKnubDPOenBvZKhHUnzz8wFhs82nLeOu97h/fkVP0MuyqLDTdR+PzBJ uDL24twryhJKKCIDKGVezFgkMxODUi6ZGxfw1l9jDvh/x8l5ZlApe6uwDzo8+88DoloZBc DKv4hZkw70T9VIY2uGS5smmAuMIU4UUh3D4TnXqL8pxV0whO8KD9jnmsnvvJsZHk1li1eR 3T82bSdLIleHBG8h1dDC48d/3VLZbWApIizQgvfmoPOhiFuO3v7EoOv6LiqAdNcZMi5t13 UOA1Hs08GqgDhPNzHdEr4tT7l9Gb2xKBk2fkL6ZFGaO+hWzqY6j0n/m+lchD7g== ARC-Seal: i=1; s=20260414; d=pengutronix.de; t=1794814004; a=rsa-sha256; cv=none; b=PRwZ0KlCKDc+qgh1dQJkejkWplWPmdN0lHoplShQLnTPWNAIw6LxeNJtt4+fknpAmDCQTH nf/mDSvRIV0pnv2UJEDo2aU0DNIV6aoKOymL44U0Mjh1ZgSw/KItan1V/BT78iR5bJJY88 oFLL1fVDWs68tHdynku/QS1HQsdVxRJUdOozqEj+AT81IT96CJvQXsMJiyqcszJIICX1d5 u9NbwuCprYZ23DKd64PzSf2tZAwr80bfb2E49W3X4d/j8Sp0lt2MbkayYj/sp7FnMHIvNn RVAtHDw4yglqrgq57NKAHwdJyMopHLhrshLmfukH2kQrgxRMeZhCtmLfSjutNw== ARC-Authentication-Results: i=1; mx1.white.stw.pengutronix.de; dkim=pass header.d=triops.cz header.s=f2019 header.b=YmyFxJBO; spf=none (mx1.white.stw.pengutronix.de: domain of oss-lists@triops.cz has no SPF policy when checking 185.129.138.162) smtp.mailfrom=oss-lists@triops.cz; dmarc=none Received: from localhost.localdomain ([91.218.190.200]) by cmgsmtp with ESMTPSA id Sr6ux1qkrkQfeSr6xxJMQb; Mon, 16 Nov 2026 08:26:44 +0100 From: Ladislav Michl To: ptxdist@pengutronix.de Date: Mon, 16 Nov 2026 08:26:37 +0100 Message-ID: <20261116072639.3157459-18-oss-lists@triops.cz> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261116072639.3157459-1-oss-lists@triops.cz> References: <20261116072639.3157459-1-oss-lists@triops.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfG5Hyl0Mo2VC6ScR77c959WKsdYUgoNHG0R7gh0QFsDgkjKbDUSFpoViltGQGprtw7l1z13bJHd8SksfPV8ifOqwf8sUSP+2ivrwrYGqCE4PJAcF5nNA Ld1VZ3U3er8NtHSnmEuG5H4pV2CbAopEqappbVBGuUA5QkmooyrKS+R4eRSw+greeR8Id4wPj5djXpHQbVyQnB9S0k0r0ygdILU= X-Spamd-Result: default: False [-1.60 / 15.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[triops.cz:s=f2019]; ONCE_RECEIVED(0.20)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:24806, ipnet:185.129.136.0/22, country:CZ]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; NEURAL_HAM(-0.00)[-0.992]; ARC_SIGNED(0.00)[pengutronix.de:s=20260414:i=1]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DMARC_NA(0.00)[triops.cz]; R_SPF_NA(0.00)[no SPF record]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[triops.cz:+] X-Rspamd-Action: no action X-Rspamd-Queue-Id: 2AC8D200F60 X-Rspamd-Server: mx1 X-Stat-Signature: 16ije1tkjnf97cbhd8yc4ka7gngieu1f Subject: [ptxdist] [PATCH v3 17/18] sepolgen: version bump 1.1.8 -> 3.11 X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false From: Ladislav Michl Since SELinux userspace 2.8, the sepolgen python module is shipped in the selinux-python tarball together with audit2allow, so rename the package to selinux-python. Signed-off-by: Ladislav Michl --- CHANGES: - v2: pass PREFIX, BINDIR, PYTHON, PYTHONLIBDIR and CFLAGS as make options instead of environment, so they apply to install as well. - v3: select PYTHON3_LIBSELINUX. Byte-compile the python modules and install only .pyc files using install_glob. rules/selinux-python.in | 12 ++++++ rules/selinux-python.make | 80 +++++++++++++++++++++++++++++++++++++++ rules/sepolgen.in | 29 -------------- rules/sepolgen.make | 54 -------------------------- 4 files changed, 92 insertions(+), 83 deletions(-) create mode 100644 rules/selinux-python.in create mode 100644 rules/selinux-python.make delete mode 100644 rules/sepolgen.in delete mode 100644 rules/sepolgen.make diff --git a/rules/selinux-python.in b/rules/selinux-python.in new file mode 100644 index 000000000..2ebd65e6e --- /dev/null +++ b/rules/selinux-python.in @@ -0,0 +1,12 @@ +## SECTION=selinux + +config SELINUX_PYTHON + tristate + prompt "selinux-python" + select PYTHON3 + select LIBSEPOL + select LIBSELINUX + select PYTHON3_LIBSELINUX + help + audit2allow and the sepolgen python module it uses to + generate SELinux policy from audit messages. diff --git a/rules/selinux-python.make b/rules/selinux-python.make new file mode 100644 index 000000000..951824b07 --- /dev/null +++ b/rules/selinux-python.make @@ -0,0 +1,80 @@ +# -*-makefile-*- +# +# Copyright (C) 2013 by Marc Kleine-Budde +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_SELINUX_PYTHON) += selinux-python + +# +# Paths and names +# +SELINUX_PYTHON_VERSION := $(SELINUX_VERSION) +SELINUX_PYTHON_SHA256 := f854d7fe67981d80c612067e97c1804f641a9dfcca2d38baeb3efe52b7875398 +SELINUX_PYTHON := selinux-python-$(SELINUX_PYTHON_VERSION) +SELINUX_PYTHON_SUFFIX := tar.gz +SELINUX_PYTHON_URL := $(SELINUX_URL)/$(SELINUX_PYTHON).$(SELINUX_PYTHON_SUFFIX) +SELINUX_PYTHON_SOURCE := $(SRCDIR)/$(SELINUX_PYTHON).$(SELINUX_PYTHON_SUFFIX) +SELINUX_PYTHON_DIR := $(BUILDDIR)/$(SELINUX_PYTHON) +SELINUX_PYTHON_LICENSE := GPL-2.0-only +SELINUX_PYTHON_LICENSE_FILES := file://LICENSE;md5=393a5ca445f6965873eca0259a17f833 + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +SELINUX_PYTHON_CONF_TOOL := NO +SELINUX_PYTHON_MAKE_ENV := $(CROSS_ENV) +SELINUX_PYTHON_MAKE_OPT = \ + SUBDIRS="sepolgen audit2allow" \ + PREFIX=/usr \ + BINDIR=/usr/bin \ + PYTHON=$(CROSS_PYTHON3) \ + PYTHONLIBDIR=$(PYTHON3_SITEPACKAGES) \ + CFLAGS="-O2 -Wall -g" +SELINUX_PYTHON_INSTALL_OPT = \ + $(SELINUX_PYTHON_MAKE_OPT) \ + install + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/selinux-python.install: + @$(call targetinfo) + @$(call world/install, SELINUX_PYTHON) + @$(CROSS_PYTHON3) -m compileall -q -d $(PYTHON3_SITEPACKAGES) \ + $(SELINUX_PYTHON_PKGDIR)$(PYTHON3_SITEPACKAGES) + @$(call world/env, SELINUX_PYTHON) ptxd_make_world_install_python_cleanup + @$(call touch) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/selinux-python.targetinstall: + @$(call targetinfo) + + @$(call install_init, selinux-python) + @$(call install_fixup, selinux-python,PRIORITY,optional) + @$(call install_fixup, selinux-python,SECTION,base) + @$(call install_fixup, selinux-python,AUTHOR,"Marc Kleine-Budde ") + @$(call install_fixup, selinux-python,DESCRIPTION,missing) + + @$(call install_glob, selinux-python, 0, 0, -, $(PYTHON3_SITEPACKAGES),, *.py) + @$(call install_alternative, selinux-python, 0, 0, 0644, /var/lib/sepolgen/perm_map) + @$(call install_copy, selinux-python, 0, 0, 0755, -, /usr/bin/audit2allow) + @$(call install_link, selinux-python, audit2allow, /usr/bin/audit2why) + @$(call install_copy, selinux-python, 0, 0, 0755, -, /usr/bin/sepolgen-ifgen) + @$(call install_copy, selinux-python, 0, 0, 0755, -, /usr/bin/sepolgen-ifgen-attr-helper) + + @$(call install_finish, selinux-python) + + @$(call touch) + +# vim: syntax=make diff --git a/rules/sepolgen.in b/rules/sepolgen.in deleted file mode 100644 index 94f2ce071..000000000 --- a/rules/sepolgen.in +++ /dev/null @@ -1,29 +0,0 @@ -## SECTION=staging -## old section: -### SECTION=selinux - -config SEPOLGEN - tristate - prompt "sepolgen" - select PYTHON - select LIBSELINUX - select LIBSELINUX_PYTHON - help - A Python module used in SELinux policy generation - - This package contains a Python module that forms the core of - the modern audit2allow (which is a part of the package - policycoreutils). The sepolgen library is structured to give - flexibility to the application using it. The library - contains: Reference Policy Representation, which are Objects - for representing policies and the reference policy - interfaces. Secondly, it has objects and algorithms for - representing access and sets of access in an abstract way - and searching that access. It also has a parser for - reference policy "headers". It contains infrastructure for - parsing SELinux related messages as produced by the audit - system. It has facilities for generating policy based on - required access. - - STAGING: remove in ptxdist-2020.06.0 - Old version that needs to be updated. diff --git a/rules/sepolgen.make b/rules/sepolgen.make deleted file mode 100644 index 7084e1d1d..000000000 --- a/rules/sepolgen.make +++ /dev/null @@ -1,54 +0,0 @@ -# -*-makefile-*- -# -# Copyright (C) 2013 by Marc Kleine-Budde -# -# For further information about the PTXdist project and license conditions -# see the README file. -# - -# -# We provide this package -# -PACKAGES-$(PTXCONF_SEPOLGEN) += sepolgen - -# -# Paths and names -# -SEPOLGEN_VERSION := 1.1.8 -SEPOLGEN_MD5 := d734ff236639cc1bd3a33901774fa98d -SEPOLGEN := sepolgen-$(SEPOLGEN_VERSION) -SEPOLGEN_SUFFIX := tar.gz -SEPOLGEN_URL := https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20120924/$(SEPOLGEN).$(SEPOLGEN_SUFFIX) -SEPOLGEN_SOURCE := $(SRCDIR)/$(SEPOLGEN).$(SEPOLGEN_SUFFIX) -SEPOLGEN_DIR := $(BUILDDIR)/$(SEPOLGEN) -SEPOLGEN_LICENSE := GPL-2.0-only - -# ---------------------------------------------------------------------------- -# Prepare -# ---------------------------------------------------------------------------- - -SEPOLGEN_CONF_TOOL := NO -# no ':=' because of $(PYTHON_SITEPACKAGES) -SEPOLGEN_MAKE_ENV = PYTHONLIBDIR=$(PYTHON_SITEPACKAGES) - -# ---------------------------------------------------------------------------- -# Target-Install -# ---------------------------------------------------------------------------- - -$(STATEDIR)/sepolgen.targetinstall: - @$(call targetinfo) - - @$(call install_init, sepolgen) - @$(call install_fixup, sepolgen,PRIORITY,optional) - @$(call install_fixup, sepolgen,SECTION,base) - @$(call install_fixup, sepolgen,AUTHOR,"Marc Kleine-Budde ") - @$(call install_fixup, sepolgen,DESCRIPTION,missing) - - @$(call install_tree, sepolgen, 0, 0, -, $(PYTHON_SITEPACKAGES)) - @$(call install_alternative, sepolgen, 0, 0, 0644, /var/lib/sepolgen/perm_map) - - @$(call install_finish, sepolgen) - - @$(call touch) - -# vim: syntax=make -- 2.47.3