4 Star 0 Fork 7

OpenCloudOS Stream/mariadb

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
mariadb.spec 50.50 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374
%global __requires_exclude ^perl\\((hostnames|lib::mtr|lib::v1|mtr_|My::|wsrep)
%global __provides_exclude_from ^(%{_datadir}/(mysql|mysql-test)/.*|%{_libdir}/%{pkg_name}/plugin/.*\\.so)$
%global pkg_name %{name}
%global pkgnamepatch mariadb
%global _pkgdocdirname %{pkg_name}
# Include systemd files
%global daemon_name %{name}
%global daemon_no_prefix %{pkg_name}
%global mysqld_pid_dir mariadb
# Regression tests take a long time (many cores recommended), skip them
%{!?runselftest:%global runselftest 0}
# Set to 1 to see if the tests pass, but set it to 0 when production ready build
%global ignore_testsuite_result 0
# The last version on which the full testsuite has been run
# In case of further rebuilds of that version, don't require full testsuite to be run, only "main" suite
%global last_tested_version 10.11.4
# Set to 1 forces the testsuite to run, even if it was already tested in current version
%global force_run_testsuite 0
# Aditional SELinux rules (common for MariaDB & MySQL)
%global require_mysql_selinux 1
# When block offset is applied, patch(1) creates backup files by default. Turn that off
%global _default_patch_flags --no-backup-if-mismatch
%global python_path /usr/bin/python3
# We define some system's well known locations here, so we can use them easily later when
# building to another location (like SCL)
%global logrotateddir %{_sysconfdir}/logrotate.d
%global logfiledir %{_localstatedir}/log/%{daemon_name}
%global logfile %{logfiledir}/%{daemon_name}.log
# Saving path of pid file/ database data /Home directory
%global pidfiledir %{_rundir}/%{mysqld_pid_dir}
%global dbdatadir %{_localstatedir}/lib/mysql
%global mysqluserhome /var/lib/mysql
# Make long macros shorter
%global sameevr %{version}-%{release}
# Mroonga engine, https://mariadb.com/kb/en/mariadb/about-mroonga/
# RocksDB engine, https://mariadb.com/kb/en/library/about-myrocks-for-mariadb/
%ifarch x86_64 loongarch64
%bcond_with mroonga
%bcond_with rocksdb
%endif
# Open Query GRAPH engine (OQGRAPH)
%bcond_without oqgraph
# PAM authentication plugin
%bcond_without pam
# Other plugins
%bcond_with cracklib
%bcond_with connect
%bcond_with sphinx
# S3 storage engine,https://mariadb.com/kb/en/s3-storage-engine/
%bcond_with s3
%bcond_without gssapi
# For some use cases we do not need some parts of the package. Set to "...with" to exclude
%bcond_with clibrary
%bcond_without embedded
%bcond_without devel
%bcond_without client
%bcond_without common
%bcond_without errmsg
%bcond_without test
%bcond_without galera
%bcond_without backup
# Page compression algorithms for InnoDB & XtraDB
%bcond_without lz4
# MariaDB 10.0 and later requires pcre >= 10.34, otherwise we need to use the bundled library,
%bcond_without unbundled_pcre
%bcond_with config
# For deep debugging, with extra debug info
%bcond_with debug
# Provide mysql names for compatibility
%bcond_with mysql_names
Summary: A very fast and robust SQL database server
Name: mariadb
Version: 10.11.4
Release: 8%{?dist}
License: GPLv2 and LGPLv2
URL: http://mariadb.org
Source0: https://downloads.mariadb.org/interstitial/mariadb-%{version}/source/mariadb-%{version}.tar.gz
Source1: README.mariadb-docs
Source2: LICENSE.clustercheck
Source3: mariadb-server-galera.te
Source10: mariadb.tmpfiles.d.in
Source11: mysql.service.in
Source12: mysql@.service.in
Source13: my.cnf.in
Source14: mariadb-check-socket.sh
Source15: mariadb-scripts-common.sh
Source16: mariadb-check-upgrade.sh
Source17: mariadb-prepare-db-dir.sh
Source18: clustercheck.sh
Source20: skipped-tests-base.list
Source21: skipped-tests-arm.list
Source23: skipped-tests-ppc.list
# add all files where we want macros to be expanded to the CMake file
Patch3001: %{pkgnamepatch}-scripts-10.11.4.patch
# pre-configure to comply with guidelines
Patch3002: %{pkgnamepatch}-ownsetup.patch
BuildRequires: make cmake gcc-c++
BuildRequires: selinux-policy-devel
BuildRequires: systemd systemd-devel systemtap-sdt-devel
BuildRequires: zlib-devel bison bison-devel
BuildRequires: libaio-devel libedit-devel ncurses-devel
BuildRequires: python3 procps time openssl openssl-devel
BuildRequires: pkgconfig(fmt)
BuildRequires: perl-interpreter perl-generators
BuildRequires: perl(base) perl(strict) perl(warnings) perl(lib)
BuildRequires: perl(Cwd) perl(Data::Dumper) perl(English)
BuildRequires: perl(Env) perl(Errno) perl(Exporter) perl(Fcntl)
BuildRequires: perl(File::Basename) perl(File::Copy) perl(File::Find) perl(IPC::Open3)
BuildRequires: perl(File::Spec) perl(File::Spec::Functions) perl(File::Temp) perl(Getopt::Long)
BuildRequires: perl(IO::File) perl(IO::Handle) perl(IO::Select) perl(IO::Socket) perl(IO::Socket::INET)
BuildRequires: perl(Memoize) perl(POSIX) perl(Socket) perl(Symbol) perl(Sys::Hostname)
BuildRequires: perl(Term::ANSIColor) perl(Test::More) perl(Time::HiRes) perl(Time::localtime)
%{?with_lz4:BuildRequires: lz4-devel}
%{?with_debug:BuildRequires: valgrind-devel}
# use new adequate version of pcre2 or provide bundles(pcre2)
%{?with_unbundled_pcre:BuildRequires: pcre2-devel pkgconf}
%{!?with_unbundled_pcre:Provides: bundled(pcre2) = %{pcre_bundled_version}}
Requires: bash coreutils grep
Requires: %{name}-common = %{sameevr}
%if %{with clibrary}
# For RHBZ#1406320, explicit EVR requirements for -libs are required
Requires: %{name}-libs = %{sameevr}
%else
# Not built with client library in this package, use connector-c
Requires: mariadb-connector-c >= 3.0
%endif
%if %{with mysql_names}
Provides: mysql = %{sameevr}
Provides: mysql-compat-client = %{sameevr}
%endif
Suggests: %{name}-server = %{sameevr}
Conflicts: mysql
%description
MariaDB is a community developed fork from MySQL, which is a multi-user and multi-threaded SQL
database server. It is a client/server implementation consisting of a server daemon (mariadbd)
and many different client programs and libraries. It provides the standard MariaDB/MySQL client
programs and utilities.
%if %{with clibrary}
%package libs
Summary: The shared libraries required for MariaDB/MySQL clients
Requires: %{name}-common = %{sameevr}
%if %{with mysql_names}
Provides: mysql-libs = %{sameevr}
%endif
%description libs
This package provides the essential shared libraries for any MariaDB/MySQL client program or
interface. You need to install this package before you can use other MariaDB package or any
clients that need to connect to a MariaDB/MySQL server.
%endif
# At least main config file /etc/my.cnf is shared for client and server part. Since we want to
# support combination of different client and server implementations (such as mariadb library
# and community-mysql server), we need the config file(s) to be in a separate package without
# fetching additional packages, because these would likely conflict.
# More specifically, the dependency on the main configuration file (/etc/my.cnf) is supposed to
# be defined as Requires: /etc/my.cnf rather than requiring a specific package, so installer app
# can choose whatever package fits to the transaction.
%if %{with config}
%package config
Summary: The config files required by server and client
%description config
This package provides the config file my.cnf and my.cnf.d directory used by any MariaDB or MySQL
program. If config files are not provided in the package itself, you need to install this package.
%endif
%if %{with common}
%package common
Summary: The shared files required by server and client
Requires: %{_sysconfdir}/my.cnf
%if %{without clibrary}
Obsoletes: %{name}-libs <= %{sameevr}
%endif
%description common
This package provides the essential shared files for any MariaDB program.You will need to install
this package to use any other MariaDB package.
%endif
%if %{with errmsg}
%package errmsg
Summary: The error messages files required by server and embedded
Requires: %{name}-common = %{sameevr}
%description errmsg
This package provides error messages files for the MariaDB daemon and the embedded server. You will
need to install this package to use any of those MariaDB packages.
%endif
%if %{with galera}
%package server-galera
Summary: The configuration files and scripts for galera replication
Requires: %{name}-common = %{sameevr}
Requires: %{name}-server = %{sameevr}
Requires: galera >= 26.4.3
Requires(post): libselinux-utils
Requires(post): policycoreutils-python-utils
# wsrep requirements
Requires: lsof
Requires: rsync
%description server-galera
This package contains added files to allow MariaDB server to operate as a Galera cluster member.
%endif
%package server
Summary: The MariaDB server and related files
%if %{with mysql_names}
Requires: mysql-compat-client
Requires: mysql
Recommends: %{name}
%else
Requires: %{name}
%endif
Requires: %{name}-common = %{sameevr}
Requires: %{name}-errmsg = %{sameevr}
Recommends: %{name}-server-utils = %{sameevr}
Recommends: %{name}-backup = %{sameevr}
%{?with_cracklib:Recommends: %{name}-cracklib-password-check = %{sameevr}}
%{?with_gssapi:Recommends: %{name}-gssapi-server = %{sameevr}}
%{?with_rocksdb:Suggests: %{name}-rocksdb-engine = %{sameevr}}
%{?with_sphinx:Suggests: %{name}-sphinx-engine = %{sameevr}}
%{?with_oqgraph:Suggests: %{name}-oqgraph-engine = %{sameevr}}
%{?with_connect:Suggests: %{name}-connect-engine = %{sameevr}}
%{?with_pam:Suggests: %{name}-pam = %{sameevr}}
Suggests: mytop
Suggests: logrotate
Requires: %{_sysconfdir}/my.cnf
Requires: %{_sysconfdir}/my.cnf.d
# Additional SELinux rules (common for MariaDB & MySQL) are shipped in a separate package
# For the cases where we want to fix a SELinux issues in MariaDB, it predates the release
# of the patched selinux-policy-targeted package is released
%if %require_mysql_selinux
Requires: (mysql-selinux if selinux-policy-targeted)
%endif
# for fuser in mysql-check-socket
Requires: psmisc
Requires: coreutils
Requires(pre): /usr/sbin/useradd
# Require this to be present for %%{_tmpfilesdir}
Requires: systemd
%{?systemd_requires}
# use 'iproute' instead of 'net-tools' RHBZ#1496131;
Requires: iproute
%if %{with mysql_names}
Provides: mysql-server = %{sameevr}
Provides: mysql-compat-server = %{sameevr}
%endif
Conflicts: mysql-server
%description server
This package contains the MariaDB server and some accompanying files and directories.
%if %{with oqgraph}
%package oqgraph-engine
Summary: The Open Query GRAPH engine for MariaDB
Requires: %{name}-server = %{sameevr}
# boost and Judy required for oograph
BuildRequires: boost-devel Judy-devel
%description oqgraph-engine
This package provides Open Query GRAPH engine (OQGRAPH) as plugin for MariaDB database server.
OQGRAPH is a computation engine allowing hierarchies and more complex graph structures to be
handled in a relational fashion. In short, tree structures and friend-of-a-friend style searches
can now be done using standard SQL syntax, and results joined onto other tables.
%endif
%if %{with connect}
%package connect-engine
Summary: The CONNECT storage engine for MariaDB
BuildRequires: libxml2-devel
Requires: %{name}-server = %{sameevr}
%description connect-engine
The CONNECT storage engine enables MariaDB to access external local or remote data (MED). This
is done by defining tables based on different data types, in particular files in various formats,
data extracted from other DBMS or products (such as Excel), or data retrieved from the environment
(for example DIR, WMI, and MAC tables).
%endif
%if %{with backup}
%package backup
Summary: The mariabackup tool for physical online backups
BuildRequires: libarchive-devel
Requires: %{name}-server = %{sameevr}
%description backup
MariaDB Backup is an open source tool provided by MariaDB for performing physical online backups
of InnoDB, Aria and MyISAM tables. "hot online" backups are possible for InnoDB.
%endif
%if %{with rocksdb}
%package rocksdb-engine
Summary: The RocksDB storage engine for MariaDB
Requires: %{name}-server = %{sameevr}
Provides: bundled(rocksdb)
%description rocksdb-engine
The RocksDB storage engine is used for high performance servers on SSD drives.
%endif
%if %{with cracklib}
%package cracklib-password-check
Summary: The password strength checking plugin
BuildRequires: cracklib-dicts cracklib-devel
Requires: %{name}-server = %{sameevr}
Requires: cracklib-dicts
%description cracklib-password-check
CrackLib is a password strength checking library. Many Linux distributions install it by
default and call it automatically (by pam_cracklib.so) whenever the user login password
is modified.
Now, you can check MariaDB account passwords with the cracklib_password_check password
validation plugin.
%endif
%if %{with gssapi}
%package gssapi-server
Summary: GSSAPI authentication plugin for server
BuildRequires: krb5-devel
Requires: %{name}-server = %{sameevr}
%description gssapi-server
GSSAPI authentication server-side plugin for MariaDB for passwordless login.
This plugin includes support for Kerberos on Unix.
%endif
%if %{with pam}
%package pam
Summary: PAM authentication plugin for the MariaDB server
BuildRequires: pam-devel
Requires: %{name}-server = %{sameevr}
# Require the 'mysql' user/group (created during mariadb-server %%pre) to be available before installation
Requires(pre): %{name}-server = %{sameevr}
%description pam
PAM authentication server-side plugin for MariaDB.
%endif
%if %{with sphinx}
%package sphinx-engine
Summary: The Sphinx storage engine for MariaDB
BuildRequires: sphinx libsphinxclient libsphinxclient-devel
Requires: %{name}-server = %{sameevr}
Requires: sphinx libsphinxclient
%description sphinx-engine
The Sphinx storage engine for MariaDB.
%endif
%if %{with s3}
%package s3-engine
Summary: The S3 storage engine for MariaDB
BuildRequires: curl-devel
Requires: %{name}-server = %{sameevr}
%description s3-engine
The S3 read only storage engine allows archiving MariaDB tables in Amazon S3, or any
third-party public or private cloud that implements S3 API, but still read them in MariaDB.
%endif
%package server-utils
Summary: Non-essential server utilities for MariaDB/MySQL applications
Requires: %{name}-server = %{sameevr}
%if %{with mysql_names}
Provides: mysql-perl = %{sameevr}
%endif
Conflicts: mysql-server
# mysqlhotcopy needs DBI/DBD support
Requires: perl(DBI) perl(DBD::MariaDB)
%description server-utils
This package provides all non-essential server utilities and scripts for managing databases.
It also contains all utilities requiring Perl and it is the only MariaDB sub-package, except
test subpackage, that depends on Perl.
%if %{with devel}
%package devel
Summary: Files for development of MariaDB/MySQL applications
%{?with_clibrary:Requires: %{name}-libs = %{sameevr}}
Requires: openssl-devel
%if %{without clibrary}
Requires: mariadb-connector-c-devel >= 3.0
%endif
%if %{with mysql_names}
Provides: mysql-devel = %{sameevr}
%endif
Conflicts: mysql-devel
%description devel
MariaDB is a multi-user, multi-threaded SQL database server.
%if %{with clibrary}
This package contains everything needed for developing MariaDB/MySQL client
and server plugins and applications.
%else
This package contains everything needed for developing MariaDB/MySQL server
plugins and applications. For developing client applications, use
mariadb-connector-c package.
%endif
%endif
%if %{with embedded}
%package embedded
Summary: MariaDB as an embeddable library
Requires: %{name}-common = %{sameevr}
Requires: %{name}-errmsg = %{sameevr}
%if %{with mysql_names}
Provides: mysql-embedded = %{sameevr}
%endif
%description embedded
This package provides a version of the MariaDB server that can be embedded into a client
application instead of running as a separate process.
%package embedded-devel
Summary: Development files for MariaDB as an embeddable library
Requires: %{name}-embedded = %{sameevr}
Requires: %{name}-devel = %{sameevr}
# embedded-devel should require libaio-devel (rhbz#1290517)
Requires: libaio-devel
%if %{with mysql_names}
Provides: mysql-embedded-devel = %{sameevr}
%endif
Conflicts: mysql-embedded-devel
%description embedded-devel
This package provides files needed for developing and testing with the embedded version of
the MariaDB server.
%endif
%if %{with test}
%package test
Summary: The test suite distributed with MariaDB
Requires: %{name} = %{sameevr}
Requires: %{name}-common = %{sameevr}
Requires: %{name}-server = %{sameevr}
Requires: patch
Requires: perl(Env)
Requires: perl(Exporter)
Requires: perl(Fcntl)
Requires: perl(File::Temp)
Requires: perl(Data::Dumper)
Requires: perl(Getopt::Long)
Requires: perl(IPC::Open3)
Requires: perl(Socket)
Requires: perl(Sys::Hostname)
Requires: perl(Test::More)
Requires: perl(Time::HiRes)
%if %{with mysql_names}
Provides: mysql-test = %{sameevr}
%endif
Conflicts: mysql-test
%description test
This package contains the regression test suite distributed with the MariaDB sources.
%endif
%prep
%autosetup -p1
find . -name "*.jar" -type f -exec rm --verbose -f {} \;
# remove testsuite for the mariadb-connector-c
rm -rf libmariadb/unittest
%if %{without rocksdb}
rm -r storage/rocksdb/
%endif
# generate a list of failed tests that are not disabled by upstream
cat %{SOURCE20} | tee -a mysql-test/unstable-tests
# disable some tests failing on different arches
%ifarch aarch64
cat %{SOURCE21} | tee -a mysql-test/unstable-tests
%endif
%ifarch ppc64le
cat %{SOURCE23} | tee -a mysql-test/unstable-tests
%endif
cp %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} \
%{SOURCE15} %{SOURCE16} %{SOURCE17} %{SOURCE18} scripts
%if %{with galera}
# prepare for the selinux policy
mkdir selinux
sed 's/mariadb-server-galera/%{name}-server-galera/' %{SOURCE3} > selinux/%{name}-server-galera.te
%endif
# get the PCRE version used by the upstream
pcre_version=`grep -e "https://github.com/PCRE2Project/pcre2/releases/download" cmake/pcre.cmake | sed -r "s;.*pcre2-([[:digit:]]+\.[[:digit:]]+).*;\1;" `
# Check if the PCRE version in macro 'pcre_bundled_version', is the same version as upstream actually bundles
%if %{without unbundled_pcre}
if [ %{pcre_bundled_version} != "$pcre_version" ] ; then
echo -e "\n Error: Bundled PCRE version is not correct. \n\tBundled version number: %{pcre_bundled_version} \n\tUpstream version number: $pcre_version\n"
exit 1
fi
%else
# Check if the PCRE version that upstream use, is the same as the one present in system
pcre_system_version=`pkgconf %{_libdir}/pkgconfig/libpcre2-*.pc --modversion 2>/dev/null | head -n 1`
if [ "$pcre_system_version" != "$pcre_version" ] ; then
echo -e "\n Warning: Error: Bundled PCRE version is not correct. \n\tSystem version number: $pcre_system_version \n\tUpstream version number: $pcre_version\n"
fi
%endif
%build
# fail quickly when user tries to build as root
%if %runselftest
if [ x"$(id -u)" = "x0" ]; then
echo "mysql's regression tests fail if run as root."
echo "If you really need to build the RPM as root, use"
echo "--nocheck to skip the regression tests."
exit 1
fi
%endif
# The INSTALL_xxx macros must be specified relative to CMAKE_INSTALL_PREFIX,
# so not use %%{_datadir} and so forth here.
%cmake \
-DBUILD_CONFIG=mysql_release \
-DFEATURE_SET="community" \
-DINSTALL_LAYOUT=RPM \
-DDAEMON_NAME="%{daemon_name}" \
-DDAEMON_NO_PREFIX="%{daemon_no_prefix}" \
-DLOG_LOCATION="%{logfile}" \
-DPID_FILE_DIR="%{pidfiledir}" \
-DNICE_PROJECT_NAME="MariaDB" \
-DRPM="ocs" \
-DCMAKE_INSTALL_PREFIX="%{_prefix}" \
-DINSTALL_SYSCONFDIR="%{_sysconfdir}" \
-DINSTALL_SYSCONF2DIR="%{_sysconfdir}/my.cnf.d" \
-DINSTALL_DOCDIR="share/doc/%{_pkgdocdirname}" \
-DINSTALL_DOCREADMEDIR="share/doc/%{_pkgdocdirname}" \
-DINSTALL_INCLUDEDIR=include/mysql \
-DINSTALL_INFODIR=share/info \
-DINSTALL_LIBDIR="%{_lib}" \
-DINSTALL_MANDIR=share/man \
-DINSTALL_MYSQLSHAREDIR=share/%{pkg_name} \
-DINSTALL_MYSQLTESTDIR=%{?with_test:share/mysql-test}%{!?with_test:} \
-DINSTALL_PLUGINDIR="%{_lib}/%{pkg_name}/plugin" \
-DINSTALL_SBINDIR=libexec \
-DINSTALL_SCRIPTDIR=bin \
-DINSTALL_SUPPORTFILESDIR=share/%{pkg_name} \
-DMYSQL_DATADIR="%{dbdatadir}" \
-DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \
-DTMPDIR=/var/tmp \
-DGRN_DATA_DIR=share/%{name}-server/groonga \
-DGROONGA_NORMALIZER_MYSQL_PROJECT_NAME=%{name}-server/groonga-normalizer-mysql \
-DENABLED_LOCAL_INFILE=ON \
-DENABLE_DTRACE=ON \
-DSECURITY_HARDENED=OFF \
-DWITH_WSREP=%{?with_galera:ON}%{!?with_galera:OFF} \
-DWITH_INNODB_DISALLOW_WRITES=%{?with_galera:ON}%{!?with_galera:OFF} \
-DWITH_EMBEDDED_SERVER=%{?with_embedded:ON}%{!?with_embedded:OFF} \
-DWITH_MARIABACKUP=%{?with_backup:ON}%{!?with_backup:NO} \
-DWITH_UNIT_TESTS=%{?with_test:ON}%{!?with_test:NO} \
-DCONC_WITH_SSL=%{?with_clibrary:ON}%{!?with_clibrary:NO} \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DLZ4_LIBS=%{_libdir}/liblz4.so \
-DLZ4_LIBS=%{?with_lz4:%{_libdir}/liblz4.so}%{!?with_lz4:} \
-DWITH_INNODB_LZ4=%{?with_lz4:ON}%{!?with_lz4:OFF} \
-DWITH_ROCKSDB_LZ4=%{?with_lz4:ON}%{!?with_lz4:OFF} \
-DPLUGIN_MROONGA=%{?with_mroonga:DYNAMIC}%{!?with_mroonga:NO} \
-DPLUGIN_OQGRAPH=%{?with_oqgraph:DYNAMIC}%{!?with_oqgraph:NO} \
-DPLUGIN_CRACKLIB_PASSWORD_CHECK=%{?with_cracklib:DYNAMIC}%{!?with_cracklib:NO} \
-DPLUGIN_ROCKSDB=%{?with_rocksdb:DYNAMIC}%{!?with_rocksdb:NO} \
-DPLUGIN_SPHINX=%{?with_sphinx:DYNAMIC}%{!?with_sphinx:NO} \
-DPLUGIN_CONNECT=%{?with_connect:DYNAMIC}%{!?with_connect:NO} \
-DPLUGIN_S3=%{?with_s3:DYNAMIC}%{!?with_s3:NO} \
-DPLUGIN_AUTH_PAM=%{?with_pam:YES}%{!?with_pam:NO} \
-DPLUGIN_AUTH_PAM_V1=%{?with_pam:DYNAMIC}%{!?with_pam:NO} \
-DPLUGIN_COLUMNSTORE=NO \
-DPLUGIN_CLIENT_ED25519=OFF \
-DPYTHON_SHEBANG=%{python_path} \
-DPLUGIN_CACHING_SHA2_PASSWORD=%{?with_clibrary:DYNAMIC}%{!?with_clibrary:OFF} \
-DPLUGIN_AWS_KEY_MANAGEMENT=NO \
-DCONNECT_WITH_MONGO=OFF \
-DCONNECT_WITH_JDBC=OFF \
%{?with_debug: -DCMAKE_BUILD_TYPE=Debug -DWITH_ASAN=OFF -DWITH_INNODB_EXTRA_DEBUG=ON -DWITH_VALGRIND=ON}
# DSECURITY_HARDENED can be used to force a set of compilation flags for hardening
# disable this option to the default compilation flags (which have higher level of hardening) will be used
CFLAGS="$CFLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
# force PIC mode so that we can build libmysqld.so
CFLAGS="$CFLAGS -fPIC"
%if %{with debug}
# Override all optimization flags when making a debug build
# -D_FORTIFY_SOURCE requires optimizations enabled. Disable the fortify.
CFLAGS=`echo "$CFLAGS" | sed -r 's/-D_FORTIFY_SOURCE=[012]/-D_FORTIFY_SOURCE=0/'`
CFLAGS=`echo "$CFLAGS" | sed -r 's/-O[0123]//'`
CFLAGS="$CFLAGS -O0 -g -D_FORTIFY_SOURCE=0"
%endif
CXXFLAGS="$CFLAGS"
CPPFLAGS="$CFLAGS"
export CFLAGS CXXFLAGS CPPFLAGS
cmake -B %{_vpath_builddir} -LAH
%cmake_build
# build selinux policy
%if %{with galera}
pushd selinux
make -f /usr/share/selinux/devel/Makefile %{name}-server-galera.pp
%endif
%install
%cmake_install
ln -s mysql_config.1.gz %{buildroot}%{_mandir}/man1/mariadb_config.1.gz
%if %{without clibrary}
# client part is included in 'mariadb-connector-c'
%ifarch loongarch64
rm %{buildroot}/usr/lib/pkgconfig/libmariadb.pc
%else
rm %{buildroot}%{_libdir}/pkgconfig/libmariadb.pc
%endif
%endif
# install INFO_SRC, INFO_BIN into libdir
install -p -m 644 %{_vpath_builddir}/Docs/INFO_SRC %{buildroot}%{_libdir}/%{pkg_name}/
install -p -m 644 %{_vpath_builddir}/Docs/INFO_BIN %{buildroot}%{_libdir}/%{pkg_name}/
rm -r %{buildroot}%{_datadir}/doc/%{_pkgdocdirname}/MariaDB-server-%{version}/
# creat logfile
mkdir -p %{buildroot}%{logfiledir}
chmod 0750 %{buildroot}%{logfiledir}
touch %{buildroot}%{logfile}
# current setting in my.cnf is to use /var/run/mariadb for creating pid file. However since
# my.cnf is not updated by RPM if changed, we need to create mysqld as well because users
# can have odd settings in their /etc/my.cnf
mkdir -p %{buildroot}%{pidfiledir}
install -p -m 0755 -d %{buildroot}%{dbdatadir}
%if %{with config}
install -D -p -m 0644 %{_vpath_builddir}/scripts/my.cnf %{buildroot}%{_sysconfdir}/my.cnf
%else
rm %{_vpath_builddir}/scripts/my.cnf
%endif
# use different config file name for each variant of server (mariadb / mysql)
mv %{buildroot}%{_sysconfdir}/my.cnf.d/server.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/%{pkg_name}-server.cnf
# Remove upstream SysV init script and Systemd service files, we use systemd
rm %{buildroot}%{_libexecdir}/rcmysql
rm -r %{buildroot}%{_datadir}/%{pkg_name}/systemd
# Systemd service file have set aliases to the "mysql" names in the [Install] section.
# They can be enabled / disabled by "systemctl enable / diable <service_name>"
rm %{buildroot}%{_unitdir}/{mysql,mysqld}.service
# systemd unit files and scripts for server startup
install -D -p -m 644 %{_vpath_builddir}/scripts/mysql.service %{buildroot}%{_unitdir}/%{daemon_name}.service
install -D -p -m 644 %{_vpath_builddir}/scripts/mysql@.service %{buildroot}%{_unitdir}/%{daemon_name}@.service
# helper scripts for service starting
install -p -m 755 %{_vpath_builddir}/scripts/mariadb-prepare-db-dir %{buildroot}%{_libexecdir}/mariadb-prepare-db-dir
install -p -m 755 %{_vpath_builddir}/scripts/mariadb-check-socket %{buildroot}%{_libexecdir}/mariadb-check-socket
install -p -m 755 %{_vpath_builddir}/scripts/mariadb-check-upgrade %{buildroot}%{_libexecdir}/mariadb-check-upgrade
install -p -m 644 %{_vpath_builddir}/scripts/mariadb-scripts-common %{buildroot}%{_libexecdir}/mariadb-scripts-common
install -D -p -m 0644 %{_vpath_builddir}/scripts/mariadb.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{name}.conf
%if 0%{?mysqld_pid_dir:1}
echo "d %{pidfiledir} 0755 mysql mysql -" >>%{buildroot}%{_tmpfilesdir}/%{name}.conf
%endif
# additional galera selinux policy
%if %{with galera}
install -p -m 644 -D selinux/%{name}-server-galera.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/%{name}-server-galera.pp
%endif
%if %{with test}
# mysql-test contains an executable file that is not in the /usr/share, so move it and provide a symlink
mv %{buildroot}%{_datadir}/mysql-test/lib/My/SafeProcess/my_safe_process %{buildroot}%{_bindir}
ln -s ../../../../../bin/my_safe_process %{buildroot}%{_datadir}/mysql-test/lib/My/SafeProcess/my_safe_process
# provide RH QA tests symlink
ln -s unstable-tests %{buildroot}%{_datadir}/mysql-test/rh-skipped-tests.list
%endif
%{?with_embedded:rm %{buildroot}%{_bindir}/{mariadb-,mysql_}embedded}
rm %{buildroot}%{_mandir}/man1/{mysql_,mariadb-}embedded.1*
rm %{buildroot}%{_libdir}/*.a
# creates the MySQL system tables and starts the server, but upstream does't think it will be used
rm %{buildroot}%{_datadir}/%{pkg_name}/binary-configure
# FS files first-bytes recoginiton, upstream does't think it will be used
rm %{buildroot}%{_datadir}/%{pkg_name}/magic
# replace them with our own systemd unit files and scripts
rm %{buildroot}%{_datadir}/%{pkg_name}/mysql.server
rm %{buildroot}%{_datadir}/%{pkg_name}/mysqld_multi.server
# Binary for monitoring MySQL performance, distributed as a separate package
rm %{buildroot}%{_bindir}/mytop
rm %{buildroot}%{_mandir}/man1/mytop.1*
# shipped with mariadb-connector-c
rm %{buildroot}%{_mandir}/man1/mariadb_config.1*
mkdir -p %{buildroot}%{logrotateddir}
mv %{buildroot}%{_datadir}/%{pkg_name}/mariadb.logrotate %{buildroot}%{logrotateddir}/%{daemon_name}
chmod 644 %{buildroot}%{logrotateddir}/%{daemon_name}
# to be compatible with upstream RPMs, create mysqld symlink in sbin
mkdir -p %{buildroot}%{_sbindir}
ln -s %{_libexecdir}/mysqld %{buildroot}%{_sbindir}/mysqld
ln -s %{_libexecdir}/mariadbd %{buildroot}%{_sbindir}/mariadbd
# copy additional docs into build tree for %%doc finding
install -p -m 0644 %{SOURCE1} %{basename:%{SOURCE1}}
install -p -m 0644 %{SOURCE16} %{basename:%{SOURCE16}}
install -p -m 0644 %{SOURCE2} %{basename:%{SOURCE2}}
# install galera config file
%if %{with galera}
sed -i -r 's|^wsrep_provider=none|wsrep_provider=%{_libdir}/galera/libgalera_smm.so|' %{_vpath_builddir}/support-files/wsrep.cnf
install -p -m 0644 %{_vpath_builddir}/support-files/wsrep.cnf %{buildroot}%{_sysconfdir}/my.cnf.d/galera.cnf
%endif
# install the clustercheck script
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
touch %{buildroot}%{_sysconfdir}/sysconfig/clustercheck
install -p -m 0755 %{_vpath_builddir}/scripts/clustercheck %{buildroot}%{_bindir}/clustercheck
rm -r %{buildroot}%{_datadir}/%{pkg_name}/policy/apparmor
# buildroot does not have symlink between /lib64 --> and /usr/lib64
%if %{with pam}
mv %{buildroot}/%{_lib}/security %{buildroot}%{_libdir}
%endif
# disable plugins of gssapi/cracklib
%if %{with gssapi}
sed -i 's/^plugin-load-add/#plugin-load-add/' %{buildroot}%{_sysconfdir}/my.cnf.d/auth_gssapi.cnf
%endif
%if %{with cracklib}
sed -i 's/^plugin-load-add/#plugin-load-add/' %{buildroot}%{_sysconfdir}/my.cnf.d/cracklib_password_check.cnf
%endif
# Fix Galera Replication config file
# The replication requires cluster address upon startup (which is end-user specific).
# Disable it entirely, rather than have it failing out-of-the-box.
%if %{with galera}
sed -i 's/^wsrep_on=1/wsrep_on=0/' %{buildroot}%{_sysconfdir}/my.cnf.d/galera.cnf
%endif
%if %{without embedded}
rm %{buildroot}%{_mandir}/man1/{mysql_client_test_embedded,mysqltest_embedded}.1*
rm %{buildroot}%{_mandir}/man1/{mariadb-client-test-embedded,mariadb-test-embedded}.1*
%endif
%if %{without clibrary}
rm %{buildroot}%{_sysconfdir}/my.cnf.d/client.cnf
rm %{buildroot}%{_libdir}/libmariadb.so.*
unlink %{buildroot}%{_libdir}/libmysqlclient.so
unlink %{buildroot}%{_libdir}/libmysqlclient_r.so
unlink %{buildroot}%{_libdir}/libmariadb.so
rm %{buildroot}%{_libdir}/%{pkg_name}/plugin/{dialog.so,mysql_clear_password.so,sha256_password.so}
%if %{with gssapi}
rm %{buildroot}%{_libdir}/%{pkg_name}/plugin/auth_gssapi_client.so
%endif
%endif
%if %{without clibrary} || %{without devel}
rm %{buildroot}%{_bindir}/mysql_config*
rm %{buildroot}%{_bindir}/mariadb_config
rm %{buildroot}%{_bindir}/mariadb-config
rm %{buildroot}%{_mandir}/man1/mysql_config*.1*
%endif
%if %{without clibrary} && %{with devel}
# provided in mariadb-connector-c
rm %{buildroot}%{_includedir}/mysql/mysql_version.h
rm %{buildroot}%{_includedir}/mysql/{errmsg.h,ma_list.h,ma_pvio.h,mariadb_com.h,\
mariadb_ctype.h,mariadb_dyncol.h,mariadb_stmt.h,mariadb_version.h,ma_tls.h,mysqld_error.h,mysql.h,mariadb_rpl.h}
rm -r %{buildroot}%{_includedir}/mysql/{mariadb,mysql}
%endif
%if %{without devel}
rm -r %{buildroot}%{_includedir}/mysql
rm %{buildroot}%{_datadir}/aclocal/mysql.m4
rm %{buildroot}%{_libdir}/pkgconfig/mariadb.pc
%if %{with clibrary}
rm %{buildroot}%{_libdir}/libmariadb*.so
unlink %{buildroot}%{_libdir}/libmysqlclient.so
unlink %{buildroot}%{_libdir}/libmysqlclient_r.so
%endif
%endif
%if %{without client}
rm %{buildroot}%{_bindir}/msql2mysql
rm %{buildroot}%{_bindir}/{mysql,mariadb}
rm %{buildroot}%{_bindir}/mysql{access,admin,binlog,check,dump,_find_rows,import,_plugin,show,slap,_waitpid}
rm %{buildroot}%{_bindir}/mariadb-{access,admin,binlog,check,dump,find-rows,import,plugin,show,slap,waitpid}
rm %{buildroot}%{_mandir}/man1/msql2mysql.1*
rm %{buildroot}%{_mandir}/man1/{mysql,mariadb}.1*
rm %{buildroot}%{_mandir}/man1/mysql{access,admin,binlog,check,dump,_find_rows,import,_plugin,show,slap,_waitpid}.1*
rm %{buildroot}%{_mandir}/man1/mariadb-{access,admin,binlog,check,dump,find-rows,import,plugin,show,slap,waitpid}.1*
rm %{buildroot}%{_sysconfdir}/my.cnf.d/mysql-clients.cnf
%endif
%if %{without config}
rm %{buildroot}%{_sysconfdir}/my.cnf
# provided by mariadb-connector-c
rm %{buildroot}%{_mandir}/man3/*
%endif
%if %{without common}
rm -r %{buildroot}%{_datadir}/%{pkg_name}/charsets
%endif
%if %{without errmsg}
rm %{buildroot}%{_datadir}/%{pkg_name}/errmsg-utf8.txt
rm -r %{buildroot}%{_datadir}/%{pkg_name}/{english,czech,danish,dutch,estonian,\
french,german,greek,hungarian,italian,japanese,korean,norwegian,norwegian-ny,\
polish,portuguese,romanian,russian,serbian,slovak,spanish,swedish,ukrainian,hindi,\
bulgarian,chinese}
%endif
%if %{without test}
%if %{with embedded}
rm %{buildroot}%{_bindir}/test-connect-t
rm %{buildroot}%{_bindir}/{mysql_client_test_embedded,mysqltest_embedded}
rm %{buildroot}%{_bindir}/{mariadb-client-test-embedded,mariadb-test-embedded}
rm %{buildroot}%{_mandir}/man1/{mysql_client_test_embedded,mysqltest_embedded}.1*
rm %{buildroot}%{_mandir}/man1/{mariadb-client-test-embedded,mariadb-test-embedded}.1*
%endif
%if %{with pam}
rm %{buildroot}/suite/plugins/pam/mariadb_mtr
rm %{buildroot}/suite/plugins/pam/pam_mariadb_mtr.so
%endif
rm %{buildroot}%{_bindir}/{mysql_client_test,mysqltest}
rm %{buildroot}%{_bindir}/{mariadb-client-test,mariadb-test}
rm %{buildroot}%{_mandir}/man1/{mysql_client_test,mysqltest,my_safe_process}.1*
rm %{buildroot}%{_mandir}/man1/{mariadb-client-test,mariadb-test}.1*
rm %{buildroot}%{_mandir}/man1/{mysql-test-run,mysql-stress-test}.pl.1*
%endif
%if %{without galera}
rm %{buildroot}%{_sysconfdir}/sysconfig/clustercheck
rm %{buildroot}%{_bindir}/{clustercheck,galera_new_cluster}
rm %{buildroot}%{_bindir}/galera_recovery
%endif
%if %{without rocksdb}
rm %{buildroot}%{_mandir}/man1/{mysql_,mariadb-}ldb.1*
rm %{buildroot}%{_mandir}/man1/myrocks_hotbackup.1*
%endif
%if %{without backup}
rm %{buildroot}%{_mandir}/man1/maria{,db-}backup.1*
rm %{buildroot}%{_mandir}/man1/mbstream.1*
%endif
%if %{without s3}
rm %{buildroot}%{_mandir}/man1/aria_s3_copy.1*
%endif
%check
%if %{with test}
%if %runselftest
export MTR_PARALLEL=1
# Builds might happen at the same host, we need to avoid collision
# The port used is calculated as 20 * MTR_BUILD_THREAD + 10000
# The resulting port must be between 5000 and 32767
# This is the same as using option "--build-thread" for the "mysql-test-run.pl"
export MTR_BUILD_THREAD=$(( $(date +%s) % 1100 ))
# The cmake build scripts don't provide any simple way to control the options for mysql-test-run,
# so ignore the make target and just call it manually. Nonstandard options chosen are:
# --force to continue tests after a failure
# no retries please
# test SSL with --ssl
# skip tests that are listed in skipped-tests.list
# avoid redundant test runs with --binlog-format=mixed
# increase timeouts to prevent unwanted failures during mass rebuilds
# Usefull arguments:
# --do-test=mysql_client_test_nonblock \
# --skip-rpl
# --suite=roles
# --mem for running in the RAM; Not enough space in KOJI for this
(
set -ex
cd %{buildroot}%{_datadir}/mysql-test
export common_testsuite_arguments=" --parallel=auto --force --retry=2 --suite-timeout=900 --testcase-timeout=30 --mysqld=--binlog-format=mixed --force-restart --shutdown-timeout=60 --max-test-fail=5 "
# If full testsuite has already been run on this version, don't want the full testsuite to be run
if [[ "%{last_tested_version}" == "%{version}" ]] && [[ %{force_run_testsuite} -eq 0 ]]
then
# in further rebuilds only run the basic "main" suite (~800 tests)
echo -e "\n\nRunning just the base testsuite\n\n"
perl ./mysql-test-run.pl $common_testsuite_arguments --ssl --suite=main --mem --skip-test-list=unstable-tests
fi
# If this version wasn't marked as tested yet or I explicitly want to run the testsuite, run everything we have (~4000 test)
if [[ "%{last_tested_version}" != "%{version}" ]] || [[ %{force_run_testsuite} -ne 0 ]]
then
echo -e "\n\nRunning the advanced testsuite\n\n"
perl ./mysql-test-run.pl $common_testsuite_arguments --ssl --big-test --skip-test=spider \
%if %{ignore_testsuite_result}
--max-test-fail=9999 || :
%else
--skip-test-list=unstable-tests
%endif
# Second run for the SPIDER suites that fail with SCA (ssl self signed certificate)
# spider/handler is not provided in mariadb-10.11.4, so you may need to remove this suite!
perl ./mysql-test-run.pl $common_testsuite_arguments --skip-ssl --big-test --mem --suite=spider,spider/bg,spider/bugfix,spider/handler \
%if %{ignore_testsuite_result}
--max-test-fail=999 || :
%endif
fi
# remove dangling symlink from the testing, not be installed
rm -rf ./var
)
# NOTE: the Spider SE has 2 more hidden testsuites, they are "oracle" and "oracle2".
# however, these tests fail with: "failed: 12521: Can't use wrapper 'oracle' for SQL connection"
%endif
%endif
%pre server
/usr/sbin/groupadd -g 27 -o -r mysql >/dev/null 2>&1 || :
/usr/sbin/useradd -M -N -g mysql -o -r -d %{mysqluserhome} -s /sbin/nologin \
-c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || :
%if %{with galera}
%post server-galera
# Allow ports needed for the replication:
# Galera Replication Port
semanage port -a -t mysqld_port_t -p tcp 4567 >/dev/null 2>&1 || :
semanage port -a -t mysqld_port_t -p udp 4567 >/dev/null 2>&1 || :
# IST Port
semanage port -a -t mysqld_port_t -p tcp 4568 >/dev/null 2>&1 || :
# SST Port
semanage port -a -t mysqld_port_t -p tcp 4444 >/dev/null 2>&1 || :
semodule -i %{_datadir}/selinux/packages/%{name}/%{name}-server-galera.pp >/dev/null 2>&1 || :
%endif
%post server
%systemd_post %{daemon_name}.service
%preun server
%systemd_preun %{daemon_name}.service
%if %{with galera}
%postun server-galera
if [ $1 -eq 0 ]; then
semodule -r %{name}-server-galera 2>/dev/null || :
fi
%endif
%postun server
%systemd_postun_with_restart %{daemon_name}.service
%if %{with client}
%files
%config(noreplace) %{_sysconfdir}/my.cnf.d/mysql-clients.cnf
%{_bindir}/msql2mysql
%{_bindir}/{mysql,mariadb}
%{_bindir}/mysql{access,admin,binlog,check,dump,_find_rows,import,_plugin,show,slap,_waitpid}
%{_bindir}/mariadb-{access,admin,binlog,check,dump,find-rows,import,plugin,show,slap,waitpid}
%{_mandir}/man1/msql2mysql.1*
%{_mandir}/man1/{mysql,mariadb}.1*
%{_mandir}/man1/mysql{access,admin,binlog,check,dump,_find_rows,import,_plugin,show,slap,_waitpid}.1*
%{_mandir}/man1/mariadb-{access,admin,binlog,check,dump,find-rows,import,plugin,show,slap,waitpid}.1*
%endif
%if %{with clibrary}
%files libs
%config(noreplace) %{_sysconfdir}/my.cnf.d/client.cnf
%exclude %{_libdir}/{libmysqlclient.so.18,libmariadb.so,libmysqlclient.so,libmysqlclient_r.so}
%{_libdir}/libmariadb.so*
%endif
%if %{with config}
%files config
# put my.cnf in the common package, so it can be used for client settings too.
%config(noreplace) %{_sysconfdir}/my.cnf
%dir %{_sysconfdir}/my.cnf.d
%endif
%if %{with common}
%files common
%doc %{_datadir}/doc/%{_pkgdocdirname}
%if %{with clibrary}
%{_libdir}/%{pkg_name}/plugin/dialog.so
%{_libdir}/%{pkg_name}/plugin/mysql_clear_password.so
%endif
%dir %{_datadir}/%{pkg_name}
%{_datadir}/%{pkg_name}/charsets
%endif
%if %{with errmsg}
%files errmsg
%{_datadir}/%{pkg_name}/errmsg-utf8.txt
%{_datadir}/%{pkg_name}/english
%lang(cs) %{_datadir}/%{pkg_name}/czech
%lang(da) %{_datadir}/%{pkg_name}/danish
%lang(nl) %{_datadir}/%{pkg_name}/dutch
%lang(et) %{_datadir}/%{pkg_name}/estonian
%lang(fr) %{_datadir}/%{pkg_name}/french
%lang(de) %{_datadir}/%{pkg_name}/german
%lang(el) %{_datadir}/%{pkg_name}/greek
%lang(hi) %{_datadir}/%{pkg_name}/hindi
%lang(hu) %{_datadir}/%{pkg_name}/hungarian
%lang(it) %{_datadir}/%{pkg_name}/italian
%lang(ja) %{_datadir}/%{pkg_name}/japanese
%lang(ko) %{_datadir}/%{pkg_name}/korean
%lang(no) %{_datadir}/%{pkg_name}/norwegian
%lang(no) %{_datadir}/%{pkg_name}/norwegian-ny
%lang(pl) %{_datadir}/%{pkg_name}/polish
%lang(pt) %{_datadir}/%{pkg_name}/portuguese
%lang(ro) %{_datadir}/%{pkg_name}/romanian
%lang(ru) %{_datadir}/%{pkg_name}/russian
%lang(sr) %{_datadir}/%{pkg_name}/serbian
%lang(sk) %{_datadir}/%{pkg_name}/slovak
%lang(es) %{_datadir}/%{pkg_name}/spanish
%lang(sv) %{_datadir}/%{pkg_name}/swedish
%lang(uk) %{_datadir}/%{pkg_name}/ukrainian
%lang(bg) %{_datadir}/%{pkg_name}/bulgarian
%lang(zh) %{_datadir}/%{pkg_name}/chinese
%endif
%if %{with galera}
%files server-galera
%license LICENSE.clustercheck
%doc Docs/README-wsrep
%config(noreplace) %{_sysconfdir}/my.cnf.d/galera.cnf
%attr(0640,root,root) %ghost %config(noreplace) %{_sysconfdir}/sysconfig/clustercheck
%{_bindir}/clustercheck
%{_bindir}/galera_new_cluster
%{_bindir}/galera_recovery
%{_datadir}/selinux/packages/%{name}/%{name}-server-galera.pp
%endif
%files server
%attr(0755,mysql,mysql) %dir %{pidfiledir}
%attr(0755,mysql,mysql) %dir %{dbdatadir}
%attr(0750,mysql,mysql) %dir %{logfiledir}
%attr(0660,mysql,mysql) %config %ghost %verify(not md5 size mtime) %{logfile}
%config(noreplace) %{logrotateddir}/%{daemon_name}
%config(noreplace) %{_sysconfdir}/my.cnf.d/%{pkg_name}-server.cnf
%config(noreplace) %{_sysconfdir}/my.cnf.d/enable_encryption.preset
%config(noreplace) %{_sysconfdir}/my.cnf.d/spider.cnf
%{_sysconfdir}/my.cnf.d/provider_lz4.cnf
%{_tmpfilesdir}/%{name}.conf
%{_sysusersdir}/%{name}.conf
%{_bindir}/aria_{chk,dump_log,ftdump,pack,read_log}
%{_bindir}/mariadb-service-convert
%{_bindir}/myisamchk
%{_bindir}/myisam_ftdump
%{_bindir}/myisamlog
%{_bindir}/myisampack
%{_bindir}/my_print_defaults
%{_bindir}/mariadb-conv
%{_bindir}/mysql_{install_db,secure_installation,tzinfo_to_sql}
%{_bindir}/mariadb-{install-db,secure-installation,tzinfo-to-sql}
%{_bindir}/{mysqld_,mariadbd-}safe
%{_bindir}/{mysqld_safe_helper,mariadbd-safe-helper}
%{_bindir}/innochecksum
%{_bindir}/replace
%{_bindir}/resolve_stack_dump
%{_bindir}/resolveip
%if %{with galera}
%{_bindir}/wsrep_*
%endif
%{_sbindir}/mysqld
%{_sbindir}/mariadbd
%{_libexecdir}/{mysqld,mariadbd}
%{_libexecdir}/mariadb-prepare-db-dir
%{_libexecdir}/mariadb-check-socket
%{_libexecdir}/mariadb-check-upgrade
%{_libexecdir}/mariadb-scripts-common
%{_libdir}/%{pkg_name}/INFO_SRC
%{_libdir}/%{pkg_name}/INFO_BIN
%if %{without common}
%dir %{_datadir}/%{pkg_name}
%endif
%dir %{_libdir}/%{pkg_name}
%dir %{_libdir}/%{pkg_name}/plugin
%{_libdir}/%{pkg_name}/plugin/*
%{?with_oqgraph:%exclude %{_libdir}/%{pkg_name}/plugin/ha_oqgraph.so}
%{?with_connect:%exclude %{_libdir}/%{pkg_name}/plugin/ha_connect.so}
%{?with_cracklib:%exclude %{_libdir}/%{pkg_name}/plugin/cracklib_password_check.so}
%{?with_rocksdb:%exclude %{_libdir}/%{pkg_name}/plugin/ha_rocksdb.so}
%{?with_gssapi:%exclude %{_libdir}/%{pkg_name}/plugin/auth_gssapi.so}
%{?with_sphinx:%exclude %{_libdir}/%{pkg_name}/plugin/ha_sphinx.so}
%{?with_s3:%exclude %{_libdir}/%{pkg_name}/plugin/ha_s3.so}
%if %{with clibrary}
%exclude %{_libdir}/%{pkg_name}/plugin/dialog.so
%exclude %{_libdir}/%{pkg_name}/plugin/mysql_clear_password.so
%endif
# PAM plugin; moved to a separate subpackage
%exclude %{_libdir}/%{pkg_name}/plugin/{auth_pam_v1.so,auth_pam.so}
%exclude %dir %{_libdir}/%{pkg_name}/plugin/auth_pam_tool_dir
%exclude %{_libdir}/%{pkg_name}/plugin/auth_pam_tool_dir/auth_pam_tool
%{_datadir}/%{pkg_name}/fill_help_tables.sql
%{_datadir}/%{pkg_name}/maria_add_gis_sp.sql
%{_datadir}/%{pkg_name}/maria_add_gis_sp_bootstrap.sql
%{_datadir}/%{pkg_name}/mysql_system_tables.sql
%{_datadir}/%{pkg_name}/mysql_system_tables_data.sql
%{_datadir}/%{pkg_name}/mysql_test_data_timezone.sql
%{_datadir}/%{pkg_name}/mysql_performance_tables.sql
%{_datadir}/%{pkg_name}/mysql_test_db.sql
%{_datadir}/%{pkg_name}/georgian/errmsg.sys
%{_datadir}/%{pkg_name}/mini-benchmark
%{_datadir}/%{pkg_name}/mysql_sys_schema.sql
%if %{with mroonga}
%license %{_datadir}/%{pkg_name}/mroonga/COPYING
%license %{_datadir}/%{pkg_name}/mroonga/AUTHORS
%license %{_datadir}/%{name}-server/groonga-normalizer-mysql/lgpl-2.0.txt
%license %{_datadir}/%{name}-server/groonga/COPYING
%doc %{_datadir}/%{name}-server/groonga-normalizer-mysql/README.md
%doc %{_datadir}/%{name}-server/groonga/README.md
%{_datadir}/%{pkg_name}/mroonga/install.sql
%{_datadir}/%{pkg_name}/mroonga/uninstall.sql
%endif
%if %{with galera}
%{_datadir}/%{pkg_name}/wsrep.cnf
%endif
%dir %{_datadir}/%{pkg_name}/policy
%dir %{_datadir}/%{pkg_name}/policy/selinux
%{_datadir}/%{pkg_name}/wsrep_notify
%{_datadir}/%{pkg_name}/policy/selinux/README
%{_datadir}/%{pkg_name}/policy/selinux/mariadb-server.*
%{_datadir}/%{pkg_name}/policy/selinux/mariadb.*
%{_unitdir}/%{daemon_name}*
%{_mandir}/man1/aria_{chk,dump_log,ftdump,pack,read_log}.1*
%{_mandir}/man1/galera_new_cluster.1*
%{_mandir}/man1/galera_recovery.1*
%{_mandir}/man1/mariadb-service-convert.1*
%{_mandir}/man1/myisamchk.1*
%{_mandir}/man1/myisamlog.1*
%{_mandir}/man1/myisampack.1*
%{_mandir}/man1/myisam_ftdump.1*
%{_mandir}/man1/my_print_defaults.1*
%{_mandir}/man1/mariadb-conv.1*
%{_mandir}/man1/mysql_{install_db,secure_installation,tzinfo_to_sql}.1*
%{_mandir}/man1/mariadb-{install-db,secure-installation,tzinfo-to-sql}.1*
%{_mandir}/man1/{mysqld_,mariadbd-}safe.1*
%{_mandir}/man1/{mysqld_safe_helper,mariadbd-safe-helper}.1*
%{_mandir}/man1/innochecksum.1*
%{_mandir}/man1/replace.1*
%{_mandir}/man1/resolveip.1*
%{_mandir}/man1/resolve_stack_dump.1*
%{_mandir}/man8/{mysqld,mariadbd}.8*
%{_mandir}/man1/wsrep_*.1*
%{_mandir}/man1/mysql.server.1*
%if %{with cracklib}
%files cracklib-password-check
%config(noreplace) %{_sysconfdir}/my.cnf.d/cracklib_password_check.cnf
%{_libdir}/%{pkg_name}/plugin/cracklib_password_check.so
%endif
%if %{with backup}
%files backup
%{_bindir}/maria{,db-}backup
%{_bindir}/mbstream
%{_mandir}/man1/maria{,db-}backup.1*
%{_mandir}/man1/mbstream.1*
%endif
%if %{with rocksdb}
%files rocksdb-engine
%config(noreplace) %{_sysconfdir}/my.cnf.d/rocksdb.cnf
%{_bindir}/myrocks_hotbackup
%{_bindir}/{mysql_,mariadb-}ldb
%{_bindir}/sst_dump
%{_libdir}/%{pkg_name}/plugin/ha_rocksdb.so
%{_mandir}/man1/{mysql_,mariadb-}ldb.1*
%{_mandir}/man1/myrocks_hotbackup.1*
%endif
%if %{with gssapi}
%files gssapi-server
%{_libdir}/%{pkg_name}/plugin/auth_gssapi.so
%config(noreplace) %{_sysconfdir}/my.cnf.d/auth_gssapi.cnf
%endif
%if %{with pam}
%files pam
%config(noreplace) %{_sysconfdir}/security/user_map.conf
%attr(0755,root,root) %dir %{_libdir}/%{pkg_name}/plugin/auth_pam_tool_dir
# SUID-to-root binary. Access MUST be restricted
%attr(4750,root,mysql) %{_libdir}/%{pkg_name}/plugin/auth_pam_tool_dir/auth_pam_tool
%{_libdir}/security/pam_user_map.so
%{_libdir}/%{pkg_name}/plugin/{auth_pam_v1.so,auth_pam.so}
%endif
%if %{with sphinx}
%files sphinx-engine
%{_libdir}/%{pkg_name}/plugin/ha_sphinx.so
%endif
%if %{with oqgraph}
%files oqgraph-engine
%config(noreplace) %{_sysconfdir}/my.cnf.d/oqgraph.cnf
%{_libdir}/%{pkg_name}/plugin/ha_oqgraph.so
%endif
%if %{with connect}
%files connect-engine
%config(noreplace) %{_sysconfdir}/my.cnf.d/connect.cnf
%{_libdir}/%{pkg_name}/plugin/ha_connect.so
%endif
%if %{with s3}
%files s3-engine
%config(noreplace) %{_sysconfdir}/my.cnf.d/s3.cnf
%{_bindir}/aria_s3_copy
%{_libdir}/%{pkg_name}/plugin/ha_s3.so
%{_mandir}/man1/aria_s3_copy.1*
%endif
%files server-utils
%{_bindir}/mysql{_convert_table_format,dumpslow,_fix_extensions,hotcopy,_setpermission}
%{_bindir}/mariadb-{convert-table-format,dumpslow,fix-extensions,hotcopy,setpermission}
%{_bindir}/{mysqld_,mariadbd-}multi
%{_bindir}/{mysql_,mariadb-}upgrade
%{_bindir}/perror
%{_mandir}/man1/mysql{_convert_table_format,dumpslow,_fix_extensions,hotcopy,_setpermission}.1*
%{_mandir}/man1/mariadb-{convert-table-format,dumpslow,fix-extensions,hotcopy,setpermission}.1*
%{_mandir}/man1/{mysqld_,mariadbd-}multi.1*
%{_mandir}/man1/{mysql_,mariadb-}upgrade.1*
%{_mandir}/man1/perror.1*
%if %{with devel}
%files devel
%{_includedir}/*
%{_libdir}/pkgconfig/*mariadb.pc
%{_datadir}/aclocal/mysql.m4
%if %{with clibrary}
%{_libdir}/{libmysqlclient.so.18,libmariadb.so,libmysqlclient.so,libmysqlclient_r.so}
%{_bindir}/mysql_config*
%{_bindir}/mariadb_config*
%{_bindir}/mariadb-config
%{_libdir}/libmariadb.so
%{_libdir}/libmysqlclient.so
%{_libdir}/libmysqlclient_r.so
%{_mandir}/man1/mysql_config*
%endif
%endif
%if %{with embedded}
%files embedded
%{_libdir}/libmariadbd.so.*
%files embedded-devel
%{_libdir}/libmysqld.so
%{_libdir}/libmariadbd.so
%endif
%if %{with test}
%files test
%{_bindir}/{mysql_client_test,mysqltest,mariadb-client-test,mariadb-test}
%{_bindir}/my_safe_process
%if %{with embedded}
%{_bindir}/test-connect-t
%{_bindir}/{mysql_client_test_embedded,mysqltest_embedded}
%{_bindir}/{mariadb-client-test-embedded,mariadb-test-embedded}
%{_mandir}/man1/{mysql_client_test_embedded,mysqltest_embedded}.1*
%{_mandir}/man1/{mariadb-client-test-embedded,mariadb-test-embedded}.1*
%endif
%attr(-,mysql,mysql) %{_datadir}/mysql-test
%{_mandir}/man1/{mysql_client_test,mysqltest,mariadb-client-test,mariadb-test}.1*
%{_mandir}/man1/my_safe_process.1*
%{_mandir}/man1/mysql-stress-test.pl.1*
%{_mandir}/man1/mysql-test-run.pl.1*
%endif
%changelog
* Thu Sep 26 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 10.11.4-8
- Rebuilt for clarifying the packages requirement in BaseOS and AppStream
* Fri Aug 16 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 10.11.4-7
- Rebuilt for loongarch release
* Sat Jul 06 2024 Zhai Liangliang <zhailiangliang@loongson.cn> - 10.11.4-6
- [Type] other
- [DESC] Remove macro loongarch64 for avoiding build error
* Mon Jun 24 2024 Zhai Liangliang <zhailiangliang@loongson.cn> - 10.11.4-5
- [Type] other
- [DESC] fix build error for loongarch
* Fri Sep 08 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 10.11.4-4
- Rebuilt for OpenCloudOS Stream 23.09
* Tue Aug 01 2023 rockerzhu rockerzhu@tencent.com - 10.11.4-3
- Rebuilt for boost 1.82.0
* Mon Jul 24 2023 Wang Guodong <gordonwwang@tencent.com> - 10.11.4-2
- Update the mariadb-server.cnf and service files to avoid systemctl start problems
* Mon Jul 24 2023 Wang Guodong <gordonwwang@tencent.com> - 10.11.4-1
- Upgrade to 10.11.4
* Fri Apr 28 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 10.5.16-4
- Rebuilt for OpenCloudOS Stream 23.05
* Fri Apr 7 2023 Wang Guodong <gordonwwang@tencent.com> - 10.5.16-3
- Make the conflicts between the mariadb and mysql packages explicit.
* Fri Mar 31 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 10.5.16-2
- Rebuilt for OpenCloudOS Stream 23
* Wed Dec 14 2022 Wang Guodong <gordonwwang@tencent.com> - 10.5.16-1
- package init.
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/opencloudos-stream/mariadb.git
git@gitee.com:opencloudos-stream/mariadb.git
opencloudos-stream
mariadb
mariadb
master

搜索帮助