Sophie

Sophie

distrib > Mageia > 3 > i586 > by-pkgid > ec3309693b009586ed68318a6f3917d8 > files > 8

mariadb-5.5.40-1.1.mga3.src.rpm

#(ie. use with rpm --rebuild):
#
#	--with debug	Compile with debugging code
# 
#  enable build with debugging code: will _not_ strip away any debugging code,
#  will _add_ -g3 to CFLAGS, will _add_ --enable-maintainer-mode to 
#  configure.

%define build_debug 0
%define build_test 0

# commandline overrides:
# rpm -ba|--rebuild --with 'xxx'
%{?_with_debug: %{expand: %%define build_debug 1}}
%{?_with_test: %{expand: %%define build_test 1}}
%{?_without_test: %global build_test 0}

%if %{build_debug}
# disable build root strip policy
%define __spec_install_post %{_libdir}/rpm/brp-compress || :

# This gives extra debuggin and huge binaries
%{expand:%%define optflags %{optflags} %([ ! $DEBUG ] && echo '-g3')}
%endif

%if %{build_debug}
%define build_debug 1
%endif

%if %{build_test}
%define build_test 1
%endif

%define major 18
%define libmysqlembedded_major 0
%define libmysqlembedded_minor 0.1
%define libname %mklibname mariadb %{major}
%define libmariadbservices %mklibname mariadbservices
%define libmariadbembedded %mklibname mariadb-embedded %{major}
%define develname %mklibname -d mariadb
%define old_staticdevelname %mklibname -d -s mariadb
%define libmariadbembedded_devel %mklibname -d mariadb-embedded

%define mysql_libname %mklibname mysql %{major}
%define mysql_develname %mklibname -d mysql
%define libmysqlservices %mklibname mysqlservices
%define libmysqlembedded %mklibname mysqld %{libmysqlembedded_major}
%define libmysqlembedded_devel %mklibname -d mariadb-embedded

%define mirror	http://ftp.ddg.lth.se/mariadb

%define muser	mysql
Summary:	A very fast and reliable SQL database engine
Name: 		mariadb
Version:	5.5.40
%define subrel 1
Release:	%mkrel 1
Group:		Databases
License:	GPLv2 with exceptions
URL:		http://mariadb.org/
Source0:        %{mirror}/%{name}-%{version}/source/%{name}-%{version}.tar.gz
Source2:	mysqld.sysconfig
Source3:	my.cnf
Source10:	mysql.tmpfiles.d
Source11:	mysqld.service
Source12:	mysqld-prepare-db-dir
Source13:	mysqld-wait-ready
# the following patches are rediffed from the mysql-5.5 src.rpm to mariadb-5.5 
# fedora patches
Patch1: 	mariadb-5.5-errno.patch
Patch3: 	mariadb-5.5-install-test.patch

# mandriva patches
Patch101:	mariadb-5.5-logrotate.patch
Patch102:	mariadb-5.5-initscript.patch
Patch106:	mariadb-5.5-hotcopy.patch
Patch107:	mariadb-5.5-mysql_install_db-quiet.patch

Requires(post):  systemd >= %{systemd_required_version}
Requires(post):  rpm-helper >= 0.24.8-1
Requires(preun): rpm-helper >= 0.24.8-1
Requires(post): %{name}-common%{_isa} = %{version}-%{release}
Requires(preun): %{name}-common%{_isa} = %{version}-%{release}
Requires(post): %{name}-client%{_isa} = %{version}-%{release}
Requires(preun): %{name}-client%{_isa} = %{version}-%{release}
Requires(postun): %{name}-common%{_isa} = %{version}-%{release}
Requires(postun): %{name}-client%{_isa} = %{version}-%{release}
Requires:	%{name}-common%{_isa} = %{version}-%{release}
Requires:	%{name}-core%{_isa} = %{version}-%{release}
Requires:	%{name}-client%{_isa} = %{version}-%{release}
Provides:	mysql = %{version}-%{release}
Obsoletes:	mysql < %{version}-%{release}
Obsoletes:	%{libmariadbservices} < 5.5.18-0.3194.20111227.1
Obsoletes:	%{libmysqlservices} < %{version}-%{release}
Conflicts:	%{name}-extra%{_isa} < %{version}-%{release}
Conflicts:	%{name}-feedback%{_isa} < %{version}-%{release}
Conflicts:	%{name}-obsolete%{_isa} < %{version}-%{release}
Suggests:	%{name}-extra%{_isa}
BuildRequires:	bison
BuildRequires:	cmake
BuildRequires:	doxygen
BuildRequires:	glibc-devel
BuildRequires:	libaio-devel
BuildRequires:	libstdc++-devel
BuildRequires:	libtermcap-devel
BuildRequires:	multiarch-utils >= 1.0.3
BuildRequires:	ncurses-devel
BuildRequires:	openssl-devel
BuildRequires:	wrap-devel
BuildRequires:	python
BuildRequires:	systemtap
BuildRequires:	tetex
BuildRequires:	texinfo
BuildRequires:	xfs-devel
BuildRequires:	zlib-devel
BuildRequires:	boost-devel
BuildRequires:	libaio-devel
BuildRequires:	pam-devel
BuildConflicts:	edit-devel
BuildRequires:	jemalloc-devel >= 3.6.0

%description
The MariaDB software delivers a very fast, multi-threaded, multi-user, and
robust SQL (Structured Query Language) database server. MariaDB Server is
intended for mission-critical, heavy-load production systems as well as for
embedding into mass-deployed software.

The mariadb server is compiled with the following storage engines:

 - Aria Storage Engine
 - Archive Storage Engine
 - Blackhole Storage Engine
 - CSV Storage Engine
 - FederatedX Storage Engine (Federated replacement)
 - Heap Storage Engine
 - MyISAM Storage Engine
 - MyISAMMRG Storage Engine
 - Partition Storage Engine
 - Perfschema Storage Engine
 - XtraDB Storage Engine (InnoDB replacement)

