summaryrefslogtreecommitdiff
path: root/support-files
diff options
context:
space:
mode:
authorDaniel Fischer <df@sun.com>2010-04-21 14:58:09 +0200
committerDaniel Fischer <df@sun.com>2010-04-21 14:58:09 +0200
commitb83e1c868622125ff59d405710cb6438c131a7f4 (patch)
tree4fad82e285f056995b626f0a62b5fa0488294c19 /support-files
parent718ee3e595d3c73517c1bc1df8d3bdfc2e22510b (diff)
parent210d37e5c0aaa821783023b3f275c5e7992c515c (diff)
downloadmariadb-git-b83e1c868622125ff59d405710cb6438c131a7f4.tar.gz
Merge
Diffstat (limited to 'support-files')
-rw-r--r--support-files/CMakeLists.txt26
-rw-r--r--support-files/my-huge.cnf.sh4
-rw-r--r--support-files/my-large.cnf.sh4
-rw-r--r--support-files/my-medium.cnf.sh4
-rw-r--r--support-files/my-small.cnf.sh2
-rw-r--r--support-files/mysql-multi.server.sh4
-rw-r--r--support-files/mysql.spec.sh1068
7 files changed, 544 insertions, 568 deletions
diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt
index 194ddaf3ca4..72c4d1ab2d0 100644
--- a/support-files/CMakeLists.txt
+++ b/support-files/CMakeLists.txt
@@ -29,29 +29,35 @@ ELSE()
SET(CXXFLAGS ${CMAKE_CXX_FLAGS})
SET(MYSQLD_USER "mysql")
SET(ini_file_extension "cnf")
+ SET(HOSTNAME "hostname")
+ENDIF()
+
+# XXX: shouldn't we just have variables for all this stuff and centralise
+# XXX: their configuration in install_layout.cmake?
+IF(WIN32)
+ SET(inst_location ${INSTALL_DOCREADMEDIR})
+ELSE()
+ SET(inst_location ${INSTALL_SUPPORTFILESDIR})
ENDIF()
FOREACH(inifile my-huge my-innodb-heavy-4G my-large my-medium my-small)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${inifile}.cnf.sh
${CMAKE_CURRENT_BINARY_DIR}/${inifile}.${ini_file_extension} @ONLY)
- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${inifile}.${ini_file_extension} DESTINATION
- ${INSTALL_DOCREADMEDIR} COMPONENT IniFiles)
-
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${inifile}.${ini_file_extension}
+ DESTINATION ${inst_location} COMPONENT IniFiles)
ENDFOREACH()
IF(UNIX)
+ # XXX: again, used elsewhere (scripts/), should be standardised in
+ # XXX: install_layout.cmake
IF(INSTALL_LAYOUT MATCHES "STANDALONE")
SET(prefix ".")
- SET(inst_location ${INSTALL_SUPPORTFILESDIR})
ELSE()
SET(prefix ${CMAKE_INSTALL_PREFIX})
- SET(inst_location ${INSTALL_MYSQLSHAREDIR})
ENDIF()
-
- FILE(GLOB ndb_ini_files ${CMAKE_CURRENT_SOURCE_DIR}/*.ini)
- INSTALL(FILES ${ndb_ini_files} DESTINATION ${inst_location})
-
- FOREACH(script mysqld_multi.server mysql-log-rotate)
+
+ FOREACH(script mysqld_multi.server mysql-log-rotate binary-configure
+ config.medium.ini config.small.ini config.huge.ini ndb-config-2-node.ini)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${script}.sh
${CMAKE_CURRENT_BINARY_DIR}/${script} @ONLY )
diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh
index 17a7ddb5855..a6bf70b6f83 100644
--- a/support-files/my-huge.cnf.sh
+++ b/support-files/my-huge.cnf.sh
@@ -25,7 +25,7 @@ socket = @MYSQL_UNIX_ADDR@
[mysqld]
port = @MYSQL_TCP_PORT@
socket = @MYSQL_UNIX_ADDR@
-skip-locking
+skip-external-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
@@ -115,7 +115,7 @@ server-id = 1
# Point the following paths to different dedicated disks
#tmpdir = /tmp/
-#log-update = /path-to-dedicated-directory/hostname
+#log-bin = /path-to-dedicated-directory/hostname
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = @localstatedir@/
diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh
index bbdfdb32a96..92839b8fc2c 100644
--- a/support-files/my-large.cnf.sh
+++ b/support-files/my-large.cnf.sh
@@ -25,7 +25,7 @@ socket = @MYSQL_UNIX_ADDR@
[mysqld]
port = @MYSQL_TCP_PORT@
socket = @MYSQL_UNIX_ADDR@
-skip-locking
+skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 1M
table_open_cache = 256
@@ -115,7 +115,7 @@ server-id = 1
# Point the following paths to different dedicated disks
#tmpdir = /tmp/
-#log-update = /path-to-dedicated-directory/hostname
+#log-bin = /path-to-dedicated-directory/hostname
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = @localstatedir@/
diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh
index 88113d0a8d4..b219d02a7be 100644
--- a/support-files/my-medium.cnf.sh
+++ b/support-files/my-medium.cnf.sh
@@ -26,7 +26,7 @@ socket = @MYSQL_UNIX_ADDR@
[mysqld]
port = @MYSQL_TCP_PORT@
socket = @MYSQL_UNIX_ADDR@
-skip-locking
+skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
@@ -113,7 +113,7 @@ server-id = 1
# Point the following paths to different dedicated disks
#tmpdir = /tmp/
-#log-update = /path-to-dedicated-directory/hostname
+#log-bin = /path-to-dedicated-directory/hostname
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = @localstatedir@/
diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh
index b4461ebf90f..d789a175603 100644
--- a/support-files/my-small.cnf.sh
+++ b/support-files/my-small.cnf.sh
@@ -26,7 +26,7 @@ socket = @MYSQL_UNIX_ADDR@
[mysqld]
port = @MYSQL_TCP_PORT@
socket = @MYSQL_UNIX_ADDR@
-skip-locking
+skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
diff --git a/support-files/mysql-multi.server.sh b/support-files/mysql-multi.server.sh
index 31020029354..a036374a4b2 100644
--- a/support-files/mysql-multi.server.sh
+++ b/support-files/mysql-multi.server.sh
@@ -18,8 +18,8 @@
# A typical multi-instance /etc/my.cnf file would look like:
# [mysqld]
# basedir=...
-# set-variable = key_buffer_size=16M
-# set-variable = max_allowed_packet=1M
+# key_buffer_size=16M
+# max_allowed_packet=1M
# [mysql_multi_server]
# svr1-datadir=/foo1/bar
# svr2-datadir=/foo2/bar
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index cc71e65ee08..b1fbc90d829 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -1,114 +1,212 @@
-# Copyright (C) 2000-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
-#
+# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
-# along with this program; see the file COPYING. If not, write to the
+# along with this program; see the file COPYING. If not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
# MA 02110-1301 USA.
-%define mysql_version @VERSION@
+##############################################################################
+# Some common macro definitions
+##############################################################################
# NOTE: "vendor" is used in upgrade/downgrade check, so you can't
# change these, has to be exactly as is.
-%define mysql_old_vendor MySQL AB
-%define mysql_vendor Sun Microsystems, Inc.
+%define mysql_old_vendor MySQL AB
+%define mysql_vendor_2 Sun Microsystems, Inc.
+%define mysql_vendor Oracle and/or its affiliates
-# use "rpmbuild --with static" or "rpm --define '_with_static 1'" (for RPM 3.x)
-# to enable static linking (off by default)
-%{?_with_static:%define STATIC_BUILD 1}
-%{!?_with_static:%define STATIC_BUILD 0}
+%define mysql_version @VERSION@
-# use "rpmbuild --with yassl" or "rpm --define '_with_yassl 1'" (for RPM 3.x)
-# to build with yaSSL support (off by default)
-%{?_with_yassl:%define YASSL_BUILD 1}
-%{!?_with_yassl:%define YASSL_BUILD 0}
+%define mysqld_user mysql
+%define mysqld_group mysql
+%define mysqldatadir /var/lib/mysql
-# ----------------------------------------------------------------------
-# use "rpmbuild --with bundled_zlib" or "rpm --define '_with_bundled_zlib 1'"
-# (for RPM 3.x) to build using the bundled zlib (off by default)
-# ----------------------------------------------------------------------
-%{?_with_bundled_zlib:%define WITH_BUNDLED_ZLIB 1}
-%{!?_with_bundled_zlib:%define WITH_BUNDLED_ZLIB 0}
+%define release 1
-# use "rpmbuild --with cluster" or "rpm --define '_with_cluster 1'" (for RPM 3.x)
-# to build with cluster support (off by default)
-%{?_with_cluster:%define CLUSTER_BUILD 1}
-%{!?_with_cluster:%define CLUSTER_BUILD 0}
+#
+# Macros we use which are not available in all supported versions of RPM
+#
+# - defined/undefined are missing on RHEL4
+#
+%if %{expand:%{?defined:0}%{!?defined:1}}
+%define defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
+%endif
+%if %{expand:%{?undefined:0}%{!?undefined:1}}
+%define undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
+%endif
-# ----------------------------------------------------------------------
-# support optional "tcmalloc" stuff (experimental)
-# ----------------------------------------------------------------------
-%{?malloc_lib_target:%define WITH_TCMALLOC 1}
-%{!?malloc_lib_target:%define WITH_TCMALLOC 0}
+# ----------------------------------------------------------------------------
+# RPM build tools now automatically detect Perl module dependencies. This
+# detection causes problems as it is broken in some versions, and it also
+# provides unwanted dependencies from mandatory scripts in our package.
+# It might not be possible to disable this in all versions of RPM, but here we
+# try anyway. We keep the "AutoReqProv: no" for the "test" sub package, as
+# disabling here might fail, and that package has the most problems.
+# See:
+# http://fedoraproject.org/wiki/Packaging/Perl#Filtering_Requires:_and_Provides
+# http://www.wideopen.com/archives/rpm-list/2002-October/msg00343.html
+# ----------------------------------------------------------------------------
+%undefine __perl_provides
+%undefine __perl_requires
+
+##############################################################################
+# Command line handling
+##############################################################################
+#
+# To set options:
+#
+# $ rpmbuild --define="option <x>" ...
+#
+
+# ----------------------------------------------------------------------------
+# Commercial builds
+# ----------------------------------------------------------------------------
+%if %{undefined commercial}
+%define commercial 0
+%endif
+
+# ----------------------------------------------------------------------------
+# Source name
+# ----------------------------------------------------------------------------
+%if %{undefined src_base}
+%define src_base mysql
+%endif
+%define src_dir %{src_base}-%{mysql_version}
+
+# ----------------------------------------------------------------------------
+# Feature set (storage engines, options). Default to community (everything)
+# ----------------------------------------------------------------------------
+%if %{undefined feature_set}
+%define feature_set community
+%endif
+
+# ----------------------------------------------------------------------------
+# Server comment strings
+# ----------------------------------------------------------------------------
+%if %{undefined compilation_comment_debug}
+%define compilation_comment_debug MySQL Community Server - Debug (GPL)
+%endif
+%if %{undefined compilation_comment_release}
+%define compilation_comment_release MySQL Community Server (GPL)
+%endif
+
+# ----------------------------------------------------------------------------
+# Product and server suffixes
+# ----------------------------------------------------------------------------
+%if %{undefined product_suffix}
+ %if %{defined short_product_tag}
+ %define product_suffix -%{short_product_tag}
+ %else
+ %define product_suffix %{nil}
+ %endif
+%endif
+
+%if %{undefined server_suffix}
+%define server_suffix %{nil}
+%endif
-%if %{STATIC_BUILD}
-%define release 1
+# ----------------------------------------------------------------------------
+# Distribution support
+# ----------------------------------------------------------------------------
+%if %{undefined distro_specific}
+%define distro_specific 0
+%endif
+%if %{distro_specific}
+ %if %(test -f /etc/redhat-release && echo 1 || echo 0)
+ %define redhatver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
+ %if "%redhatver" == "4"
+ %define distro_description Red Hat Enterprise Linux 4
+ %define distro_releasetag rhel4
+ %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils
+ %else
+ %if "%redhatver" == "5"
+ %define distro_description Red Hat Enterprise Linux 5
+ %define distro_releasetag rhel5
+ %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils
+ %else
+ %{error:Red Hat %{redhatver} is unsupported}
+ %endif
+ %endif
+ %else
+ %if %(test -f /etc/SuSE-release && echo 1 || echo 0)
+ %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release)
+ %if "%susever" == "10"
+ %define distro_description SUSE Linux Enterprise Server 10
+ %define distro_releasetag sles10
+ %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client readline-devel zlib-devel
+ %define distro_requires aaa_base coreutils grep procps pwdutils
+ %else
+ %if "%susever" == "11"
+ %define distro_description SUSE Linux Enterprise Server 11
+ %define distro_releasetag sles11
+ %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils readline-devel zlib-devel
+ %define distro_requires aaa_base coreutils grep procps pwdutils
+ %else
+ %{error:SuSE %{susever} is unsupported}
+ %endif
+ %endif
+ %else
+ %{error:Unsupported distribution}
+ %endif
+ %endif
%else
-%define release 1.glibc23
+ %define generic_kernel %(uname -r | cut -d. -f1-2)
+ %define distro_description Generic Linux (kernel %{generic_kernel})
+ %define distro_releasetag linux%{generic_kernel}
+ %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires coreutils grep procps /sbin/chkconfig /usr/sbin/useradd /usr/sbin/groupadd
%endif
-%define mysql_license GPL
-%define mysqld_user mysql
-%define mysqld_group mysql
-%define server_suffix -standard
-%define mysqldatadir /var/lib/mysql
-
-# We don't package all files installed into the build root by intention -
-# See BUG#998 for details.
-%define _unpackaged_files_terminate_build 0
-
-# ------------------------------------------------------------------------------
-# RPM build tools now automatically detects Perl module dependencies. This
-# detection gives problems as it is broken in some versions, and it also
-# give unwanted dependencies from mandatory scripts in our package.
-# Might not be possible to disable in all RPM tool versions, but here we
-# try. We keep the "AutoReqProv: no" for the "test" sub package, as disabling
-# here might fail, and that package has the most problems.
-# See http://fedoraproject.org/wiki/Packaging/Perl#Filtering_Requires:_and_Provides
-# http://www.wideopen.com/archives/rpm-list/2002-October/msg00343.html
-# ------------------------------------------------------------------------------
-%undefine __perl_provides
-%undefine __perl_requires
-%define see_base For a description of MySQL see the base MySQL RPM or http://www.mysql.com
+# ----------------------------------------------------------------------------
+# Support optional "tcmalloc" library (experimental)
+# ----------------------------------------------------------------------------
+%if %{defined malloc_lib_target}
+%define WITH_TCMALLOC 1
+%else
+%define WITH_TCMALLOC 0
+%endif
-# On SuSE 9 no separate "debuginfo" package is built. To enable basic
-# debugging on that platform, we don't strip binaries on SuSE 9. We
-# disable the strip of binaries by redefining the RPM macro
-# "__os_install_post" leaving out the script calls that normally does
-# this. We do this in all cases, as on platforms where "debuginfo" is
-# created, a script "find-debuginfo.sh" will be called that will do
-# the strip anyway, part of separating the executable and debug
-# information into separate files put into separate packages.
-#
-# Some references (shows more advanced conditional usage):
-# http://www.redhat.com/archives/rpm-list/2001-November/msg00257.html
-# http://www.redhat.com/archives/rpm-list/2003-February/msg00275.html
-# http://www.redhat.com/archives/rhl-devel-list/2004-January/msg01546.html
-# http://lists.opensuse.org/archive/opensuse-commit/2006-May/1171.html
-
-%define __os_install_post /usr/lib/rpm/brp-compress
-
-Name: MySQL
-Summary: MySQL: a very fast and reliable SQL database server
-Group: Applications/Databases
-Version: @MYSQL_U_SCORE_VERSION@
-Release: %{release}
-License: Copyright 2000-2008 MySQL AB, @MYSQL_COPYRIGHT_YEAR@ Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Under %{mysql_license} license as shown in the Description field.
-Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz
-URL: http://www.mysql.com/
-Packager: Sun Microsystems, Inc. Product Engineering Team <build@mysql.com>
-Vendor: %{mysql_vendor}
-Provides: msqlormysql MySQL-server mysql
-BuildRequires: ncurses-devel
-Obsoletes: mysql
+##############################################################################
+# Configuration based upon above user input, not to be set directly
+##############################################################################
+
+%if %{commercial}
+%define license_files_server %{src_dir}/LICENSE.mysql
+%define license_type Commercial
+%else
+%define license_files_devel %{src_dir}/EXCEPTIONS-CLIENT
+%define license_files_server %{src_dir}/COPYING %{src_dir}/README
+%define license_type GPL
+%endif
+
+##############################################################################
+# Main spec file section
+##############################################################################
+
+Name: MySQL%{product_suffix}
+Summary: MySQL: a very fast and reliable SQL database server
+Group: Applications/Databases
+Version: @MYSQL_U_SCORE_VERSION@
+Release: %{release}%{?distro_releasetag:.%{distro_releasetag}}
+Distribution: %{distro_description}
+License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Use is subject to license terms. Under %{license_type} license as shown in the Description field.
+Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz
+URL: http://www.mysql.com/
+Packager: MySQL Build Team <build@mysql.com>
+Vendor: %{mysql_vendor}
+Provides: msqlormysql MySQL-server mysql
+BuildRequires: %{distro_buildreq}
# Think about what you use here since the first step is to
# run a rm -rf
@@ -120,331 +218,218 @@ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
and robust SQL (Structured Query Language) database server. MySQL Server
is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of
-Sun Microsystems, Inc.
-
-Copyright 2000-2008 MySQL AB, @MYSQL_COPYRIGHT_YEAR@ Sun Microsystems, Inc. All rights reserved.
-Use is subject to license terms.
+%{mysql_vendor}
-This software comes with ABSOLUTELY NO WARRANTY. This is free software,
-and you are welcome to modify and redistribute it under the GPL license.
+The MySQL software has Dual Licensing, which means you can use the MySQL
+software free of charge under the GNU General Public License
+(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+licenses from %{mysql_vendor} if you do not wish to be bound by the terms of
+the GPL. See the chapter "Licensing and Support" in the manual for
+further info.
The MySQL web site (http://www.mysql.com/) provides the latest
news and information about the MySQL software. Also please see the
documentation and the manual for more information.
-%package server
-Summary: MySQL: a very fast and reliable SQL database server
-Group: Applications/Databases
-Requires: coreutils grep procps /usr/sbin/useradd /usr/sbin/groupadd /sbin/chkconfig
-Provides: msqlormysql mysql-server mysql MySQL
-Obsoletes: MySQL mysql mysql-server
+##############################################################################
+# Sub package definition
+##############################################################################
+
+%package -n MySQL-server%{product_suffix}
+Summary: MySQL: a very fast and reliable SQL database server
+Group: Applications/Databases
+Requires: %{distro_requires}
+Provides: msqlormysql mysql-server mysql MySQL MySQL-server
+Obsoletes: MySQL mysql mysql-server MySQL-server
-%description server
+%description -n MySQL-server%{product_suffix}
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
and robust SQL (Structured Query Language) database server. MySQL Server
is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of
-Sun Microsystems, Inc.
+%{mysql_vendor}
-Copyright 2000-2008 MySQL AB, @MYSQL_COPYRIGHT_YEAR@ Sun Microsystems, Inc. All rights reserved.
-Use is subject to license terms.
+The MySQL software has Dual Licensing, which means you can use the MySQL
+software free of charge under the GNU General Public License
+(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
+licenses from %{mysql_vendor} if you do not wish to be bound by the terms of
+the GPL. See the chapter "Licensing and Support" in the manual for
+further info.
-This software comes with ABSOLUTELY NO WARRANTY. This is free software,
-and you are welcome to modify and redistribute it under the GPL license.
+The MySQL web site (http://www.mysql.com/) provides the latest news and
+information about the MySQL software. Also please see the documentation
+and the manual for more information.
-The MySQL web site (http://www.mysql.com/) provides the latest
-news and information about the MySQL software. Also please see the
-documentation and the manual for more information.
-
-This package includes the MySQL server binary (incl. InnoDB) as well
-as related utilities to run and administrate a MySQL server.
+This package includes the MySQL server binary as well as related utilities
+to run and administer a MySQL server.
If you want to access and work with the database, you have to install
-package "MySQL-client" as well!
-
-%package client
-Summary: MySQL - Client
-Group: Applications/Databases
-Obsoletes: mysql-client
-Provides: mysql-client
-
-%description client
-This package contains the standard MySQL clients and administration tools.
-
-%{see_base}
-
-%if %{CLUSTER_BUILD}
-%package ndb-storage
-Summary: MySQL - ndbcluster storage engine
-Group: Applications/Databases
-
-%description ndb-storage
-This package contains the ndbcluster storage engine.
-It is necessary to have this package installed on all
-computers that should store ndbcluster table data.
-
-%{see_base}
-
-%package ndb-management
-Summary: MySQL - ndbcluster storage engine management
-Group: Applications/Databases
-
-%description ndb-management
-This package contains ndbcluster storage engine management.
-It is necessary to have this package installed on at least
-one computer in the cluster.
-
-%{see_base}
-
-%package ndb-tools
-Summary: MySQL - ndbcluster storage engine basic tools
-Group: Applications/Databases
-
-%description ndb-tools
-This package contains ndbcluster storage engine basic tools.
-
-%{see_base}
-
-%package ndb-extra
-Summary: MySQL - ndbcluster storage engine extra tools
-Group: Applications/Databases
-
-%description ndb-extra
-This package contains some extra ndbcluster storage engine tools for the advanced user.
-They should be used with caution.
-
-%{see_base}
-%endif
-
-%package test
-Requires: %{name}-client perl
-Summary: MySQL - Test suite
-Group: Applications/Databases
-Provides: mysql-test
-Obsoletes: mysql-bench mysql-test
-AutoReqProv: no
-
-%description test
+package "MySQL-client%{product_suffix}" as well!
+
+# ----------------------------------------------------------------------------
+%package -n MySQL-client%{product_suffix}
+Summary: MySQL - Client
+Group: Applications/Databases
+Obsoletes: mysql-client MySQL-client
+Provides: mysql-client MySQL-client
+
+%description -n MySQL-client%{product_suffix}
+This package contains the standard MySQL clients and administration tools.
+
+For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
+
+# ----------------------------------------------------------------------------
+%package -n MySQL-test%{product_suffix}
+Requires: MySQL-client%{product_suffix} perl
+Summary: MySQL - Test suite
+Group: Applications/Databases
+Provides: mysql-test
+Obsoletes: mysql-bench mysql-test
+AutoReqProv: no
+
+%description -n MySQL-test%{product_suffix}
This package contains the MySQL regression test suite.
-%{see_base}
+For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
-%package devel
-Summary: MySQL - Development header files and libraries
-Group: Applications/Databases
-Provides: mysql-devel
-Obsoletes: mysql-devel
+# ----------------------------------------------------------------------------
+%package -n MySQL-devel%{product_suffix}
+Summary: MySQL - Development header files and libraries
+Group: Applications/Databases
+Provides: mysql-devel
+Obsoletes: mysql-devel
-%description devel
-This package contains the development header files and libraries
-necessary to develop MySQL client applications.
+%description -n MySQL-devel%{product_suffix}
+This package contains the development header files and libraries necessary
+to develop MySQL client applications.
-%{see_base}
+For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
-%package shared
-Summary: MySQL - Shared libraries
-Group: Applications/Databases
+# ----------------------------------------------------------------------------
+%package -n MySQL-shared%{product_suffix}
+Summary: MySQL - Shared libraries
+Group: Applications/Databases
-%description shared
-This package contains the shared libraries (*.so*) which certain
-languages and applications need to dynamically load and use MySQL.
+%description -n MySQL-shared%{product_suffix}
+This package contains the shared libraries (*.so*) which certain languages
+and applications need to dynamically load and use MySQL.
-%package embedded
-Requires: %{name}-devel
-Summary: MySQL - embedded library
-Group: Applications/Databases
-Obsoletes: mysql-embedded
+# ----------------------------------------------------------------------------
+%package -n MySQL-embedded%{product_suffix}
+Summary: MySQL - embedded library
+Group: Applications/Databases
+Requires: MySQL-devel%{product_suffix}
+Obsoletes: mysql-embedded
-%description embedded
+%description -n MySQL-embedded%{product_suffix}
This package contains the MySQL server as an embedded library.
-The embedded MySQL server library makes it possible to run a
-full-featured MySQL server inside the client application.
-The main benefits are increased speed and more simple management
-for embedded applications.
+The embedded MySQL server library makes it possible to run a full-featured
+MySQL server inside the client application. The main benefits are increased
+speed and more simple management for embedded applications.
The API is identical for the embedded MySQL version and the
client/server version.
-%{see_base}
+For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
+##############################################################################
%prep
-# We unpack the source two times, for 'debug' and 'release' build.
-%setup -T -a 0 -c -n mysql-%{mysql_version}
-mv mysql-%{mysql_version} mysql-debug-%{mysql_version}
-%setup -D -T -a 0 -n mysql-%{mysql_version}
-mv mysql-%{mysql_version} mysql-release-%{mysql_version}
+%setup -T -a 0 -c -n %{src_dir}
+##############################################################################
%build
-BuildMySQL() {
-# The --enable-assembler simply does nothing on systems that does not
-# support assembler speedups.
-sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
- CC=\"${CC:-$MYSQL_BUILD_CC}\" \
- CXX=\"${CXX:-$MYSQL_BUILD_CXX}\" \
- CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" \
- LDFLAGS=\"$MYSQL_BUILD_LDFLAGS\" \
- ./configure \
- $* \
- --with-mysqld-ldflags='-static' \
- --with-client-ldflags='-static' \
- --with-zlib-dir=bundled \
- --enable-assembler \
- --enable-local-infile \
- --with-fast-mutexes \
- --with-mysqld-user=%{mysqld_user} \
- --with-unix-socket-path=/var/lib/mysql/mysql.sock \
- --with-pic \
- --prefix=/ \
-%if %{CLUSTER_BUILD}
- --with-extra-charsets=all \
-%else
- --with-extra-charsets=complex \
-%endif
-%if %{YASSL_BUILD}
- --with-ssl \
-%endif
- --exec-prefix=%{_exec_prefix} \
- --libexecdir=%{_sbindir} \
- --libdir=%{_libdir} \
- --sysconfdir=%{_sysconfdir} \
- --datadir=%{_datadir} \
- --localstatedir=%{mysqldatadir} \
- --infodir=%{_infodir} \
- --includedir=%{_includedir} \
- --mandir=%{_mandir} \
- --enable-thread-safe-client \
- --with-readline \
- --with-innodb \
-%if %{CLUSTER_BUILD}
- --with-ndbcluster \
-%else
- --without-ndbcluster \
-%endif
- --with-archive-storage-engine \
- --with-csv-storage-engine \
- --with-blackhole-storage-engine \
- --with-federated-storage-engine \
- --without-plugin-daemon_example \
- --without-plugin-ftexample \
- --with-partition \
- --with-big-tables \
-%if %{WITH_BUNDLED_ZLIB}
- --with-zlib-dir=bundled \
-%endif
- --enable-shared \
- "
- make
-}
-
-# Use our own copy of glibc
-
-OTHER_LIBC_DIR=/usr/local/mysql-glibc
-USE_OTHER_LIBC_DIR=""
-if test -d "$OTHER_LIBC_DIR"
-then
- USE_OTHER_LIBC_DIR="--with-other-libc=$OTHER_LIBC_DIR"
-fi
-
-# Use the build root for temporary storage of the shared libraries.
+# Be strict about variables, bail at earliest opportunity, etc.
+set -eu
-RBR=$RPM_BUILD_ROOT
-
-# Clean up the BuildRoot first
-[ "$RBR" != "/" ] && [ -d $RBR ] && rm -rf $RBR;
-mkdir -p $RBR%{_libdir}/mysql
+# Optional package files
+touch optional-files-devel
#
-# Use MYSQL_BUILD_PATH so that we can use a dedicated version of gcc
+# Set environment in order of preference, MYSQL_BUILD_* first, then variable
+# name, finally a default. RPM_OPT_FLAGS is assumed to be a part of the
+# default RPM build environment.
#
-PATH=${MYSQL_BUILD_PATH:-/bin:/usr/bin}
-export PATH
-
-# Build the Debug binary.
-
-# Use gcc for C and C++ code (to avoid a dependency on libstdc++ and
-# including exceptions into the code
-if [ -z "$CXX" -a -z "$CC" ]
-then
- export CC="gcc"
- export CXX="gcc"
-fi
-
-# Prepare compiler flags
-CFLAGS=${MYSQL_BUILD_CFLAGS:-$RPM_OPT_FLAGS}
-CXXFLAGS=${MYSQL_BUILD_CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti }
-
-##############################################################################
-#
-# Build the debug version
+# We set CXX=gcc by default to support so-called 'generic' binaries, where we
+# do not have a dependancy on libgcc/libstdc++. This only works while we do
+# not require C++ features such as exceptions, and may need to be removed at
+# a later date.
#
-##############################################################################
-
+export PATH=${MYSQL_BUILD_PATH:-$PATH}
+export CC=${MYSQL_BUILD_CC:-${CC:-gcc}}
+export CXX=${MYSQL_BUILD_CXX:-${CXX:-gcc}}
+export CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}}
+export CXXFLAGS=${MYSQL_BUILD_CXXFLAGS:-${CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti}}
+export LDFLAGS=${MYSQL_BUILD_LDFLAGS:-${LDFLAGS:-}}
+export CMAKE=${MYSQL_BUILD_CMAKE:-${CMAKE:-cmake}}
+
+# Build debug mysqld and libmysqld.a
+mkdir debug
(
-# We are in a subshell, so we can modify variables just for one run.
-CFLAGS=`echo " $CFLAGS " | \
- sed -e 's/ -O[0-9]* / /' -e 's/ -unroll2 / /' -e 's/ -ip / /' \
- -e 's/^ //' -e 's/ $//'`
-CXXFLAGS=`echo " $CXXFLAGS " | \
- sed -e 's/ -O[0-9]* / /' -e 's/ -unroll2 / /' -e 's/ -ip / /' \
- -e 's/^ //' -e 's/ $//'`
-
-# Add -g and --with-debug.
-cd mysql-debug-%{mysql_version} &&
-CFLAGS="$CFLAGS" \
-CXXFLAGS="$CXXFLAGS" \
-BuildMySQL "\
- --with-debug \
- --with-comment=\"MySQL Community Server - Debug (%{mysql_license})\"")
-
-# We might want to save the config log file
-if test -n "$MYSQL_DEBUGCONFLOG_DEST"
-then
- cp -fp mysql-debug-%{mysql_version}/config.log "$MYSQL_DEBUGCONFLOG_DEST"
-fi
-
-(cd mysql-debug-%{mysql_version} ; make test-bt-debug)
-
-##############################################################################
-#
-# Build the release binary
-#
-##############################################################################
-
-(cd mysql-release-%{mysql_version} &&
-CFLAGS="$CFLAGS" \
-CXXFLAGS="$CXXFLAGS" \
-BuildMySQL "\
- --with-embedded-server \
- --with-comment=\"MySQL Community Server (%{mysql_license})\"")
-# We might want to save the config log file
-if test -n "$MYSQL_CONFLOG_DEST"
-then
- cp -fp mysql-release-%{mysql_version}/config.log "$MYSQL_CONFLOG_DEST"
-fi
+ cd debug
+ # Attempt to remove any optimisation flags from the debug build
+ CFLAGS=`echo " ${CFLAGS} " | \
+ sed -e 's/ -O[0-9]* / /' \
+ -e 's/ -unroll2 / /' \
+ -e 's/ -ip / /' \
+ -e 's/^ //' \
+ -e 's/ $//'`
+ CXXFLAGS=`echo " ${CXXFLAGS} " | \
+ sed -e 's/ -O[0-9]* / /' \
+ -e 's/ -unroll2 / /' \
+ -e 's/ -ip / /' \
+ -e 's/^ //' \
+ -e 's/ $//'`
+ # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before
+ # XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM
+ ${CMAKE} ../%{src_dir} -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \
+ -DCMAKE_BUILD_TYPE=Debug \
+ -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \
+ -DFEATURE_SET="%{feature_set}" \
+ -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \
+ -DMYSQL_SERVER_SUFFIX="%{server_suffix}"
+ make VERBOSE=1 mysqld mysqlserver
+)
+# Build full release
+mkdir release
+(
+ cd release
+ # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before
+ # XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM
+ ${CMAKE} ../%{src_dir} -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \
+ -DFEATURE_SET="%{feature_set}" \
+ -DCOMPILATION_COMMENT="%{compilation_comment_release}" \
+ -DMYSQL_SERVER_SUFFIX="%{server_suffix}"
+ make VERBOSE=1
+)
-(cd mysql-release-%{mysql_version} ; make test-bt)
+# Use the build root for temporary storage of the shared libraries.
+RBR=$RPM_BUILD_ROOT
-##############################################################################
+# Clean up the BuildRoot first
+[ "$RBR" != "/" ] && [ -d "$RBR" ] && rm -rf "$RBR";
-# Include libgcc.a in the devel subpackage (BUG 4921)
-if expr "$CC" : ".*gcc.*" > /dev/null ;
+# For gcc builds, include libgcc.a in the devel subpackage (BUG 4921). This
+# needs to be during build phase as $CC is not set during install.
+if "$CC" -v 2>&1 | grep '^gcc.version' >/dev/null 2>&1
then
libgcc=`$CC $CFLAGS --print-libgcc-file`
if [ -f $libgcc ]
then
- %define have_libgcc 1
+ mkdir -p $RBR%{_libdir}/mysql
install -m 644 $libgcc $RBR%{_libdir}/mysql/libmygcc.a
+ echo "%{_libdir}/mysql/libmygcc.a" >>optional-files-devel
fi
fi
##############################################################################
-
%install
+
RBR=$RPM_BUILD_ROOT
-MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}/mysql-release-%{mysql_version}
+MBD=$RPM_BUILD_DIR/%{src_dir}
# Ensure that needed directories exists
install -d $RBR%{_sysconfdir}/{logrotate.d,init.d}
@@ -455,47 +440,45 @@ install -d $RBR%{_libdir}
install -d $RBR%{_mandir}
install -d $RBR%{_sbindir}
+# Install all binaries
+(
+ cd $MBD/release
+ make DESTDIR=$RBR install
+)
-# Install all binaries
-(cd $MBD && make install DESTDIR=$RBR testroot=%{_datadir})
-# Old packages put shared libs in %{_libdir}/ (not %{_libdir}/mysql), so do
-# the same here.
-mv $RBR/%{_libdir}/mysql/*.so* $RBR/%{_libdir}/
+# FIXME: at some point we should stop doing this and just install everything
+# FIXME: directly into %{_libdir}/mysql - perhaps at the same time as renaming
+# FIXME: the shared libraries to use libmysql*-$major.$minor.so syntax
+mv -v $RBR/%{_libdir}/*.a $RBR/%{_libdir}/mysql/
-# install "mysqld-debug"
-$MBD/libtool --mode=execute install -m 755 \
- $RPM_BUILD_DIR/mysql-%{mysql_version}/mysql-debug-%{mysql_version}/sql/mysqld \
- $RBR%{_sbindir}/mysqld-debug
+# Install logrotate and autostart
+install -m 644 $MBD/release/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql
+install -m 755 $MBD/release/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql
+
+# Create a symlink "rcmysql", pointing to the init.script. SuSE users
+# will appreciate that, as all services usually offer this.
+ln -s %{_sysconfdir}/init.d/mysql $RBR%{_sbindir}/rcmysql
+
+# Touch the place where the my.cnf config file might be located
+# Just to make sure it's in the file list and marked as a config file
+touch $RBR%{_sysconfdir}/my.cnf
%if %{WITH_TCMALLOC}
-# Even though this is a shared library, put it under /usr/lib/mysql, so it
-# doesn't conflict with possible shared lib by the same name in /usr/lib. See
+# Even though this is a shared library, put it under /usr/lib*/mysql, so it
+# doesn't conflict with possible shared lib by the same name in /usr/lib*. See
# `mysql_config --variable=pkglibdir` and mysqld_safe for how this is used.
install -m 644 "%{malloc_lib_source}" "$RBR%{_libdir}/mysql/%{malloc_lib_target}"
%endif
-# install saved perror binary with NDB support (BUG#13740)
-install -m 755 $MBD/extra/perror $RBR%{_bindir}/perror
-
-# Install logrotate and autostart
-install -m 644 $MBD/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql
-install -m 755 $MBD/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql
-
-# Install embedded server library in the build root
-install -m 644 $MBD/libmysqld/libmysqld.a $RBR%{_libdir}/mysql/
-
-# in RPMs, it is unlikely that anybody should use "sql-bench"
-rm -fr $RBR%{_datadir}/sql-bench
-
-# Create a symlink "rcmysql", pointing to the init.script. SuSE users
-# will appreciate that, as all services usually offer this.
-ln -s %{_sysconfdir}/init.d/mysql $RPM_BUILD_ROOT%{_sbindir}/rcmysql
+# Remove man pages we explicitly do not want to package, avoids 'unpackaged
+# files' warning.
+rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1*
-# Touch the place where the my.cnf config file might be located.
-# Just to make sure it's in the file list and marked as a config file.
-touch $RBR%{_sysconfdir}/my.cnf
+##############################################################################
+# Post processing actions, i.e. when installed
+##############################################################################
-%pre server
+%pre -n MySQL-server%{product_suffix}
# Check if we can safely upgrade. An upgrade is only safe if it's from one
# of our RPMs in the same version family.
@@ -504,6 +487,7 @@ if [ $? -eq 0 -a -n "$installed" ]; then
vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1`
version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1`
myoldvendor='%{mysql_old_vendor}'
+ myvendor_2='%{mysql_vendor_2}'
myvendor='%{mysql_vendor}'
myversion='%{mysql_version}'
@@ -515,10 +499,10 @@ if [ $? -eq 0 -a -n "$installed" ]; then
[ -z "$new_family" ] && new_family="<bad package specification: version $myversion>"
error_text=
- if [ "$vendor" != "$myoldvendor" -a "$vendor" != "$myvendor" ]; then
+ if [ "$vendor" != "$myoldvendor" -a "$vendor" != "$myvendor_2" -a "$vendor" != "$myvendor" ]; then
error_text="$error_text
The current MySQL server package is provided by a different
-vendor ($vendor) than $myoldvendor or $myvendor.
+vendor ($vendor) than $myoldvendor, $myvendor_2, or $myvendor.
Some files may be installed to different locations, including log
files and the service startup script in %{_sysconfdir}/init.d/.
"
@@ -564,58 +548,66 @@ HERE
fi
# Shut down a previously installed server first
-if test -x %{_sysconfdir}/init.d/mysql
-then
- %{_sysconfdir}/init.d/mysql stop > /dev/null 2>&1
- echo "Giving mysqld a couple of seconds to exit nicely"
- sleep 5
-elif test -x %{_sysconfdir}/rc.d/init.d/mysql
-then
- %{_sysconfdir}/rc.d/init.d/mysql stop > /dev/null 2>&1
- echo "Giving mysqld a couple of seconds to exit nicely"
- sleep 5
+if [ -x %{_sysconfdir}/init.d/mysql ] ; then
+ %{_sysconfdir}/init.d/mysql stop > /dev/null 2>&1
+ echo "Giving mysqld 5 seconds to exit nicely"
+ sleep 5
fi
-%post server
+%post -n MySQL-server%{product_suffix}
mysql_datadir=%{mysqldatadir}
+# ----------------------------------------------------------------------
# Create data directory if needed
-if test ! -d $mysql_datadir; then mkdir -m 755 $mysql_datadir; fi
-if test ! -d $mysql_datadir/mysql; then mkdir $mysql_datadir/mysql; fi
-if test ! -d $mysql_datadir/test; then mkdir $mysql_datadir/test; fi
+# ----------------------------------------------------------------------
+if [ ! -d $mysql_datadir ] ; then mkdir -m 755 $mysql_datadir; fi
+if [ ! -d $mysql_datadir/mysql ] ; then mkdir $mysql_datadir/mysql; fi
+if [ ! -d $mysql_datadir/test ] ; then mkdir $mysql_datadir/test; fi
+# ----------------------------------------------------------------------
# Make MySQL start/shutdown automatically when the machine does it.
+# ----------------------------------------------------------------------
# use insserv for older SuSE Linux versions
-if test -x /sbin/insserv
-then
- /sbin/insserv %{_sysconfdir}/init.d/mysql
+if [ -x /sbin/insserv ] ; then
+ /sbin/insserv %{_sysconfdir}/init.d/mysql
# use chkconfig on Red Hat and newer SuSE releases
-elif test -x /sbin/chkconfig
-then
- /sbin/chkconfig --add mysql
+elif [ -x /sbin/chkconfig ] ; then
+ /sbin/chkconfig --add mysql
fi
+# ----------------------------------------------------------------------
# Create a MySQL user and group. Do not report any problems if it already
# exists.
+# ----------------------------------------------------------------------
groupadd -r %{mysqld_group} 2> /dev/null || true
-useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
+useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
# The user may already exist, make sure it has the proper group nevertheless (BUG#12823)
usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
+# ----------------------------------------------------------------------
# Change permissions so that the user that will run the MySQL daemon
# owns all database files.
+# ----------------------------------------------------------------------
chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
+# ----------------------------------------------------------------------
# Initiate databases if needed
+# ----------------------------------------------------------------------
%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
+# ----------------------------------------------------------------------
# Upgrade databases if needed would go here - but it cannot be automated yet
+# ----------------------------------------------------------------------
+# ----------------------------------------------------------------------
# Change permissions again to fix any new files.
+# ----------------------------------------------------------------------
chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
+# ----------------------------------------------------------------------
# Fix permissions for the permission database so that only the user
# can read them.
+# ----------------------------------------------------------------------
chmod -R og-rw $mysql_datadir/mysql
# Restart in the same way that mysqld will be started normally.
@@ -628,52 +620,45 @@ sleep 2
#systems, we recommend MySQL Enterprise, which contains enterprise-ready
#software, intelligent advisory services, and full production support with
#scheduled service packs and more. Visit www.mysql.com/enterprise for more
-#information."
-
-%if %{CLUSTER_BUILD}
-%post ndb-storage
-mysql_clusterdir=/var/lib/mysql-cluster
-
-# Create cluster directory if needed
-if test ! -d $mysql_clusterdir; then mkdir -m 755 $mysql_clusterdir; fi
-%endif
-
-%preun server
-if test $1 = 0
-then
- # Stop MySQL before uninstalling it
- if test -x %{_sysconfdir}/init.d/mysql
- then
- %{_sysconfdir}/init.d/mysql stop > /dev/null
-
- # Remove autostart of mysql
- # for older SuSE Linux versions
- if test -x /sbin/insserv
- then
- /sbin/insserv -r %{_sysconfdir}/init.d/mysql
- # use chkconfig on Red Hat and newer SuSE releases
- elif test -x /sbin/chkconfig
- then
- /sbin/chkconfig --del mysql
- fi
- fi
+#information."
+
+%preun -n MySQL-server%{product_suffix}
+if [ $1 = 0 ] ; then
+ # Stop MySQL before uninstalling it
+ if [ -x %{_sysconfdir}/init.d/mysql ] ; then
+ %{_sysconfdir}/init.d/mysql stop > /dev/null
+ # Remove autostart of MySQL
+ # For older SuSE Linux versions
+ if [ -x /sbin/insserv ] ; then
+ /sbin/insserv -r %{_sysconfdir}/init.d/mysql
+ # use chkconfig on Red Hat and newer SuSE releases
+ elif [ -x /sbin/chkconfig ] ; then
+ /sbin/chkconfig --del mysql
+ fi
+ fi
fi
# We do not remove the mysql user since it may still own a lot of
# database files.
-# Clean up the BuildRoot
+# ----------------------------------------------------------------------
+# Clean up the BuildRoot after build is done
+# ----------------------------------------------------------------------
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
-%files server
+##############################################################################
+# Files section
+##############################################################################
+
+%files -n MySQL-server%{product_suffix}
%defattr(-,root,root,0755)
-%doc mysql-release-%{mysql_version}/COPYING mysql-release-%{mysql_version}/README
-%doc mysql-release-%{mysql_version}/support-files/my-*.cnf
-%if %{CLUSTER_BUILD}
-%doc mysql-release-%{mysql_version}/support-files/ndb-*.ini
+%if %{defined license_files_server}
+%doc %{license_files_server}
%endif
+%doc %{src_dir}/Docs/ChangeLog
+%doc release/support-files/my-*.cnf
%doc %attr(644, root, root) %{_infodir}/mysql.info*
@@ -683,11 +668,15 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/myisamchk.1*
%doc %attr(644, root, man) %{_mandir}/man1/myisamlog.1*
%doc %attr(644, root, man) %{_mandir}/man1/myisampack.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_convert_table_format.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_extensions.1*
%doc %attr(644, root, man) %{_mandir}/man8/mysqld.8*
%doc %attr(644, root, man) %{_mandir}/man1/mysqld_multi.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1*
-#%doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_privilege_tables.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysqldumpslow.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_install_db.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_secure_installation.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_setpermission.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_upgrade.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlhotcopy.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlman.1*
@@ -698,6 +687,8 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/mysqlbug.1*
%doc %attr(644, root, man) %{_mandir}/man1/perror.1*
%doc %attr(644, root, man) %{_mandir}/man1/replace.1*
+%doc %attr(644, root, man) %{_mandir}/man1/resolve_stack_dump.1*
+%doc %attr(644, root, man) %{_mandir}/man1/resolveip.1*
%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf
@@ -709,7 +700,6 @@ fi
%attr(755, root, root) %{_bindir}/myisampack
%attr(755, root, root) %{_bindir}/mysql_convert_table_format
%attr(755, root, root) %{_bindir}/mysql_fix_extensions
-%attr(755, root, root) %{_bindir}/mysql_fix_privilege_tables
%attr(755, root, root) %{_bindir}/mysql_install_db
%attr(755, root, root) %{_bindir}/mysql_secure_installation
%attr(755, root, root) %{_bindir}/mysql_setpermission
@@ -727,7 +717,10 @@ fi
%attr(755, root, root) %{_bindir}/resolve_stack_dump
%attr(755, root, root) %{_bindir}/resolveip
-%attr(755, root, root) %{_libdir}/mysql/plugin/ha_example.so*
+%attr(755, root, root) %{_sbindir}/mysqld
+%attr(755, root, root) %{_sbindir}/mysqld-debug
+%attr(755, root, root) %{_sbindir}/rcmysql
+%attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so
%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so*
%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so*
@@ -735,22 +728,22 @@ fi
%attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target}
%endif
-%attr(755, root, root) %{_sbindir}/mysqld
-%attr(755, root, root) %{_sbindir}/mysqld-debug
-%attr(755, root, root) %{_sbindir}/rcmysql
-
%attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
%attr(755, root, root) %{_sysconfdir}/init.d/mysql
%attr(755, root, root) %{_datadir}/mysql/
-%files client
+# ----------------------------------------------------------------------------
+%files -n MySQL-client%{product_suffix}
+
%defattr(-, root, root, 0755)
%attr(755, root, root) %{_bindir}/msql2mysql
%attr(755, root, root) %{_bindir}/mysql
%attr(755, root, root) %{_bindir}/mysql_find_rows
%attr(755, root, root) %{_bindir}/mysql_waitpid
%attr(755, root, root) %{_bindir}/mysqlaccess
+# XXX: This should be moved to %{_sysconfdir}
+%attr(644, root, root) %{_bindir}/mysqlaccess.conf
%attr(755, root, root) %{_bindir}/mysqladmin
%attr(755, root, root) %{_bindir}/mysqlbinlog
%attr(755, root, root) %{_bindir}/mysqlcheck
@@ -762,6 +755,7 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/msql2mysql.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_find_rows.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_waitpid.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlaccess.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqladmin.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlbinlog.1*
@@ -771,130 +765,106 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/mysqlshow.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlslap.1*
-%post shared
-/sbin/ldconfig
-
-%postun shared
-/sbin/ldconfig
-
-%if %{CLUSTER_BUILD}
-%files ndb-storage
-%defattr(-,root,root,0755)
-%attr(755, root, root) %{_sbindir}/ndbd
-%doc %attr(644, root, man) %{_mandir}/man8/ndbd.8*
-
-%files ndb-management
-%defattr(-,root,root,0755)
-%attr(755, root, root) %{_sbindir}/ndb_mgmd
-%doc %attr(644, root, man) %{_mandir}/man8/ndb_mgmd.8*
-
-%files ndb-tools
-%defattr(-,root,root,0755)
-%attr(755, root, root) %{_bindir}/ndb_config
-%attr(755, root, root) %{_bindir}/ndb_desc
-%attr(755, root, root) %{_bindir}/ndb_error_reporter
-%attr(755, root, root) %{_bindir}/ndb_mgm
-%attr(755, root, root) %{_bindir}/ndb_print_backup_file
-%attr(755, root, root) %{_bindir}/ndb_print_schema_file
-%attr(755, root, root) %{_bindir}/ndb_print_sys_file
-%attr(755, root, root) %{_bindir}/ndb_restore
-%attr(755, root, root) %{_bindir}/ndb_select_all
-%attr(755, root, root) %{_bindir}/ndb_select_count
-%attr(755, root, root) %{_bindir}/ndb_show_tables
-%attr(755, root, root) %{_bindir}/ndb_size.pl
-%attr(755, root, root) %{_bindir}/ndb_test_platform
-%attr(755, root, root) %{_bindir}/ndb_waiter
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_config.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_desc.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_error_reporter.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_mgm.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_restore.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_print_backup_file.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_print_schema_file.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_print_sys_file.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_select_all.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_select_count.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_show_tables.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_size.pl.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_waiter.1*
-
-%files ndb-extra
-%defattr(-,root,root,0755)
-%attr(755, root, root) %{_bindir}/ndb_delete_all
-%attr(755, root, root) %{_bindir}/ndb_drop_index
-%attr(755, root, root) %{_bindir}/ndb_drop_table
-%attr(755, root, root) %{_sbindir}/ndb_cpcd
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_delete_all.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_drop_index.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_drop_table.1*
-%doc %attr(644, root, man) %{_mandir}/man1/ndb_cpcd.1*
-%endif
-
-%files devel
+# ----------------------------------------------------------------------------
+%files -n MySQL-devel%{product_suffix} -f optional-files-devel
%defattr(-, root, root, 0755)
-%doc mysql-release-%{mysql_version}/EXCEPTIONS-CLIENT
+%if %{defined license_files_devel}
+%doc %{license_files_devel}
+%endif
+%doc %attr(644, root, man) %{_mandir}/man1/comp_err.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_config.1*
%attr(755, root, root) %{_bindir}/mysql_config
%dir %attr(755, root, root) %{_includedir}/mysql
%dir %attr(755, root, root) %{_libdir}/mysql
%{_includedir}/mysql/*
%{_datadir}/aclocal/mysql.m4
-%{_libdir}/mysql/libdbug.a
-%{_libdir}/mysql/libheap.a
-%if %{have_libgcc}
-%{_libdir}/mysql/libmygcc.a
-%endif
-%{_libdir}/mysql/libmyisam.a
-%{_libdir}/mysql/libmyisammrg.a
%{_libdir}/mysql/libmysqlclient.a
-%{_libdir}/mysql/libmysqlclient.la
%{_libdir}/mysql/libmysqlclient_r.a
-%{_libdir}/mysql/libmysqlclient_r.la
%{_libdir}/mysql/libmysqlservices.a
-%{_libdir}/mysql/libmystrings.a
-%{_libdir}/mysql/libmysys.a
-%if %{CLUSTER_BUILD}
-%{_libdir}/mysql/libndbclient.a
-%{_libdir}/mysql/libndbclient.la
-%endif
-%{_libdir}/mysql/libvio.a
-%{_libdir}/mysql/libz.a
-%{_libdir}/mysql/libz.la
-%{_libdir}/mysql/plugin/ha_example.a
-%{_libdir}/mysql/plugin/ha_example.la
-%{_libdir}/mysql/plugin/semisync_master.a
-%{_libdir}/mysql/plugin/semisync_master.la
-%{_libdir}/mysql/plugin/semisync_slave.a
-%{_libdir}/mysql/plugin/semisync_slave.la
-
-%files shared
+
+# ----------------------------------------------------------------------------
+%files -n MySQL-shared%{product_suffix}
%defattr(-, root, root, 0755)
# Shared libraries (omit for architectures that don't support them)
%{_libdir}/libmysql*.so*
-%if %{CLUSTER_BUILD}
-%{_libdir}/libndb*.so*
-%endif
-%files test
+%post -n MySQL-shared%{product_suffix}
+/sbin/ldconfig
+
+%postun -n MySQL-shared%{product_suffix}
+/sbin/ldconfig
+
+# ----------------------------------------------------------------------------
+%files -n MySQL-test%{product_suffix}
%defattr(-, root, root, 0755)
%attr(-, root, root) %{_datadir}/mysql-test
%attr(755, root, root) %{_bindir}/mysql_client_test
%attr(755, root, root) %{_bindir}/mysql_client_test_embedded
%attr(755, root, root) %{_bindir}/mysqltest_embedded
%doc %attr(644, root, man) %{_mandir}/man1/mysql_client_test.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_client_test_embedded.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql-stress-test.pl.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql-test-run.pl.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_client_test_embedded.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqltest_embedded.1*
-%files embedded
-%defattr(-, root, root, 0755)
+# ----------------------------------------------------------------------------
+%files -n MySQL-embedded%{product_suffix}
+%defattr(-, root, root, 0755)
+%attr(755, root, root) %{_bindir}/mysql_embedded
%attr(644, root, root) %{_libdir}/mysql/libmysqld.a
+%attr(644, root, root) %{_libdir}/mysql/libmysqld-debug.a
+##############################################################################
# The spec file changelog only includes changes made to the spec file
# itself - note that they must be ordered by date (important when
# merging BK trees)
+##############################################################################
%changelog
+* Wed Mar 24 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Add "--with-perfschema" to the configure options.
+
+* Mon Mar 22 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- User "usr/lib*" to allow for both "usr/lib" and "usr/lib64",
+ mask "rmdir" return code 1.
+- Remove "ha_example.*" files from the list, they aren't built.
+
+* Wed Mar 17 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Fix a wrong path name in handling the debug plugins.
+
+* Wed Mar 10 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Take the result of the debug plugin build and put it into the optimized tree,
+ so that it becomes part of the final installation;
+ include the files in the packlist. Part of the fixes for bug#49022.
+
+* Mon Mar 01 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Set "Oracle and/or its affiliates" as the vendor and copyright owner,
+ accept upgrading from packages showing MySQL or Sun as vendor.
+
+* Fri Feb 12 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Formatting changes:
+ Have a consistent structure of separator lines and of indentation
+ (8 leading blanks => tab).
+- Introduce the variable "src_dir".
+- Give the environment variables "MYSQL_BUILD_CC(CXX)" precedence
+ over "CC" ("CXX").
+- Drop the old "with_static" argument analysis, this is not supported
+ in 5.1 since ages.
+- Introduce variables to control the handlers individually, as well
+ as other options.
+- Use the new "--with-plugin" notation for the table handlers.
+- Drop handling "/etc/rc.d/init.d/mysql", the switch to "/etc/init.d/mysql"
+ was done back in 2002 already.
+- Make "--with-zlib-dir=bundled" the default, add an option to disable it.
+- Add missing manual pages to the file list.
+- Improve the runtime check for "libgcc.a", protect it against being tried
+ with the Intel compiler "icc".
+
* Mon Jan 11 2010 Joerg Bruehe <joerg.bruehe@sun.com>
- Change RPM file naming:
@@ -1455,7 +1425,7 @@ fi
- Reworked the build steps a little bit: the Max binary is supposed
to include OpenSSL, which cannot be linked statically, thus trying
- to statically link against a special glibc is futile anyway
+ to statically link against a special glibc is futile anyway
- because of this, it is not required to make yet another build run
just to compile the shared libs (saves a lot of time)
- updated package description of the Max subpackage
@@ -1466,7 +1436,7 @@ fi
- Updated Packager information
- Fixed the build options: the regular package is supposed to
include InnoDB and linked statically, while the Max package
- should include BDB and SSL support
+ should include BDB and SSL support
* Fri May 03 2002 Lenz Grimmer <lenz@mysql.com>