Commit Graph

915 Commits

Author SHA1 Message Date
Pavol Sloboda
01c3ed1a1d Updated the cil selinux rules for galera to install properly
added the missing bracket and removed the illegal . from the name and
replaced it with a _

This issue has been found after recieving a dnf error during
installation of the mariadb-server-galera package:
>>> Scriptlet output:
>>> Close parenthesis without matching open at line 15 of /var/lib/selinux/targeted/tmp/modules/200/mariadb-server-galera/cil
>>> libsemanage.semanage_load_files: Error while reading from file /var/lib/selinux/targeted/tmp/modules/200/mariadb-server-galera/cil. (No such file or directory).
>>> semodule:  Failed!

and the subsequent call of `semodule -lfull | grep galera`
prints nothing and returns 1

The expected output for the installation is to go through normally
without the above mentioned error

And the expected output for `semodule -lfull | grep galera` is:
200 mariadb-server-galera                  cil

and the command returning 0
2025-07-23 09:10:26 +02:00
Michal Schorm
d0ed3f88b5 [SPECfile cleanup] Remove Obsolete from 'mariadb-common' to 'mariadb-libs'
The 'mariadb-libs' sub-package contains the MariaDB client library.
However we don't build or use the 'mariadb-libs' sub-package anymore, since
the client library is shipped by the 'mariadb-connector-c' package instead.

This change was done between MariaDB 10.1 and 10.2, which is more than 7 years ago.

The right way would be to set this Obsolete inside the 'mariadb-connector-c'
package instead, but since it's such an acient artifact, I'll just drop it entirely.

This issue was found by RPMlint:
 | mariadb11.8-common.noarch: W: obsolete-not-provided mariadb11.8-libs
2025-06-17 17:41:10 +02:00
Michal Schorm
f401430d5b [packaging bugfix] Fix undeclared file conflicts with rocksdb-tools
rpmdeplint error:
  mariadb-rocksdb-engine-3:10.11.13-8.fc43.x86_64 provides /usr/bin/sst_dump
  which is also provided by rocksdb-tools-10.1.3-1.fc43.x86_64
2025-06-17 17:41:10 +02:00
Michal Schorm
ff080d1daf [packaging bugfix] The Galera documentation file should only be packaged by the '-server-galera' sub-package
Otherwise the '-common' noarch sub-package would differ on i686,
where we recently disabled the building of Galera.
2025-06-17 17:41:10 +02:00
Pavol Sloboda
c8027d496a [SPECfile enhancement] Added the documentation regarding the 'rocksdb' bundling
- why the version of the bundled rocksdb provided by the mariadb-rocksdb-engine
subpackage is not specified inside the spec file and the info about where the
rough version of rocksdb can be found.
2025-06-16 20:05:12 +02:00
Michal Schorm
68aa608fdb [SPECfile enhancement] Clarify the error message for mismatching PCRE version 2025-06-16 20:05:12 +02:00
Pavol Sloboda
02819ea294 Rebase to 10.11.13
Release notes: https://mariadb.com/kb/en/mariadb-10-11-13-release-notes/
Changlelog: https://mariadb.com/kb/en/mariadb-10-11-13-changelog/

The test 'main.mysql_client_test_nonblock' fails, but only on aarch64.
Related: rhbz#2373007

--

Switch back to the system version of PCRE.
PCRE issue fixed on upstream:
  bc13c8e4ae

--

Resolves: rhbz#2368090
2025-06-16 20:05:12 +02:00
Michal Schorm
e1a265078f [packaging bugfix] Exclude galera specific file from the '-common' sub-package
This file is already packed in 'mariadb-server-galera'.

Removing this file from the '-common' sub-package makes it identical both with
and without galera, wihch is necessary fixup for the previous commit, to keep
the '-common' sub-package 'noarch'
2025-06-16 20:05:12 +02:00
Michal Schorm
2f305d04f2 [packaging bugfix] Disable building of the 'mariadb-server-galera' sub-package on the %{ix86} architectures
Package 'galera', which is a run-time requirement for 'mariadb-server-galera' is no longer built for %{ix86}

Resolves: rhbz#2370439
2025-06-16 20:04:58 +02:00
Pavol Sloboda
498ee13b13 [packaging enahancement] Move the 'wsrep_info.so'
from the 'mariadb-server' to the 'mariadb-server-galera' sub-package,
as it is only used with the galera cluster and therefore it fits into
the '-server-galera' subpackage more.

