summaryrefslogtreecommitdiff
path: root/support-files
diff options
context:
space:
mode:
Diffstat (limited to 'support-files')
-rw-r--r--support-files/.cvsignore13
-rw-r--r--support-files/CMakeLists.txt94
-rw-r--r--support-files/MacOSX/Makefile.am57
-rw-r--r--support-files/Makefile.am133
-rw-r--r--support-files/MySQL-shared-compat.spec.sh28
-rw-r--r--support-files/RHEL4-SElinux/Makefile.am23
-rw-r--r--support-files/dtrace/locktime.d65
-rw-r--r--support-files/dtrace/query-execandqc.d52
-rw-r--r--support-files/dtrace/query-filesort-time.d63
-rw-r--r--support-files/dtrace/query-network-time.d79
-rw-r--r--support-files/dtrace/query-parse-time.d39
-rw-r--r--support-files/dtrace/query-rowops.d82
-rw-r--r--support-files/dtrace/query-time.d41
-rw-r--r--support-files/dtrace/statement-time.d61
-rw-r--r--support-files/dtrace/statement-type-aggregate.d62
-rw-r--r--support-files/my-huge.cnf.sh2
-rw-r--r--support-files/my-innodb-heavy-4G.cnf.sh5
-rw-r--r--support-files/my-large.cnf.sh2
-rw-r--r--support-files/my-medium.cnf.sh2
-rw-r--r--support-files/my-small.cnf.sh9
-rw-r--r--support-files/mysql-multi.server.sh4
-rw-r--r--support-files/mysql.server.sh178
-rw-r--r--support-files/mysql.spec.sh1390
-rw-r--r--support-files/ndb-config-2-node.ini.sh2
24 files changed, 1482 insertions, 1004 deletions
diff --git a/support-files/.cvsignore b/support-files/.cvsignore
deleted file mode 100644
index 97f52806614..00000000000
--- a/support-files/.cvsignore
+++ /dev/null
@@ -1,13 +0,0 @@
-Makefile
-Makefile.in
-binary-configure
-my-example.cnf
-my-huge.cnf
-my-large.cnf
-my-medium.cnf
-my-small.cnf
-mysql-3.*-alpha.spec
-mysql-3.23.21-beta.spec
-mysql-log-rotate
-mysql.server
-mysql.spec
diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt
new file mode 100644
index 00000000000..3ad48520dfb
--- /dev/null
+++ b/support-files/CMakeLists.txt
@@ -0,0 +1,94 @@
+# Copyright (c) 2006, 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; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+IF(WIN32)
+ SET(localstatedir "C:\\\\mysql\\\\data\\\\")
+ SET(ini_file_extension "ini")
+ELSE()
+ SET(localstatedir "${MYSQL_DATADIR}")
+ SET(prefix "${CMAKE_INSTALL_PREFIX}")
+ SET(libexecdir "${CMAKE_INSTALL_PREFIX}/${INSTALL_SBINDIR}")
+ SET(bindir "${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR}" )
+ SET(sbindir "${libexecdir}")
+ SET(datadir "${MYSQL_DATADIR}")
+ SET(CC ${CMAKE_C_COMPILER})
+ SET(CXX ${CMAKE_CXX_COMPILER})
+ SET(CFLAGS ${CMAKE_C_FLAGS})
+ 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 ${inst_location} COMPONENT IniFiles)
+ENDFOREACH()
+
+IF(UNIX)
+ SET(prefix ${CMAKE_INSTALL_PREFIX})
+ 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 )
+
+ IF(script MATCHES ".ini")
+ SET(comp IniFiles)
+ ELSE()
+ SET(comp Server_Scripts)
+ ENDIF()
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${script}
+ DESTINATION ${inst_location} COMPONENT ${comp}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+ ENDFOREACH()
+ IF(INSTALL_SUPPORTFILESDIR)
+ INSTALL(FILES magic DESTINATION ${inst_location} COMPONENT SupportFiles)
+ ENDIF()
+
+ INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
+ CONFIGURE_FILE(MySQL-shared-compat.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/MySQL-shared-compat.spec @ONLY)
+ CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.spec @ONLY)
+
+ SET(SPECFILENAME "mysql.${VERSION}.spec")
+ IF("${VERSION}" MATCHES "-ndb-")
+ STRING(REGEX REPLACE "^.*-ndb-" "" NDBVERSION "${VERSION}")
+ SET(SPECFILENAME "mysql-cluster-${NDBVERSION}.spec")
+ ENDIF()
+ CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/${SPECFILENAME} @ONLY)
+
+ CONFIGURE_FILE(MySQL-shared-compat.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/MySQL-shared-compat.spec @ONLY)
+
+ SET(bindir ${prefix}/${INSTALL_BINDIR})
+ SET(sbindir ${prefix}/${INSTALL_SBINDIR})
+ SET(scriptdir ${prefix}/${INSTALL_SCRIPTDIR})
+ SET(libexecdir ${prefix}/${INSTALL_SBINDIR})
+ SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR})
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql.server.sh
+ ${CMAKE_CURRENT_BINARY_DIR}/mysql.server @ONLY)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql.server
+ DESTINATION ${inst_location} COMPONENT SupportFiles
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
+ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+ENDIF()
diff --git a/support-files/MacOSX/Makefile.am b/support-files/MacOSX/Makefile.am
deleted file mode 100644
index 819334706ef..00000000000
--- a/support-files/MacOSX/Makefile.am
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright (c) 2003-2006, 2008 MySQL AB
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA 02110-1301, USA
-
-## Process this file with automake to create Makefile.in
-
-EXTRA_DIST = Info.plist.sh \
- Description.plist.sh \
- StartupParameters.plist.sh \
- postflight.sh \
- preflight.sh \
- ReadMe.txt \
- MySQLCOM \
- StartupItem.Description.plist \
- StartupItem.Info.plist \
- StartupItem.postinstall
-
-noinst_DATA = Info.plist \
- Description.plist \
- StartupParameters.plist \
- postflight \
- preflight
-
-CLEANFILES = Info.plist \
- Description.plist \
- StartupParameters.plist \
- postflight \
- preflight
-
-SUFFIXES = .sh
-
-.sh:
- @RM@ -f $@ $@-t
- @SED@ \
- -e 's!@''prefix''@!$(prefix)!g' \
- -e 's!@''VERSION''@!@VERSION@!' \
- -e 's!@''MYSQL_NUMERIC_VERSION''@!@MYSQL_NUMERIC_VERSION@!' \
- -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \
- -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \
- $< > $@-t
- @MV@ $@-t $@
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/support-files/Makefile.am b/support-files/Makefile.am
deleted file mode 100644
index efe4c399860..00000000000
--- a/support-files/Makefile.am
+++ /dev/null
@@ -1,133 +0,0 @@
-# Copyright (c) 2000, 2001, 2003-2008 MySQL AB, 2010 Sun Microsystems, Inc.
-# Use is subject to license terms.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
-# MA 02110-1301, USA
-
-## Process this file with automake to create Makefile.in
-
-EXTRA_DIST = mysql.spec.sh \
- my-small.cnf.sh \
- my-medium.cnf.sh \
- my-large.cnf.sh \
- my-huge.cnf.sh \
- my-innodb-heavy-4G.cnf.sh \
- mysql-log-rotate.sh \
- mysql.server.sh \
- mysqld_multi.server.sh \
- config.huge.ini.sh \
- config.medium.ini.sh \
- config.small.ini.sh \
- binary-configure.sh \
- magic mysql.m4 \
- MySQL-shared-compat.spec.sh \
- ndb-config-2-node.ini.sh \
- compiler_warnings.supp
-
-SUBDIRS = MacOSX RHEL4-SElinux
-
-# Default same as 'pkgdatadir', but we can override it
-pkgsuppdir = $(datadir)/@PACKAGE@
-
-pkgsupp_DATA = my-small.cnf \
- my-medium.cnf \
- my-large.cnf \
- my-huge.cnf \
- config.huge.ini \
- config.medium.ini \
- config.small.ini \
- my-innodb-heavy-4G.cnf \
- mysql-log-rotate \
- binary-configure \
- ndb-config-2-node.ini
-
-pkgsupp_SCRIPTS = mysql.server \
- mysqld_multi.server
-
-aclocaldir = $(datadir)/aclocal
-aclocal_DATA = mysql.m4
-
-noinst_DATA = mysql-@VERSION@.spec \
- MySQL-shared-compat.spec
-
-CLEANFILES = my-small.cnf \
- my-medium.cnf \
- my-large.cnf \
- my-huge.cnf \
- config.huge.ini \
- config.medium.ini \
- config.small.ini \
- my-innodb-heavy-4G.cnf \
- mysql.spec \
- mysql-@VERSION@.spec \
- mysql-log-rotate \
- mysql.server \
- mysqld_multi.server \
- binary-configure \
- MySQL-shared-compat.spec \
- ndb-config-2-node.ini
-
-mysql-@VERSION@.spec: mysql.spec
- rm -f $@
- cp mysql.spec $@
-
-SUFFIXES = .sh
-
-.sh:
- @RM@ -f $@ $@-t
- @SED@ \
- -e 's!@''bindir''@!$(bindir)!g' \
- -e 's!@''sbindir''@!$(sbindir)!g' \
- -e 's!@''scriptdir''@!$(bindir)!g' \
- -e 's!@''prefix''@!$(prefix)!g' \
- -e 's!@''datadir''@!$(datadir)!g' \
- -e 's!@''localstatedir''@!$(localstatedir)!g' \
- -e 's!@''libexecdir''@!$(libexecdir)!g' \
- -e 's!@''CC''@!@CC@!'\
- -e 's!@''CXX''@!@CXX@!'\
- -e 's!@''GXX''@!@GXX@!'\
- -e 's!@''PERL''@!@PERL@!' \
- -e 's!@''CFLAGS''@!@SAVE_CFLAGS@!'\
- -e 's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'\
- -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\
- -e 's!@''VERSION''@!@VERSION@!' \
- -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \
- -e 's!@''COMPILATION_COMMENT''@!@COMPILATION_COMMENT@!' \
- -e 's!@''MACHINE_TYPE''@!@MACHINE_TYPE@!' \
- -e 's!@''HOSTNAME''@!@HOSTNAME@!' \
- -e 's!@''SYSTEM_TYPE''@!@SYSTEM_TYPE@!' \
- -e 's!@''CHECK_PID''@!@CHECK_PID@!' \
- -e 's!@''FIND_PROC''@!@FIND_PROC@!' \
- -e 's!@''MYSQLD_DEFAULT_SWITCHES''@!@MYSQLD_DEFAULT_SWITCHES@!' \
- -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
- -e 's!@''TARGET_LINUX''@!@TARGET_LINUX@!' \
- -e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \
- -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \
- -e 's!@''sysconfdir''@!@sysconfdir@!' \
- -e 's!@''SHORT_MYSQL_INTRO''@!@SHORT_MYSQL_INTRO@!' \
- -e 's!@''SHARED_LIB_VERSION''@!@SHARED_LIB_VERSION@!' \
- -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
- -e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \
- -e 's!@''MYSQL_U_SCORE_VERSION''@!@MYSQL_U_SCORE_VERSION@!' \
- -e 's!@''MYSQL_COPYRIGHT_YEAR''@!@MYSQL_COPYRIGHT_YEAR@!' \
- -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
- -e 's!@''PERL_DBI_VERSION''@!@PERL_DBI_VERSION@!' \
- -e 's!@''PERL_DBD_VERSION''@!@PERL_DBD_VERSION@!' \
- -e 's!@''PERL_DATA_DUMPER''@!@PERL_DATA_DUMPER@!' \
- $< > $@-t
- @MV@ $@-t $@
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/support-files/MySQL-shared-compat.spec.sh b/support-files/MySQL-shared-compat.spec.sh
index 95a1e61e1d6..afda068b335 100644
--- a/support-files/MySQL-shared-compat.spec.sh
+++ b/support-files/MySQL-shared-compat.spec.sh
@@ -1,3 +1,4 @@
+# Copyright 2003-2008 MySQL AB, 2009 Sun Microsystems, Inc.
#
# MySQL-shared-compat.spec
#
@@ -7,8 +8,6 @@
# separate "MySQL-shared" package. This spec file simply repackages two
# already existing MySQL-shared RPMs into a single package.
#
-# Copyright (c) 2003-2007 MySQL AB
-#
# 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.
@@ -28,27 +27,27 @@
#
# Change this to match the version of the shared libs you want to include
#
-%define version50 @MYSQL_NO_DASH_VERSION@
+%define version_cur @MYSQL_RPM_VERSION@
%define version41 4.1.17
%define version40 4.0.26
%define version3 3.23.58
Name: MySQL-shared-compat
-Packager: MySQL Product Engineering team <build@mysql.com>
-Vendor: MySQL AB
+Packager: Sun Microsystems, Inc. Product Engineering Team <build@mysql.com>
+Vendor: Sun Microsystems, Inc.
License: GPL
Group: Applications/Databases
URL: http://www.mysql.com/
Autoreqprov: on
-Version: %{version50}
-Release: 0
+Version: %{version_cur}
+Release: 1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Obsoletes: MySQL-shared, mysql-shared
Provides: MySQL-shared
Summary: MySQL shared client libraries for MySQL %{version}, %{version41}, %{version40} and %{version3}
# We simply use the "MySQL-shared" subpackages as input sources instead of
# rebuilding all from source
-Source0: MySQL-shared-%{version50}-0.%{_arch}.rpm
+Source0: MySQL-shared-%{version_cur}-1.%{_arch}.rpm
Source1: MySQL-shared-%{version41}-1.%{_arch}.rpm
Source2: MySQL-shared-%{version40}-0.%{_arch}.rpm
Source3: MySQL-shared-%{version3}-1.%{_arch}.rpm
@@ -62,7 +61,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This package includes the shared libraries for MySQL %{version3},
-MySQL %{version40}, %{version41} as well as MySQL %{version50}.
+MySQL %{version40}, %{version41} as well as MySQL %{version_cur}.
Install this package instead of "MySQL-shared", if you have applications
installed that are dynamically linked against older versions of the MySQL
client library but you want to upgrade to MySQL %{version} without breaking the
@@ -84,3 +83,14 @@ rpm2cpio %{SOURCE3} | cpio -iv --make-directories
%files
%defattr(-, root, root)
%{_libdir}/libmysqlclient*
+
+# 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
+* Tue Dec 22 2009 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Change RPM file naming:
+ - Suffix like "-m2", "-rc" becomes part of version as "_m2", "_rc".
+ - Release counts from 1, not 0.
+
diff --git a/support-files/RHEL4-SElinux/Makefile.am b/support-files/RHEL4-SElinux/Makefile.am
deleted file mode 100644
index 3289a94d1df..00000000000
--- a/support-files/RHEL4-SElinux/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (c) 2000, 2001, 2003-2007 MySQL AB
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library 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
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA 02110-1301, USA
-
-## Process this file with automake to create Makefile.in
-
-EXTRA_DIST = mysql.fc mysql.te
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/support-files/dtrace/locktime.d b/support-files/dtrace/locktime.d
new file mode 100644
index 00000000000..610da8fbffb
--- /dev/null
+++ b/support-files/dtrace/locktime.d
@@ -0,0 +1,65 @@
+#!/usr/sbin/dtrace -s
+#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# 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; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Shows the time that an individual lock is applied to a database and table
+# Shows the time to achieve the lock, and the time the table was locked
+
+o#pragma D option quiet
+
+mysql*:::handler-rdlock-start
+{
+ self->rdlockstart = timestamp;
+ this->lockref = strjoin(copyinstr(arg0),strjoin("@",copyinstr(arg1)));
+ self->lockmap[this->lockref] = self->rdlockstart;
+ printf("Start: Lock->Read %s.%s\n",copyinstr(arg0),copyinstr(arg1));
+}
+
+mysql*:::handler-wrlock-start
+{
+ self->wrlockstart = timestamp;
+ this->lockref = strjoin(copyinstr(arg0),strjoin("@",copyinstr(arg1)));
+ self->lockmap[this->lockref] = self->rdlockstart;
+ printf("Start: Lock->Write %s.%s\n",copyinstr(arg0),copyinstr(arg1));
+}
+
+mysql*:::handler-unlock-start
+{
+ self->unlockstart = timestamp;
+ this->lockref = strjoin(copyinstr(arg0),strjoin("@",copyinstr(arg1)));
+ printf("Start: Lock->Unlock %s.%s (%d ms lock duration)\n",
+ copyinstr(arg0),copyinstr(arg1),
+ (timestamp - self->lockmap[this->lockref])/1000000);
+}
+
+mysql*:::handler-rdlock-done
+{
+ printf("End: Lock->Read %d ms\n",
+ (timestamp - self->rdlockstart)/1000000);
+}
+
+mysql*:::handler-wrlock-done
+{
+ printf("End: Lock->Write %d ms\n",
+ (timestamp - self->wrlockstart)/1000000);
+}
+
+mysql*:::handler-unlock-done
+{
+ printf("End: Lock->Unlock %d ms\n",
+ (timestamp - self->unlockstart)/1000000);
+}
diff --git a/support-files/dtrace/query-execandqc.d b/support-files/dtrace/query-execandqc.d
new file mode 100644
index 00000000000..27dd5983fb0
--- /dev/null
+++ b/support-files/dtrace/query-execandqc.d
@@ -0,0 +1,52 @@
+#!/usr/sbin/dtrace -s
+#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# 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; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Show query execution times, indicating whether the query-cache was used
+
+#pragma D option quiet
+
+dtrace:::BEGIN
+{
+ printf("%-20s %-20s %-40s %2s %-9s\n", "Who", "Database", "Query", "QC", "Time(ms)");
+}
+
+mysql*:::query-start
+{
+ self->query = copyinstr(arg0);
+ self->connid = arg1;
+ self->db = copyinstr(arg2);
+ self->who = strjoin(copyinstr(arg3),strjoin("@",copyinstr(arg4)));
+ self->querystart = timestamp;
+ self->qc = 0;
+}
+
+mysql*:::query-cache-hit
+{
+ self->qc = 1;
+}
+
+mysql*:::query-cache-miss
+{
+ self->qc = 0;
+}
+
+mysql*:::query-done
+{
+ printf("%-20s %-20s %-40s %-2s %-9d\n",self->who,self->db,self->query,(self->qc ? "Y" : "N"),
+ (timestamp - self->querystart) / 1000000);
+}
diff --git a/support-files/dtrace/query-filesort-time.d b/support-files/dtrace/query-filesort-time.d
new file mode 100644
index 00000000000..0705f6ec556
--- /dev/null
+++ b/support-files/dtrace/query-filesort-time.d
@@ -0,0 +1,63 @@
+#!/usr/sbin/dtrace -s
+#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# 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; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Show the time taken for a query, including the time taken to
+# sort the results using filesort
+
+#pragma D option quiet
+
+dtrace:::BEGIN
+{
+ printf("%-2s %-10s %-10s %9s %18s %-s \n",
+ "St", "Who", "DB", "ConnID", "Dur microsec", "Query");
+}
+
+mysql*:::query-start
+{
+ self->query = copyinstr(arg0);
+ self->who = strjoin(copyinstr(arg3),strjoin("@",copyinstr(arg4)));
+ self->db = copyinstr(arg2);
+ self->connid = arg1;
+ self->querystart = timestamp;
+ self->filesort = 0;
+ self->fsdb = "";
+ self->fstable = "";
+}
+
+mysql*:::filesort-start
+{
+ self->filesort = timestamp;
+ self->fsdb = copyinstr(arg0);
+ self->fstable = copyinstr(arg1);
+}
+
+mysql*:::filesort-done
+{
+ this->elapsed = (timestamp - self->filesort) /1000;
+ printf("%2d %-10s %-10s %9d %18d Filesort on %s\n",
+ arg0, self->who, self->fsdb,
+ self->connid, this->elapsed, self->fstable);
+}
+
+mysql*:::query-done
+{
+ this->elapsed = (timestamp - self->querystart) /1000;
+ printf("%2d %-10s %-10s %9d %18d %s\n",
+ arg0, self->who, self->db,
+ self->connid, this->elapsed, self->query);
+}
diff --git a/support-files/dtrace/query-network-time.d b/support-files/dtrace/query-network-time.d
new file mode 100644
index 00000000000..1b425284873
--- /dev/null
+++ b/support-files/dtrace/query-network-time.d
@@ -0,0 +1,79 @@
+#!/usr/sbin/dtrace -s
+#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# 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; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Show the time taken to execute a query, include the bytes and time taken
+# to transfer the information over the network to/from the client
+
+#pragma D option quiet
+#pragma D option dynvarsize=4m
+
+dtrace:::BEGIN
+{
+ printf("%-2s %-30s %-10s %9s %18s %-s \n",
+ "St", "Who", "DB", "ConnID", "Dur microsec", "Query");
+}
+
+mysql*:::query-start
+{
+ self->query = copyinstr(arg0);
+ self->who = strjoin(copyinstr(arg3),strjoin("@",copyinstr(arg4)));
+ self->db = copyinstr(arg2);
+ self->connid = arg1;
+ self->querystart = timestamp;
+ self->netwrite = 0;
+ self->netwritecum = 0;
+ self->netwritebase = 0;
+ self->netread = 0;
+ self->netreadcum = 0;
+ self->netreadbase = 0;
+}
+
+mysql*:::net-write-start
+{
+ self->netwrite += arg0;
+ self->netwritebase = timestamp;
+}
+
+mysql*:::net-write-done
+{
+ self->netwritecum += (timestamp - self->netwritebase);
+ self->netwritebase = 0;
+}
+
+mysql*:::net-read-start
+{
+ self->netreadbase = timestamp;
+}
+
+mysql*:::net-read-done
+{
+ self->netread += arg1;
+ self->netreadcum += (timestamp - self->netreadbase);
+ self->netreadbase = 0;
+}
+
+mysql*:::query-done
+{
+ this->elapsed = (timestamp - self->querystart) /1000000;
+ printf("%2d %-30s %-10s %9d %18d %s\n",
+ arg0, self->who, self->db,
+ self->connid, this->elapsed, self->query);
+ printf("Net read: %d bytes (%d ms) write: %d bytes (%d ms)\n",
+ self->netread, (self->netreadcum/1000000),
+ self->netwrite, (self->netwritecum/1000000));
+}
diff --git a/support-files/dtrace/query-parse-time.d b/support-files/dtrace/query-parse-time.d
new file mode 100644
index 00000000000..211152afdd2
--- /dev/null
+++ b/support-files/dtrace/query-parse-time.d
@@ -0,0 +1,39 @@
+#!/usr/sbin/dtrace -s
+#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# 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; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Shows time take to actually parse the query statement
+
+#pragma D option quiet
+
+mysql*:::query-parse-start
+{
+ self->parsestart = timestamp;
+ self->parsequery = copyinstr(arg0);
+}
+
+mysql*:::query-parse-done
+/arg0 == 0/
+{
+ printf("Parsing %s: %d microseconds\n", self->parsequery,((timestamp - self->parsestart)/1000));
+}
+
+mysql*:::query-parse-done
+/arg0 != 0/
+{
+ printf("Error parsing %s: %d microseconds\n", self->parsequery,((timestamp - self->parsestart)/1000));
+}
diff --git a/support-files/dtrace/query-rowops.d b/support-files/dtrace/query-rowops.d
new file mode 100644
index 00000000000..04748955f6c
--- /dev/null
+++ b/support-files/dtrace/query-rowops.d
@@ -0,0 +1,82 @@
+#!/usr/sbin/dtrace -s
+#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# 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; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Calculates the time (and operations) for accessing data from individual
+# rows for each query
+
+#pragma D option quiet
+
+dtrace:::BEGIN
+{
+ printf("%-2s %-10s %-10s %9s %9s %-s \n",
+ "St", "Who", "DB", "ConnID", "Dur ms", "Query");
+}
+
+mysql*:::query-start
+{
+ self->query = copyinstr(arg0);
+ self->who = strjoin(copyinstr(arg3),strjoin("@",copyinstr(arg4)));
+ self->db = copyinstr(arg2);
+ self->connid = arg1;
+ self->querystart = timestamp;
+ self->rowdur = 0;
+}
+
+mysql*:::query-done
+{
+ this->elapsed = (timestamp - self->querystart) /1000000;
+ printf("%2d %-10s %-10s %9d %9d %s\n",
+ arg0, self->who, self->db,
+ self->connid, this->elapsed, self->query);
+}
+
+mysql*:::query-done
+/ self->rowdur /
+{
+ printf("%34s %9d %s\n", "", (self->rowdur/1000000), "-> Row ops");
+}
+
+mysql*:::insert-row-start
+{
+ self->rowstart = timestamp;
+}
+
+mysql*:::delete-row-start
+{
+ self->rowstart = timestamp;
+}
+
+mysql*:::update-row-start
+{
+ self->rowstart = timestamp;
+}
+
+mysql*:::insert-row-done
+{
+ self->rowdur += (timestamp-self->rowstart);
+}
+
+mysql*:::delete-row-done
+{
+ self->rowdur += (timestamp-self->rowstart);
+}
+
+mysql*:::update-row-done
+{
+ self->rowdur += (timestamp-self->rowstart);
+}
diff --git a/support-files/dtrace/query-time.d b/support-files/dtrace/query-time.d
new file mode 100644
index 00000000000..98e4b129838
--- /dev/null
+++ b/support-files/dtrace/query-time.d
@@ -0,0 +1,41 @@
+#!/usr/sbin/dtrace -s
+#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# 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; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Shows basic query execution time, who execute the query, and on what database
+
+#pragma D option quiet
+
+dtrace:::BEGIN
+{
+ printf("%-20s %-20s %-40s %-9s\n", "Who", "Database", "Query", "Time(ms)");
+}
+
+mysql*:::query-start
+{
+ self->query = copyinstr(arg0);
+ self->connid = arg1;
+ self->db = copyinstr(arg2);
+ self->who = strjoin(copyinstr(arg3),strjoin("@",copyinstr(arg4)));
+ self->querystart = timestamp;
+}
+
+mysql*:::query-done
+{
+ printf("%-20s %-20s %-40s %-9d\n",self->who,self->db,self->query,
+ (timestamp - self->querystart) / 1000000);
+}
diff --git a/support-files/dtrace/statement-time.d b/support-files/dtrace/statement-time.d
new file mode 100644
index 00000000000..10ef57039ad
--- /dev/null
+++ b/support-files/dtrace/statement-time.d
@@ -0,0 +1,61 @@
+#!/usr/sbin/dtrace -s
+#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# 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; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Creates a report on each query executed at the individual statement
+# level, showing rows matched, updated, and total query time
+
+#pragma D option quiet
+
+dtrace:::BEGIN
+{
+ printf("%-60s %-8s %-8s %-8s\n", "Query", "RowsU", "RowsM", "Dur (ms)");
+}
+
+mysql*:::update-start, mysql*:::insert-start,
+mysql*:::delete-start, mysql*:::multi-delete-start,
+mysql*:::multi-delete-done, mysql*:::select-start,
+mysql*:::insert-select-start, mysql*:::multi-update-start
+{
+ self->query = copyinstr(arg0);
+ self->querystart = timestamp;
+}
+
+mysql*:::insert-done, mysql*:::select-done,
+mysql*:::delete-done, mysql*:::multi-delete-done, mysql*:::insert-select-done
+/ self->querystart /
+{
+ this->elapsed = ((timestamp - self->querystart)/1000000);
+ printf("%-60s %-8d %-8d %d\n",
+ self->query,
+ 0,
+ arg1,
+ this->elapsed);
+ self->querystart = 0;
+}
+
+mysql*:::update-done, mysql*:::multi-update-done
+/ self->querystart /
+{
+ this->elapsed = ((timestamp - self->querystart)/1000000);
+ printf("%-60s %-8d %-8d %d\n",
+ self->query,
+ arg1,
+ arg2,
+ this->elapsed);
+ self->querystart = 0;
+}
diff --git a/support-files/dtrace/statement-type-aggregate.d b/support-files/dtrace/statement-type-aggregate.d
new file mode 100644
index 00000000000..784ee4aee9b
--- /dev/null
+++ b/support-files/dtrace/statement-type-aggregate.d
@@ -0,0 +1,62 @@
+#!/usr/sbin/dtrace -s
+#
+# Copyright (c) 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# 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; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Creates an aggregate report of the time spent perform queries of the four main
+# types (select, insert, update, delete)
+#
+# Report generated every 30s
+
+#pragma D option quiet
+
+dtrace:::BEGIN
+{
+ printf("Reporting...Control-C to stop\n");
+}
+
+mysql*:::update-start, mysql*:::insert-start,
+mysql*:::delete-start, mysql*:::multi-delete-start,
+mysql*:::multi-delete-done, mysql*:::select-start,
+mysql*:::insert-select-start, mysql*:::multi-update-start
+{
+ self->querystart = timestamp;
+}
+
+mysql*:::select-done
+{
+ @statements["select"] = sum(((timestamp - self->querystart)/1000000));
+}
+
+mysql*:::insert-done, mysql*:::insert-select-done
+{
+ @statements["insert"] = sum(((timestamp - self->querystart)/1000000));
+}
+
+mysql*:::update-done, mysql*:::multi-update-done
+{
+ @statements["update"] = sum(((timestamp - self->querystart)/1000000));
+}
+
+mysql*:::delete-done, mysql*:::multi-delete-done
+{
+ @statements["delete"] = sum(((timestamp - self->querystart)/1000000));
+}
+
+tick-30s
+{
+ printa(@statements);
+}
diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh
index 81786d20917..378a1df67aa 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
diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh
index ce958a34454..3fce97cf1d2 100644
--- a/support-files/my-innodb-heavy-4G.cnf.sh
+++ b/support-files/my-innodb-heavy-4G.cnf.sh
@@ -377,9 +377,10 @@ innodb_data_file_path = ibdata1:10M:autoextend
#innodb_data_home_dir = <directory>
# Number of IO threads to use for async IO operations. This value is
-# hardcoded to 4 on Unix, but on Windows disk I/O may benefit from a
+# hardcoded to 8 on Unix, but on Windows disk I/O may benefit from a
# larger number.
-innodb_file_io_threads = 4
+innodb_write_io_threads = 8
+innodb_read_io_threads = 8
# If you run into InnoDB tablespace corruption, setting this to a nonzero
# value will likely help you to dump your tables. Start from value 1 and
diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh
index 7460660025c..79d43407cda 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
diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh
index f15fce8f15f..4ec245e88b9 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
diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh
index 0fb4ec86d43..7b215988572 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
@@ -51,6 +51,13 @@ server-id = 1
# binary logging format - mixed recommended
#binlog_format=mixed
+# Causes updates to non-transactional engines using statement format to be
+# written directly to binary log. Before using this option make sure that
+# there are no dependencies between transactional and non-transactional
+# tables such as in the statement INSERT INTO t_myisam SELECT * FROM
+# t_innodb; otherwise, slaves may diverge from the master.
+#binlog_direct_non_transactional_updates=TRUE
+
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = @localstatedir@
#innodb_data_file_path = ibdata1:10M:autoextend
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.server.sh b/support-files/mysql.server.sh
index 8d8e91049f6..7487d5acc0f 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -53,13 +53,14 @@ datadir=
# Negative numbers mean to wait indefinitely
service_startup_timeout=900
+# Lock directory for RedHat / SuSE.
+lockdir='/var/lock/subsys'
+lock_file_path="$lockdir/mysql"
+
# The following variables are only set for letting mysql.server find things.
# Set some defaults
-pid_file=
-server_pid_file=
-use_mysqld_safe=1
-user=@MYSQLD_USER@
+mysqld_pid_file_path=
if test -z "$basedir"
then
basedir=@prefix@
@@ -101,11 +102,14 @@ else
}
fi
-PATH=/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin
+PATH="/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin"
export PATH
mode=$1 # start or stop
-shift
+
+[ $# -ge 1 ] && shift
+
+
other_args="$*" # uncommon, but needed when called from an RPM upgrade action
# Expected: "--skip-networking --skip-grant-tables"
# They are not checked here, intentionally, as it is the resposibility
@@ -131,59 +135,50 @@ parse_server_arguments() {
--datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'`
datadir_set=1
;;
- --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
- --pid-file=*) server_pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
+ --pid-file=*) mysqld_pid_file_path=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
- --use-mysqld_safe) use_mysqld_safe=1;;
- --use-manager) use_mysqld_safe=0;;
- esac
- done
-}
-
-parse_manager_arguments() {
- for arg do
- case "$arg" in
- --pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
- --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
esac
done
}
wait_for_pid () {
- verb="$1"
- manager_pid="$2" # process ID of the program operating on the pid-file
+ verb="$1" # created | removed
+ pid="$2" # process ID of the program operating on the pid-file
+ pid_file_path="$3" # path to the PID file.
+
i=0
avoid_race_condition="by checking again"
+
while test $i -ne $service_startup_timeout ; do
case "$verb" in
'created')
# wait for a PID-file to pop into existence.
- test -s $pid_file && i='' && break
+ test -s "$pid_file_path" && i='' && break
;;
'removed')
# wait for this PID-file to disappear
- test ! -s $pid_file && i='' && break
+ test ! -s "$pid_file_path" && i='' && break
;;
*)
- echo "wait_for_pid () usage: wait_for_pid created|removed manager_pid"
+ echo "wait_for_pid () usage: wait_for_pid created|removed pid pid_file_path"
exit 1
;;
esac
- # if manager isn't running, then pid-file will never be updated
- if test -n "$manager_pid"; then
- if kill -0 "$manager_pid" 2>/dev/null; then
- : # the manager still runs
+ # if server isn't running, then pid-file will never be updated
+ if test -n "$pid"; then
+ if kill -0 "$pid" 2>/dev/null; then
+ : # the server still runs
else
- # The manager may have exited between the last pid-file check and now.
+ # The server may have exited between the last pid-file check and now.
if test -n "$avoid_race_condition"; then
avoid_race_condition=""
continue # Check again.
fi
# there's nothing that will affect the file.
- log_failure_msg "Manager of pid-file quit without updating file."
+ log_failure_msg "The server quit without updating PID file ($pid_file_path)."
return 1 # not waiting any more.
fi
fi
@@ -191,6 +186,7 @@ wait_for_pid () {
echo $echo_n ".$echo_c"
i=`expr $i + 1`
sleep 1
+
done
if test -z "$i" ; then
@@ -259,28 +255,16 @@ fi
parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server`
-# Look for the pidfile
-parse_manager_arguments `$print_defaults $extra_args manager`
-
#
# Set pid file if not given
#
-if test -z "$pid_file"
-then
- pid_file=$datadir/mysqlmanager-`@HOSTNAME@`.pid
-else
- case "$pid_file" in
- /* ) ;;
- * ) pid_file="$datadir/$pid_file" ;;
- esac
-fi
-if test -z "$server_pid_file"
+if test -z "$mysqld_pid_file_path"
then
- server_pid_file=$datadir/`@HOSTNAME@`.pid
+ mysqld_pid_file_path=$datadir/`@HOSTNAME@`.pid
else
- case "$server_pid_file" in
+ case "$mysqld_pid_file_path" in
/* ) ;;
- * ) server_pid_file="$datadir/$server_pid_file" ;;
+ * ) mysqld_pid_file_path="$datadir/$mysqld_pid_file_path" ;;
esac
fi
@@ -291,53 +275,23 @@ case "$mode" in
# Safeguard (relative paths, core dumps..)
cd $basedir
- manager=$bindir/mysqlmanager
- if test -x $libexecdir/mysqlmanager
- then
- manager=$libexecdir/mysqlmanager
- elif test -x $sbindir/mysqlmanager
- then
- manager=$sbindir/mysqlmanager
- fi
-
echo $echo_n "Starting MySQL"
- if test -x $manager -a "$use_mysqld_safe" = "0"
- then
- if test -n "$other_args"
- then
- log_failure_msg "MySQL manager does not support options '$other_args'"
- exit 1
- fi
- # Give extra arguments to mysqld with the my.cnf file. This script may
- # be overwritten at next upgrade.
- "$manager" \
- --mysqld-safe-compatible \
- --user="$user" \
- --pid-file="$pid_file" >/dev/null 2>&1 &
- wait_for_pid created $!; return_value=$?
-
- # Make lock for RedHat / SuSE
- if test -w /var/lock/subsys
- then
- touch /var/lock/subsys/mysqlmanager
- fi
- exit $return_value
- elif test -x $bindir/mysqld_safe
+ if test -x $bindir/mysqld_safe
then
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
- pid_file=$server_pid_file
- $bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &
- wait_for_pid created $!; return_value=$?
+ $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &
+ wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=$?
# Make lock for RedHat / SuSE
- if test -w /var/lock/subsys
+ if test -w "$lockdir"
then
- touch /var/lock/subsys/mysql
+ touch "$lock_file_path"
fi
+
exit $return_value
else
- log_failure_msg "Couldn't find MySQL manager ($manager) or server ($bindir/mysqld_safe)"
+ log_failure_msg "Couldn't find MySQL server ($bindir/mysqld_safe)"
fi
;;
@@ -345,39 +299,29 @@ case "$mode" in
# Stop daemon. We use a signal here to avoid having to know the
# root password.
- # The RedHat / SuSE lock directory to remove
- lock_dir=/var/lock/subsys/mysqlmanager
-
- # If the manager pid_file doesn't exist, try the server's
- if test ! -s "$pid_file"
+ if test -s "$mysqld_pid_file_path"
then
- pid_file=$server_pid_file
- lock_dir=/var/lock/subsys/mysql
- fi
+ mysqld_pid=`cat "$mysqld_pid_file_path"`
- if test -s "$pid_file"
- then
- mysqlmanager_pid=`cat $pid_file`
-
- if (kill -0 $mysqlmanager_pid 2>/dev/null)
+ if (kill -0 $mysqld_pid 2>/dev/null)
then
echo $echo_n "Shutting down MySQL"
- kill $mysqlmanager_pid
- # mysqlmanager should remove the pid_file when it exits, so wait for it.
- wait_for_pid removed "$mysqlmanager_pid"; return_value=$?
+ kill $mysqld_pid
+ # mysqld should remove the pid file when it exits, so wait for it.
+ wait_for_pid removed "$mysqld_pid" "$mysqld_pid_file_path"; return_value=$?
else
- log_failure_msg "MySQL manager or server process #$mysqlmanager_pid is not running!"
- rm $pid_file
+ log_failure_msg "MySQL server process #$mysqld_pid is not running!"
+ rm "$mysqld_pid_file_path"
fi
-
- # delete lock for RedHat / SuSE
- if test -f $lock_dir
+
+ # Delete lock for RedHat / SuSE
+ if test -f "$lock_file_path"
then
- rm -f $lock_dir
+ rm -f "$lock_file_path"
fi
exit $return_value
else
- log_failure_msg "MySQL manager or server PID file could not be found!"
+ log_failure_msg "MySQL server PID file could not be found!"
fi
;;
@@ -393,10 +337,10 @@ case "$mode" in
;;
'reload'|'force-reload')
- if test -s "$server_pid_file" ; then
- read mysqld_pid < $server_pid_file
+ if test -s "$mysqld_pid_file_path" ; then
+ read mysqld_pid < "$mysqld_pid_file_path"
kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL"
- touch $server_pid_file
+ touch "$mysqld_pid_file_path"
else
log_failure_msg "MySQL PID file could not be found!"
exit 1
@@ -404,8 +348,8 @@ case "$mode" in
;;
'status')
# First, check to see if pid file exists
- if test -s "$server_pid_file" ; then
- read mysqld_pid < $server_pid_file
+ if test -s "$mysqld_pid_file_path" ; then
+ read mysqld_pid < "$mysqld_pid_file_path"
if kill -0 $mysqld_pid 2>/dev/null ; then
log_success_msg "MySQL running ($mysqld_pid)"
exit 0
@@ -423,13 +367,8 @@ case "$mode" in
log_failure_msg "Multiple MySQL running but PID file could not be found ($mysqld_pid)"
exit 5
elif test -z $mysqld_pid ; then
- if test "$use_mysqld_safe" = "0" ; then
- lockfile=/var/lock/subsys/mysqlmanager
- else
- lockfile=/var/lock/subsys/mysql
- fi
- if test -f $lockfile ; then
- log_failure_msg "MySQL is not running, but lock exists"
+ if test -f "$lock_file_path" ; then
+ log_failure_msg "MySQL is not running, but lock file ($lock_file_path) exists"
exit 2
fi
log_failure_msg "MySQL is not running"
@@ -442,7 +381,8 @@ case "$mode" in
;;
*)
# usage
- echo "Usage: $0 {start|stop|restart|reload|force-reload|status} [ MySQL server options ]"
+ basename=`basename "$0"`
+ echo "Usage: $basename {start|stop|restart|reload|force-reload|status} [ MySQL server options ]"
exit 1
;;
esac
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index 115a1380e32..bac22fc96a9 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -20,127 +20,240 @@
# 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_2 Sun Microsystems, Inc.
-%define mysql_vendor Oracle and/or its affiliates
-
-%define mysql_version @VERSION@
-
-%define mysqld_user mysql
-%define mysqld_group mysql
-%define mysqldatadir /var/lib/mysql
-%define see_base For a description of MySQL see the base MySQL RPM or http://www.mysql.com
-
-# ------------------------------------------------------------------------------
-# 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.
+%define mysql_old_vendor MySQL AB
+%define mysql_vendor_2 Sun Microsystems, Inc.
+%define mysql_vendor Oracle and/or its affiliates
+
+%define mysql_version @VERSION@
+
+%define mysqld_user mysql
+%define mysqld_group mysql
+%define mysqldatadir /var/lib/mysql
+
+%define release 1
+
+#
+# Macros we use which are not available in all supported versions of RPM
#
-# 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
-
-# ------------------------------------------------------------------------------
-# 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
-# ------------------------------------------------------------------------------
+# - 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
+
+# ----------------------------------------------------------------------------
+# 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>" ...
+#
-# ----------------------------------------------------------------------
-# 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}
+# ----------------------------------------------------------------------------
+# Commercial builds
+# ----------------------------------------------------------------------------
+%if %{undefined commercial}
+%define commercial 0
+%endif
-# ----------------------------------------------------------------------
-# use "rpmbuild --without bundled_zlib" or "rpm --define '_without_bundled_zlib 1'"
-# (for RPM 3.x) to not build using the bundled zlib (on by default)
-# ----------------------------------------------------------------------
-%{!?_with_bundled_zlib: %{!?_without_bundled_zlib: %define WITH_BUNDLED_ZLIB 1}}
-%{?_with_bundled_zlib:%define WITH_BUNDLED_ZLIB 1}
-%{?_without_bundled_zlib:%define WITH_BUNDLED_ZLIB 0}
+# ----------------------------------------------------------------------------
+# Source name
+# ----------------------------------------------------------------------------
+%if %{undefined src_base}
+%define src_base mysql
+%endif
+%define src_dir %{src_base}-%{mysql_version}
-# ----------------------------------------------------------------------
-# use "rpmbuild --without innodb_plugin" or "rpm --define '_without_innodb_plugin 1'"
-# (for RPM 3.x) to not build the innodb plugin (on by default with innodb builds)
-# ----------------------------------------------------------------------
-%{!?_with_innodb_plugin: %{!?_without_innodb_plugin: %define WITH_INNODB_PLUGIN 1}}
-%{?_with_innodb_plugin:%define WITH_INNODB_PLUGIN 1}
-%{?_without_innodb_plugin:%define WITH_INNODB_PLUGIN 0}
+# ----------------------------------------------------------------------------
+# Feature set (storage engines, options). Default to community (everything)
+# ----------------------------------------------------------------------------
+%if %{undefined feature_set}
+%define feature_set community
+%endif
-# ----------------------------------------------------------------------
-# 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}
+# ----------------------------------------------------------------------------
+# 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 definitions - set for a "community" package
-##############################################################################
+# ----------------------------------------------------------------------------
+# 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
-%define server_suffix -community
-%define package_suffix -community
-%define ndbug_comment MySQL Community Server (GPL)
-%define debug_comment MySQL Community Server - Debug (GPL)
-%define commercial 0
-%define EMBEDDED_BUILD 1
-%define PARTITION_BUILD 1
-# Default for CLUSTER_BUILD is "0", but command line option may override it
-%define COMMUNITY_BUILD 1
-%define INNODB_BUILD 1
-%define NORMAL_TEST_MODE test-bt
-%define DEBUG_TEST_MODE test-bt-debug
+%if %{undefined server_suffix}
+%define server_suffix %{nil}
+%endif
+
+# ----------------------------------------------------------------------------
+# Distribution support
+# ----------------------------------------------------------------------------
+%if %{undefined distro_specific}
+%define distro_specific 0
+%endif
+%if %{distro_specific}
+ %if %(test -f /etc/enterprise-release && echo 1 || echo 0)
+ %define oelver %(rpm -qf --qf '%%{version}\\n' /etc/enterprise-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
+ %if "%oelver" == "4"
+ %define distro_description Oracle Enterprise Linux 4
+ %define distro_releasetag oel4
+ %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
+ %else
+ %if "%oelver" == "5"
+ %define distro_description Oracle Enterprise Linux 5
+ %define distro_releasetag oel5
+ %define distro_buildreq gcc-c++ gperf ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
+ %else
+ %{error:Oracle Enterprise Linux %{oelver} is unsupported}
+ %endif
+ %endif
+ %else
+ %if %(test -f /etc/oracle-release && echo 1 || echo 0)
+ %define elver %(rpm -qf --qf '%%{version}\\n' /etc/oracle-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
+ %if "%elver" == "6"
+ %define distro_description Oracle Linux 6
+ %define distro_releasetag el6
+ %define distro_buildreq gcc-c++ ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
+ %else
+ %{error:Oracle Linux %{elver} is unsupported}
+ %endif
+ %else
+ %if %(test -f /etc/redhat-release && echo 1 || echo 0)
+ %define rhelver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g')
+ %if "%rhelver" == "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 net-tools
+ %else
+ %if "%rhelver" == "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 net-tools
+ %else
+ %if "%rhelver" == "6"
+ %define distro_description Red Hat Enterprise Linux 6
+ %define distro_releasetag rhel6
+ %define distro_buildreq gcc-c++ ncurses-devel perl readline-devel time zlib-devel
+ %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools
+ %else
+ %{error:Red Hat Enterprise Linux %{rhelver} is unsupported}
+ %endif
+ %endif
+ %endif
+ %else
+ %if %(test -f /etc/SuSE-release && echo 1 || echo 0)
+ %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release | cut -d. -f1)
+ %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
+ %endif
+ %endif
+%else
+ %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
+
+# Avoid debuginfo RPMs, leaves binaries unstripped
+%define debug_package %{nil}
+
+# Hack to work around bug in RHEL5 __os_install_post macro, wrong inverted
+# test for __debug_package
+%define __strip /bin/true
-%define release 1.glibc23
+# ----------------------------------------------------------------------------
+# Support optional "tcmalloc" library (experimental)
+# ----------------------------------------------------------------------------
+%if %{defined malloc_lib_target}
+%define WITH_TCMALLOC 1
+%else
+%define WITH_TCMALLOC 0
+%endif
+
+##############################################################################
+# Configuration based upon above user input, not to be set directly
+##############################################################################
-%define mysql_license GPL
-%define src_dir mysql-%{mysql_version}
+%if %{commercial}
+%define license_files_server %{src_dir}/LICENSE.mysql
+%define license_type Commercial
+%else
+%define license_files_server %{src_dir}/COPYING %{src_dir}/README
+%define license_type GPL
+%endif
##############################################################################
# Main spec file section
##############################################################################
-Name: MySQL
-Summary: MySQL: a very fast and reliable SQL database server
-Group: Applications/Databases
-Version: @MYSQL_U_SCORE_VERSION@
-Release: %{release}
-License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{mysql_license} 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_vendor} Product Engineering Team <build@mysql.com>
-Vendor: %{mysql_vendor}
-Provides: msqlormysql MySQL-server mysql
-BuildRequires: ncurses-devel
-Obsoletes: mysql
+Name: MySQL%{product_suffix}
+Summary: MySQL: a very fast and reliable SQL database server
+Group: Applications/Databases
+Version: @MYSQL_RPM_VERSION@
+Release: %{release}%{?distro_releasetag:.%{distro_releasetag}}
+Distribution: %{distro_description}
+License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. 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 Release Engineering <mysql-build@oss.oracle.com>
+Vendor: %{mysql_vendor}
+Provides: msqlormysql MySQL-server mysql
+BuildRequires: %{distro_buildreq}
+
+# Regression tests may take a long time, override the default to skip them
+%{!?runselftest:%global runselftest 1}
# Think about what you use here since the first step is to
# run a rm -rf
@@ -154,10 +267,12 @@ is intended for mission-critical, heavy-load production systems as well
as for embedding into mass-deployed software. MySQL is a trademark of
%{mysql_vendor}
-Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved.
-
-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
@@ -167,469 +282,311 @@ documentation and the manual for more information.
# Sub package definition
##############################################################################
-%package server
+%package -n MySQL-server%{product_suffix}
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 MySQL mysql-server MySQL-server
-Obsoletes: mysql MySQL mysql-server MySQL-server
+Requires: %{distro_requires}
+Provides: msqlormysql MySQL MySQL-server
+Conflicts: mysql mysql-server mysql-advanced mysql-server-advanced
+Obsoletes: MySQL MySQL-server
Obsoletes: MySQL-server-classic MySQL-server-community MySQL-server-enterprise
Obsoletes: MySQL-server-advanced MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
-%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
%{mysql_vendor}
-Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved.
+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
-%if %{INNODB_BUILD}
-(configured including InnoDB)
-%endif
-as well as related utilities to run and administer 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 "MySQL-client%{product_suffix}" as well!
-# ------------------------------------------------------------------------------
-
-%package client
+# ----------------------------------------------------------------------------
+%package -n MySQL-client%{product_suffix}
Summary: MySQL - Client
Group: Applications/Databases
-Provides: mysql-client MySQL-client
-Obsoletes: mysql-client MySQL-client
+Provides: MySQL-client
+Conflicts: mysql mysql-advanced
+Obsoletes: MySQL-client
Obsoletes: MySQL-client-classic MySQL-client-community MySQL-client-enterprise
Obsoletes: MySQL-client-advanced MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
-%description client
+%description -n MySQL-client%{product_suffix}
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
+For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
-# ------------------------------------------------------------------------------
-
-%package test
+# ----------------------------------------------------------------------------
+%package -n MySQL-test%{product_suffix}
Summary: MySQL - Test suite
Group: Applications/Databases
-Requires: %{name}-client perl
-Provides: mysql-test MySQL-test
-Obsoletes: mysql-test MySQL-test
+Requires: MySQL-client perl
+Provides: MySQL-test
+Conflicts: mysql-test mysql-test-advanced
+Obsoletes: MySQL-test
Obsoletes: mysql-bench MySQL-bench
Obsoletes: MySQL-test-classic MySQL-test-community MySQL-test-enterprise
Obsoletes: MySQL-test-advanced MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
-AutoReqProv: no
+AutoReqProv: no
-%description test
+%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
+# ----------------------------------------------------------------------------
+%package -n MySQL-devel%{product_suffix}
Summary: MySQL - Development header files and libraries
Group: Applications/Databases
-Provides: mysql-devel MySQL-devel
-Obsoletes: mysql-devel MySQL-devel
+Provides: MySQL-devel
+Conflicts: mysql-devel mysql-embedded-devel mysql-devel-advanced mysql-embedded-devel-advanced
+Obsoletes: MySQL-devel
Obsoletes: MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise
Obsoletes: MySQL-devel-advanced MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl
-%description devel
-This package contains the development header files and libraries
-necessary to develop MySQL client applications.
-
-%{see_base}
+%description -n MySQL-devel%{product_suffix}
+This package contains the development header files and libraries necessary
+to develop MySQL client applications.
-# ------------------------------------------------------------------------------
+For a description of MySQL see the base MySQL RPM or http://www.mysql.com/
-%package shared
+# ----------------------------------------------------------------------------
+%package -n MySQL-shared%{product_suffix}
Summary: MySQL - Shared libraries
Group: Applications/Databases
-Provides: mysql-shared MySQL-shared
-Obsoletes: mysql-shared MySQL-shared-standard MySQL-shared-pro
+Provides: MySQL-shared
+Obsoletes: MySQL-shared-standard MySQL-shared-pro
Obsoletes: MySQL-shared-pro-cert MySQL-shared-pro-gpl
Obsoletes: MySQL-shared-pro-gpl-cert MySQL-shared
Obsoletes: MySQL-shared-classic MySQL-shared-community MySQL-shared-enterprise
Obsoletes: MySQL-shared-advanced MySQL-shared-advanced-gpl MySQL-shared-enterprise-gpl
-%description shared
-This package contains the shared libraries (*.so*) which certain
-languages and applications need to dynamically load and use MySQL.
-
-# ------------------------------------------------------------------------------
-
-%if %{EMBEDDED_BUILD}
+%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
+# ----------------------------------------------------------------------------
+%package -n MySQL-embedded%{product_suffix}
Summary: MySQL - Embedded library
Group: Applications/Databases
-Requires: %{name}-devel
-Provides: mysql-embedded MySQL-embedded
-Obsoletes: mysql-embedded MySQL-embedded
+Requires: MySQL-devel
+Provides: MySQL-embedded
+Conflicts: mysql-embedded mysql-embedded-advanced
+Obsoletes: MySQL-embedded
Obsoletes: MySQL-embedded-pro
Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise
Obsoletes: MySQL-embedded-advanced MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl
-%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}
-
-%endif
+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}
##############################################################################
-# The actual build
-##############################################################################
-
%build
-BuildMySQL() {
-# Let "MYSQL_BUILD_*FLAGS" take precedence.
-CFLAGS=${MYSQL_BUILD_CFLAGS:-$CFLAGS}
-CXXFLAGS=${MYSQL_BUILD_CXXFLAGS:-$CXXFLAGS}
-LDFLAGS=${MYSQL_BUILD_LDFLAGS:-$LDFLAGS}
-# Fall back on RPM_OPT_FLAGS (part of RPM environment) if no flags are given.
-CFLAGS=${CFLAGS:-$RPM_OPT_FLAGS}
-CXXFLAGS=${CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti }
-# Evaluate current setting of $DEBUG
-if [ $DEBUG -gt 0 ] ; then
- OPT_COMMENT='--with-comment="%{debug_comment}"'
- OPT_DEBUG='--with-debug --enable-mysql-maintainer-mode=no'
- 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/ $//'`
-else
- OPT_COMMENT='--with-comment="%{ndbug_comment}"'
- OPT_DEBUG=''
-fi
-# The --enable-assembler simply does nothing on systems that does not
-# support assembler speedups.
-sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
- CC=\"${MYSQL_BUILD_CC:-$CC}\" \
- CXX=\"${MYSQL_BUILD_CXX:-$CXX}\" \
- CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" \
- LDFLAGS=\"$LDFLAGS\" \
- ./configure \
- $* \
- --with-mysqld-ldflags='-static' \
- --with-client-ldflags='-static' \
- --enable-assembler \
- --enable-local-infile \
- --with-fast-mutexes \
- --with-mysqld-user=%{mysqld_user} \
- --with-unix-socket-path=%{mysqldatadir}/mysql.sock \
- --with-pic \
- --prefix=/ \
-%if %{CLUSTER_BUILD}
- --with-extra-charsets=all \
-%else
- --with-extra-charsets=complex \
+# Fail quickly and obviously if user tries to build as root
+%if %runselftest
+ if [ x"`id -u`" = x0 ]; then
+ echo "The MySQL regression tests may fail if run as root."
+ echo "If you really need to build the RPM as root, use"
+ echo "--define='runselftest 0' to skip the regression tests."
+ exit 1
+ fi
%endif
-%if %{YASSL_BUILD}
- --with-ssl \
-%else
- --without-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 \
- $OPT_COMMENT \
- $OPT_DEBUG \
- --with-readline \
-%if %{WITH_BUNDLED_ZLIB}
- --with-zlib-dir=bundled \
-%endif
-%if %{CLUSTER_BUILD}
- --with-plugin-ndbcluster \
-%else
- --without-plugin-ndbcluster \
-%endif
-%if %{INNODB_BUILD}
- --with-plugin-innobase \
-%if %{WITH_INNODB_PLUGIN}
-%else
- --without-plugin-innodb_plugin \
-%endif
-%else
- --without-plugin-innobase \
- --without-plugin-innodb_plugin \
-%endif
-%if %{PARTITION_BUILD}
- --with-plugin-partition \
-%else
- --without-plugin-partition \
-%endif
- --with-plugin-csv \
- --with-plugin-archive \
- --with-plugin-blackhole \
- --with-plugin-federated \
- --without-plugin-daemon_example \
- --without-plugin-ftexample \
-%if %{EMBEDDED_BUILD}
- --with-embedded-server \
-%else
- --without-embedded-server \
-%endif
- --with-big-tables \
- --enable-shared \
- "
- make
-}
-# end of function definition "BuildMySQL"
-
-# 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" CXX="gcc"
-fi
-
-
-##############################################################################
-#
-# 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.
#
-##############################################################################
+# This is a hack, $RPM_OPT_FLAGS on ia64 hosts contains flags which break
+# the compile in cmd-line-utils/readline - needs investigation, but for now
+# we simply unset it and use those specified directly in cmake.
+%if "%{_arch}" == "ia64"
+RPM_OPT_FLAGS=
+%endif
+
+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}}
+export MAKE_JFLAG=${MYSQL_BUILD_MAKE_JFLAG:-}
+
+# Build debug mysqld and libmysqld.a
+mkdir debug
(
-# We are in a subshell, so we can modify variables just for one run.
-
-# Add -g and --with-debug.
-DEBUG=1
-cd mysql-debug-%{mysql_version} &&
-CFLAGS="$CFLAGS" \
-CXXFLAGS="$CXXFLAGS" \
-BuildMySQL
+ 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="%{mysqldatadir}/mysql.sock" \
+ -DFEATURE_SET="%{feature_set}" \
+ -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \
+ -DMYSQL_SERVER_SUFFIX="%{server_suffix}"
+ echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG
+ make ${MAKE_JFLAG} VERBOSE=1
)
-
-# 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
-#
-##############################################################################
-
-DEBUG=0
-(cd mysql-release-%{mysql_version} &&
-CFLAGS="$CFLAGS" \
-CXXFLAGS="$CXXFLAGS" \
-BuildMySQL
+# 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="%{mysqldatadir}/mysql.sock" \
+ -DFEATURE_SET="%{feature_set}" \
+ -DCOMPILATION_COMMENT="%{compilation_comment_release}" \
+ -DMYSQL_SERVER_SUFFIX="%{server_suffix}"
+ echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG
+ make ${MAKE_JFLAG} VERBOSE=1
)
-# 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 mysql-release-%{mysql_version} ; make test-bt)
+%if %runselftest
+ MTR_BUILD_THREAD=auto
+ export MTR_BUILD_THREAD
-##############################################################################
-
-# For gcc builds, include libgcc.a in the devel subpackage (BUG 4921)
-# Some "icc" calls may have "gcc" in the argument string, so we should first
-# check for "icc". (If we don't check, the "--print-libgcc-file" call will fail.)
-if expr "$CC" : ".*icc.*" > /dev/null ;
-then
- %define WITH_LIBGCC 0
- :
-elif expr "$CC" : ".*gcc.*" > /dev/null ;
-then
- libgcc=`$CC $CFLAGS --print-libgcc-file`
- if [ -f $libgcc ]
- then
- %define WITH_LIBGCC 1
- install -m 644 $libgcc $RBR%{_libdir}/mysql/libmygcc.a
- else
- %define WITH_LIBGCC 0
- :
- fi
-else
- %define WITH_LIBGCC 0
- :
-fi
+ (cd release && make test-bt-fast || true)
+%endif
##############################################################################
-
%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}
install -d $RBR%{mysqldatadir}/mysql
install -d $RBR%{_datadir}/mysql-test
+install -d $RBR%{_datadir}/mysql/SELinux/RHEL4
install -d $RBR%{_includedir}
install -d $RBR%{_libdir}
install -d $RBR%{_mandir}
install -d $RBR%{_sbindir}
-
# 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}/
+(
+ cd $MBD/release
+ make DESTDIR=$RBR install
+)
-# 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
+# For gcc builds, include libgcc.a in the devel subpackage (BUG 4921). Do
+# this in a sub-shell to ensure we don't pollute the install environment
+# with compiler bits.
+(
+ PATH=${MYSQL_BUILD_PATH:-$PATH}
+ CC=${MYSQL_BUILD_CC:-${CC:-gcc}}
+ CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}}
+ if "${CC}" -v 2>&1 | grep '^gcc.version' >/dev/null 2>&1; then
+ libgcc=`${CC} ${CFLAGS} --print-libgcc-file`
+ if [ -f ${libgcc} ]; then
+ 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 saved perror binary with NDB support (BUG#13740)
-install -m 755 $MBD/extra/perror $RBR%{_bindir}/perror
+# 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 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
-
-%if %{EMBEDDED_BUILD}
-# Install embedded server library in the build root
-install -m 644 $MBD/libmysqld/libmysqld.a $RBR%{_libdir}/mysql/
-%endif
-
-# in RPMs, it is unlikely that anybody should use "sql-bench"
-rm -fr $RBR%{_datadir}/sql-bench
+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 and mysqlmanager.passwd
-# (MySQL Instance Manager password file) might be located
+# 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
-touch $RBR%{_sysconfdir}/mysqlmanager.passwd
+
+# Install SELinux files in datadir
+install -m 600 $MBD/%{src_dir}/support-files/RHEL4-SElinux/mysql.{fc,te} \
+ $RBR%{_datadir}/mysql/SELinux/RHEL4
+
+%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
+# `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
+
+# Remove man pages we explicitly do not want to package, avoids 'unpackaged
+# files' warning.
+# This has become obsolete: rm -f $RBR%{_mandir}/man1/make_win_bin_dist.1*
##############################################################################
# Post processing actions, i.e. when installed
##############################################################################
-%pre server
+%pre -n MySQL-server%{product_suffix}
# This is the code running at the beginning of a RPM upgrade action,
# before replacing the old files with the new ones.
+# ATTENTION: Parts of this are duplicated in the "triggerpostun" !
+
# There are users who deviate from the default file system layout.
# Check local settings to support them.
if [ -x %{_bindir}/my_print_defaults ]
@@ -649,8 +606,13 @@ fi
# Check if we can safely upgrade. An upgrade is only safe if it's from one
# of our RPMs in the same version family.
+# Handle both ways of spelling the capability.
installed=`rpm -q --whatprovides mysql-server 2> /dev/null`
+if [ $? -ne 0 -o -z "$installed" ]; then
+ installed=`rpm -q --whatprovides MySQL-server 2> /dev/null`
+fi
if [ $? -eq 0 -a -n "$installed" ]; then
+ installed=`echo $installed | sed 's/\([^ ]*\) .*/\1/'` # Tests have shown duplicated package names
vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1`
version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1`
myoldvendor='%{mysql_old_vendor}'
@@ -658,15 +620,19 @@ if [ $? -eq 0 -a -n "$installed" ]; then
myvendor='%{mysql_vendor}'
myversion='%{mysql_version}'
- old_family=`echo $version | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
- new_family=`echo $myversion | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
+ old_family=`echo $version \
+ | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
+ new_family=`echo $myversion \
+ | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
[ -z "$vendor" ] && vendor='<unknown>'
[ -z "$old_family" ] && old_family="<unrecognized version $version>"
[ -z "$new_family" ] && new_family="<bad package specification: version $myversion>"
error_text=
- if [ "$vendor" != "$myoldvendor" -a "$vendor" != "$myvendor_2" -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, $myvendor_2, or $myvendor.
@@ -783,15 +749,17 @@ fi
# so a "stop" is attempted even if there is no PID file.
# (Maybe the "stop" doesn't work then, but we might fix that in itself.)
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
+ %{_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}
# This is the code running at the end of a RPM install or upgrade action,
# after the (new) files have been written.
+# ATTENTION: Parts of this are duplicated in the "triggerpostun" !
+
# There are users who deviate from the default file system layout.
# Check local settings to support them.
if [ -x %{_bindir}/my_print_defaults ]
@@ -813,7 +781,7 @@ if [ ! -d $mysql_datadir ] ; then mkdir -m 755 $mysql_datadir; fi
if [ -f $STATUS_FILE ] ; then
SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-`
else
- SERVER_TO_START='true' # This is for 5.1 only, to not change behavior
+ SERVER_TO_START=''
fi
# echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
if [ ! -d $mysql_datadir/mysql ] ; then
@@ -829,12 +797,12 @@ fi
# ----------------------------------------------------------------------
# NOTE: This still needs to be debated. Should we check whether these links
# for the other run levels exist(ed) before the upgrade?
+# use chkconfig on Enterprise Linux and newer SuSE releases
+if [ -x /sbin/chkconfig ] ; then
+ /sbin/chkconfig --add mysql
# use insserv for older SuSE Linux versions
-if [ -x /sbin/insserv ] ; then
- /sbin/insserv %{_sysconfdir}/init.d/mysql
-# use chkconfig on Red Hat and newer SuSE releases
-elif [ -x /sbin/chkconfig ] ; then
- /sbin/chkconfig --add mysql
+elif [ -x /sbin/insserv ] ; then
+ /sbin/insserv %{_sysconfdir}/init.d/mysql
fi
# ----------------------------------------------------------------------
@@ -842,8 +810,10 @@ fi
# 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
-# The user may already exist, make sure it has the proper group nevertheless (BUG#12823)
+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
# ----------------------------------------------------------------------
@@ -878,86 +848,180 @@ chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
chmod -R og-rw $mysql_datadir/mysql
# ----------------------------------------------------------------------
-# Deal with SELinux, if it is installed / used
+# install SELinux files - but don't override existing ones
# ----------------------------------------------------------------------
-if [ -x /sbin/restorecon ] ; then
- /sbin/restorecon -R %{mysqldatadir}
+SETARGETDIR=/etc/selinux/targeted/src/policy
+SEDOMPROG=$SETARGETDIR/domains/program
+SECONPROG=$SETARGETDIR/file_contexts/program
+if [ -f /etc/redhat-release ] \
+ && (grep -q "Red Hat Enterprise Linux .. release 4" /etc/redhat-release \
+ || grep -q "CentOS release 4" /etc/redhat-release) ; then
+ echo
+ echo
+ echo 'Notes regarding SELinux on this platform:'
+ echo '========================================='
+ echo
+ echo 'The default policy might cause server startup to fail because it is'
+ echo 'not allowed to access critical files. In this case, please update'
+ echo 'your installation.'
+ echo
+ echo 'The default policy might also cause inavailability of SSL related'
+ echo 'features because the server is not allowed to access /dev/random'
+ echo 'and /dev/urandom. If this is a problem, please do the following:'
+ echo
+ echo ' 1) install selinux-policy-targeted-sources from your OS vendor'
+ echo ' 2) add the following two lines to '$SEDOMPROG/mysqld.te':'
+ echo ' allow mysqld_t random_device_t:chr_file read;'
+ echo ' allow mysqld_t urandom_device_t:chr_file read;'
+ echo ' 3) cd to '$SETARGETDIR' and issue the following command:'
+ echo ' make load'
+ echo
+ echo
+fi
+
+if [ -x sbin/restorecon ] ; then
+ sbin/restorecon -R var/lib/mysql
fi
# Was the server running before the upgrade? If so, restart the new one.
if [ "$SERVER_TO_START" = "true" ] ; then
# Restart in the same way that mysqld will be started normally.
- %{_sysconfdir}/init.d/mysql start
-
- # Allow mysqld_safe to start mysqld and print a message before we exit
- sleep 2
+ if [ -x %{_sysconfdir}/init.d/mysql ] ; then
+ %{_sysconfdir}/init.d/mysql start
+ echo "Giving mysqld 5 seconds to start"
+ sleep 5
+ fi
fi
-#echo "Thank you for installing the MySQL Community Server! For Production
-#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."
-
# Collect an upgrade history ...
echo "Upgrade/install finished at `date`" >> $STATUS_FILE
echo >> $STATUS_FILE
echo "=====" >> $STATUS_FILE
STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY
cat $STATUS_FILE >> $STATUS_HISTORY
-rm $STATUS_FILE
-
-%if %{CLUSTER_BUILD}
-%post ndb-storage
-mysql_clusterdir=/var/lib/mysql-cluster
+mv -f $STATUS_FILE ${STATUS_FILE}-LAST # for "triggerpostun"
-# Create cluster directory if needed
-if test ! -d $mysql_clusterdir; then mkdir -m 755 $mysql_clusterdir; fi
-%endif
-%preun server
+#echo "Thank you for installing the MySQL Community Server! For Production
+#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."
+
+%preun -n MySQL-server%{product_suffix}
+
+# Which '$1' does this refer to? Fedora docs have info:
+# " ... a count of the number of versions of the package that are installed.
+# Action Count
+# Install the first time 1
+# Upgrade 2 or higher (depending on the number of versions installed)
+# Remove last version of package 0 "
+#
+# http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s04s05.html
+
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
+ # Stop MySQL before uninstalling it
+ if [ -x %{_sysconfdir}/init.d/mysql ] ; then
+ %{_sysconfdir}/init.d/mysql stop > /dev/null
+ # Remove autostart of MySQL
+ # use chkconfig on Enterprise Linux and newer SuSE releases
+ if [ -x /sbin/chkconfig ] ; then
+ /sbin/chkconfig --del mysql
+ # For older SuSE Linux versions
+ elif [ -x /sbin/insserv ] ; then
+ /sbin/insserv -r %{_sysconfdir}/init.d/mysql
+ fi
+ fi
fi
# We do not remove the mysql user since it may still own a lot of
# database files.
+%triggerpostun -n MySQL-server%{product_suffix} --MySQL-server-community
+
+# Setup: We renamed this package, so any existing "server-community"
+# package will be removed when this "server" is installed.
+# Problem: RPM will first run the "pre" and "post" sections of this script,
+# and only then the "preun" of that old community server.
+# But this "preun" includes stopping the server and uninstalling the service,
+# "chkconfig --del mysql" which removes the symlinks to the start script.
+# Solution: *After* the community server got removed, restart this server
+# and re-install the service.
+#
+# For information about triggers in spec files, see the Fedora docs:
+# http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch10s02.html
+# For all details of this code, see the "pre" and "post" sections.
+
+# There are users who deviate from the default file system layout.
+# Check local settings to support them.
+if [ -x %{_bindir}/my_print_defaults ]
+then
+ mysql_datadir=`%{_bindir}/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p'`
+fi
+if [ -z "$mysql_datadir" ]
+then
+ mysql_datadir=%{mysqldatadir}
+fi
+
+NEW_VERSION=%{mysql_version}-%{release}
+STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER-LAST # Note the difference!
+STATUS_HISTORY=$mysql_datadir/RPM_UPGRADE_HISTORY
+
+if [ -f $STATUS_FILE ] ; then
+ SERVER_TO_START=`grep '^SERVER_TO_START=' $STATUS_FILE | cut -c17-`
+else
+ # This should never happen, but let's be prepared
+ SERVER_TO_START=''
+fi
+echo "Analyzed: SERVER_TO_START=$SERVER_TO_START"
+
+if [ -x /sbin/chkconfig ] ; then
+ /sbin/chkconfig --add mysql
+# use insserv for older SuSE Linux versions
+elif [ -x /sbin/insserv ] ; then
+ /sbin/insserv %{_sysconfdir}/init.d/mysql
+fi
+
+# Was the server running before the upgrade? If so, restart the new one.
+if [ "$SERVER_TO_START" = "true" ] ; then
+ # Restart in the same way that mysqld will be started normally.
+ if [ -x %{_sysconfdir}/init.d/mysql ] ; then
+ %{_sysconfdir}/init.d/mysql start
+ echo "Giving mysqld 5 seconds to start"
+ sleep 5
+ fi
+fi
+
+echo "Trigger 'postun --community' finished at `date`" >> $STATUS_HISTORY
+echo >> $STATUS_HISTORY
+echo "=====" >> $STATUS_HISTORY
+
+
# ----------------------------------------------------------------------
# Clean up the BuildRoot after build is done
# ----------------------------------------------------------------------
%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
+[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] \
+ && rm -rf $RPM_BUILD_ROOT;
##############################################################################
# Files section
##############################################################################
-%files server
+%files -n MySQL-server%{product_suffix} -f release/support-files/plugins.files
%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 %{src_dir}/Docs/INFO_SRC*
+%doc release/Docs/INFO_BIN*
+%doc release/support-files/my-*.cnf
%doc %attr(644, root, root) %{_infodir}/mysql.info*
-%if %{INNODB_BUILD}
%doc %attr(644, root, man) %{_mandir}/man1/innochecksum.1*
-%endif
%doc %attr(644, root, man) %{_mandir}/man1/my_print_defaults.1*
%doc %attr(644, root, man) %{_mandir}/man1/myisam_ftdump.1*
%doc %attr(644, root, man) %{_mandir}/man1/myisamchk.1*
@@ -969,14 +1033,13 @@ fi
%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/mysqldumpslow.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_privilege_tables.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_install_db.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_plugin.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*
-%doc %attr(644, root, man) %{_mandir}/man8/mysqlmanager.8*
%doc %attr(644, root, man) %{_mandir}/man1/mysql.server.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqltest.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_tzinfo_to_sql.1*
@@ -988,11 +1051,8 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/resolveip.1*
%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf
-%ghost %config(noreplace,missingok) %{_sysconfdir}/mysqlmanager.passwd
-%if %{INNODB_BUILD}
%attr(755, root, root) %{_bindir}/innochecksum
-%endif
%attr(755, root, root) %{_bindir}/my_print_defaults
%attr(755, root, root) %{_bindir}/myisam_ftdump
%attr(755, root, root) %{_bindir}/myisamchk
@@ -1000,8 +1060,8 @@ 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_plugin
%attr(755, root, root) %{_bindir}/mysql_secure_installation
%attr(755, root, root) %{_bindir}/mysql_setpermission
%attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql
@@ -1020,27 +1080,29 @@ fi
%attr(755, root, root) %{_sbindir}/mysqld
%attr(755, root, root) %{_sbindir}/mysqld-debug
-%attr(755, root, root) %{_sbindir}/mysqlmanager
%attr(755, root, root) %{_sbindir}/rcmysql
-%if %{INNODB_BUILD}
-%if %{WITH_INNODB_PLUGIN}
-%attr(755, root, root) %{_libdir}/mysql/plugin/ha_innodb_plugin.so*
-%endif
+%attr(755, root, root) %{_libdir}/mysql/plugin/daemon_example.ini
+
+%if %{WITH_TCMALLOC}
+%attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target}
%endif
-%attr(755, root, root) %{_libdir}/mysql/plugin/ha_example.so*
%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
@@ -1052,6 +1114,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*
@@ -1061,129 +1124,51 @@ 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 %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 %{WITH_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/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
-%if %{INNODB_BUILD}
-%if %{WITH_INNODB_PLUGIN}
-%{_libdir}/mysql/plugin/ha_innodb_plugin.a
-%{_libdir}/mysql/plugin/ha_innodb_plugin.la
-%endif
-%endif
+%{_libdir}/mysql/libmysqlservices.a
-%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-stress-test.pl.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql-test-run.pl.1*
-%if %{EMBEDDED_BUILD}
-%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_embedded.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqltest_embedded.1*
-%endif
-%if %{EMBEDDED_BUILD}
-%files embedded
+# ----------------------------------------------------------------------------
+%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
-%endif
+%attr(644, root, root) %{_libdir}/mysql/libmysqld-debug.a
##############################################################################
# The spec file changelog only includes changes made to the spec file
@@ -1191,11 +1176,23 @@ fi
# merging BK trees)
##############################################################################
%changelog
-* Tue Sep 11 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
+* Tue Jul 24 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Add a macro "runselftest":
+ if set to 1 (default), the test suite will be run during the RPM build;
+ this can be oveeridden via the command line by adding
+ --define "runselftest 0"
+ Failures of the test suite will NOT make the RPM build fail!
-- Disable "maintainer mode" in debug builds, there is a cast ulonglong -> int
- in the sources (since 2007) that would cause builds to fail.
+* Mon Jun 11 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
+- Make sure newly added "SPECIFIC-ULN/" directory does not disturb packaging.
+
+* Wed Sep 28 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Fix duplicate mentioning of "mysql_plugin" and its manual page,
+ it is better to keep alphabetic order in the files list (merging!).
+
* Wed Sep 14 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Let the RPM capabilities ("obsoletes" etc) ensure that an upgrade may replace
@@ -1206,14 +1203,41 @@ fi
The implicit generation cannot be prevented, so all these capabilities must be
explicitly listed in "Obsoletes:"
+* Tue Sep 13 2011 Jonathan Perkin <jonathan.perkin@oracle.com>
+
+- Add support for Oracle Linux 6 and Red Hat Enterprise Linux 6. Due to
+ changes in RPM behaviour ($RPM_BUILD_ROOT is removed prior to install)
+ this necessitated a move of the libmygcc.a installation to the install
+ phase, which is probably where it belonged in the first place.
+
+* Tue Sep 13 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- "make_win_bin_dist" and its manual are dropped, cmake does it different.
+
+* Thu Sep 08 2011 Daniel Fischer <daniel.fischer@oracle.com>
+
+- Add mysql_plugin man page.
+
+* Tue Aug 30 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Add the manual page for "mysql_plugin" to the server package.
+
* Fri Aug 19 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
-- Fix bug#37165 "((Generic rpm)) fail to install on Fedora 9 x86_64"
- On Fedora, certain accesses to "/var/lib/mysql/HOSTNAME.err" were blocked
- by SELinux policy, this made the server start fail with the message
- Manager of pid-file quit without updating file
- Calling "/sbin/restorecon -R /var/lib/mysql" fixes this.
-- Replace occurrences of that path name by the spec file variable %{mysqldatadir}.
+- Null-upmerge the fix of bug#37165: This spec file is not affected.
+- Replace "/var/lib/mysql" by the spec file variable "%{mysqldatadir}".
+
+* Fri Aug 12 2011 Daniel Fischer <daniel.fischer@oracle.com>
+
+- Source plugin library files list from cmake-generated file.
+
+* Mon Jul 25 2011 Chuck Bell <chuck.bell@oracle.com>
+
+- Added the mysql_plugin client - enables or disables plugins.
+
+* Thu Jul 21 2011 Sunanda Menon <sunanda.menon@oracle.com>
+
+- Fix bug#12561297: Added the MySQL embedded binary
* Thu Jul 07 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
@@ -1222,33 +1246,89 @@ fi
not in an RPM upgrade.
This affects both the "mkdir" and the call of "mysql_install_db".
-* Thu Feb 03 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+* Thu Feb 09 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Fix bug#56581: If an installation deviates from the default file locations
("datadir" and "pid-file"), the mechanism to detect a running server (on upgrade)
should still work, and use these locations.
The problem was that the fix for bug#27072 did not check for local settings.
+
+* Mon Jan 31 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- Install the new "manifest" files: "INFO_SRC" and "INFO_BIN".
+
+* Tue Nov 23 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
+
+- EXCEPTIONS-CLIENT has been deleted, remove it from here too
+- Support MYSQL_BUILD_MAKE_JFLAG environment variable for passing
+ a '-j' argument to make.
+
+* Mon Nov 1 2010 Georgi Kodinov <georgi.godinov@oracle.com>
-* Wed Nov 24 2010 Alexander Nozdrin <alexander.nozdrin@oracle.com>
+- Added test authentication (WL#1054) plugin binaries
-- EXCEPTIONS-CLIENT has been deleted, remove it from here too.
+* Wed Oct 6 2010 Georgi Kodinov <georgi.godinov@oracle.com>
+
+- Added example external authentication (WL#1054) plugin binaries
+
+* Wed Aug 11 2010 Joerg Bruehe <joerg.bruehe@oracle.com>
+
+- With a recent spec file cleanup, names have changed: A "-community" part was dropped.
+ Reflect that in the "Obsoletes" specifications.
+- Add a "triggerpostun" to handle the uninstall of the "-community" server RPM.
+- This fixes bug#55015 "MySQL server is not restarted properly after RPM upgrade".
* Tue Jun 15 2010 Joerg Bruehe <joerg.bruehe@sun.com>
-- Change the behaviour on upgrade:
+- Change the behaviour on installation and upgrade:
+ On installation, do not autostart the server.
*Iff* the server was stopped before the upgrade is started, this is taken as a
sign the administrator is handling that manually, and so the new server will
not be started automatically at the end of the upgrade.
The start/stop scripts will still be installed, so the server will be started
on the next machine boot.
- This is the 5.1 version of fixing bug#27072 (RPM autostarting the server).
+ This is the 5.5 version of fixing bug#27072 (RPM autostarting the server).
+
+* Tue Jun 1 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
+
+- Implement SELinux checks from distribution-specific spec file.
+
+* Wed May 12 2010 Jonathan Perkin <jonathan.perkin@oracle.com>
+
+- Large number of changes to build using CMake
+- Introduce distribution-specific RPMs
+- Drop debuginfo, build all binaries with debug/symbols
+- Remove __os_install_post, use native macro
+- Remove _unpackaged_files_terminate_build, make it an error to have
+ unpackaged files
+- Remove cluster RPMs
+
+* 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 05 2010 Joerg Bruehe <joerg.bruehe@sun.com>
+* Fri Feb 12 2010 Joerg Bruehe <joerg.bruehe@sun.com>
- Formatting changes:
Have a consistent structure of separator lines and of indentation
@@ -1260,8 +1340,6 @@ fi
in 5.1 since ages.
- Introduce variables to control the handlers individually, as well
as other options.
-- Handle the InnoDB plugin using a positive logic: "WITH_INNODB_PLUGIN",
- the old negative logic ("WITHOUT_INNODB_PLUGIN") was obfuscating.
- 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.
@@ -1276,6 +1354,36 @@ fi
- Suffix like "-m2", "-rc" becomes part of version as "_m2", "_rc".
- Release counts from 1, not 0.
+* Wed Dec 23 2009 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- The "semisync" plugin file name has lost its introductory "lib",
+ adapt the file lists for the subpackages.
+ This is a part missing from the fix for bug#48351.
+- Remove the "fix_privilege_tables" manual, it does not exist in 5.5
+ (and likely, the whole script will go, too).
+
+* Mon Nov 16 2009 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Fix some problems with the directives around "tcmalloc" (experimental),
+ remove erroneous traces of the InnoDB plugin (that is 5.1 only).
+
+* Fri Oct 06 2009 Magnus Blaudd <mvensson@mysql.com>
+
+- Removed mysql_fix_privilege_tables
+
+* Fri Oct 02 2009 Alexander Nozdrin <alexander.nozdrin@sun.com>
+
+- "mysqlmanager" got removed from version 5.4, all references deleted.
+
+* Fri Aug 28 2009 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- Merge up from 5.1 to 5.4: Remove handling for the InnoDB plugin.
+
+* Thu Aug 27 2009 Joerg Bruehe <joerg.bruehe@sun.com>
+
+- This version does not contain the "Instance manager", "mysqlmanager":
+ Remove it from the spec file so that packaging succeeds.
+
* Mon Aug 24 2009 Jonathan Perkin <jperkin@sun.com>
- Add conditionals for bundled zlib and innodb plugin
@@ -1804,7 +1912,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
@@ -1815,7 +1923,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>
diff --git a/support-files/ndb-config-2-node.ini.sh b/support-files/ndb-config-2-node.ini.sh
index 1d9b1c65431..cf3bbfc436e 100644
--- a/support-files/ndb-config-2-node.ini.sh
+++ b/support-files/ndb-config-2-node.ini.sh
@@ -1,4 +1,4 @@
-# Copyright (c) 2005 MySQL AB
+# Copyright (c) 2006, 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