The following extra storage engines are provided by the mariadb-extra package

 - OQGraph Storage Engine
 - Sphinx Storage Engine

The feedback storage engine is provided by the mariadb-feedback package

 - Feedback Storage Engine

The following storage engines are provided in the mariadb-obsolete package

 - Federated Storage Engine
 - InnoDB Storage Engine

%package -n	mysql-MariaDB
Summary:	A MySQL drop-in replacement
Group:		System/Servers
Requires:	%{name}%{_isa}

%description -n	mysql-MariaDB
MariaDB is a complete MySQL drop-in replacement with additional fixes and
storage engines.

This package is used as a transitional virtual package, which requires
MariaDB so that people who used to use mysql can find it nicely.

%package	feedback
Summary:	MariaDB feedback storage engine
Group:		System/Servers
Requires:	%{name}-common-core%{_isa} >= %{version}-%{release}
Conflicts:	%{name}-common-core%{_isa} < %{version}-%{release}

%description	feedback
MariaDB feedback storage engine submits feedback about your mariadb server.
Results can be seen on http://mariadb.org/feedback_plugin/ .

%package	extra
Summary:	MariaDB extra storage engines
Group:		System/Servers
Requires:	%{name}-common-core%{_isa} >= %{version}-%{release}
Conflicts:	%{name}-common-core%{_isa} < %{version}-%{release}

%description	extra
MariaDB oqgraph and sphinx storage engines.

%package	obsolete
Summary:	MariaDB obsolete storage engines
Group:		System/Servers
Requires:	%{name}-common-core%{_isa} >= %{version}-%{release}
Conflicts:	%{name}-common-core%{_isa} < %{version}-%{release}
Conflicts:	mysql-core < 5.5.18

%description	obsolete
MariaDB obsolete storage engines. InnoDB and Federated are being replaced by
XtraDB and FederatedX storage engines. These obsolete storage engines are
provided in case you need the vanilla mysql storage engines.

%package	core
Summary:	Server core binary
Group:		System/Servers
Requires:	%{name}-common-core%{_isa} >= %{version}-%{release}
Provides:	mysql-core = %{version}-%{release}
Obsoletes:	mysql-core < %{version}-%{release}

%description	core
Core mysqld server binary. For a full MariaDB database server, install
package 'mariadb'.

%package	common-core
Summary:	Common files required by core binary
Group:		System/Servers
Provides:	mysql-common-core = %{version}-%{release}
Obsoletes:	mysql-common-core < %{version}-%{release}

%description	common-core
Common files minimally required by mysqld server binary.

%package	common
Summary:	Common files
Group:		System/Servers
Requires(post): rpm-helper
Requires(preun): rpm-helper
Requires(pre): rpm-helper
Requires(postun): rpm-helper
Requires(post): %{name}-client%{_isa} >= %{version}-%{release}
Requires(preun): %{name}-client%{_isa} >= %{version}-%{release}
Requires:	%{name}-client%{_isa} >= %{version}-%{release}
Requires:	%{name}-common-core%{_isa} >= %{version}-%{release}
Provides:	mysql-common = %{version}-%{release}
Obsoletes:	mysql-common < %{version}-%{release}

%description	common
Common files for the MariaDB database server.

%package	client
Summary:	Client
Group:		Databases
Requires(post): %{libname}%{_isa} >= %{version}-%{release}
Requires(preun): %{libname}%{_isa} >= %{version}-%{release}
Requires:	%{libname}%{_isa} >= %{version}-%{release}
Provides:	mysql-client = %{version}-%{release}
Obsoletes:	mysql-client < %{version}-%{release}

%description	client
This package contains the standard MariaDB clients.

%package	bench
Summary:	Benchmarks and test system
Group:		System/Servers
Requires(post): %{name}-client%{_isa} >= %{version}-%{release}
Requires(preun): %{name}-client%{_isa} >= %{version}-%{release}
Requires:	%{name}-client%{_isa} >= %{version}-%{release}
Suggests:	%{name}%{_isa} >= %{version}-%{release}
Provides:	mysql-bench = %{version}-%{release}
Obsoletes:	mysql-bench < %{version}-%{release}

%description	bench
This package contains MariaDB benchmark scripts and data.

%package -n	%{libname}
Summary:	Shared libraries
Group:		System/Libraries
Provides:	%{name}-shared-libs = %{version}-%{release}
Provides:	%{name}-shared = %{version}-%{release}
Provides:	%{mysql_libname} = %{version}-%{release}
Obsoletes:	%{mysql_libname} < %{version}-%{release}

%description -n	%{libname}
This package contains the shared libraries (*.so*) which certain languages and
applications need to dynamically load and use MariaDB.

%package -n	%{develname}
Summary:	Development header files and libraries
Group:		Development/Other
Requires(post): %{libname} >= %{version}-%{release}
Requires(preun): %{libname} >= %{version}-%{release}
Requires(post): %{name}-common%{_isa} >= %{version}-%{release}
Requires(preun): %{name}-common%{_isa} >= %{version}-%{release}
Requires(post): %{name}-client%{_isa} >= %{version}-%{release}
Requires(preun): %{name}-client%{_isa} >= %{version}-%{release}
Requires:	%{libname} = %{version}-%{release}
Requires:	%{name}-common%{_isa} >= %{version}-%{release}
Requires:	%{name}-client%{_isa} >= %{version}-%{release}
Provides:	%{name}-devel = %{version}-%{release}
Provides:	%{libname}-devel = %{version}-%{release}
Obsoletes:	%{libname}-devel < %{version}-%{release}
Obsoletes:	%{old_staticdevelname} < %{version}-%{release}
Provides:	%{mysql_develname} = %{version}-%{release}
Obsoletes:	%{mysql_develname} < %{version}-%{release}
Provides:	mysql-devel = %{version}-%{release}

%description -n	%{develname}
This package contains the development header files and libraries necessary to
develop MariaDB client applications.

