From 5c2a8a0046269e461c8afb43484b3bc3a1c99651 Mon Sep 17 00:00:00 2001 From: yuanhui Date: Tue, 12 Mar 2024 14:11:36 +0800 Subject: [PATCH] Merge LifseaOS code to anolis8 Signed-off-by: yuanhui --- container-selinux.spec | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/container-selinux.spec b/container-selinux.spec index 043d877..a48a80b 100644 --- a/container-selinux.spec +++ b/container-selinux.spec @@ -20,7 +20,7 @@ Epoch: 2 Name: container-selinux Version: 2.221.0 -Release: 1%{?dist} +Release: 2%{?dist}%{?lifsea_dist} License: GPLv2 URL: %{git0} Summary: SELinux policies for container runtimes @@ -35,11 +35,13 @@ Requires: selinux-policy >= %{selinux_policyver} Requires(post): selinux-policy-base >= %{selinux_policyver} Requires(post): selinux-policy-targeted >= %{selinux_policyver} Requires(post): policycoreutils >= 2.5-11 +%if ! %{defined lifsea_dist} %if 0%{?rhel} > 7 || 0%{?fedora} Requires(post): policycoreutils-python-utils %else Requires(post): policycoreutils-python %endif +%endif Requires(post): libselinux-utils Requires(post): sed Obsoletes: %{name} <= 2:1.12.5-14 @@ -51,6 +53,13 @@ Conflicts: udica < 0.2.6-1 %description SELinux policy modules for use with container runtimes. +# To avoid users installing the LifseaOS package in other os +%define common_pre_scripts() \ +if ! grep -q 'ID="lifsea"' /etc/os-release; then \ + echo "This package is only for LifseaOS!" \ + exit 1 \ +fi + %prep %autosetup -Sgit @@ -91,6 +100,9 @@ rm -rf %{name}.spec %check %pre +%if %{defined lifsea_dist} +%{common_pre_scripts} +%endif %selinux_relabel_pre -s %{selinuxtype} %post @@ -127,6 +139,9 @@ fi %{_datadir}/udica/templates/* %changelog +* Tue Mar 12 2024 yuanhui - 2:2.221.0-2 +- LifseaOS: Remove the dependency of python + * Tue Aug 15 2023 Jindrich Novy - 2:2.221.0-1 - update to https://github.com/containers/container-selinux/releases/tag/v2.221.0 - Related: #2176055 -- Gitee