From 3294b48acf2f764873445e32e66d633f0e8f67c8 Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Fri, 15 Sep 2023 14:46:53 +0200 Subject: [PATCH] Additional explanation for the previous commit: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the previous commit, the line: both the line | Requires(post): policycoreutils and is removed, since it is already contained in the macro | %{?selinux_requires} on line after them. $ rpm -E %{?selinux_requires} | | Requires: selinux-policy >= 37.22-1.fc37 | BuildRequires: pkgconfig(systemd) | BuildRequires: selinux-policy | BuildRequires: selinux-policy-devel | Requires(post): selinux-policy-base >= 37.22-1.fc37 | Requires(post): libselinux-utils | Requires(post): policycoreutils | %if 037 || 0 > 7 | Requires(post): policycoreutils-python-utils | %else | Requires(post): policycoreutils-python | %endif Defined here: https://src.fedoraproject.org/rpms/selinux-policy/blob/rawhide/f/rpm.macros#_32 However this can't be applied to the line: | BuildRequires: selinux-policy-devel Since the it is a recursive problem - the BuildRequires has to be already evaluated for a package containing the macro %{?selinux_requires} to be brought in. So the additional BuildRequires that macro brings has no effect as the evaluation of this kind of symbols has already finished. That's why in the examples as: https://fedoraproject.org/wiki/SELinux/IndependentPolicy#Example_spec_file_changes_to_incorporate_-selinux_subpackage is the lines | BuildRequires: selinux-policy-devel | %{?selinux_requires} Next to each other. Even though the first line would seem redundant, it in fact isnĀ“t. In this commit, I've changed ordering of the lines to group up same symbols together as they logically go one after another. I believe that having all BuildRequires grouped together is easier to read and understand. --- mysql-selinux.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-selinux.spec b/mysql-selinux.spec index 3150ffb..d2d9de1 100644 --- a/mysql-selinux.spec +++ b/mysql-selinux.spec @@ -14,11 +14,13 @@ Summary: SELinux policy modules for MySQL and MariaDB packages Source0: https://github.com/devexp-db/mysql-selinux/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz BuildArch: noarch + BuildRequires: make +BuildRequires: selinux-policy-devel + +%{?selinux_requires} Requires: selinux-policy-%{selinuxtype} Requires(post): selinux-policy-%{selinuxtype} -BuildRequires: selinux-policy-devel -%{?selinux_requires} %description SELinux policy modules for MySQL and MariaDB packages.