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] f43: [refactor] Rework versioned packages layout macros
Date: Fri, 26 Jun 2026 16:16:07 GMT	[thread overview]
Message-ID: <178249056766.1.10200627378770756443.rpms-mariadb10.11-587e69fda676@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/mariadb10.11
            Branch : f43
            Commit : 587e69fda6765671e319127f623e3acc2563849c
            Author : Michal Schorm <mschorm@redhat.com>
            Date   : 2026-06-26T18:15:58+02:00
            Stats  : +53/-50 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/mariadb10.11/c/587e69fda6765671e319127f623e3acc2563849c?branch=f43

            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 f29f470..840e317 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
@@ -347,27 +378,7 @@ Suggests:         %{pkgname}-server%{?_isa} = %{sameevr}
 %{?with_conflicts_mysql:Conflicts: mysql-server-any}
 %{?with_conflicts_community_mysql:Conflicts: community-mysql-server}
 
-%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
@@ -391,9 +402,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
@@ -407,7 +416,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}
 %{?with_conflicts_community_mysql:Conflicts: community-mysql-libs}
@@ -433,7 +442,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
@@ -453,9 +462,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.
@@ -469,9 +476,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
@@ -496,7 +501,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
@@ -539,7 +544,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
@@ -582,7 +587,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
@@ -601,7 +606,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
@@ -618,7 +623,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
@@ -643,7 +648,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.
@@ -662,7 +667,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
@@ -679,7 +684,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.
@@ -697,7 +702,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.
@@ -712,7 +717,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.
@@ -726,7 +731,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,
@@ -742,9 +747,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}
 %{?with_conflicts_community_mysql:Conflicts: community-mysql-server}
@@ -765,7 +768,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}
 %{?with_conflicts_community_mysql:Conflicts: community-mysql-devel}
@@ -790,7 +793,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
@@ -806,7 +809,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.
@@ -835,7 +838,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}
 %{?with_conflicts_community_mysql:Conflicts: community-mysql-test}

                 reply	other threads:[~2026-06-26 16:16 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=178249056766.1.10200627378770756443.rpms-mariadb10.11-587e69fda676@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