This also means that the mariadb-server-galera subpackage can no longer be 'noarch'
as this .so file is located in the '%{_libdir}/mariadb/plugin', which is
an arch-specific directory.

More info about the wsrep_info plugin file:
https://mariadb.com/kb/en/wsrep_info-plugin/
2025-06-16 13:49:44 +02:00
Pavol Sloboda
ad73a518de [SELinux] Added the %ghost file to ensure that the policy created by selinux for
the mariadb-server-galera subpackage is owned by the subpackage.
I did this for the other selinux policy as well to achieve the same with
it as well.
Also changed the occurences of "targeted" to %selinuxtype to make
further administration of the package easier and to make the spec file
more readable.
Also removed the no longer needed BuildRequires of selinux-policy-devel
for the mariadb-server-galera subpackage as no policy is being compiled
as we changed tot he cil format of the policy.
But I needed to add the BuildRequires and Requires of
selinux-policy-targeted for the installation of the policy.
2025-06-16 13:49:37 +02:00
Pavol Sloboda
6c8b0197db [SELinux] Changed from the .te format of selinux rules to the .cil format
as it removes the need to compile the selinux rules, thus getting rid of
the ``` [!]: Uses parallel make %{?_smp_mflags} macro.````
warning. This change was created as a part of the fixing of the problems
with the rebase to 11.8 which are documented here:
https://bugzilla.redhat.com/show_bug.cgi?id=2368742
2025-06-16 13:49:27 +02:00
Michal Schorm
ff377c9133 [SPECfile bugfix] Fix the 'BuildRequires' for the hashicorp plugin
Until now, the plugin build only worked when the S3 plugin was build,
since the S2 plugin also requires the 'curl-devel', so it helped to
satisfy this build requirement in the buildroot.
2025-06-12 21:26:00 +02:00
Michal Schorm
c69d236cf2 [SPECfile bugfix] Fix the control code when the 'common' sub-package is not built 2025-06-12 21:26:00 +02:00
Michal Schorm
7cd1b99ae6 [SPECfile bugfix] Fix the control code for the GSSAPI plugin
- we were missing the CMake control variable

- I also discovered that the build of the gssapi client plugin -
  which we remove, since it is shipped as a part of the
  'mariadb-connector-c' package in Fedora,
  is somehow also controlled bz the build of the hashicorp plugin.

  Need further examination.
2025-06-12 21:25:50 +02:00
Pavol Sloboda
7984b9ae05 [SPECfile cleanup] Removed the redundant 'BuildRequires' of 'libsphinxclient'
of the '-shpinx-engine' sub-package as the 'libsphinxclient' library is
already required by the 'libsphinxclient-devel' 'BuildRequires' of the same
subpackage, therefore it will be provided inside the buildroot even
without the explicit 'BuildRequires'
2025-06-12 21:22:50 +02:00
Pavol Sloboda
59a3784bf9 [packaging enhancement] Start packing the 'mariadb-embedded' binary
This binary provides a client interface using the embedded library
instead of the main server.

Also started packing the symlink to the binary called 'mysql_embedded'
and their man pages.

This change was inspired by the way the Fedora 41 and RHEL 9
RPMs provided by the MariaDB upstream are packaged.

More info about the binary here:
https://mariadb.com/kb/en/mariadb-embedded/
2025-06-12 21:22:50 +02:00
Pavol Sloboda
7c2073e861 [SPECfile enhancement] Added a few comments to note the differences
between how we and the MariaDB upstream package the
'ha_sphinx' and 'hashicorp' parts of the package
2025-06-12 21:22:50 +02:00
Pavol Sloboda
6cdc4a90cc [packaging enhancement] Moved the '.so' and '.ini' files used specifically
for testing from the '-server' sub-package to the '-test' sub-package
Also added the '%{_libdir}/%{majorname}/plugin' directory to the
%files section of the '-test' sub-package to ensure that the directory
does not become unowned if only the '-test' sub-package is installed
without the '-server' subpackage.

We don't need the excludes anymore aince we stopped using glob for the
plugin directory.

This change was inspired by the way the Fedora 41 and RHEL 9
RPMs provided by the MariaDB upstream are packaged.
2025-06-12 21:22:50 +02:00
Pavol Sloboda
61ec4a36a2 [packaging enhancement] Moved the 'replace' utility from the '-server'
sub-package to the main package as it only seems to be used by the
'msql2mysql' utility which is inside the main package,
therefore the replace util fits there better as well as a client util.

This change was inspired by the way the Fedora 41 and RHEL 9
RPMs provided by the MariaDB upstream are packaged.

More info about the util here:
https://mariadb.com/kb/en/replace-utility/
2025-06-12 11:04:43 +02:00
Pavol Sloboda
a2d03b8796 [packaging enhancement] Moved the 'mariadb-dumpslow' and 'mysqldumpslow' utils
from the '-server-utils' to the '-client-utils' sub-package, as it
connects to the database server using a client interface.

This change was inspired by the way the Fedora 41 and RHEL 9
RPMs provided by the MariaDB upstream are packaged.

More about the util here:
https://mariadb.com/kb/en/mariadb-dumpslow/
2025-06-12 11:04:29 +02:00
Pavol Sloboda
7780436e80 [packaging enhancement] Moved the 'mariadb-hotcopy' and 'mysqlhotcopy' utils
from the '-server-utils' to the '-client-utils' sub-package, as it
connects to the database server using a client interface.

This change was inspired by the way the Fedora 41 and RHEL 9
RPMs provided by the MariaDB upstream are packaged.

More info on the util:
https://mariadb.com/kb/en/mariadb-hotcopy/
2025-06-12 11:04:22 +02:00
Pavol Sloboda
f8ce3bb5b5 [packaging enhancement] Moved the 'mariadb-setpermission'
and 'mysql_setpermission' utils from the '-server-utils' to the
'-client-utils' sub-package, as it connects to the database server
using a client interface.

This change was inspired by the way the Fedora 41 and RHEL 9
RPMs provided by the MariaDB upstream are packaged.

More info about the util here:
https://mariadb.com/kb/en/mariadb-setpermission/
2025-06-12 11:04:01 +02:00
Pavol Sloboda
74ea0b38be [packaging enhancement] Moved the 'mariadb-convert-table-format'
and 'mysql_convert_table_format' utils form the '-server-utils' sub-package
into the '-client-utils' sub-package because they are written to communicate
with the server part of the package through a client interface.

This change was inspired by the way the Fedora 41 and RHEL 9
RPMs provided by the MariaDB upstream are packaged.

More info on the util:
https://mariadb.com/kb/en/mariadb-convert-table-format/
2025-06-12 11:03:40 +02:00
Pavol Sloboda
6ed9d8c35c [packaging enhancement] Moved the 'my_print_defaults' binary
from the '-server' sub-package into the '-client' sub-package.

It reads data from the client config and it is a client utility.

More info on the utility here:
https://mariadb.com/kb/en/my_print_defaults/
2025-06-12 11:03:27 +02:00
Pavol Sloboda
583731bcd0 [packaging enhancement] Moved the 'mariadb-tzinfo-to-sql' and 'mysql_tzinfo_to_sql'
from the '-server' sub-package into the '-client' sub-package,
since it is a utility used by the client part of the package
to set the timezoneinfo of the client.

This change was inspired by the way the Fedora 41 and RHEL 9
RPMs provided by the MariaDB upstream are packaged.

More info about the utility:
https://mariadb.com/kb/en/mariadb-tzinfo-to-sql/
2025-06-12 11:03:05 +02:00
Pavol Sloboda
a2f8ad1597 Changed the occurences of redhat-linux-build to %{_vpath_builddir}
to ensure proper macro usage inside the spec file
2025-05-30 13:41:11 +02:00
Michal Schorm
6decd3d82b [SPECfile cleanup] The INFO_{BIN,SRC} files patch isn't necessary
We don't actually need the patch to stop the files from packing.
We called the 'install' deliberately before that patch, but the upstream CMake
do not pack them by default.

It still builds them though, so I still proposed this patch upstream with default
to 'OFF' so we can save a bit of wasted computational time.

https://github.com/MariaDB/server/pull/4078
2025-05-30 13:40:05 +02:00
Michal Schorm
2ff1031b65 [packaging enhancement] Pack the symlinks to the mariadb systemd service
so that the user can access it using the 'mysql.service' and 'mysqld.service'
names even before the first call of 'systemctl enable mariadb.service' which
creates the symlinks.

This has been consulted with the systemd team and approved by them.

The update is acutally a mirror of what MariaDB upstream is doing in their RPMs.
2025-05-29 15:17:52 +02:00
Michal Schorm
7e36d42bdc Stopped providing the INFO_SRC and INFO_BIN files
as there seems to be no good place for them inside
the packages as they are no longer provided by upstream.

The INFO_SRC file contains the information about the source the build
was created from and the INFO_BIN file contains the architecture and
cmake flags the build was created with.

These files have been moved around in the history of this package and
there were many opinions on where the files should be provided and
whether they should be provided at all.
e.g. providing the files inside _libidr as we did so far:
https://bugs.mysql.com/bug.php?id=61425

and not providing the files at all:
https://jira.mariadb.org/browse/MDEV-6526

As a result of this the tests located inside the main testsuite that
check for these files (file_contents.test) have been updated to no
longer check for these files (as seen in the jira link above).
Before this update we used a patch to update these tests to take into
the consideration the location we moved the files to, which was removed
in the rebase to 10.1.24 as seen here:
https://src.fedoraproject.org/rpms/mariadb10.11/c/789b009

These files could be useful in case someone decides to rebuild the
package themself and needs to debug their rpms against the rpms provided
by us. However Fedora has existing standardized solutions by design to
inspect from what sources and how the package was built, so packaging
these files is redundant.
Nor these files should not be in the server subpackage.
2025-05-29 11:27:00 +02:00
Nikola Davidova
b9a73375ac [packaging enhancement] Update justification of patches 2025-05-21 15:03:21 +02:00
Nikola Davidova
719cb12a75 [packaging enahncement] Replace hard coded paths with macros 2025-05-21 15:01:07 +02:00
Michal Schorm
9945c635b1 [bugfix] Fixup of the versioned package layout control code 2025-05-21 14:59:30 +02:00
Michal Schorm
6fe64f2be1 [bugfix] Add Requires to 'which' for the server.
The 'wsrep_sst_common' and 'wsrep_sst_rsync_tunnel' scripts requires 'which' utility

https://github.com/MariaDB/server/blob/main/scripts/wsrep_sst_common.sh#L39
https://src.fedoraproject.org/rpms/mariadb10.11/blob/rawhide/f/wsrep_sst_rsync_tunnel#_94
2025-05-15 15:37:19 +02:00
Michal Schorm
6ef7f3da69 Bump release for package rebuild 2025-05-07 13:23:39 +02:00
Michal Schorm
810dbf2ed2 PARTIAL REVERT of "[packaging fix for containers] Drop usage of tmpfiles.d"
This PARTIALLY REVERTS commit 9f34c64543.

--

My assumption in the original commit was incorrect.

It's true we're creating the `/run/mariadb` directory at the RPM level.
However, the `/run` directory is tmpfs, which means it's non-persistent and gets cleaned after reboot.
The tmpfile.d configuration was making sure that after reboot, the `/run/mariadb` directory is recreated.
But after it has been dropped, at the time of reboot, the `/run/mariadb` dir is removed and not recreated, thus causing this issue.

--

Resolves: rhbz#2364619
2025-05-07 13:20:55 +02:00
Michal Schorm
b74fb13bdb [packaging bugfix] Fix the application of the compilation flags
I discovered that the second call of "cmake -LAH" further changes the cache.
That was definitelly unintended. Applying "-N" to operate in "cache read-only" mode.

That however broke the build, since the compilation flags are set up during the "cmake" call.
Up until now, the code flow was:
  1) %cmake ...
  2) <adjusting compilation flags>
  3) cmake -LAH
And since the "cmake -LAH" without the "-N" argument changed the cache, it actually applied all the
adjustements in the second step. When switched to "-N" mode, the flags failed to be applied, and the build broke.

What we actually need to do is to:
  1) initialize the compilation flags with the distribution default values
  2) adjust the compilation flags
  3) %cmake ...
  3) cmake -N -LAH

This way the compilation flags are correctly applied during the first CMake call,
and the CMake cache remains unchanged during the second CMake call.

--

The '%cmake' macro contains the '%{set_build_flags}' macro at it's beginning
  https://src.fedoraproject.org/rpms/cmake/blob/b3bf0e/f/macros.cmake.in#_20
and the '%{set_build_flags}' macro is constructed with the:
  CFLAGS="${CFLAGS:-...}
syntax, which translates to "Use the content of the $CFLAGS variable. If empty, use the following default value: '...' ".

So we first need to call the '%{set_build_flags}' macro separately, so we apply the default values. Then we append to them.
And then the '%cmake' macro calls the '%{set_build_flags}' macro that finds the existing values, and uses them, instead of the default ones.
2025-05-06 21:36:42 +02:00
Michal Schorm
3ca7be2944 [packaging enahancement] Remove no longer needed workaround for debug build
The debug build compiles without it
2025-05-06 19:50:28 +02:00
Pavol Sloboda
d56cff44c7 Removed the no longer needed patch for rocksdb and gc13
I have removed the no longer needed patch as it has already been fixed
2025-05-06 16:59:56 +02:00
Pavol Sloboda
9847d25db4 Removed the no longer needed %ifarch i686 as the issue is resolved
The issue that this workaround solved:
https://bugzilla.redhat.com/show_bug.cgi?id=2239498

has already been resolved as mentioned here:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111497

I have tried it and created a koji scratch build:
https://koji.fedoraproject.org/koji/taskinfo?taskID=132349872
2025-05-05 16:34:17 +02:00
Michal Schorm
381ac0c846 Bump release for package rebuild 2025-05-05 12:43:58 +02:00
Michal Schorm
f19e9b6545 [packaging enahncement] Remove 'force' from 'rm -rf',
to be be notified of unexpected changes in the removed files
2025-05-05 12:35:19 +02:00
Michal Schorm
902fdc60db [packaging enhancement] Disable the generation of the upstream sysusersdir.d config file by CMake,
we use a downstream one.

The 'INSTALL_SYSTEMD_SYSUSERSDIR' CMake option is of a type 'string',
so only setting to an empty string makes the statement FALSE in contidions.
2025-05-05 12:32:31 +02:00
Michal Schorm
9f34c64543 [packaging fix for containers] Drop usage of tmpfiles.d
The 'tmpfiles.d' functionality requires 'systemd'.
That is inappropriate for container use-cases, where
we can save 15-20 MB by removal for the systemd stack.

In the case of MariaDB, we
1) were NOT using the upstream tpmfiles.d config
2) we were used downstream tmpfiles.d config
2.a) which only contained creation of the PID file dir (/var/run/mariadb)

This can be easily replaced by RPM creating and owning the path.

By closer inspection I found that we do it already, so the current tmpfiles.d config
just do entirely redundant job. I assume this was an overlook when the tmpfiles.d config
was introduced.

This commit:
1) removes the donwstream tmpfiles.d config file
2) sets "INSTALL_SYSTEMD_TMPFILESDIR" CMake option to an empty string
   to disable generating the upstream config file
3) Drops the "Requires" to 'systemd' to "Recommends"
   so the systemd can be ommited in containers, but is still installed by default
4) Drops the '%{?systemd_requires}' macro, which makes sure the systemd is present
   for it's %post, %preun and %postun scriptlets.

   This can only happen when someone calls the installation or removal on a system that does not
   have systemd, which is highly, highly unlikely nowadays.

   And in the cases where it is expected - e.g. containers - the %systemd-{post,preun,postun} marcos
   contains a condition that makes sure it's content is only run when the systemd is present,
   so the effective functionality remains unchanged.
2025-05-05 12:13:17 +02:00
Michal Schorm
d321029c85 Bump release for package rebuild 2025-04-22 22:20:47 +02:00
Michal Schorm
6a9fe92fcf [packaging enhancement] Make sub-packages 'galera', 'client-utils' and 'server-utils' noarch
These sub-packages are not arch dependent, so let's save infrastructure resources by
de-duplicating the arched variants.
2025-04-22 22:18:50 +02:00
Michal Schorm
752c65a873 [packaging enhancement] Move compiled utilities to the server subpackage
This will allow to make the server-utils a noarch package and
also this will make container setup easier, when installation
of the DNF weak dependencies are disabled.
2025-04-22 22:16:40 +02:00
Michal Schorm
26b2d808a3 [packaging enhancement] Make '%files' section more compact 2025-04-22 22:16:10 +02:00
Michal Schorm
a3826e2600 Bump release for package rebuild 2025-04-07 12:55:33 +02:00
Michal Schorm
6e14d48369 Update the 'mysql' user GECOS field to be more accurate 2025-04-07 12:54:41 +02:00