%package -n 	%{libmariadbembedded}
Summary: 	MariaDB as an embeddable library
Group: 		System/Libraries
Provides: 	%{name}-embedded = %{version}-%{release}
Obsoletes: 	%{name}-embedded < %{version}-%{release}
Provides:	%{libmysqlembedded} = %{version}-%{release}
Obsoletes:	%{libmysqlembedded} < %{version}-%{release}

%description -n %{libmariadbembedded}
MariaDB is a multi-user, multi-threaded SQL database server. This
package contains a version of the MariaDB server that can be embedded
into a client application instead of running as a separate process.

The API is identical for the embedded MariaDB version and the client/server
version.

%package -n 	%{libmariadbembedded_devel}
Summary: 	Development files for MySQL as an embeddable library
Group: 		Development/Other
Provides: 	%{name}-embedded-devel = %{version}-%{release}
Obsoletes: 	%{name}-embedded-devel < %{version}-%{release}
Requires: 	%{libmariadbembedded} = %{version}-%{release}
Requires: 	%{develname} = %{version}-%{release}
Provides:	%{libmysqlembedded_devel} = %{version}-%{release}
Obsoletes:	%{libmysqlembedded_devel} < %{version}-%{release}
Provides:	mysql-embedded-devel = %{version}-%{release}

%description -n %{libmariadbembedded_devel}
MariaDB is a multi-user, multi-threaded SQL database server. This
package contains files needed for developing and testing with
the embedded version of the MariaDB server.
 
The API is identical for the embedded MariaDB version and the client/server
version.


%prep
%setup -q
%apply_patches

mkdir -p Mageia
cp %{SOURCE2} Mageia/mysqld.sysconfig
cp %{SOURCE3} Mageia/my.cnf

# remove the sql_yacc.cc file so that bison will regenerate it properly, even if it's patched
rm -f sql/sql_yacc.cc

# lib64 fix
perl -pi -e "s|/usr/lib/|%{_libdir}/|g" Mageia/my.cnf

