public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Michal Schorm <mschorm@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/mariadb10.11] f44: [refactor] Rework versioned packages layout macros
Date: Fri, 26 Jun 2026 08:44:15 GMT [thread overview]
Message-ID: <178246345547.1.9066040082052999531.rpms-mariadb10.11-918bbfaf67d5@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/mariadb10.11
Branch : f44
Commit : 918bbfaf67d5bb644a25b2b4c8955eeea5abf4c9
Author : Michal Schorm <mschorm@redhat.com>
Date : 2026-06-26T10:43:49+02:00
Stats : +53/-50 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/mariadb10.11/c/918bbfaf67d5bb644a25b2b4c8955eeea5abf4c9?branch=f44
Log:
[refactor] Rework versioned packages layout macros
- Move all macro definitions to the top of the spec (after globals),
away from the base package section, for clarity that this code
is not base package specific
- Rename 'mariadbXX_if_default()' to 'versioned_virtual_provides()';
clearer name describing what it does, not when it applies
- Add 'versioned_virtual_provides_arched()': composes base macro
+ ISA-tagged variant, so the Provides line is not duplicated
- Reverse naming convention: base macro (no suffix) = noarch-safe,
'_arched' suffix = adds '%{?_isa}' provides. Applied consistently
to both 'versioned_virtual_provides()' and 'virtual_conflicts_and_provides()'
- Noarch subpackages (client-utils, common, errmsg, server-utils) now
use 'virtual_conflicts_and_provides()' (base), gaining versioned provides
they previously lacked. Arch subpackages use '_arched' variant.
This is important for the virtual provides integrity.
When each package - arch or noarch - provides the versioned names,
these versioned names can be used programatically for batch package
upgrades and downgrades. Without that, downgrades specifically to the
version-less (distribution default) RPMs has to be done only via the
unversioned names.
--
Co-Authored-By: Claude AI <noreply@anthropic.com>
---
diff --git a/mariadb10.11.spec b/mariadb10.11.spec
index 7e7c67c..6fecc59 100644
--- a/mariadb10.11.spec
+++ b/mariadb10.11.spec
@@ -151,6 +151,37 @@
%global dbdatadir %{_localstatedir}/lib/mysql
+# Macros for extra RPM relations for the versioned packages layout
+%define conflict_with_other_streams() %{expand:\
+Provides: %{majorname}%{?1:-%{1}}-any\
+Conflicts: %{majorname}%{?1:-%{1}}-any\
+}
+
+# Add versioned virtual provides, when the RPMs real names are version-less
+# (that is, when this is the "distribution default version")
+%if %?mariadb_default
+%define versioned_virtual_provides() %{expand:\
+Provides: mariadb%{majorversion}%{?1:-%{1}} = %{sameevr}\
+}
+%define versioned_virtual_provides_arched() %{expand:\
+%versioned_virtual_provides %{**}\
+Provides: mariadb%{majorversion}%{?1:-%{1}}%{?_isa} = %{sameevr}\
+}
+%else
+%define versioned_virtual_provides() %{nil}
+%define versioned_virtual_provides_arched() %{nil}
+%endif
+
+%define virtual_conflicts_and_provides() %{expand:\
+%conflict_with_other_streams %{**}\
+%versioned_virtual_provides %{**}\
+}
+
+%define virtual_conflicts_and_provides_arched() %{expand:\
+%conflict_with_other_streams %{**}\
+%versioned_virtual_provides_arched %{**}\
+}
+# End of versioned packages layout macros
# Set explicit conflicts with 'mysql' packages
%bcond_without conflicts_mysql
@@ -342,27 +373,7 @@ Suggests: %{pkgname}-server%{?_isa} = %{sameevr}
# Explicitly disallow combination mariadb + mysql-server
%{?with_conflicts_mysql:Conflicts: mysql-server-any}
-%define conflict_with_other_streams() %{expand:\
-Provides: %{majorname}%{?1:-%{1}}-any\
-Conflicts: %{majorname}%{?1:-%{1}}-any\
-}
-
-# Provide also mariadbXX.XX if default
-%if %?mariadb_default
-%define mariadbXX_if_default() %{expand:\
-Provides: mariadb%{majorversion}%{?1:-%{1}} = %{sameevr}\
-Provides: mariadb%{majorversion}%{?1:-%{1}}%{?_isa} = %{sameevr}\
-}
-%else
-%define mariadbXX_if_default() %{nil}
-%endif
-
-%define virtual_conflicts_and_provides() %{expand:\
-%conflict_with_other_streams %{**}\
-%mariadbXX_if_default %{**}\
-}
-
-%virtual_conflicts_and_provides
+%virtual_conflicts_and_provides_arched
%description
MariaDB is a community developed fork from MySQL - a multi-user, multi-threaded
@@ -386,9 +397,7 @@ Summary: Non-essential client utilities for MariaDB/MySQL applications
Requires: %{pkgname} = %{sameevr}
Requires: perl(DBI)
-# Only conflicts, provides would add %%{_isa} provides for noarch,
-# which is not wanted
-%conflict_with_other_streams client-utils
+%virtual_conflicts_and_provides client-utils
%description -n %{pkgname}-client-utils
This package contains all non-essential client utilities and scripts for
@@ -402,7 +411,7 @@ subpackage, that depends on Perl.
Summary: The shared libraries required for MariaDB/MySQL clients
Requires: %{pkgname}-common = %{sameevr}
-%virtual_conflicts_and_provides libs
+%virtual_conflicts_and_provides_arched libs
%{?with_conflicts_mysql:Conflicts: mysql-libs-any}
@@ -427,7 +436,7 @@ to a MariaDB/MySQL server.
%package -n %{pkgname}-config
Summary: The config files required by server and client
-%virtual_conflicts_and_provides config
+%virtual_conflicts_and_provides_arched config
%description -n %{pkgname}-config
The package provides the config file my.cnf and my.cnf.d directory used by any
@@ -447,9 +456,7 @@ Requires: mariadb-connector-c-config
Requires: %{_sysconfdir}/my.cnf
%endif
-# Only conflicts, provides would add %%{_isa} provides for noarch,
-# which is not wanted
-%conflict_with_other_streams common
+%virtual_conflicts_and_provides common
%description -n %{pkgname}-common
The package provides the essential shared files for any MariaDB program.
@@ -463,9 +470,7 @@ Summary: The error messages files required by server and embedded
BuildArch: noarch
Requires: %{pkgname}-common = %{sameevr}
-# Only conflicts, provides would add %%{_isa} provides for noarch,
-# which is not wanted
-%conflict_with_other_streams errmsg
+%virtual_conflicts_and_provides errmsg
%description -n %{pkgname}-errmsg
The package provides error messages files for the MariaDB daemon and the
@@ -490,7 +495,7 @@ Requires: lsof
# Default wsrep_sst_method
Requires: rsync
-%virtual_conflicts_and_provides server-galera
+%virtual_conflicts_and_provides_arched server-galera
%description -n %{pkgname}-server-galera
MariaDB is a multi-user, multi-threaded SQL database server. It is a
@@ -533,7 +538,7 @@ Requires: %{_sysconfdir}/my.cnf
Requires: %{_sysconfdir}/my.cnf.d
%endif
-%virtual_conflicts_and_provides server
+%virtual_conflicts_and_provides_arched server
# Additional SELinux rules (common for MariaDB & MySQL) shipped in a separate package
# For cases, where we want to fix a SELinux issues in MariaDB sooner than patched selinux-policy-targeted package is released
@@ -574,7 +579,7 @@ Requires: %{pkgname}-server%{?_isa} = %{sameevr}
BuildRequires: boost-devel >= 1.40.0
BuildRequires: Judy-devel
-%virtual_conflicts_and_provides oqgraph-engine
+%virtual_conflicts_and_provides_arched oqgraph-engine
%description -n %{pkgname}-oqgraph-engine
The package provides Open Query GRAPH engine (OQGRAPH) as plugin for MariaDB
@@ -593,7 +598,7 @@ Requires: %{pkgname}-server%{?_isa} = %{sameevr}
# As per https://jira.mariadb.org/browse/MDEV-21450
BuildRequires: libxml2-devel
-%virtual_conflicts_and_provides connect-engine
+%virtual_conflicts_and_provides_arched connect-engine
%description -n %{pkgname}-connect-engine
The CONNECT storage engine enables MariaDB to access external local or
@@ -610,7 +615,7 @@ Summary: The mariabackup tool for physical online backups
Requires: %{pkgname}-server%{?_isa} = %{sameevr}
BuildRequires: libarchive-devel
-%virtual_conflicts_and_provides backup
+%virtual_conflicts_and_provides_arched backup
%description -n %{pkgname}-backup
MariaDB Backup is an open source tool provided by MariaDB for performing
@@ -635,7 +640,7 @@ Requires: %{pkgname}-server%{?_isa} = %{sameevr}
Provides: bundled(rocksdb)
Conflicts: rocksdb-tools
-%virtual_conflicts_and_provides rocksdb-engine
+%virtual_conflicts_and_provides_arched rocksdb-engine
%description -n %{pkgname}-rocksdb-engine
The RocksDB storage engine is used for high performance servers on SSD drives.
@@ -654,7 +659,7 @@ Requires(post): (libselinux-utils if selinux-policy-%{selinuxtype})
Requires(post): (policycoreutils if selinux-policy-%{selinuxtype})
Requires(post): (policycoreutils-python-utils if selinux-policy-%{selinuxtype})
-%virtual_conflicts_and_provides cracklib-password-check
+%virtual_conflicts_and_provides_arched cracklib-password-check
%description -n %{pkgname}-cracklib-password-check
CrackLib is a password strength checking library. It is installed by default
@@ -671,7 +676,7 @@ Summary: GSSAPI authentication plugin for server
Requires: %{pkgname}-server%{?_isa} = %{sameevr}
BuildRequires: krb5-devel
-%virtual_conflicts_and_provides gssapi-server
+%virtual_conflicts_and_provides_arched gssapi-server
%description -n %{pkgname}-gssapi-server
GSSAPI authentication server-side plugin for MariaDB for passwordless login.
@@ -689,7 +694,7 @@ Requires(pre): %{pkgname}-server%{?_isa} = %{sameevr}
BuildRequires: pam-devel
-%virtual_conflicts_and_provides pam
+%virtual_conflicts_and_provides_arched pam
%description -n %{pkgname}-pam
PAM authentication server-side plugin for MariaDB.
@@ -704,7 +709,7 @@ Requires: %{pkgname}-server%{?_isa} = %{sameevr}
BuildRequires: sphinx libsphinxclient-devel
Requires: sphinx libsphinxclient
-%virtual_conflicts_and_provides sphinx-engine
+%virtual_conflicts_and_provides_arched sphinx-engine
%description -n %{pkgname}-sphinx-engine
The Sphinx storage engine for MariaDB.
@@ -718,7 +723,7 @@ Requires: %{pkgname}-server%{?_isa} = %{sameevr}
BuildRequires: curl-devel
-%virtual_conflicts_and_provides s3-engine
+%virtual_conflicts_and_provides_arched s3-engine
%description -n %{pkgname}-s3-engine
The S3 read only storage engine allows archiving MariaDB tables in Amazon S3,
@@ -734,9 +739,7 @@ Requires: %{pkgname}-server = %{sameevr}
# mysqlhotcopy needs DBI/DBD support
Requires: perl(DBI) perl(DBD::MariaDB)
-# Only conflicts, provides would add %%{_isa} provides for noarch,
-# which is not wanted
-%conflict_with_other_streams server-utils
+%virtual_conflicts_and_provides server-utils
%{?with_conflicts_mysql:Conflicts: mysql-server-any}
@@ -756,7 +759,7 @@ Requires: openssl-devel
Requires: mariadb-connector-c-devel >= 3.0
%endif
-%virtual_conflicts_and_provides devel
+%virtual_conflicts_and_provides_arched devel
%{?with_conflicts_mysql:Conflicts: mysql-devel-any}
@@ -780,7 +783,7 @@ Summary: MariaDB as an embeddable library
Requires: %{pkgname}-common = %{sameevr}
Requires: %{pkgname}-errmsg = %{sameevr}
-%virtual_conflicts_and_provides embedded
+%virtual_conflicts_and_provides_arched embedded
%description -n %{pkgname}-embedded
MariaDB is a multi-user, multi-threaded SQL database server. This
@@ -796,7 +799,7 @@ Requires: %{pkgname}-devel%{?_isa} = %{sameevr}
# embedded-devel should require libaio-devel (rhbz#1290517)
Requires: libaio-devel
-%virtual_conflicts_and_provides embedded-devel
+%virtual_conflicts_and_provides_arched embedded-devel
%description -n %{pkgname}-embedded-devel
MariaDB is a multi-user, multi-threaded SQL database server.
@@ -825,7 +828,7 @@ Requires: perl(Sys::Hostname)
Requires: perl(Test::More)
Requires: perl(Time::HiRes)
-%virtual_conflicts_and_provides test
+%virtual_conflicts_and_provides_arched test
%{?with_conflicts_mysql:Conflicts: mysql-test-any}
reply other threads:[~2026-06-26 8:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=178246345547.1.9066040082052999531.rpms-mariadb10.11-918bbfaf67d5@fedoraproject.org \
--to=mschorm@redhat.com \
--cc=git-commits@fedoraproject.org \
/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