2010-05-05 23:42:29 +02:00
|
|
|
#
|
2011-08-17 09:42:39 +02:00
|
|
|
# spec file for package mariadb
|
2010-05-05 23:42:29 +02:00
|
|
|
#
|
2015-06-23 15:23:57 +02:00
|
|
|
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
2010-05-05 23:42:29 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2014-12-06 14:56:41 +01:00
|
|
|
|
2015-06-25 15:57:47 +02:00
|
|
|
### WARNING!!!! ##############################################################
|
|
|
|
# This package is developed on http://github.com/openSUSE/mysql-packaging/
|
|
|
|
# Do not change anything here in OBS.
|
|
|
|
##############################################################################
|
2015-06-23 15:23:57 +02:00
|
|
|
%define pretty_name MariaDB
|
|
|
|
%define libname mysqlclient
|
|
|
|
%define soname 18
|
2015-06-25 15:57:47 +02:00
|
|
|
%define preferred 1
|
2011-12-08 10:43:01 +01:00
|
|
|
%define builtin_plugins partition,csv,heap,aria,pbxt,myisam,myisammrg,xtradb
|
2014-05-23 09:29:50 +02:00
|
|
|
%define extra_provides mariadb_100
|
2015-06-25 15:57:47 +02:00
|
|
|
%define with_mandatory_boost 0
|
2015-06-26 12:21:30 +02:00
|
|
|
# _tmpfilesdir is not defined in systemd macros up to openSUSE 13.2
|
|
|
|
%{!?_tmpfilesdir: %global _tmpfilesdir %{_libexecdir}/tmpfiles.d }
|
2015-06-23 15:23:57 +02:00
|
|
|
# Remove when 13.1 is out of support scope
|
2014-05-14 19:52:29 +02:00
|
|
|
%if ! %{defined _rundir}
|
|
|
|
%define _rundir %{_localstatedir}/run
|
|
|
|
%endif
|
2015-04-14 12:29:38 +02:00
|
|
|
%if 0 > 0
|
2015-04-14 12:38:26 +02:00
|
|
|
%define with_jemalloc 1
|
|
|
|
%define with_oqgraph 1
|
|
|
|
%define with_cassandra 1
|
2015-04-14 12:29:38 +02:00
|
|
|
%else
|
2015-04-14 12:38:26 +02:00
|
|
|
%define with_jemalloc 0
|
|
|
|
%define with_oqgraph 0
|
|
|
|
%define with_cassandra 0
|
2015-04-14 10:23:34 +02:00
|
|
|
%endif
|
2011-03-14 16:49:42 +01:00
|
|
|
Name: mariadb
|
2015-06-25 15:57:47 +02:00
|
|
|
Version: 10.0.20
|
2014-12-06 14:56:41 +01:00
|
|
|
Release: 0
|
2015-06-23 15:23:57 +02:00
|
|
|
Summary: Server part of %{pretty_name}
|
2012-02-18 09:26:22 +01:00
|
|
|
License: SUSE-GPL-2.0-with-FLOSS-exception
|
2010-05-05 23:42:29 +02:00
|
|
|
Group: Productivity/Databases/Servers
|
2014-09-03 15:09:43 +02:00
|
|
|
Url: https://www.mariadb.org
|
2014-12-06 14:56:41 +01:00
|
|
|
Source: https://downloads.mariadb.org/f/mariadb-%{version}/source/mariadb-%{version}.tar.gz
|
2010-05-05 23:42:29 +02:00
|
|
|
Source2: baselibs.conf
|
|
|
|
Source3: README.debug
|
|
|
|
Source4: suse-test-run
|
|
|
|
Source5: mysql.SuSEfirewall2
|
2014-05-23 09:29:50 +02:00
|
|
|
Source7: README.install
|
2014-09-03 15:09:43 +02:00
|
|
|
Source8: README.SUSE
|
2011-01-11 12:12:56 +01:00
|
|
|
Source9: mysql-patches.tar.bz2
|
|
|
|
Source12: series
|
2011-12-08 10:43:01 +01:00
|
|
|
Source13: configuration-tweaks.tar.bz2
|
2013-06-05 07:52:53 +02:00
|
|
|
Source14: my.ini
|
2015-06-25 15:57:47 +02:00
|
|
|
Source15: mysql.service
|
|
|
|
Source16: mysql.target
|
|
|
|
Source17: mysql-systemd-helper
|
|
|
|
Source18: mysql@.service
|
2013-07-30 22:06:56 +02:00
|
|
|
BuildRequires: bison
|
2012-07-02 14:29:26 +02:00
|
|
|
BuildRequires: cmake
|
2015-06-25 15:57:47 +02:00
|
|
|
BuildRequires: dos2unix
|
2014-12-06 14:56:41 +01:00
|
|
|
BuildRequires: fdupes
|
2012-07-02 14:29:26 +02:00
|
|
|
BuildRequires: gcc-c++
|
2013-06-06 15:23:51 +02:00
|
|
|
BuildRequires: libaio-devel
|
2014-12-06 14:56:41 +01:00
|
|
|
BuildRequires: libbz2-devel
|
2013-06-05 07:52:53 +02:00
|
|
|
BuildRequires: libedit-devel
|
2014-05-23 12:52:59 +02:00
|
|
|
BuildRequires: libevent-devel
|
2012-07-02 14:29:26 +02:00
|
|
|
BuildRequires: libtool
|
2014-12-06 14:56:41 +01:00
|
|
|
BuildRequires: libxml2-devel
|
|
|
|
BuildRequires: lzo-devel
|
2012-07-02 14:29:26 +02:00
|
|
|
BuildRequires: ncurses-devel
|
|
|
|
BuildRequires: openssl-devel
|
2012-02-18 09:26:22 +01:00
|
|
|
BuildRequires: pam-devel
|
2015-03-03 09:15:49 +01:00
|
|
|
BuildRequires: pcre-devel
|
2015-06-25 15:57:47 +02:00
|
|
|
BuildRequires: pkgconfig
|
2012-07-02 14:29:26 +02:00
|
|
|
BuildRequires: procps
|
|
|
|
BuildRequires: pwdutils
|
2014-12-06 14:56:41 +01:00
|
|
|
BuildRequires: readline-devel
|
2011-01-11 12:12:56 +01:00
|
|
|
BuildRequires: sqlite
|
2014-12-06 14:56:41 +01:00
|
|
|
BuildRequires: tcpd-devel
|
|
|
|
BuildRequires: zlib-devel
|
|
|
|
BuildRequires: pkgconfig(systemd)
|
2015-06-26 12:21:30 +02:00
|
|
|
# Tests requires time and ps and some perl modules
|
|
|
|
# Keep in sync with Requires of mysql-testsuite
|
|
|
|
BuildRequires: procps
|
|
|
|
BuildRequires: time
|
|
|
|
BuildRequires: perl(Env)
|
|
|
|
BuildRequires: perl(Exporter)
|
|
|
|
BuildRequires: perl(Fcntl)
|
|
|
|
BuildRequires: perl(File::Temp)
|
|
|
|
BuildRequires: perl(Data::Dumper)
|
|
|
|
BuildRequires: perl(Getopt::Long)
|
|
|
|
BuildRequires: perl(IPC::Open3)
|
|
|
|
BuildRequires: perl(Socket)
|
|
|
|
BuildRequires: perl(Sys::Hostname)
|
|
|
|
BuildRequires: perl(Test::More)
|
|
|
|
BuildRequires: perl(Time::HiRes)
|
2010-05-05 23:42:29 +02:00
|
|
|
# required by rcmysql
|
2013-02-04 17:08:57 +01:00
|
|
|
Requires: %{name}-client
|
2014-12-06 14:56:41 +01:00
|
|
|
Requires: %{name}-errormessages = %{version}
|
2013-02-04 17:08:57 +01:00
|
|
|
Requires: perl-base
|
2014-12-06 14:56:41 +01:00
|
|
|
Requires(pre): pwdutils
|
|
|
|
Recommends: logrotate
|
2015-06-23 15:23:57 +02:00
|
|
|
Conflicts: otherproviders(mariadb-server)
|
|
|
|
Conflicts: otherproviders(mysql)
|
|
|
|
Conflicts: otherproviders(mysql-debug)
|
|
|
|
Conflicts: otherproviders(mysql-server)
|
2014-12-06 14:56:41 +01:00
|
|
|
# Compatibility with Fedora/CentOS
|
2015-06-25 15:57:47 +02:00
|
|
|
Provides: mysql-server = %{version}
|
|
|
|
Provides: mariadb-server = %{version}
|
2014-12-06 14:56:41 +01:00
|
|
|
# Compatibility with old version
|
2015-06-25 15:57:47 +02:00
|
|
|
Provides: %{name}-debug-version = %{version}
|
|
|
|
Obsoletes: %{name}-debug-version < %{version}
|
|
|
|
Provides: %{name}-debug = %{version}
|
|
|
|
Obsoletes: %{name}-debug < %{version}
|
|
|
|
Provides: mysql = %{version}
|
|
|
|
Provides: mysql-debug = %{version}
|
|
|
|
Provides: %{extra_provides} = %{version}
|
|
|
|
Obsoletes: %{extra_provides} < %{version}
|
|
|
|
Provides: %{extra_provides}-debug-version = %{version}
|
|
|
|
Obsoletes: %{extra_provides}-debug-version < %{version}
|
2014-12-06 14:56:41 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2013-03-15 09:54:20 +01:00
|
|
|
%{?systemd_requires}
|
2015-06-25 15:57:47 +02:00
|
|
|
%if 0%{with_mandatory_boost} > 0
|
|
|
|
BuildRequires: boost-devel >= 1.57.0
|
|
|
|
%endif
|
2015-06-23 15:23:57 +02:00
|
|
|
%if 0%{with_oqgraph} > 0 || 0%{with_cassandra} > 0
|
|
|
|
BuildRequires: boost-devel
|
2013-03-15 09:54:20 +01:00
|
|
|
%endif
|
2015-06-23 15:23:57 +02:00
|
|
|
%if 0%{with_jemalloc} > 0
|
|
|
|
BuildRequires: jemalloc-devel
|
|
|
|
%endif
|
|
|
|
%if 0%{with_oqgraph} > 0
|
|
|
|
BuildRequires: judy-devel
|
|
|
|
%endif
|
|
|
|
%if 0%{with_cassandra} > 0
|
|
|
|
BuildRequires: libthrift-devel
|
2013-08-12 12:27:00 +02:00
|
|
|
%endif
|
2014-05-23 10:06:28 +02:00
|
|
|
%if 0%{?preferred} > 0
|
2015-06-25 15:57:47 +02:00
|
|
|
Obsoletes: mysql < %{version}
|
|
|
|
Obsoletes: mysql-debug < %{version}
|
2013-08-12 12:27:00 +02:00
|
|
|
%endif
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2010-05-05 23:42:29 +02:00
|
|
|
%description
|
|
|
|
MariaDB is a backward compatible, drop-in replacement branch of the MySQL
|
|
|
|
Database Server. It includes all major open source storage engines, including
|
|
|
|
the Maria storage engine.
|
|
|
|
|
|
|
|
This package only contains the server-side programs.
|
|
|
|
|
2014-05-23 10:06:28 +02:00
|
|
|
%if 0%{?preferred} > 0
|
2010-05-05 23:42:29 +02:00
|
|
|
%package -n libmysqlclient-devel
|
2015-06-23 15:23:57 +02:00
|
|
|
Summary: %{pretty_name} development header files and libraries
|
2014-12-06 14:56:41 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2013-02-04 17:08:57 +01:00
|
|
|
Requires: glibc-devel
|
2015-06-23 15:23:57 +02:00
|
|
|
Requires: libmysqlclient%{soname} = %{version}
|
2015-06-25 15:57:47 +02:00
|
|
|
Requires: libmysqlclient_r%{soname} = %{version}
|
2011-12-08 10:43:01 +01:00
|
|
|
Requires: openssl-devel
|
|
|
|
Requires: zlib-devel
|
2015-07-07 12:49:16 +02:00
|
|
|
# mysql-devel needs to be provided as some pkgs still depend on it
|
|
|
|
Provides: mysql-devel = %{version}
|
|
|
|
Obsoletes: mysql-devel < %{version}
|
2010-05-05 23:42:29 +02:00
|
|
|
|
|
|
|
%description -n libmysqlclient-devel
|
|
|
|
This package contains the development header files and libraries
|
2015-06-23 15:23:57 +02:00
|
|
|
necessary to develop client applications for %{pretty_name}.
|
2010-05-05 23:42:29 +02:00
|
|
|
|
2015-06-23 15:23:57 +02:00
|
|
|
%package -n libmysqld%{soname}
|
|
|
|
Summary: %{pretty_name} embedded server development files
|
2010-05-05 23:42:29 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
2014-12-06 14:56:41 +01:00
|
|
|
Requires: %{name}-errormessages = %{version}
|
2010-05-05 23:42:29 +02:00
|
|
|
|
2015-06-23 15:23:57 +02:00
|
|
|
%description -n libmysqld%{soname}
|
2010-05-05 23:42:29 +02:00
|
|
|
This package contains the development header files and libraries
|
2015-06-23 15:23:57 +02:00
|
|
|
for developing applications that embed the %{pretty_name}.
|
2010-05-05 23:42:29 +02:00
|
|
|
|
|
|
|
%package -n libmysqld-devel
|
2015-06-23 15:23:57 +02:00
|
|
|
Summary: %{pretty_name} embedded server development files
|
2013-02-04 17:08:57 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2010-05-05 23:42:29 +02:00
|
|
|
# the headers files are the shared
|
2014-12-06 14:56:41 +01:00
|
|
|
Requires: libmysqlclient-devel = %{version}
|
2015-06-23 15:23:57 +02:00
|
|
|
Requires: libmysqld%{soname} = %{version}
|
2013-02-04 17:08:57 +01:00
|
|
|
Requires: tcpd-devel
|
2010-05-05 23:42:29 +02:00
|
|
|
|
|
|
|
%description -n libmysqld-devel
|
|
|
|
This package contains the development header files and libraries
|
2015-06-23 15:23:57 +02:00
|
|
|
for developing applications that embed the %{pretty_name}.
|
2011-12-08 10:43:01 +01:00
|
|
|
%endif
|
2010-05-05 23:42:29 +02:00
|
|
|
|
2015-06-23 15:23:57 +02:00
|
|
|
%package -n lib%{libname}%{soname}
|
|
|
|
Summary: Shared Libraries for %{pretty_name}
|
2010-05-05 23:42:29 +02:00
|
|
|
Group: Development/Libraries/Other
|
|
|
|
|
2015-06-23 15:23:57 +02:00
|
|
|
%description -n lib%{libname}%{soname}
|
2010-05-05 23:42:29 +02:00
|
|
|
This package contains the shared libraries (.so) which certain
|
2015-06-23 15:23:57 +02:00
|
|
|
languages and applications need to dynamically load and use %{pretty_name}.
|
2010-05-05 23:42:29 +02:00
|
|
|
|
2015-06-23 15:23:57 +02:00
|
|
|
%package -n lib%{libname}_r%{soname}
|
|
|
|
Summary: Shared Libraries for %{pretty_name}
|
2010-05-05 23:42:29 +02:00
|
|
|
Group: Development/Libraries/Other
|
2015-06-23 15:23:57 +02:00
|
|
|
Requires: lib%{libname}%{soname}
|
2010-05-05 23:42:29 +02:00
|
|
|
|
2015-06-23 15:23:57 +02:00
|
|
|
%description -n lib%{libname}_r%{soname}
|
2010-05-05 23:42:29 +02:00
|
|
|
This package contains the shared libraries (.so) which certain
|
2015-06-23 15:23:57 +02:00
|
|
|
languages and applications need to dynamically load and use %{pretty_name}.
|
2010-05-05 23:42:29 +02:00
|
|
|
|
|
|
|
%package client
|
2015-06-23 15:23:57 +02:00
|
|
|
Summary: Client for %{pretty_name}
|
2010-05-05 23:42:29 +02:00
|
|
|
Group: Productivity/Databases/Clients
|
2014-12-06 14:56:41 +01:00
|
|
|
Requires: %{name}-errormessages = %{version}
|
2015-06-23 15:23:57 +02:00
|
|
|
# Explicit requires to pull in charsets for errormessages
|
|
|
|
Requires: lib%{libname}%{soname}
|
|
|
|
Requires(pre): pwdutils
|
2014-12-06 14:56:41 +01:00
|
|
|
Conflicts: otherproviders(mysql-client)
|
2015-06-25 15:57:47 +02:00
|
|
|
Provides: mysql-client = %{version}
|
2012-03-12 17:06:36 +01:00
|
|
|
Provides: %{extra_provides}-client = %{version}
|
|
|
|
Obsoletes: %{extra_provides}-client < %{version}
|
2014-05-23 10:06:28 +02:00
|
|
|
%if 0%{?preferred} > 0
|
2015-06-25 15:57:47 +02:00
|
|
|
Obsoletes: mysql-client < %{version}
|
2011-12-08 10:43:01 +01:00
|
|
|
%endif
|
2010-05-05 23:42:29 +02:00
|
|
|
|
|
|
|
%description client
|
2015-06-23 15:23:57 +02:00
|
|
|
This package contains the standard clients for %{pretty_name}.
|
2010-05-05 23:42:29 +02:00
|
|
|
|
2012-06-25 14:08:16 +02:00
|
|
|
%package errormessages
|
|
|
|
Summary: MySQL Community Server development header files and libraries
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
|
|
|
|
%description errormessages
|
|
|
|
This package provides the translated error messages for the standalone
|
|
|
|
server daemon as well as the embedded server
|
|
|
|
|
2010-05-05 23:42:29 +02:00
|
|
|
%package bench
|
2015-06-23 15:23:57 +02:00
|
|
|
Summary: Benchmarks for %{pretty_name}
|
2010-05-05 23:42:29 +02:00
|
|
|
Group: Productivity/Databases/Tools
|
2014-12-06 14:56:41 +01:00
|
|
|
Requires: %{name}-client
|
|
|
|
Requires: perl-DBD-mysql
|
|
|
|
Conflicts: otherproviders(mysql-bench)
|
2015-06-25 15:57:47 +02:00
|
|
|
Provides: mysql-bench = %{version}
|
2012-03-12 17:06:36 +01:00
|
|
|
Provides: %{extra_provides}-bench = %{version}
|
|
|
|
Obsoletes: %{extra_provides}-bench < %{version}
|
2014-05-23 10:06:28 +02:00
|
|
|
%if 0%{?preferred} > 0
|
2015-06-25 15:57:47 +02:00
|
|
|
Obsoletes: mysql-bench < %{version}
|
2011-12-08 10:43:01 +01:00
|
|
|
%endif
|
2010-05-05 23:42:29 +02:00
|
|
|
|
|
|
|
%description bench
|
2015-06-23 15:23:57 +02:00
|
|
|
This package contains benchmark scripts and data for %{pretty_name}.
|
2010-05-05 23:42:29 +02:00
|
|
|
|
|
|
|
To run these database benchmarks, start the script "run-all-tests" in
|
2015-06-23 15:23:57 +02:00
|
|
|
the directory %{_datadir}/sql-bench after starting %{pretty_name}.
|
2010-05-05 23:42:29 +02:00
|
|
|
|
|
|
|
%package test
|
2015-06-23 15:23:57 +02:00
|
|
|
Summary: Testsuite for %{pretty_name}
|
2010-05-05 23:42:29 +02:00
|
|
|
Group: Productivity/Databases/Servers
|
2011-07-27 13:56:09 +02:00
|
|
|
Requires: %{name} = %{version}
|
2013-02-04 17:08:57 +01:00
|
|
|
Requires: %{name}-bench = %{version}
|
2011-07-27 13:56:09 +02:00
|
|
|
Requires: %{name}-client = %{version}
|
2013-02-03 15:37:10 +01:00
|
|
|
Requires: %{name}-tools = %{version}
|
2015-06-26 12:21:30 +02:00
|
|
|
# Tests requires time and ps and some perl modules
|
|
|
|
Requires: procps
|
|
|
|
Requires: time
|
|
|
|
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)
|
2013-02-04 17:08:57 +01:00
|
|
|
Requires: perl-DBD-mysql
|
2014-12-06 14:56:41 +01:00
|
|
|
Conflicts: otherproviders(mysql-test)
|
2015-06-25 15:57:47 +02:00
|
|
|
Provides: mysql-test = %{version}
|
2012-03-12 17:06:36 +01:00
|
|
|
Provides: %{extra_provides}-test = %{version}
|
|
|
|
Obsoletes: %{extra_provides}-test < %{version}
|
2014-05-23 10:06:28 +02:00
|
|
|
%if 0%{?preferred} > 0
|
2015-06-25 15:57:47 +02:00
|
|
|
Obsoletes: mysql-test < %{version}
|
2011-12-08 10:43:01 +01:00
|
|
|
%endif
|
2010-05-05 23:42:29 +02:00
|
|
|
|
|
|
|
%description test
|
2015-06-23 15:23:57 +02:00
|
|
|
This package contains the test scripts and data for %{pretty_name}.
|
2010-05-05 23:42:29 +02:00
|
|
|
|
2014-12-06 14:56:41 +01:00
|
|
|
To run the testsuite, run %{_datadir}/mysql-test/suse-test-run.
|
2010-05-05 23:42:29 +02:00
|
|
|
|
|
|
|
%package tools
|
2015-06-23 15:23:57 +02:00
|
|
|
Summary: %{pretty_name} tools
|
2010-05-05 23:42:29 +02:00
|
|
|
Group: Productivity/Databases/Servers
|
|
|
|
Requires: perl-DBD-mysql
|
2015-06-23 15:23:57 +02:00
|
|
|
Conflicts: otherproviders(mysql-tools)
|
2010-05-05 23:42:29 +02:00
|
|
|
# make sure this package is installed when updating from 10.2 and older
|
2014-12-06 14:56:41 +01:00
|
|
|
Provides: mysql-client:%{_bindir}/perror
|
|
|
|
Provides: mysql:%{_bindir}/mysqlhotcopy
|
2015-06-25 15:57:47 +02:00
|
|
|
Provides: mysql-tools = %{version}
|
2012-03-12 17:06:36 +01:00
|
|
|
Provides: %{extra_provides}-tools = %{version}
|
|
|
|
Obsoletes: %{extra_provides}-tools < %{version}
|
2014-05-23 10:06:28 +02:00
|
|
|
%if 0%{?preferred} > 0
|
2015-06-25 15:57:47 +02:00
|
|
|
Obsoletes: mysql-tools < %{version}
|
2011-12-08 10:43:01 +01:00
|
|
|
%endif
|
2010-05-05 23:42:29 +02:00
|
|
|
|
|
|
|
%description tools
|
2015-06-23 15:23:57 +02:00
|
|
|
A set of scripts for administering a %{pretty_name} or developing
|
|
|
|
applications with %{pretty_name}.
|
2010-05-05 23:42:29 +02:00
|
|
|
|
|
|
|
%prep
|
2012-04-10 11:53:56 +02:00
|
|
|
%setup -q -n mariadb-%{version} -D -a 9
|
2014-12-06 14:56:41 +01:00
|
|
|
cp %{_sourcedir}/README.SUSE .
|
|
|
|
cp %{_sourcedir}/suse-test-run .
|
2011-01-11 12:12:56 +01:00
|
|
|
# apply patches from series
|
2014-12-06 14:56:41 +01:00
|
|
|
mysql-patches/tools/quilt-setup.sh "%{SOURCE12}"
|
|
|
|
mysql-patches/tools/apply-series.sh "%{SOURCE12}"
|
2010-05-05 23:42:29 +02:00
|
|
|
# remove unneeded manpages ('make install' basically installs everything under
|
|
|
|
# man/*)
|
|
|
|
rm -f man/mysqlman.1 # dummy fallback manpage
|
2012-06-19 16:26:01 +02:00
|
|
|
[ \! -f man/CMakeLists.txt ] || sed -i 's|mysqlman.1||' man/CMakeLists.txt
|
2010-05-05 23:42:29 +02:00
|
|
|
rm -f man/mysql.server.1 # init script, not installed in our rpm
|
2012-06-19 16:26:01 +02:00
|
|
|
[ \! -f man/CMakeLists.txt ] || sed -i 's|mysql.server.1||' man/CMakeLists.txt
|
2010-05-05 23:42:29 +02:00
|
|
|
rm -f man/make_win_*.1 # windows build scripts
|
|
|
|
rm -f man/comp_err.1 # built-time utility
|
|
|
|
# 5.1 Carrier Grade Edition only / still under development as of 5.1.22
|
|
|
|
rm -f man/ndbd_redo_log_reader.1
|
|
|
|
# breaks VPATH builds when in sourcedir, is generated in the builddirs
|
|
|
|
rm -f sql/sql_builtin.cc
|
2014-12-06 14:56:41 +01:00
|
|
|
sed -i 's|@localstatedir@|%{_localstatedir}/log|' support-files/mysql-log-rotate.sh
|
2014-05-23 10:06:28 +02:00
|
|
|
%if 0%{preferred} < 1
|
2010-05-05 23:42:29 +02:00
|
|
|
for i in `grep -Rl mysqlclient .`; do
|
2015-06-23 15:23:57 +02:00
|
|
|
sed -i 's|mysqlclient|%{libname}|g' $i
|
|
|
|
sed -i 's|-lib%{libname}-symbols.patch|-libmysqlclient-symbols.patch|g' $i
|
2010-05-05 23:42:29 +02:00
|
|
|
done
|
|
|
|
%endif
|
2013-01-17 09:17:25 +01:00
|
|
|
# Broken test that needs sources
|
|
|
|
rm -f mysql-test/t/file_contents.test mysql-test/r/file_contents.result
|
2013-12-11 12:03:05 +01:00
|
|
|
# Specify perl path on shebangs
|
|
|
|
for i in `grep -Rl '^#!@PERL@$' .`; do
|
2014-12-06 14:56:41 +01:00
|
|
|
sed -i 's|@PERL@|%{_bindir}/perl|' $i
|
2013-12-11 12:03:05 +01:00
|
|
|
done
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2010-05-05 23:42:29 +02:00
|
|
|
%build
|
2015-06-23 15:23:57 +02:00
|
|
|
EXTRA_FLAGS="-Wno-unused-but-set-variable -fno-strict-aliasing -Wno-unused-parameter"
|
|
|
|
# Mariadb devs seems to fall in love with -Werror option
|
|
|
|
EXTRA_FLAGS="${EXTRA_FLAGS} -Wno-error"
|
|
|
|
export CFLAGS="%{optflags} -DOPENSSL_LOAD_CONF -DPIC -fPIC -DFORCE_INIT_OF_VARS $EXTRA_FLAGS"
|
|
|
|
export CXXFLAGS="$CFLAGS -felide-constructors"
|
|
|
|
%cmake -DWITH_SSL=system \
|
|
|
|
-DWITH_ZLIB=system \
|
|
|
|
-DWITH_LIBEVENT=system \
|
|
|
|
-DWITH_JEMALLOC=auto \
|
|
|
|
-DWITH_READLINE=0 \
|
|
|
|
-DWITH_LIBEDIT=0 \
|
|
|
|
-DINSTALL_LAYOUT=RPM \
|
|
|
|
-DMYSQL_UNIX_ADDR="%{_localstatedir}/run/mysql/mysql.sock" \
|
|
|
|
-DINSTALL_UNIX_ADDRDIR="%{_localstatedir}/run/mysql/mysql.sock" \
|
|
|
|
-DINSTALL_MYSQLSHAREDIR=share/%{name} \
|
|
|
|
-DWITH_COMMENT="openSUSE MySQL rpm" \
|
|
|
|
-DWITH_EXTRA_CHARSET=all \
|
|
|
|
-DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci \
|
|
|
|
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
|
|
|
|
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
|
|
|
|
%if 0%{with_oqgraph} > 0
|
|
|
|
-DWITH_OQGRAPH_STORAGE_ENGINE=1 \
|
|
|
|
%endif
|
|
|
|
%if 0%{with_cassandra} > 0
|
|
|
|
-DWITH_CASSANDRA_STORAGE_ENGINE=1 \
|
|
|
|
%endif
|
|
|
|
-DWITH_XTRADB_STORAGE_ENGINE=1 \
|
|
|
|
-DWITH_CSV_STORAGE_ENGINE=1 \
|
|
|
|
-DWITH_HANDLERSOCKET_STORAGE_ENGINE=1 \
|
|
|
|
-DWITH_EMBEDDED_SERVER=true \
|
|
|
|
-DCOMPILATION_COMMENT="openSUSE package" \
|
|
|
|
-DDENABLE_DOWNLOADS=false \
|
|
|
|
-DINSTALL_PLUGINDIR_RPM="%{_lib}/mysql/plugin" \
|
|
|
|
-DINSTALL_LIBDIR_RPM="%{_lib}" \
|
|
|
|
-DINSTALL_SYSCONF2DIR="%{_sysconfdir}/my.cnf.d" \
|
|
|
|
-DCMAKE_C_FLAGS_RELWITHDEBINFO="$CFLAGS" \
|
|
|
|
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$CXXFLAGS" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DINSTALL_SQLBENCHDIR=share \
|
|
|
|
-DCMAKE_C_FLAGS="$CFLAGS" \
|
|
|
|
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
|
|
|
|
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -pie -Wl,-z,relro,-z,now" \
|
|
|
|
-DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -pie -Wl,-z,relro,-z,now" \
|
|
|
|
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -pie -Wl,-z,relro,-z,now" \
|
|
|
|
-Wno-dev "$@" ..
|
|
|
|
make %{?_smp_mflags}
|
|
|
|
nm --numeric-sort sql/mysqld > sql/mysqld.sym
|
2010-05-05 23:42:29 +02:00
|
|
|
|
|
|
|
%install
|
2015-06-25 15:57:47 +02:00
|
|
|
# Helper function to generate filelist for binaries and their manpages
|
|
|
|
filelist()
|
|
|
|
{
|
|
|
|
echo '%%defattr(-, root, root)'
|
|
|
|
pushd %{buildroot} >/dev/null
|
|
|
|
for i; do
|
|
|
|
if test -e usr/sbin/"$i"; then
|
|
|
|
echo %{_sbindir}/"$i"
|
|
|
|
fi
|
|
|
|
if test -e usr/bin/"$i"; then
|
|
|
|
echo %{_bindir}/"$i"
|
|
|
|
fi
|
|
|
|
if test -d usr/share/*/"$i"; then
|
|
|
|
echo "/`echo usr/share/*/"$i"`"
|
|
|
|
fi
|
|
|
|
if test -n "`ls -1 %{buildroot}$i 2> /dev/null`"; then
|
|
|
|
echo "$i"
|
|
|
|
fi
|
|
|
|
if ls usr/share/man/*/"$i".[1-9]* >/dev/null 2>&1; then
|
|
|
|
echo "%{_mandir}/*/$i.[1-9]*"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
popd >/dev/null
|
|
|
|
}
|
|
|
|
|
|
|
|
# Install the package itself
|
|
|
|
%cmake_install benchdir_root=%{_datadir}/
|
|
|
|
|
|
|
|
# Logrotate file should be named as the package
|
|
|
|
if [ ! -e %{buildroot}%{_sysconfdir}/logrotate.d/mysql ]; then
|
|
|
|
# some versions do not install it automatically
|
|
|
|
install -D -m 644 build/support-files/mysql-log-rotate %{buildroot}%{_sysconfdir}/logrotate.d/mysql
|
|
|
|
fi
|
|
|
|
mv %{buildroot}%{_sysconfdir}/logrotate.d/mysql %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
2010-05-05 23:42:29 +02:00
|
|
|
|
2015-06-25 15:57:47 +02:00
|
|
|
# Create log directory with the expected perms of mysql
|
|
|
|
install -d -m 700 %{buildroot}%{_localstatedir}/log/mysql/
|
|
|
|
|
|
|
|
# Symbols from build to go into libdir
|
|
|
|
install -m 644 build/sql/mysqld.sym %{buildroot}%{_libdir}/mysql/mysqld.sym
|
|
|
|
|
|
|
|
# Remove handler socket client
|
|
|
|
rm -f %{buildroot}%{_libdir}/mysql/plugin/handlersocket.so
|
|
|
|
|
|
|
|
# Remove debug management for keys Mariadb 101+
|
|
|
|
rm -f %{buildroot}%{_libdir}/mysql/plugin/debug_key_management.so
|
|
|
|
|
|
|
|
# Remove most static libs (FIXME: don't build them at all...)
|
|
|
|
[ \! -f "%{buildroot}%{_libdir}/"libmysqld.a ] || mv "%{buildroot}%{_libdir}/"libmysqld.a "%{buildroot}%{_libdir}/"libmysqld.static
|
|
|
|
rm -f %{buildroot}%{_libdir}/*.a
|
|
|
|
[ \! -f "%{buildroot}%{_libdir}/"libmysqld.static ] || mv "%{buildroot}%{_libdir}/"libmysqld.static "%{buildroot}%{_libdir}/"libmysqld.a
|
|
|
|
|
|
|
|
# Rename mytop to have name prefixed with the implementation
|
|
|
|
[ \! -f "%{buildroot}%{_bindir}/mytop" ] || mv %{buildroot}%{_bindir}/mytop %{buildroot}%{_bindir}/%{name}_mytop
|
|
|
|
|
|
|
|
# Remove few configure/examples
|
|
|
|
rm -f %{buildroot}%{_datadir}/mysql/{binary-configure,errmsg-utf8.txt,magic,mysql-log-rotate,mysql*.server}
|
|
|
|
rm -f %{buildroot}%{_libdir}/mysql/plugin/daemon_example.ini
|
|
|
|
|
|
|
|
mv %{buildroot}%{_datadir}/mysql-test/lib/My/SafeProcess/my_safe_process %{buildroot}%{_bindir}
|
|
|
|
|
|
|
|
# Generate various filelists
|
2015-07-07 12:49:16 +02:00
|
|
|
filelist innochecksum my_print_defaults myisam_ftdump myisamchk myisamlog myisampack mysql_fix_extensions mysql_fix_privilege_tables mysql_ssl_rsa_setup mysql_install_db mysql_secure_installation mysql_upgrade mysqlbug mysqld mysqld_multi mysqld_safe mysqlbinlog mysqldumpslow mysqlmanager mroonga resolve_stack_dump resolveip {m,}aria_chk {m,}aria_dump_log {m,}aria_ftdump {m,}aria_pack {m,}aria_read_log xtstat tokuft_logprint tokuftdump >mysql.files
|
2015-06-25 15:57:47 +02:00
|
|
|
|
|
|
|
filelist mysql mysqladmin mysqlcheck mysqldump mysqlimport mysqlshow mysql_config_editor >mysql-client.files
|
|
|
|
# The dialog stuff is mariadb only
|
|
|
|
if [ "`ls '%buildroot'%_libdir/mysql/plugin/dialog*.so 2> /dev/null`" ]; then
|
|
|
|
echo '%%dir %%_libdir/mysql' >> mysql-client.files
|
|
|
|
echo '%%dir %%_libdir/mysql/plugin' >> mysql-client.files
|
|
|
|
echo '%%_libdir/mysql/plugin/dialog*.so' >> mysql-client.files
|
|
|
|
fi
|
|
|
|
# Mysql has configuration file in _bindir
|
|
|
|
if [ -f scripts/mysqlaccess.conf ] ; then
|
|
|
|
install -m 640 scripts/mysqlaccess.conf %{buildroot}%{_sysconfdir}/mysqlaccess.conf
|
|
|
|
rm -f %{buildroot}%{_bindir}/mysqlaccess.conf
|
|
|
|
echo '%config(noreplace) %attr(0640, root, mysql) %{_sysconfdir}/mysqlaccess.conf' >> mysql-client.files
|
|
|
|
fi
|
|
|
|
|
|
|
|
filelist mysql_config %{_datadir}/pkgconfig/mariadb.pc >libmysqlclient-devel.files
|
|
|
|
|
|
|
|
filelist mysqlslap >mysql-bench.files
|
|
|
|
|
|
|
|
filelist mysql_client_test mysql_client_test_embedded mysql_waitpid mysqltest mysqltest_embedded >mysql-test.files
|
|
|
|
|
|
|
|
filelist msql2mysql mysql_plugin mysql_convert_table_format mysql_find_rows mysql_setpermission mysql_tzinfo_to_sql mysql_zap mysqlaccess mysqlhotcopy perror replace mysql_embedded %{name}_mytop hsclient %{_bindir}/wsrep* %{_datadir}/mysql/wsrep_notify >mysql-tools.files
|
|
|
|
|
|
|
|
filelist ndbd ndbmtd ndbd_redo_log_reader >mysql-ndb-storage.files
|
|
|
|
|
|
|
|
filelist ndb_mgmd >mysql-ndb-management.files
|
|
|
|
|
|
|
|
filelist ndb_{config,desc,error_reporter,mgm,print_backup_file,print_schema_file,print_sys_file,restore,select_all,select_count,show_tables,size.pl,test_platform,waiter} >mysql-ndb-tools.files
|
|
|
|
|
|
|
|
filelist ndb_{cpcd,delete_all,drop_index,index_stat,print_file,redo_log_reader,drop_table} ndbinfo_select_all memcached >mysql-ndb-extra.files
|
|
|
|
|
|
|
|
# All configuration files
|
|
|
|
echo '%{_datadir}/mysql/*.cnf' >> mysql.files
|
|
|
|
# Mysql-community server has dictionary file in datadir
|
|
|
|
if [ -f "%{buildroot}%{_datadir}/%{name}"/dictionary.txt ]; then
|
|
|
|
echo "%{_datadir}/%{name}/dictionary.txt" >> mysql.files
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Special errormessages approach
|
|
|
|
echo '%%defattr(-, root, root)' > %{_builddir}/errormessages.files
|
|
|
|
pushd %{buildroot} >/dev/null
|
|
|
|
for f in usr/share/%{name}/*; do
|
|
|
|
if test -e $f/errmsg.sys; then
|
|
|
|
echo "%%dir /$f" >> %{_builddir}/errormessages.files
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
echo %{_datadir}/%{name}/errmsg-utf8.txt >> %{_builddir}/errormessages.files
|
|
|
|
popd >/dev/null
|
|
|
|
mv %{_builddir}/errormessages.files errormessages.files
|
|
|
|
|
|
|
|
### files not installed by make install
|
|
|
|
# Some of the documentation we need to have installed
|
|
|
|
DOCS=(COPYING README EXCEPTIONS-CLIENT %{_sourcedir}/README.debug %{_sourcedir}/README.SUSE plugin/daemon_example/daemon_example.ini)
|
|
|
|
DOCDIR=%{buildroot}%{_defaultdocdir}/%{name}
|
|
|
|
install -d -m 755 ${DOCDIR}
|
|
|
|
for i in "${DOCS[@]}"; do
|
|
|
|
install -m 644 "${i}" "${DOCDIR}" || true
|
|
|
|
done
|
|
|
|
# Default configuration file
|
|
|
|
install -m 660 %{SOURCE14} %{buildroot}%{_sysconfdir}/my.cnf
|
|
|
|
|
|
|
|
# Systemd/initscript
|
|
|
|
install -D -m 755 %{_sourcedir}/mysql-systemd-helper '%{buildroot}'%{_libexecdir}/mysql/mysql-systemd-helper
|
|
|
|
sed -i 's|@MYSQLVER@|%{version}|' '%{buildroot}'%{_libexecdir}/mysql/mysql-systemd-helper
|
|
|
|
ln -sf service '%{buildroot}'%{_sbindir}/rcmysql
|
|
|
|
install -D -m 644 %{_sourcedir}/mysql.service '%{buildroot}'%{_libexecdir}/systemd/system/mysql.service
|
|
|
|
install -D -m 644 %{_sourcedir}/mysql@.service '%{buildroot}'%{_libexecdir}/systemd/system/mysql@.service
|
|
|
|
install -D -m 644 %{_sourcedir}/mysql.target '%{buildroot}'%{_libexecdir}/systemd/system/mysql.target
|
|
|
|
ln -s mysql@.service '%{buildroot}'%{_libexecdir}/systemd/system/mysql@default.service
|
|
|
|
rm -rf '%{buildroot}'%{_sysconfdir}/init.d
|
|
|
|
|
2015-06-26 12:21:30 +02:00
|
|
|
# Tmpfiles file to exclude mysql tempfiles that are auto-cleaned up
|
|
|
|
# bnc#852451
|
|
|
|
mkdir -p %{buildroot}%{_tmpfilesdir}
|
|
|
|
cat > %{buildroot}%{_tmpfilesdir}/mysql.conf <<EOF
|
|
|
|
x /var/tmp/mysql.*
|
|
|
|
X /var/tmp/mysql.*
|
|
|
|
EOF
|
|
|
|
|
2015-06-25 15:57:47 +02:00
|
|
|
# SuSEfirewall service description
|
|
|
|
install -D -m 644 %{_sourcedir}/mysql.SuSEfirewall2 %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/mysql
|
|
|
|
|
|
|
|
# testsuite
|
|
|
|
install -d -m 755 '%{buildroot}'%{_datadir}/mysql-test/
|
|
|
|
install -m 755 suse-test-run '%{buildroot}'%{_datadir}/mysql-test/
|
|
|
|
mkdir '%{buildroot}'%{_datadir}/mysql-test/var
|
|
|
|
|
|
|
|
# Final fixes
|
|
|
|
find '%{buildroot}'%{_datadir}/mysql-test -name '*.orig' -delete
|
|
|
|
%fdupes -s '%{buildroot}'%{_datadir}/mysql-test
|
|
|
|
fdupes -q -n -r '%{buildroot}'%{_datadir}/mysql-test
|
|
|
|
for i in `grep -Rl '\r' '%{buildroot}'%{_datadir}/sql-bench`; do
|
|
|
|
dos2unix "$i"
|
|
|
|
done
|
|
|
|
|
2015-06-26 12:21:30 +02:00
|
|
|
# Fix libmysqlclient_r.so.18 symlinking to be done against plain .so file
|
|
|
|
# and thus broken later on. Fixes bnc#906147
|
|
|
|
pushd "%{buildroot}%{_libdir}"
|
|
|
|
rm -f lib%{libname}_r.so*
|
2015-07-11 14:26:45 +02:00
|
|
|
ln -sf lib%{libname}.so.%{soname}.0.0 lib%{libname}_r.so
|
|
|
|
ln -sf lib%{libname}.so.%{soname}.0.0 lib%{libname}_r.so.%{soname}
|
|
|
|
ln -sf lib%{libname}.so.%{soname}.0.0 lib%{libname}_r.so.%{soname}.0.0
|
2015-06-26 12:21:30 +02:00
|
|
|
popd
|
|
|
|
|
2015-06-25 15:57:47 +02:00
|
|
|
# If not preffered simply reduce main develpackage to NULL
|
|
|
|
%if ! 0%{preferred} > 0
|
|
|
|
cat libmysqlclient-devel.files | sed 's|%%doc\ ||' | while read tmp; do
|
|
|
|
cd '%{buildroot}'
|
|
|
|
rm -f ."$tmp"
|
|
|
|
done
|
|
|
|
rm -rf '%{buildroot}'/%{_libdir}/libmysqld.*
|
|
|
|
rm -rf '%{buildroot}'/%{_libdir}/{*.so,*.a}
|
|
|
|
rm -rf '%{buildroot}'/%{_mandir}/*/mysql_config.1*
|
|
|
|
rm -rf '%{buildroot}'/%{_includedir}
|
|
|
|
rm -rf '%{buildroot}'/%{_datadir}/aclocal
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Compat with old scripts
|
|
|
|
ln -s mysqlcheck '%{buildroot}'%{_bindir}/mysqlrepair
|
|
|
|
ln -s mysqlcheck '%{buildroot}'%{_bindir}/mysqlanalyze
|
|
|
|
ln -s mysqlcheck '%{buildroot}'%{_bindir}/mysqloptimize
|
2013-03-15 09:54:20 +01:00
|
|
|
|
2015-06-25 15:57:47 +02:00
|
|
|
# Use our configuration stuff instead of upstream one
|
|
|
|
rm -rf '%{buildroot}'%{_sysconfdir}/my.cnf.d
|
|
|
|
install -d -m 755 '%{buildroot}'%{_sysconfdir}/my.cnf.d
|
|
|
|
bzip2 -cd '%{_sourcedir}'/configuration-tweaks.tar.bz2 | tar -C '%{buildroot}'%{_sysconfdir}/my.cnf.d -xvf -
|
|
|
|
|
|
|
|
# Documentation that was copied to wrong folder
|
|
|
|
rm -f '%{buildroot}'%{_datadir}/doc/* 2> /dev/null || true
|
|
|
|
|
|
|
|
# Unwanted packaged stuff
|
|
|
|
rm -rf '%{buildroot}'%{_datadir}/mysql/{solaris,SELinux}
|
|
|
|
|
2015-06-26 12:21:30 +02:00
|
|
|
%check
|
|
|
|
cd build
|
|
|
|
|
|
|
|
# First run simple ctest unittests
|
|
|
|
LD_LIBRARY_PATH=$(pwd)/unittest/mytap make test %{?_smp_mflags}
|
|
|
|
|
|
|
|
# And then run discustingly HUGE testsuite that might fail here and there
|
|
|
|
# Basically we run it to have overview to check how it goes
|
|
|
|
cd mysql-test
|
|
|
|
./mysql-test-run.pl \
|
|
|
|
--parallel=%{?jobs:%{jobs}} \
|
|
|
|
--force \
|
|
|
|
--retry=0 \
|
|
|
|
--ssl \
|
|
|
|
--suite-timeout=720 \
|
|
|
|
--testcase-timeout=30 \
|
|
|
|
--mysqld=--binlog-format=mixed \
|
|
|
|
--force-restart \
|
|
|
|
--shutdown-timeout=60 \
|
|
|
|
--max-test-fail=0 || :
|
|
|
|
|
2015-06-25 15:57:47 +02:00
|
|
|
# client does not require server and needs the user too
|
2013-06-06 15:23:51 +02:00
|
|
|
%pre client
|
2015-06-25 15:57:47 +02:00
|
|
|
getent group mysql >/dev/null || groupadd -r mysql
|
|
|
|
getent passwd mysql >/dev/null || useradd -r -o -g mysql -u 60 -c "MySQL database admin" \
|
|
|
|
-s /bin/false -d %{_localstatedir}/lib/mysql mysql
|
|
|
|
usermod -g mysql -s /bin/false mysql
|
|
|
|
exit 0
|
2013-06-06 15:23:51 +02:00
|
|
|
|
2015-06-25 15:57:47 +02:00
|
|
|
%pre
|
|
|
|
getent group mysql >/dev/null || groupadd -r mysql
|
|
|
|
getent passwd mysql >/dev/null || useradd -r -o -g mysql -u 60 -c "MySQL database admin" \
|
|
|
|
-s /bin/false -d %{_localstatedir}/lib/mysql mysql
|
|
|
|
usermod -g mysql -s /bin/false mysql
|
2010-05-05 23:42:29 +02:00
|
|
|
|
2015-06-25 15:57:47 +02:00
|
|
|
%service_add_pre mysql.service mysql@.service mysql.target mysql@default.service
|
2014-12-06 14:56:41 +01:00
|
|
|
|
2015-06-25 15:57:47 +02:00
|
|
|
%post
|
|
|
|
%service_add_post mysql.service mysql@.service mysql.target mysql@default.service
|
2015-06-26 12:21:30 +02:00
|
|
|
# Use %tmpfiles_create when 13.2 is oldest in support scope
|
|
|
|
/usr/bin/systemd-tmpfiles --create %{_tmpfilesdir}/mysql.conf || :
|
2011-12-08 10:43:01 +01:00
|
|
|
|
2015-06-25 15:57:47 +02:00
|
|
|
# SLE11 Migration support
|
2015-07-11 14:26:45 +02:00
|
|
|
for i in protected tmp; do
|
2015-06-25 15:57:47 +02:00
|
|
|
rmdir "$datadir"/.$i 2>/dev/null || :
|
2010-05-05 23:42:29 +02:00
|
|
|
done
|
2015-06-25 15:57:47 +02:00
|
|
|
# Remove any messages that could've been in place about the upgrade
|
|
|
|
rm -f %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}
|
|
|
|
|
|
|
|
# During package rename (migration maria->mysql-community-server),
|
|
|
|
# there might be config file move and we get rpmsave that we should keep
|
2015-06-23 15:23:57 +02:00
|
|
|
if [ -f %{_sysconfdir}/my.cnf.rpmsave ]; then
|
2015-06-25 15:57:47 +02:00
|
|
|
mv %{_sysconfdir}/my.cnf{,.rpmnew}
|
|
|
|
mv %{_sysconfdir}/my.cnf{.rpmsave,}
|
|
|
|
cat >> %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release} << EOF
|
2015-03-03 09:15:49 +01:00
|
|
|
|
2015-06-23 15:23:57 +02:00
|
|
|
WARNING: %{_sysconfdir}/my.cnf.rpmsave file detected!
|
2015-03-03 09:15:49 +01:00
|
|
|
|
2015-06-25 15:57:47 +02:00
|
|
|
This probably means that you are migrating from different variant of MySQL.
|
|
|
|
Your configuration was left intact and you can see the new configuration in
|
|
|
|
%{_sysconfdir}/my.cnf.rpmnew
|
2015-03-03 09:15:49 +01:00
|
|
|
|
|
|
|
EOF
|
2010-05-05 23:42:29 +02:00
|
|
|
fi
|
2015-06-25 15:57:47 +02:00
|
|
|
|
2014-05-23 09:29:50 +02:00
|
|
|
# warn on first run
|
2015-06-25 15:57:47 +02:00
|
|
|
datadir="`%{_bindir}/my_print_defaults mysqld mysql_server | sed -n 's|--datadir=||p'`"
|
2015-03-03 09:15:49 +01:00
|
|
|
[ -n "$datadir" ] || datadir="%{_localstatedir}/lib/mysql"
|
|
|
|
if [ -d "$datadir/mysql" ]; then
|
2015-06-25 15:57:47 +02:00
|
|
|
touch "$datadir/.run-mysql_upgrade"
|
2015-03-03 09:15:49 +01:00
|
|
|
fi
|
|
|
|
if [ \! -f "$datadir/mysql_upgrade_info" ]; then
|
2015-06-25 15:57:47 +02:00
|
|
|
if [ $1 -eq 1 ]; then
|
|
|
|
cat >> %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release} << EOF
|
2015-03-03 09:15:49 +01:00
|
|
|
|
2014-12-06 14:56:41 +01:00
|
|
|
%(cat %{_sourcedir}/README.install)
|
2015-03-03 09:15:49 +01:00
|
|
|
|
2014-05-23 09:29:50 +02:00
|
|
|
EOF
|
2015-06-25 15:57:47 +02:00
|
|
|
fi
|
2015-03-03 09:15:49 +01:00
|
|
|
else
|
2015-06-25 15:57:47 +02:00
|
|
|
MYSQLVER="`echo %{version} | sed 's|\.[0-9]\+$||'`"
|
|
|
|
if [ -f "$datadir/mysql_upgrade_info" ] && \
|
|
|
|
[ -z "`grep "^$MYSQLVER" "$datadir/mysql_upgrade_info" 2> /dev/null`" ]; then
|
|
|
|
cat >> %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release} << EOF
|
2015-03-03 09:15:49 +01:00
|
|
|
|
|
|
|
WARNING: You are upgrading from different stable version of MySQL!
|
|
|
|
|
|
|
|
Your database will be migrated automatically during next restart of MySQL.
|
|
|
|
Before you do that make sure you have up to date backup of your data. It
|
|
|
|
should be mainly in $datadir directory.
|
|
|
|
|
|
|
|
EOF
|
2015-06-25 15:57:47 +02:00
|
|
|
fi
|
2015-03-03 09:15:49 +01:00
|
|
|
fi
|
2015-06-25 15:57:47 +02:00
|
|
|
exit 0
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun mysql.service mysql@.service mysql.target mysql@default.service
|
2010-05-05 23:42:29 +02:00
|
|
|
|
2015-06-25 15:57:47 +02:00
|
|
|
%postun
|
|
|
|
%service_del_postun mysql.service mysql@.service mysql.target mysql@default.service
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2015-06-23 15:23:57 +02:00
|
|
|
%post -n lib%{libname}%{soname} -p /sbin/ldconfig
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2015-06-23 15:23:57 +02:00
|
|
|
%postun -n lib%{libname}%{soname} -p /sbin/ldconfig
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2015-06-23 15:23:57 +02:00
|
|
|
%post -n lib%{libname}_r%{soname} -p /sbin/ldconfig
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2015-06-23 15:23:57 +02:00
|
|
|
%postun -n lib%{libname}_r%{soname} -p /sbin/ldconfig
|
2011-01-11 12:12:56 +01:00
|
|
|
|
2014-05-23 10:06:28 +02:00
|
|
|
%if 0%{preferred} > 0
|
2015-06-25 15:57:47 +02:00
|
|
|
%post -n libmysqld%{soname} -p /sbin/ldconfig
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2015-06-25 15:57:47 +02:00
|
|
|
%postun -n libmysqld%{soname} -p /sbin/ldconfig
|
2010-05-05 23:42:29 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%files -f mysql.files
|
|
|
|
%defattr(-, root, root)
|
2014-12-06 14:56:41 +01:00
|
|
|
%config(noreplace) %attr(0640, root, mysql) %{_sysconfdir}/my.cnf
|
|
|
|
%dir %attr(0750, root, mysql) %{_sysconfdir}/my.cnf.d
|
|
|
|
%config(noreplace) %attr(0640, root, mysql) %{_sysconfdir}/my.cnf.d/*
|
2015-06-25 15:57:47 +02:00
|
|
|
%config %{_sysconfdir}/logrotate.d/%{name}
|
2010-05-05 23:42:29 +02:00
|
|
|
%doc %{_defaultdocdir}/%{name}
|
2014-12-06 14:56:41 +01:00
|
|
|
%dir %{_libexecdir}/mysql
|
2015-06-25 15:57:47 +02:00
|
|
|
%dir %attr(0700, mysql, mysql) %{_localstatedir}/log/mysql
|
|
|
|
%{_libexecdir}/mysql/mysql-systemd-helper
|
2014-12-06 14:56:41 +01:00
|
|
|
%{_libexecdir}/systemd/system/mysql.service
|
2015-06-25 15:57:47 +02:00
|
|
|
%{_libexecdir}/systemd/system/mysql@.service
|
|
|
|
%{_libexecdir}/systemd/system/mysql@default.service
|
|
|
|
%{_libexecdir}/systemd/system/mysql.target
|
2015-06-26 12:21:30 +02:00
|
|
|
%{_tmpfilesdir}/mysql.conf
|
2014-12-06 14:56:41 +01:00
|
|
|
%{_sbindir}/rcmysql
|
|
|
|
%dir %{_datadir}/%{name}
|
|
|
|
%dir %{_datadir}/mysql
|
|
|
|
%{_datadir}/%{name}/charsets/
|
|
|
|
%{_datadir}/%{name}/*.sql
|
2010-05-05 23:42:29 +02:00
|
|
|
%dir %{_libdir}/mysql
|
|
|
|
%{_libdir}/mysql/mysqld.sym
|
2014-12-06 14:56:41 +01:00
|
|
|
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/mysql
|
|
|
|
%dir %{_libdir}/mysql/plugin
|
|
|
|
%{_libdir}/mysql/plugin/[!d]*.so
|
2015-06-25 15:57:47 +02:00
|
|
|
%ghost %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2012-06-25 14:08:16 +02:00
|
|
|
%files errormessages -f errormessages.files
|
|
|
|
%defattr(-, root, root)
|
2014-12-06 14:56:41 +01:00
|
|
|
%{_datadir}/%{name}/*/errmsg.sys
|
2012-06-25 14:08:16 +02:00
|
|
|
|
2010-05-05 23:42:29 +02:00
|
|
|
%files client -f mysql-client.files
|
|
|
|
%defattr(-, root, root)
|
|
|
|
|
2014-05-23 10:06:28 +02:00
|
|
|
%if 0%{preferred} > 0
|
2010-05-05 23:42:29 +02:00
|
|
|
%files -n libmysqlclient-devel -f libmysqlclient-devel.files
|
|
|
|
%defattr(-, root, root)
|
2014-12-06 14:56:41 +01:00
|
|
|
%{_includedir}/mysql
|
2014-05-23 09:29:50 +02:00
|
|
|
%{_libdir}/libmysqlclient.so
|
2014-12-06 14:56:41 +01:00
|
|
|
%dir %{_datadir}/aclocal
|
|
|
|
%{_datadir}/aclocal/mysql.m4
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2010-05-05 23:42:29 +02:00
|
|
|
%files -n libmysqld-devel
|
|
|
|
%defattr(-,root,root)
|
2014-12-06 14:56:41 +01:00
|
|
|
%{_libdir}/libmysqld.a
|
|
|
|
%{_libdir}/libmysqld.so
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2015-06-25 15:57:47 +02:00
|
|
|
%files -n libmysqld%{soname}
|
2010-05-05 23:42:29 +02:00
|
|
|
%defattr(-,root,root)
|
2014-12-06 14:56:41 +01:00
|
|
|
%{_libdir}/libmysqld.so.*
|
2011-12-08 10:43:01 +01:00
|
|
|
%endif
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2015-06-23 15:23:57 +02:00
|
|
|
%files -n lib%{libname}%{soname}
|
2010-05-05 23:42:29 +02:00
|
|
|
%defattr(-, root, root)
|
2015-06-23 15:23:57 +02:00
|
|
|
%{_libdir}/lib%{libname}.so.*
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2015-06-23 15:23:57 +02:00
|
|
|
%files -n lib%{libname}_r%{soname}
|
2010-05-05 23:42:29 +02:00
|
|
|
%defattr(-, root, root)
|
2015-06-26 12:21:30 +02:00
|
|
|
# We need .so file here as few apps still rely on it to be present.
|
|
|
|
# Currently known are Mysql workbench and Libreoffice
|
|
|
|
%{_libdir}/lib%{libname}_r.so*
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2010-05-05 23:42:29 +02:00
|
|
|
%files bench -f mysql-bench.files
|
|
|
|
%defattr(-, root, root)
|
2014-12-06 14:56:41 +01:00
|
|
|
%{_datadir}/sql-bench
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2010-05-05 23:42:29 +02:00
|
|
|
%files test -f mysql-test.files
|
|
|
|
%defattr(-, root, root)
|
|
|
|
%{_bindir}/my_safe_process
|
2014-12-06 14:56:41 +01:00
|
|
|
%{_mandir}/man1/mysql-test-run.pl.1*
|
|
|
|
%{_mandir}/man1/mysql-stress-test.pl.1*
|
|
|
|
%{_datadir}/mysql-test/valgrind.supp
|
|
|
|
%dir %attr(755, root, root)%{_datadir}/mysql-test
|
|
|
|
%{_datadir}/mysql-test/[^v]*
|
|
|
|
%dir %attr(755, mysql, mysql) %{_datadir}/mysql-test/var
|
2011-08-17 09:42:39 +02:00
|
|
|
|
2010-05-05 23:42:29 +02:00
|
|
|
%files tools -f mysql-tools.files
|
|
|
|
%defattr(-, root, root)
|
2014-12-06 14:56:41 +01:00
|
|
|
%{_bindir}/mysqlrepair
|
|
|
|
%{_bindir}/mysqlanalyze
|
|
|
|
%{_bindir}/mysqloptimize
|
2010-05-05 23:42:29 +02:00
|
|
|
|
|
|
|
%changelog
|