# antiborker
perl -pi -e "s|\@bindir\@|%{_bindir}|g" support-files/* scripts/*
perl -pi -e "s|\@sbindir\@|%{_sbindir}|g" support-files/* scripts/*
perl -pi -e "s|\@libexecdir\@|%{_sbindir}|g" support-files/* scripts/*
perl -pi -e "s|\@localstatedir\@|/var/lib/mysql|g" support-files/* scripts/*
perl -pi -e "s|^basedir=.*|basedir=%{_prefix}|g" support-files/* scripts/mysql_install_db*

# this may be part of the problems with mysql-test
# http://bugs.mysql.com/bug.php?id=52223
#perl -pi -e "s|basedir/lib\b|basedir/%{_lib}\b|g" mysql-test/mysql-test-run.pl
#perl -pi -e "s|basedir/lib/|basedir/%{_lib}/|g" mysql-test/mysql-test-run.pl

# workaround for upstream bug #56342
rm -f mysql-test/t/ssl_8k_key-master.opt
rm -f mysql-test/t/file_contents.test

# fix distribution name
sed -i 's/Source distribution/%{_vendor} MariaDB Server/' mysql-test/suite/percona/innodb_sys_index.result

%build
%serverbuild
export CFLAGS="${CFLAGS:-%{optflags}}"
export CXXFLAGS="${CXXFLAGS:-%{optflags}}"
export FFLAGS="${FFLAGS:-%{optflags}}"

%cmake \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    -DINSTALL_SBINDIR=sbin \
    -DMYSQL_DATADIR=/var/lib/mysql \
    -DSYSCONFDIR=%{_sysconfdir} \
    -DINSTALL_PLUGINDIR=%{_lib}/mysql/plugin \
    -DINSTALL_MANDIR=share/man \
    -DINSTALL_SHAREDIR=share/mysql \
    -DINSTALL_LIBDIR=%{_lib} \
    -DINSTALL_INCLUDEDIR=include/mysql \
    -DINSTALL_INFODIR=share/info \
    -DINSTALL_MYSQLDATADIR=/var/lib/mysql \
    -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test \
    -DINSTALL_SQLBENCHDIR=share/mysql \
    -DINSTALL_SUPPORTFILESDIR=share/mysql \
    -DINSTALL_MYSQLSHAREDIR=share/mysql \
    -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \
    -DWITH_READLINE=0 \
    -DWITH_LIBEDIT=0 \
    -DWITH_LIBWRAP=1 \
    -DWITH_SSL=system \
    -DWITH_ZLIB=system \
    -DWITH_PIC=1 \
    -DMYSQL_TCP_PORT=3306 \
    -DEXTRA_CHARSETS=all \
    -DENABLED_LOCAL_INFILE=1 \
    -DENABLE_DTRACE=1 \
    -DWITH_EMBEDDED_SERVER=1 \
    -DMYSQL_USER=%{muser} \
%if %{build_debug}
    -DWITH_DEBUG=1 \
%else
    -DWITH_DEBUG=0 \
%endif
    -DWITHOUT_TOKUDB_STORAGE_ENGINE=1 \
    -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
    -DWITHOUT_NDBCLUSTER_STORAGE_ENGINE=1 \
    -DWITHOUT_DAEMON_EXAMPLE=1 \
    -DWITH_PLUGIN_PBXT=0 \
    -DFEATURE_SET="community" \
    -DRPM=1 \
    -DCOMPILATION_COMMENT="%{_vendor} MariaDB Server"

%make

%install
rm -rf %{buildroot}

# don't fiddle with the initscript!
export DONT_GPRINTIFY=1

%if %{build_debug}
export DONT_STRIP=1
%endif

install -d %{buildroot}%{_sysconfdir}/sysconfig
install -d %{buildroot}%{_initrddir}
install -d %{buildroot}%{_var}/log/mysqld
install -d %{buildroot}/var/lib/mysql/{mysql,test}

%makeinstall_std -C build

# exclude loaddata7 from being converted
export EXCLUDE_FROM_EOL_CONVERSION="std_data/loaddata7.dat"

# install init scripts
install -m0755 build/support-files/mysql.server %{buildroot}%{_initrddir}/mysqld

# install configuration files
install -m0644 Mageia/mysqld.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/mysqld
install -m0644 Mageia/my.cnf %{buildroot}%{_sysconfdir}/my.cnf

install -m 0644 -D %{SOURCE10} %{buildroot}%{_tmpfilesdir}/mysql.conf
install -m 0644 -D %{SOURCE11} %{buildroot}%{_unitdir}/mysqld.service
install -m 0755 %{SOURCE12} %{buildroot}%{_sbindir}/mysqld-prepare-db-dir
install -m 0755 %{SOURCE13} %{buildroot}%{_sbindir}/mysqld-wait-ready

# bork
mv %{buildroot}%{_datadir}/mysql/aclocal %{buildroot}%{_datadir}/aclocal

pushd %{buildroot}%{_bindir}
    ln -sf mysqlcheck mysqlrepair
    ln -sf mysqlcheck mysqlanalyze
    ln -sf mysqlcheck mysqloptimize
popd

# nuke -Wl,--as-needed from the mysql_config file
perl -pi -e "s|^ldflags=.*|ldflags=\'-rdynamic\'|g" %{buildroot}%{_bindir}/mysql_config

# cmake generates some completely wacko references to -lprobes_mysql when
# building with dtrace support.  Haven't found where to shut that off,
# so resort to this blunt instrument.  While at it, let's not reference
# libmysqlclient_r anymore either.
sed -e 's/-lprobes_mysql//' -e 's/-lmysqlclient_r/-lmysqlclient/' \
	%{buildroot}%{_bindir}/mysql_config >mysql_config.tmp
cp -f mysql_config.tmp %{buildroot}%{_bindir}/mysql_config
chmod 755 %{buildroot}%{_bindir}/mysql_config
install -m 0755 -d %{buildroot}/var/lib/mysql

# Remove libmysqld.a, + hardlink libmysqld.so.%{libmysqlembedded_major} so that it's provided
rm -f %{buildroot}%{_libdir}/libmysqld.a
ln %{buildroot}%{_libdir}/libmysqld.so.%{major} %{buildroot}%{_libdir}/libmysqld.so.%{libmysqlembedded_major}.%{libmysqlembedded_minor}
ln -s libmysqld.so.%{libmysqlembedded_major}.%{libmysqlembedded_minor} %{buildroot}%{_libdir}/libmysqld.so.%{libmysqlembedded_major}

# missing header
install -m0644 build/include/probes_mysql_dtrace.h %{buildroot}%{_includedir}/mysql/

# libmysqlclient_r is no more.  Upstream tries to replace it with symlinks
# but that really doesn't work (wrong soname in particular).  We'll keep
# just the devel libmysqlclient_r.so link, so that rebuilding without any
# source change is enough to get rid of dependency on libmysqlclient_r.
rm -f %{buildroot}%{_libdir}/libmysqlclient_r.so*
ln -s libmysqlclient.so %{buildroot}%{_libdir}/libmysqlclient_r.so

# remove static libs
rm -f %{buildroot}%{_libdir}/libmysqlclient.a
rm -f %{buildroot}%{_libdir}/libmysqlclient_r.a

# mysql-test includes one executable that doesn't belong under /usr/share,
# so move it and provide a symlink
mv %{buildroot}%{_datadir}/mysql/mysql-test/lib/My/SafeProcess/my_safe_process %{buildroot}%{_bindir}
ln -s %{_bindir}/my_safe_process %{buildroot}%{_datadir}/mysql/mysql-test/lib/My/SafeProcess/my_safe_process

# mysql client statically built against a local embedded library, pretty useless
rm -f %{buildroot}%{_bindir}/mysql_embedded

# this command enables plugins, but needs ini file + configuration in my.cnf
# before executing... and oh yeah, mysql must be stopped... => useless
# however, apparently tests seem to want it, even thought they don't use it.
#rm -f %{buildroot}%{_bindir}/mysql_plugin
rm -f %{buildroot}%{_libdir}/mysql/plugin/daemon_example.ini

# remove more useless plugins
rm -f %{buildroot}%{_libdir}/mysql/plugin/auth_0x0100.so
rm -f %{buildroot}%{_libdir}/mysql/plugin/auth_test_plugin.so
rm -f %{buildroot}%{_libdir}/mysql/plugin/dialog_examples.so

# no RHEL4 selinux files for us
rm -rf %{buildroot}%{_datadir}/mysql/SELinux
# no solaris files for us
rm -rf %{buildroot}%{_datadir}/mysql/solaris
# no split up config yet
rm -rf %{buildroot}%{_sysconfdir}/my.cnf.d

# house cleaning
rm -rf %{buildroot}%{_datadir}/info
rm -f %{buildroot}%{_bindir}/client_test
rm -f %{buildroot}%{_bindir}/make_win_binary_distribution
rm -f %{buildroot}%{_bindir}/make_win_src_distribution
rm -f %{buildroot}%{_datadir}/mysql/binary-configure
rm -f %{buildroot}%{_datadir}/mysql/config.huge.ini
rm -f %{buildroot}%{_datadir}/mysql/config.medium.ini
rm -f %{buildroot}%{_datadir}/mysql/config.small.ini
rm -f %{buildroot}%{_datadir}/mysql/mysqld_multi.server
rm -f %{buildroot}%{_datadir}/mysql/mysql-log-rotate
rm -f %{buildroot}%{_datadir}/mysql/mysql.server
rm -f %{buildroot}%{_datadir}/mysql/ndb-config-2-node.ini
rm -f %{buildroot}%{_datadir}/mysql/binary-configure
rm -f %{buildroot}%{_mandir}/man1/make_win_bin_dist.1*
rm -f %{buildroot}%{_mandir}/man1/make_win_src_distribution.1*
rm -f %{buildroot}%{_datadir}/mysql/magic

# no idea how to fix this
rm -rf %{buildroot}%{_prefix}/data
rm -rf %{buildroot}%{_prefix}/docs
rm -rf %{buildroot}%{_prefix}/scripts
rm -rf %{buildroot}%{_datadir}/doc
rm -rf %{buildroot}%{_sysconfdir}/init.d/mysql
rm -rf %{buildroot}%{_sysconfdir}/logrotate.d/mysql

%multiarch_binaries %{buildroot}%{_bindir}/mysql_config
%multiarch_includes %{buildroot}%{_includedir}/mysql/my_config.h

cat > README.urpmi <<EOF

NOTE: MariaDB is installed without root password, it is recommended to set the
root password with the following command as soon as possible:

   mysqladmin password

The initscript used to start mysql has been reverted to use the one shipped
by MariaDB. This means the following changes:

 * The generation of the initial system mysql database is now done when mysql
   is started from the initscript and only if the /var/lib/mysql/mysql
   directory is empty (mysql_install_db). Previousely this was quite hidden and
   silently done at (rpm) install time. As a consequence to this change you may
   have to perform some manual tasks to upgrade the mysql system database and
   such. So, doing something like this might help you:

   /etc/init.d/mysqld stop
   TMPDIR=/var/tmp mysql_install_db
   mysql_upgrade

The cluster functionalities (ndb) has been deactivated and will be removed in
future mysql versions. Oracle has a new product named mysql-cluster that
replaces the cluster functionalities.

The mysql-common-core package ships with a default /etc/my.cnf file that is 
based on the my-medium.cnf file that comes with the source code.
EOF

################################################################################
# run the tests
%if %{build_test}
# disable failing tests
pushd build/mysql-test
export LANG=C
export LC_ALL=C
export LANGUAGE=C
    perl ./mysql-test-run.pl \
    --mtr-build-thread="$((${RANDOM} % 100))" \
    --retry=0 \
    --ssl \
    --big-test \
    --force \
    --max-test-fail=0 \
    --testcase-timeout=60 \
    --suite-timeout=1200 || false
popd
%endif

%pre
# enable plugins
if [ -f %{_sysconfdir}/my.cnf ]; then
    perl -pi -e "s|^#plugin-load|plugin-load|g" %{_sysconfdir}/my.cnf
    perl -pi -e "s|^#federated|federated|g" %{_sysconfdir}/my.cnf
    # switch to federatedx provider
    perl -pi -e "s|;ha_federated\.so$|;ha_federatedx\.so|g" %{_sysconfdir}/my.cnf
fi

%pre common
# delete the mysql group if no mysql user is found, before adding the user
if [ -z "`getent passwd %{muser}`" ] && ! [ -z "`getent group %{muser}`" ]; then
    %{_sbindir}/groupdel %{muser} 2> /dev/null || :
fi

%_pre_useradd %{muser} /var/lib/mysql /bin/bash

%post
%_tmpfilescreate mysql
%_post_service mysqld

%preun
%_preun_service mysqld

%postun
if [ "$1" = "1" ]; then
    if [ -f /var/lock/subsys/mysqld ]; then
        %{_initrddir}/mysqld restart > /dev/null 2>/dev/null || :
    fi
fi

%pre common-core
# enable plugins
if [ -f %{_sysconfdir}/my.cnf ]; then
    perl -pi -e "s|^#plugin-load|plugin-load|g" %{_sysconfdir}/my.cnf
    perl -pi -e "s|^#federated|federated|g" %{_sysconfdir}/my.cnf
    # switch to federatedx provider
    perl -pi -e "s|;ha_federated\.so$|;ha_federatedx\.so|g" %{_sysconfdir}/my.cnf
fi

%files
%doc README.urpmi
%{_initrddir}/mysqld
%{_tmpfilesdir}/mysql.conf
%{_unitdir}/mysqld.service
%{_sbindir}/mysqld-prepare-db-dir
%{_sbindir}/mysqld-wait-ready
%dir %{_libdir}/mysql/plugin
# authentication plugins
%{_libdir}/mysql/plugin/auth_socket.so
%{_libdir}/mysql/plugin/auth_pam.so
%{_libdir}/mysql/plugin/dialog.so
%{_libdir}/mysql/plugin/mysql_clear_password.so
# replication plugins
%{_libdir}/mysql/plugin/semisync_master.so
%{_libdir}/mysql/plugin/semisync_slave.so
# storage engines
%{_libdir}/mysql/plugin/ha_archive.so
%{_libdir}/mysql/plugin/ha_blackhole.so
%{_libdir}/mysql/plugin/ha_federatedx.so
# sql logging plugin
%{_libdir}/mysql/plugin/sql_errlog.so
# upstream describes this as "junk"
%{_libdir}/mysql/plugin/adt_null.so
%{_libdir}/mysql/plugin/mypluglib.so
%{_libdir}/mysql/plugin/qa_auth_client.so
%{_libdir}/mysql/plugin/qa_auth_interface.so
%{_libdir}/mysql/plugin/qa_auth_server.so
# example plugins, not usefull at all, removing
#%{_libdir}/mysql/plugin/auth_0x0100.so
#%{_libdir}/mysql/plugin/auth_test_plugin.so
#%{_libdir}/mysql/plugin/dialog_examples.so
%{_libdir}/mysql/plugin/server_audit.so

%files -n mysql-MariaDB

%files obsolete
%{_libdir}/mysql/plugin/ha_innodb.so
%{_libdir}/mysql/plugin/ha_federated.so

%files feedback
%{_libdir}/mysql/plugin/feedback.so

%files extra
%{_libdir}/mysql/plugin/ha_oqgraph.so
%{_libdir}/mysql/plugin/ha_sphinx.so
%{_libdir}/mysql/plugin/handlersocket.so
# new optional functionality
%{_libdir}/mysql/plugin/query_cache_info.so
# sphinx has 2 plugins now? odd, but wth
%{_libdir}/mysql/plugin/sphinx.so

%files client
%{_bindir}/msql2mysql
%{_bindir}/mysql
%{_bindir}/mysqlaccess
%{_bindir}/mysqladmin
%{_bindir}/mysqlanalyze
%{_bindir}/mysqlbinlog
%{_bindir}/mysqlcheck
%{_bindir}/mysqldump
%{_bindir}/mysqldumpslow
%{_bindir}/mysql_find_rows
%{_bindir}/mysqlimport
%{_bindir}/mysqloptimize
%{_bindir}/mysqlrepair
%{_bindir}/mysqlshow
%{_bindir}/mysqlslap
%{_bindir}/mysql_waitpid
%{_mandir}/man1/msql2mysql.1*
%{_mandir}/man1/myisam_ftdump.1*
%{_mandir}/man1/mysql.1*
%{_mandir}/man1/mysqlaccess.1*
%{_mandir}/man1/mysqladmin.1*
%{_mandir}/man1/mysqlbinlog.1*
%{_mandir}/man1/mysqlcheck.1*
%{_mandir}/man1/mysqldump.1*
%{_mandir}/man1/mysqldumpslow.1*
%{_mandir}/man1/mysql_find_rows.1*
%{_mandir}/man1/mysqlimport.1*
%{_mandir}/man1/mysqlshow.1*
%{_mandir}/man1/mysql_waitpid.1*

%files bench
%doc build/sql-bench/README
%{_bindir}/my_safe_process
%{_bindir}/mysql_client_test
%{_bindir}/mysql_client_test_embedded
%{_bindir}/mysqltest_embedded
%{_datadir}/mysql/sql-bench
%attr(-,mysql,mysql) %{_datadir}/mysql/mysql-test
%{_mandir}/man1/mysql-stress-test.pl.1*
%{_mandir}/man1/mysql-test-run.pl.1*
%{_mandir}/man1/mysql_client_test.1*
%{_mandir}/man1/mysql_client_test_embedded.1*
%{_mandir}/man1/mysqltest.1*
%{_mandir}/man1/mysqltest_embedded.1*

%files core
%{_sbindir}/mysqld

%files common-core
%config(noreplace) %{_sysconfdir}/my.cnf
%dir %{_datadir}/mysql
%{_datadir}/mysql/english
%{_datadir}/mysql/charsets

%files common
%doc README COPYING
%config(noreplace) %{_sysconfdir}/sysconfig/mysqld
%{_bindir}/aria_chk
%{_bindir}/aria_dump_log
%{_bindir}/aria_ftdump
%{_bindir}/aria_pack
%{_bindir}/aria_read_log
%{_bindir}/innochecksum
%{_bindir}/myisamchk
%{_bindir}/myisam_ftdump
%{_bindir}/myisamlog
%{_bindir}/myisampack
%{_bindir}/my_print_defaults
%{_bindir}/mysqlbug
%{_bindir}/mysql_convert_table_format
%{_bindir}/mysqld_multi
%{_bindir}/mysqld_safe
%{_bindir}/mysql_fix_extensions 
%{_bindir}/mysqlhotcopy
%{_bindir}/mysql_install_db
%{_bindir}/mysql_plugin
%{_bindir}/mysql_secure_installation
%{_bindir}/mysql_setpermission
%{_bindir}/mysqltest
%{_bindir}/mysql_tzinfo_to_sql
%{_bindir}/mysql_upgrade
%{_bindir}/mysql_zap
%{_bindir}/mytop
%{_bindir}/perror
%{_bindir}/replace
%{_bindir}/resolveip
%{_bindir}/resolve_stack_dump
%attr(0755,%{muser},%{muser}) %dir /var/lib/mysql
%attr(0755,%{muser},%{muser}) %dir /var/lib/mysql/mysql
%attr(0755,%{muser},%{muser}) %dir /var/lib/mysql/test
%attr(0755,%{muser},%{muser}) %dir %{_var}/log/mysqld
%{_datadir}/mysql/*.cnf
%{_datadir}/mysql/fill_help_tables.sql
%{_datadir}/mysql/mysql_performance_tables.sql
%{_datadir}/mysql/mysql_system_tables.sql
%{_datadir}/mysql/mysql_system_tables_data.sql
%{_datadir}/mysql/mysql_test_data_timezone.sql
%{_datadir}/mysql/errmsg-utf8.txt
%{_datadir}/mysql/czech
%{_datadir}/mysql/danish
%{_datadir}/mysql/dutch
%{_datadir}/mysql/estonian
%{_datadir}/mysql/french
%{_datadir}/mysql/german
%{_datadir}/mysql/greek
%{_datadir}/mysql/hungarian
%{_datadir}/mysql/italian
%{_datadir}/mysql/japanese
%{_datadir}/mysql/korean
%{_datadir}/mysql/norwegian
%{_datadir}/mysql/norwegian-ny
%{_datadir}/mysql/polish
%{_datadir}/mysql/portuguese
%{_datadir}/mysql/romanian
%{_datadir}/mysql/russian
%{_datadir}/mysql/serbian
%{_datadir}/mysql/slovak
%{_datadir}/mysql/spanish
%{_datadir}/mysql/swedish
%{_datadir}/mysql/ukrainian
%{_mandir}/man1/aria_chk.1*
%{_mandir}/man1/aria_dump_log.1*
%{_mandir}/man1/aria_ftdump.1*
%{_mandir}/man1/aria_pack.1*
%{_mandir}/man1/aria_read_log.1*
%{_mandir}/man1/innochecksum.1*
%{_mandir}/man1/myisamchk.1*
%{_mandir}/man1/myisamlog.1*
%{_mandir}/man1/myisampack.1*
%{_mandir}/man1/my_print_defaults.1*
%{_mandir}/man1/mysqlbug.1*
%{_mandir}/man1/mysql_convert_table_format.1*
%{_mandir}/man1/mysqld_multi.1*
%{_mandir}/man1/mysqld_safe.1*
%{_mandir}/man1/mysql_fix_extensions.1*
%{_mandir}/man1/mysqlhotcopy.1*
%{_mandir}/man1/mysql_install_db.1*
%{_mandir}/man1/mysql_plugin.1*
%{_mandir}/man1/mysql_secure_installation.1*
%{_mandir}/man1/mysql.server.1*
%{_mandir}/man1/mysql_setpermission.1*
%{_mandir}/man1/mysqlslap.1*
%{_mandir}/man1/mysql_tzinfo_to_sql.1*
%{_mandir}/man1/mysql_upgrade.1*
%{_mandir}/man1/mysql_zap.1*
%{_mandir}/man1/perror.1*
%{_mandir}/man1/replace.1*
%{_mandir}/man1/resolveip.1*
%{_mandir}/man1/resolve_stack_dump.1*
%{_mandir}/man8/mysqld.8*

%files -n %{libname}
%{_libdir}/libmysqlclient.so.%{major}*

%files -n %{develname}
%doc INSTALL-SOURCE
%multiarch %{multiarch_bindir}/mysql_config
%{_bindir}/mysql_config
%{_libdir}/libmysqlclient_r.so
%{_libdir}/libmysqlclient.so
%dir %{_includedir}/mysql
%dir %{_includedir}/mysql/psi
%{_includedir}/mysql/*.h
%{_includedir}/mysql/private/*.h
%{_includedir}/mysql/private/atomic/*.h
%{_includedir}/mysql/psi/*.h
%multiarch %{multiarch_includedir}/mysql/my_config.h
%{_mandir}/man1/mysql_config.1*
%{_datadir}/aclocal/mysql.m4
# mysqlservices library is static, because it doesn't contain any code
# itself, and is meant to be statically linked to all plugins.
%{_libdir}/libmysqlservices.a

%files -n %{libmariadbembedded}
%doc README COPYING 
%{_libdir}/libmysqld.so.%{major}
%{_libdir}/libmysqld.so.%{libmysqlembedded_major}*

%files -n %{libmariadbembedded_devel}
%{_libdir}/libmysqld.so
%{_bindir}/mysql_client_test_embedded
%{_bindir}/mysqltest_embedded
%{_mandir}/man1/mysql_client_test_embedded.1*
%{_mandir}/man1/mysqltest_embedded.1*


%changelog
* Mon Oct 27 2014 oden <oden> 5.5.40-1.1.mga3
+ Revision: 793884
- the bundled jemalloc was removed in 5.5.40, so now we're linking against the new jemalloc system libs.
- 5.5.40 (fixes CVE-2014-6507, CVE-2014-6491, CVE-2014-6500, CVE-2014-6469, CVE-2014-6555, CVE-2014-6559, CVE-2014-6494, CVE-2014-6496, CVE-2014-6464)
- package new manpages as well
- 5.5.39
- 5.5.38
- 5.5.37
- added the new audit plugin
- install one missing header file
- P102: rediff
- 5.5.36
- drop p4, added upstream (MDEV-5609)
- 5.5.35 (fixes CVE-2014-0001, CVE-2014-0412, CVE-2014-0437, CVE-2013-5908, CVE-2014-0420, CVE-2014-0393, CVE-2013-5891, CVE-2014-0386, CVE-2014-0401, CVE-2014-0402)
- 5.5.32
- drop P126, P127, P128, P129, P130, P131, P133 as these were added upstream
- rediffed P7 and P102

  + alien <alien>
    - New version 5.5.33a
    - Use upstream symbol versioning
    - Update to version 5.5.33 with tokudb disabled

* Wed Apr 10 2013 ennael <ennael> 5.5.28-13.mga3
+ Revision: 409448
- Rebuild for boost-1.53

  + alien <alien>
    - Fix invalid test

* Tue Apr 02 2013 alien <alien> 5.5.28-12.mga3
+ Revision: 407342
- fix join with blob columns

* Sun Mar 24 2013 colin <colin> 5.5.28-11.mga3
+ Revision: 404859
- Add systemd requires and general post/pre fixes (mga#9302)

* Tue Feb 12 2013 alien <alien> 5.5.28-10.mga3
+ Revision: 398168
- remove obsolete patch
- remove unmaintained pbxt
- change build name
- fix EOL of test data file
- change test invocation to do more tests
- remove test that work on a file that's not installed

* Fri Feb 08 2013 alien <alien> 5.5.28-9.mga3
+ Revision: 395509
- really fix mdev382

* Wed Feb 06 2013 alien <alien> 5.5.28-8.mga3
+ Revision: 394775
- fix test for CVE-2012-5615
- remove anonymous user in default installation so that CVE-2012-5615 isn't exploitable anymore
- mariadb-bench package requires mariadb if you want to run all tests

* Thu Jan 31 2013 alien <alien> 5.5.28-7.mga3
+ Revision: 393840
- Fix CVE-2012-5615, CVE-2012-5627, mdev4029, and a buffer overflow

* Wed Jan 23 2013 alien <alien> 5.5.28-6.mga3
+ Revision: 391746
- Fix CVE-2012-5612 no MDL lock for aliasses (mga#8784)

* Sat Jan 12 2013 umeabot <umeabot> 5.5.28-5.mga3
+ Revision: 359414
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Fri Jan 11 2013 alien <alien> 5.5.28-4.mga3
+ Revision: 346325
- removing unneeded patch, which might do harm: https://mariadb.atlassian.net/browse/MDEV-4020

* Thu Nov 29 2012 alien <alien> 5.5.28-3.mga3
+ Revision: 323173
- Fix CVE-2012-5579

* Sun Nov 25 2012 colin <colin> 5.5.28-2.mga3
+ Revision: 321752
- Do not package tmpfiles conf in /etc
- Run systemd-tmpfiles --create on post install
- Do not package the /var/run/mysqld folder

* Thu Nov 15 2012 alien <alien> 5.5.28-1.mga3
+ Revision: 318283
- Update to new version
- Remove upstreamed patches

* Sun Nov 11 2012 spuhler <spuhler> 5.5.25-3.mga3
+ Revision: 317084
- bumped rel in order to make it update from mga2

* Wed Aug 08 2012 alien <alien> 5.5.25-2.mga3
+ Revision: 279954
- Enable auth_pam

* Mon Aug 06 2012 alien <alien> 5.5.25-1.mga3
+ Revision: 279279
- update to 5.5.25 & copy patches from stable release
- Fix restarting after upgrade

  + fwang <fwang>
    - update file list
    - update file list
    - install mysqlaccess
    - new version 5.5.24

* Sat Apr 28 2012 tmb <tmb> 5.5.23-4.mga2
+ Revision: 233779
- Require rpm-helper >= 0.24.8-1 for systemd support

* Wed Apr 25 2012 alien <alien> 5.5.23-3.mga2
+ Revision: 233249
- Missing BR for aio support

* Sat Apr 14 2012 fwang <fwang> 5.5.23-2.mga2
+ Revision: 230765
- bump obsolete version to make it upgrade correctly with upcoming mga1 updates

* Wed Apr 11 2012 alien <alien> 5.5.23-1.mga2
+ Revision: 230286
- Update to final 5.5.23 version
- mysql_plugin is required for some tests
- change default to innodb, in accordance with upstream
- remove more upstreamed patch
- add conflicts so future updates will have optionally dependant packages in a single transaction

* Fri Mar 30 2012 alien <alien> 5.5.22-0.20120329.rc.mga2
+ Revision: 227543
- Update to rc version (5.5.22)
- add a plugin that logs sql errors in a logrotatable file

* Fri Mar 16 2012 alien <alien> 5.5.21-0.20120315.beta.mga2
+ Revision: 223554
- Update to the beta version (5.5.21)
- modify patch for moved file
- remove extraoneous file
- change to primary mirror

* Sun Feb 26 2012 alien <alien> 5.5.20-0.20120226.alpha.mga2
+ Revision: 215169
- Update to new released version 5.5.20-alpha
- Remove upstreamed patches
- Remove ndb* man pages

* Mon Jan 09 2012 alien <alien> 5.5.18-0.bzr3194.20111227.4.mga2
+ Revision: 194264
- Fix strict arch requirements
- Revert previous unnecessary changes to my.cnf
- Make all internal requires and suggests strict arch

* Sun Jan 08 2012 alien <alien> 5.5.18-0.bzr3194.20111227.3.mga2
+ Revision: 193514
- Make sure plugindir is always correct
- Put in a better summary for the virtual package

* Fri Jan 06 2012 alien <alien> 5.5.18-0.bzr3194.20111227.2.mga2
+ Revision: 192691
- Fix FederatedX as Federated replacement in my.cnf
- Fix the virtual mysql-MariaDB package

* Fri Jan 06 2012 alien <alien> 5.5.18-0.bzr3194.20111227.1.mga2
+ Revision: 192139
- Switch Federated to FederatedX storage engine
- Make the root password warning clearer
- add a virtual package so that mysql can be searched
- use static bundled readline5
- remove patches fixed by upstream
- Move mysqlservices static library to mariadb-devel and obsolete it
- mysqlservices library is now static only
- Update to new bzr revision
- Remove upstream applied patch
- Update to newer revision
- Split off obsolete packages
- Split off extra packages
- Split off feedback storage engine
- Remove upstreamed patches
- Fix typeinfo of the handler class for rtti build in oqgraph storage engine

* Thu Dec 22 2011 alien <alien> 5.5.18-0.bzr3169.20111216.5.mga2
+ Revision: 186212
- Install mysql DB at startup with systemd (bug #3797)

* Thu Dec 22 2011 alien <alien> 5.5.18-0.bzr3169.20111216.4.mga2
+ Revision: 185596
- fix libmysqld.so.0 provide
- clarify README.install.urpmi
- fix #3804

* Sat Dec 17 2011 alien <alien> 5.5.18-0.bzr3169.20111216.3.mga2
+ Revision: 183054
- Don't put mklibname directly in requires/provides/obsoletes

* Sat Dec 17 2011 alien <alien> 5.5.18-0.bzr3169.20111216.2.mga2
+ Revision: 183005
- Restore mklibname macro
- Fix wrong obsolete
- Restore removed provides

* Sat Dec 17 2011 fwang <fwang> 5.5.18-0.bzr3169.20111216.1.mga2
+ Revision: 182925
- fix wrong use of mklibname
- add more compat name for mysql
- use macro rather than hardcoded distro name

* Sat Dec 17 2011 alien <alien> 5.5.18-0.bzr3169.20111216.mga2
+ Revision: 182898
- Fix oqgraph typecast
- Obsoleting mysql
- Adapting for correct embedded versioning
- Provide feedback storage engine
- Don't install extra unwanted progs/files (recommended from upstream)
- Clean up patches
- Removed link from source, since this is an as of yet unreleased version
- Update tarball to newer bzr version
- my.cnf doesn't have correct log-error setting
- Fix invalid conflicts

* Sat Nov 19 2011 alien <alien> 5.5.15-0.4.mga2
+ Revision: 169072
+ rebuild (emptylog)

* Fri Nov 18 2011 alien <alien> 5.5.15-0.3.mga2
+ Revision: 169019
- update initscript patch to fix warning in /etc/init.d/mysqld

* Thu Nov 17 2011 alien <alien> 5.5.15-0.2.mga2
+ Revision: 168629
- fix missing PBXT storage

* Thu Nov 10 2011 alien <alien> 5.5.15-0.mga2
+ Revision: 166362
- imported package mariadb (based on mysql)