diff options
Diffstat (limited to 'support-files')
34 files changed, 1245 insertions, 1373 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..2d1d1e83b8b --- /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) + # XXX: again, used elsewhere (scripts/), should be standardised in + # XXX: install_layout.cmake + IF(INSTALL_LAYOUT MATCHES "STANDALONE") + SET(prefix ".") + ELSE() + SET(prefix ${CMAKE_INSTALL_PREFIX}) + ENDIF() + + 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) + CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.${VERSION}.spec @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 3f11107d714..00000000000 --- a/support-files/MacOSX/Makefile.am +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (C) 2003-2006 MySQL AB -# -# This library 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 library 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., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, 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 c78f08a39b3..00000000000 --- a/support-files/Makefile.am +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright (C) 2000-2006 MySQL AB, 2008-2010 Sun Microsystems, Inc. -# -# This library 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 library 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., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, 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 14a98616863..b8b27863b3d 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 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 52292136877..00000000000 --- a/support-files/RHEL4-SElinux/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (C) 2000-2001, 2003-2006 MySQL AB -# -# This library 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 library 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., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, 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/SCO/INSTALL.sh b/support-files/SCO/INSTALL.sh deleted file mode 100755 index 979f33f3f06..00000000000 --- a/support-files/SCO/INSTALL.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -# search & check GNU patch -PATCH="gpatch" -$PATCH --version || PATCH="patch" -$PATCH --version || exit - - -if /usr/bin/test ! -e PKG/stamp-pre ; then - grep VERSION configure | head -1 | sed 's/VERSION=//' > ./PKG/version - touch PKG/stamp-pre -fi - -if /usr/bin/test ! -e PKG/stamp-patch ; then - ${PATCH} -p0 < ./PKG/patch - touch PKG/stamp-patch -fi - -if /usr/bin/test ! -e PKG/stamp-compile ; then -sh ./PKG/compile.sh ujis -touch PKG/stamp-compile - -sh ./PKG/doc.sh ujis - -fi - - -cd PKG -sh mkpkg.sh ujis diff --git a/support-files/SCO/compile.sh b/support-files/SCO/compile.sh deleted file mode 100644 index 5281ccde02d..00000000000 --- a/support-files/SCO/compile.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh -# GNU ncurses - -# search & check GNU make -GMAKE="gmake" -$GMAKE --version || GMAKE="make" -$GMAKE --version || exit - -MAKE=$GMAKE -export MAKE - -CC=gcc -CFLAGS="-O6 -fomit-frame-pointer" -CXX=gcc -CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" -# LDFLAGS="-static" -LD=gcc - -export CC -export CXX -export LD -export CFLAGS -export CXXFLAGS -# export LDFLAGS -# Solaris don't have libpthread.a. - -if [ "x$1" = "x" ]; then - echo " please set character set" - exit -fi - -CHAR="$1" -case "$1" in - [uU]*) - CHAR=ujis - ;; - [sS]*) - CHAR=sjis - ;; -esac - -#--------------- -P=`pwd` - -if [ -f Makefile ] ; then - ${GMAKE} distclean -fi - -for i in bin sbin include man share/doc/mysql mysql-data -do - /usr/bin/mkdir -p PKG/tmp-${CHAR}/usr/local/${i} -done -/usr/bin/mkdir -p PKG/tmp-${CHAR}/etc/init.d - -#---------------------------- -./configure \ - --prefix=/usr/local \ - --libexecdir=/usr/local/sbin \ - --sbindir=/usr/local/sbin \ - --localstatedir=/usr/local/mysql-data \ - --with-charset=${CHAR} \ - --with-extra-charsets=all \ - --with-raid \ - --without-docs \ - --without-bench \ - --without-perl \ - --with-gcc \ - --with-mysqld-ldflags="-static" \ - --with-client-ldflags="-static" \ - --with-named-curses-libs=/usr/local/lib/libncurses.a \ - --with-mysqld-user=mysql - -# --with-berkeley-db-includes=/usr/local/include/db3 \ -# --with-berkeley-db-libs=/usr/local/lib/libdb3.a \ -# --with-low-memory - -${GMAKE} -${GMAKE} install DESTDIR=${P}/PKG/tmp-${CHAR} - -v=`grep '^SHARED_LIB_VERSION' configure.in | sed 's@SHARED_LIB_VERSION@@' | sed -e 's@=@@' -e 's@:@ @g' | awk '{print $1}'` -km="libmysqlclient.so.$v" -export km - -(cd ${P}/PKG/tmp-${CHAR}/usr/local/lib/mysql/ ; \ - for i in libmysqlclient* ; do \ - if /usr/bin/test ! -L $i ; then \ - mv $i ../ ; ln -sf ../$i ; \ - fi ; \ - done ; \ - k=`ls libmysqlclient.so.*.*.*` ; \ - cd .. ; \ - if /usr/bin/test ! -z libmysqlclient.so ; then \ - ln -sf $k libmysqlclient.so ; - fi ; \ - if /usr/bin/test ! -z $km ; then \ - ln -sf $k $km ; - fi ; \ -) - -# -(cd ${P}/PKG/tmp-${CHAR}/usr/local/bin ; strip * ) -(cd ${P}/PKG/tmp-${CHAR}/usr/local/sbin ; strip * ) diff --git a/support-files/SCO/doc.sh b/support-files/SCO/doc.sh deleted file mode 100644 index 9ef17166a6f..00000000000 --- a/support-files/SCO/doc.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -CHAR="$1" -case "$1" in - [uU]*) - CHAR=ujis - ;; - [sS]*) - CHAR=sjis - ;; -esac - -cp -r Docs/* PKG/tmp-${CHAR}/usr/local/share/doc/mysql/ -cp INSTALL-SOURCE* COPYING* MIRRORS README* PKG/tmp-${CHAR}/usr/local/share/doc/mysql/ - -cd PKG/tmp-${CHAR}/usr/local/share/doc/mysql/ -gzip *.txt *.texi *.info *.pdf diff --git a/support-files/SCO/mkpkg.sh b/support-files/SCO/mkpkg.sh deleted file mode 100644 index 5a38113138d..00000000000 --- a/support-files/SCO/mkpkg.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -if [ "x$1" = "x" ]; then - echo " please set charset" - exit -fi - -CHAR="$1" -case "$1" in - [uU]*) - CHAR=ujis ; CH=uj - ;; - [sS]*) - CHAR=sjis ; CH=sj - ;; -esac - -#------------------- -DIR=`pwd` - -VERSION=`cat version` - -T=`uname -p` - -sed -e "s/@CHAR1@/${CH}/" \ - -e "s/@CHAR2@/${CHAR}/" \ - -e "s/@VERSION@/${VERSION}/" \ - -e "s/@TYPE@/${T}/" \ - pkginfo.ini > pkginfo.${CHAR} - -sed -e "s,@DIR@,${DIR},g" \ - -e "s,@PKGINFO@,${DIR}/pkginfo.${CHAR}," \ - prototype.ini > prototype.${CHAR} - -INIT="tmp-${CHAR}/etc/init.d/mysql" -cp ../support-files/mysql.server $INIT -chmod 755 $INIT - -(cd tmp-${CHAR}; \ -chown root etc usr ; \ -chgrp sys etc usr ;\ -chmod 755 usr etc; \ -chgrp sys etc/init.d ; \ -chmod 755 etc/init.d ; \ -find . -print|pkgproto >> ../prototype.${CHAR}) - -pkgmk -o -f prototype.${CHAR} -r ${DIR}/tmp-${CHAR} diff --git a/support-files/SCO/patch b/support-files/SCO/patch deleted file mode 100644 index 373eb8518c6..00000000000 --- a/support-files/SCO/patch +++ /dev/null @@ -1,96 +0,0 @@ ---- scripts/safe_mysqld.sh.orig Sat Sep 2 17:28:26 2000 -+++ scripts/safe_mysqld.sh Sat Sep 2 17:31:19 2000 -@@ -89,10 +89,10 @@ - - - NOHUP_NICENESS=`nohup nice` --if test $? -ne 0 || test x"$NOHUP_NICENESS" = x0 || test ! nice --1 echo foo > /dev/null 2>&1; then -+if test $? -ne 0 || test x"$NOHUP_NICENESS" = x0 || test ! nice -1 echo foo > /dev/null 2>&1; then - NOHUP_NICENESS="nohup" - else -- NOHUP_NICENESS="nice --$NOHUP_NICENESS nohup" -+ NOHUP_NICENESS="nice -$NOHUP_NICENESS nohup" - fi - - export MYSQL_UNIX_PORT -@@ -163,7 +163,8 @@ - # The only thing is ps x => redhat 5 gives warnings when using ps -x. - # kill -9 is used or the process won't react on the kill. - numofproces=`ps xa | grep -v "grep" | grep -c $ledir/mysqld` -- echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log -+ echo | tee -a $err_log -+ echo "Number of processes running now: $numofproces" | tee -a $err_log - I=1 - while test "$I" -le "$numofproces" - do -@@ -185,4 +186,6 @@ - echo "`date +'%y%m%d %H:%M:%S mysqld restarted'`" | tee -a $err_log - done - --echo -e "`date +'%y%m%d %H:%M:%S mysqld ended\n'`" | tee -a $err_log -+echo | tee -a $err_log -+echo "`date +'%y%m%d %H:%M:%S mysqld ended'`" | tee -a $err_log -+echo | tee -a $err_log ---- support-files/mysql.server.sh.orig Sat Sep 2 17:35:56 2000 -+++ support-files/mysql.server.sh Sat Sep 2 17:36:35 2000 -@@ -23,6 +23,9 @@ - mysql_daemon_user=@MYSQLD_USER@ - export PATH - -+## your options... -+OPT="" -+ - mode=$1 - - if test -w / # determine if we should look at the root config file -@@ -82,8 +85,9 @@ - then - # Give extra arguments to mysqld with the my.cnf file. This script may - # be overwritten at next upgrade. -- $bindir/safe_mysqld \ -- --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file --log=$log_file & -+ $bindir/safe_mysqld $OPT \ -+ --user=$mysql_daemon_user --datadir=$datadir --pid-file=$pid_file & -+# --log=$log_file & - else - echo "Can't execute $bindir/safe_mysqld" - fi ---- configure.orig Sat Sep 2 17:54:03 2000 -+++ configure Sat Sep 2 17:54:18 2000 -@@ -202,7 +202,7 @@ - --with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257 - croat czech danish dec8 dos estonia euc_kr gb2312 gbk - german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr -- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr -+ latin1 latin2 swe7 usa7 win1250 win1251ukr - ujis sjis tis620; default is latin1)" - ac_help="$ac_help - --with-extra-charsets=cs1,cs2 -@@ -8843,7 +8843,7 @@ - - # Choose a character set - --CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620" -+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620" - DEFAULT_CHARSET=latin1 - - # Check whether --with-charset or --without-charset was given. ---- configure.in.orig Sat Sep 2 17:53:57 2000 -+++ configure.in Sat Sep 2 17:54:36 2000 -@@ -1517,14 +1517,14 @@ - dnl or other special handling, you must also create - dnl strings/ctype-$charset_name.c - --CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620" -+CHARSETS_AVAILABLE="big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 swe7 usa7 win1250 win1251ukr ujis sjis tis620" - DEFAULT_CHARSET=latin1 - - AC_ARG_WITH(charset, - [ --with-charset=CHARSET use CHARSET by default (one of: big5 cp1251 cp1257 - croat czech danish dec8 dos estonia euc_kr gb2312 gbk - german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr -- latin1 latin2 swe7 usa7 win1250 win1251 win1251ukr -+ latin1 latin2 swe7 usa7 win1250 win1251ukr - ujis sjis tis620; default is latin1)], - [default_charset="$withval"], - [default_charset="$DEFAULT_CHARSET"]) diff --git a/support-files/SCO/pkginfo.ini b/support-files/SCO/pkginfo.ini deleted file mode 100644 index 13b8b6adb09..00000000000 --- a/support-files/SCO/pkginfo.ini +++ /dev/null @@ -1,8 +0,0 @@ -PKG=MySQL -NAME=MySQL -ARCH=@TYPE@ -VERSION=@VERSION@ -CATEGORY=utility -VENDOR=TcX DataKonsult AB, Detron HB and MySQL AB -BASEDIR=/ -CLASSES=none diff --git a/support-files/SCO/postinstall b/support-files/SCO/postinstall deleted file mode 100644 index 2e199b9af82..00000000000 --- a/support-files/SCO/postinstall +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin -LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib -export PATH -export LD_LIBRARY_PATH - -D0="/usr/local/mysql-data" -D="${D0}/mysql" - -DOFIX=0 - -if /usr/bin/test ! -f ${D}/tables_priv.frm -a -d ${D} ; then - DOFIX=1 -fi - -if [ ! -d ${D} ]; then - DOFIX=2 - /usr/local/bin/mysql_install_db -fi - - chown -R mysql $D0 - chgrp -R mysql $D0 - -if /usr/bin/test $DOFIX -eq 1 ; then - /etc/init.d/mysql start - /usr/local/bin/mysql_fix_privilege_tables -else - /etc/init.d/mysql start || true -fi diff --git a/support-files/SCO/preinstall b/support-files/SCO/preinstall deleted file mode 100644 index c1175561a99..00000000000 --- a/support-files/SCO/preinstall +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin -LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib -export PATH -export LD_LIBRARY_PATH - -if /usr/bin/test -x /etc/init.d/mysql ; then - /etc/init.d/mysql stop || true -fi - -#----- user check -P=`grep mysql /etc/passwd` -G=`grep mysql /etc/group` - -if /usr/bin/test "x$G" = "x" ; then - /usr/sbin/groupadd mysql -fi -if /usr/bin/test "x$P" = "x" ; then - /usr/sbin/useradd -g mysql -d /usr/local/mysql-data -s /bin/false mysql -fi diff --git a/support-files/SCO/preremove b/support-files/SCO/preremove deleted file mode 100644 index a89648431c1..00000000000 --- a/support-files/SCO/preremove +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin -LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib -export PATH -export LD_LIBRARY_PATH - -pid=`/usr/bin/ps -e | /usr/bin/grep mysqld | /usr/bin/sed -e 's/^ *//' -e 's/ .*//'` -[ "$pid" != "" ] && /usr/local/bin/mysqladmin shutdown - -#--- -#/usr/ucb/echo -n "Remove DATA Directory (All data expire) [Y/N]? " -#read I -I=No - -case "$I" in -Y*|y*) - /usr/ucb/echo -n "Removing MySQL DATA ALL..." - rm -rf /usr/local/mysql-data - echo "done." - ;; -*) - echo "not purge DATA directory" - ;; -esac; diff --git a/support-files/SCO/prototype.ini b/support-files/SCO/prototype.ini deleted file mode 100644 index ca88bb67a90..00000000000 --- a/support-files/SCO/prototype.ini +++ /dev/null @@ -1,4 +0,0 @@ -i pkginfo=@PKGINFO@ -i postinstall=@DIR@/postinstall -i preinstall=@DIR@/preinstall -i preremove=@DIR@/preremove diff --git a/support-files/SCO/version b/support-files/SCO/version deleted file mode 100644 index f9dc296b71b..00000000000 --- a/support-files/SCO/version +++ /dev/null @@ -1 +0,0 @@ -3.23.23-beta diff --git a/support-files/dtrace/locktime.d b/support-files/dtrace/locktime.d new file mode 100644 index 00000000000..c9b509ca61e --- /dev/null +++ b/support-files/dtrace/locktime.d @@ -0,0 +1,49 @@ +#!/usr/sbin/dtrace -s +# +# 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..64599223f55 --- /dev/null +++ b/support-files/dtrace/query-execandqc.d @@ -0,0 +1,36 @@ +#!/usr/sbin/dtrace -s +# +# 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..425ed3863aa --- /dev/null +++ b/support-files/dtrace/query-filesort-time.d @@ -0,0 +1,47 @@ +#!/usr/sbin/dtrace -s +# +# 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..f0483778fb0 --- /dev/null +++ b/support-files/dtrace/query-network-time.d @@ -0,0 +1,63 @@ +#!/usr/sbin/dtrace -s +# +# 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..31fe1275e1a --- /dev/null +++ b/support-files/dtrace/query-parse-time.d @@ -0,0 +1,23 @@ +#!/usr/sbin/dtrace -s +# +# 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..a16f3df90f4 --- /dev/null +++ b/support-files/dtrace/query-rowops.d @@ -0,0 +1,66 @@ +#!/usr/sbin/dtrace -s +# +# 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..9983a73b7e5 --- /dev/null +++ b/support-files/dtrace/query-time.d @@ -0,0 +1,25 @@ +#!/usr/sbin/dtrace -s +# +# 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..d00fc10348d --- /dev/null +++ b/support-files/dtrace/statement-time.d @@ -0,0 +1,45 @@ +#!/usr/sbin/dtrace -s +# +# 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..32d88cb5143 --- /dev/null +++ b/support-files/dtrace/statement-type-aggregate.d @@ -0,0 +1,46 @@ +#!/usr/sbin/dtrace -s +# +# 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 87198fc9cf5..b5115a5c05e 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 @@ -417,13 +361,8 @@ case "$mode" in # Try to find appropriate mysqld process mysqld_pid=`pidof $libexecdir/mysqld` if 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" @@ -436,7 +375,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 c69ae6afce0..09d8219ffe9 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -20,127 +20,218 @@ # 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 -%define release 1.glibc23 +# ---------------------------------------------------------------------------- +# 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 + %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 + %else + %{error:Oracle Enterprise Linux %{oelver} is unsupported} + %endif + %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 + %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 + %else + %{error:Red Hat Enterprise Linux %{rhelver} is unsupported} + %endif + %endif + %else + %if %(test -f /etc/SuSE-release && echo 1 || echo 0) + %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release) + %if "%susever" == "10" + %define distro_description SUSE Linux Enterprise Server 10 + %define distro_releasetag sles10 + %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client readline-devel zlib-devel + %define distro_requires aaa_base coreutils grep procps pwdutils + %else + %if "%susever" == "11" + %define distro_description SUSE Linux Enterprise Server 11 + %define distro_releasetag sles11 + %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils readline-devel zlib-devel + %define distro_requires aaa_base coreutils grep procps pwdutils + %else + %{error:SuSE %{susever} is unsupported} + %endif + %endif + %else + %{error:Unsupported distribution} + %endif + %endif + %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 + +# ---------------------------------------------------------------------------- +# 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 2000-2008 MySQL AB, @MYSQL_COPYRIGHT_YEAR@ %{mysql_vendor} All rights reserved. Use is subject to license terms. Under %{mysql_license} license as shown in the Description field. -Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{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. Use is subject to license terms. Under %{license_type} license as shown in the Description field. +Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz +URL: http://www.mysql.com/ +Packager: MySQL Build Team <build@mysql.com> +Vendor: %{mysql_vendor} +Provides: msqlormysql MySQL-server mysql +BuildRequires: %{distro_buildreq} # Think about what you use here since the first step is to # run a rm -rf @@ -154,11 +245,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 2000-2008 MySQL AB, @MYSQL_COPYRIGHT_YEAR@ %{mysql_vendor} All rights reserved. -Use is subject to license terms. - -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 @@ -168,448 +260,271 @@ documentation and the manual for more information. # Sub package definition ############################################################################## -%package server -Summary: MySQL: a very fast and reliable SQL database server -Group: Applications/Databases -Requires: coreutils grep procps /usr/sbin/useradd /usr/sbin/groupadd /sbin/chkconfig -Provides: msqlormysql mysql-server mysql MySQL -Obsoletes: MySQL mysql mysql-server +%package -n MySQL-server%{product_suffix} +Summary: MySQL: a very fast and reliable SQL database server +Group: Applications/Databases +Requires: %{distro_requires} +Provides: msqlormysql mysql-server mysql MySQL MySQL-server +Obsoletes: MySQL mysql mysql-server MySQL-server MySQL-server-community -%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 2000-2008 MySQL AB, @MYSQL_COPYRIGHT_YEAR@ %{mysql_vendor} All rights reserved. -Use is subject to license terms. +The MySQL software has Dual Licensing, which means you can use the MySQL +software free of charge under the GNU General Public License +(http://www.gnu.org/licenses/). You can also purchase commercial MySQL +licenses from %{mysql_vendor} if you do not wish to be bound by the terms of +the GPL. See the chapter "Licensing and Support" in the manual for +further info. -This software comes with ABSOLUTELY NO WARRANTY. This is free software, -and you are welcome to modify and redistribute it under the GPL license. - -The MySQL web site (http://www.mysql.com/) provides the latest -news and information about the MySQL software. Also please see the -documentation and the manual for more information. +The MySQL web site (http://www.mysql.com/) provides the latest news and +information about the MySQL software. Also please see the documentation +and the manual for more information. -This package includes the MySQL server binary -%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 -Summary: MySQL - Client -Group: Applications/Databases -Obsoletes: mysql-client -Provides: mysql-client +# ---------------------------------------------------------------------------- +%package -n MySQL-client%{product_suffix} +Summary: MySQL - Client +Group: Applications/Databases +Obsoletes: mysql-client MySQL-client MySQL-client-community +Provides: mysql-client MySQL-client -%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 +For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ -%description ndb-extra -This package contains some extra ndbcluster storage engine tools for the advanced user. -They should be used with caution. +# ---------------------------------------------------------------------------- +%package -n MySQL-test%{product_suffix} +Requires: MySQL-client%{product_suffix} perl +Summary: MySQL - Test suite +Group: Applications/Databases +Provides: mysql-test +Obsoletes: mysql-bench mysql-test MySQL-test-community +AutoReqProv: no -%{see_base} -%endif - -# ------------------------------------------------------------------------------ - -%package test -Requires: %{name}-client perl -Summary: MySQL - Test suite -Group: Applications/Databases -Provides: mysql-test -Obsoletes: mysql-bench mysql-test -AutoReqProv: no - -%description test +%description -n MySQL-test%{product_suffix} This package contains the MySQL regression test suite. -%{see_base} - -# ------------------------------------------------------------------------------ - -%package devel -Summary: MySQL - Development header files and libraries -Group: Applications/Databases -Provides: mysql-devel -Obsoletes: mysql-devel - -%description devel -This package contains the development header files and libraries -necessary to develop MySQL client applications. - -%{see_base} +For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ -# ------------------------------------------------------------------------------ +# ---------------------------------------------------------------------------- +%package -n MySQL-devel%{product_suffix} +Summary: MySQL - Development header files and libraries +Group: Applications/Databases +Provides: mysql-devel +Obsoletes: mysql-devel MySQL-devel-community -%package shared -Summary: MySQL - Shared libraries -Group: Applications/Databases +%description -n MySQL-devel%{product_suffix} +This package contains the development header files and libraries necessary +to develop MySQL client applications. -%description shared -This package contains the shared libraries (*.so*) which certain -languages and applications need to dynamically load and use MySQL. +For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ -# ------------------------------------------------------------------------------ +# ---------------------------------------------------------------------------- +%package -n MySQL-shared%{product_suffix} +Summary: MySQL - Shared libraries +Group: Applications/Databases +Provides: mysql-shared +Obsoletes: MySQL-shared-community -%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 -Requires: %{name}-devel -Summary: MySQL - embedded library -Group: Applications/Databases -Obsoletes: mysql-embedded +# ---------------------------------------------------------------------------- +%package -n MySQL-embedded%{product_suffix} +Summary: MySQL - embedded library +Group: Applications/Databases +Requires: MySQL-devel%{product_suffix} +Obsoletes: mysql-embedded MySQL-embedded-community -%description embedded +%description -n MySQL-embedded%{product_suffix} This package contains the MySQL server as an embedded library. -The embedded MySQL server library makes it possible to run a -full-featured MySQL server inside the client application. -The main benefits are increased speed and more simple management -for embedded applications. +The embedded MySQL server library makes it possible to run a full-featured +MySQL server inside the client application. The main benefits are increased +speed and more simple management for embedded applications. The API is identical for the embedded MySQL version and the client/server version. -%{see_base} +For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ -%endif - -############################################################################## -# ############################################################################## - %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' - 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=/var/lib/mysql/mysql.sock \ - --with-pic \ - --prefix=/ \ -%if %{CLUSTER_BUILD} - --with-extra-charsets=all \ -%else - --with-extra-charsets=complex \ -%endif -%if %{YASSL_BUILD} - --with-ssl \ -%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. - -RBR=$RPM_BUILD_ROOT +# Be strict about variables, bail at earliest opportunity, etc. +set -eu -# 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. +# +# 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. # -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 +# 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 -############################################################################## -# -# Build the debug version -# -############################################################################## +export PATH=${MYSQL_BUILD_PATH:-$PATH} +export CC=${MYSQL_BUILD_CC:-${CC:-gcc}} +export CXX=${MYSQL_BUILD_CXX:-${CXX:-gcc}} +export CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}} +export CXXFLAGS=${MYSQL_BUILD_CXXFLAGS:-${CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti}} +export LDFLAGS=${MYSQL_BUILD_LDFLAGS:-${LDFLAGS:-}} +export CMAKE=${MYSQL_BUILD_CMAKE:-${CMAKE:-cmake}} +# Build debug mysqld and libmysqld.a +mkdir debug ( -# We are in a subshell, so we can modify variables just for one run. - -# 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="/var/lib/mysql/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 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="/var/lib/mysql/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 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) +# Use the build root for temporary storage of the shared libraries. +RBR=$RPM_BUILD_ROOT -############################################################################## +# Clean up the BuildRoot first +[ "$RBR" != "/" ] && [ -d "$RBR" ] && rm -rf "$RBR"; -# 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 ; +# For gcc builds, include libgcc.a in the devel subpackage (BUG 4921). This +# needs to be during build phase as $CC is not set during install. +if "$CC" -v 2>&1 | grep '^gcc.version' >/dev/null 2>&1 then libgcc=`$CC $CFLAGS --print-libgcc-file` if [ -f $libgcc ] then - %define WITH_LIBGCC 1 + mkdir -p $RBR%{_libdir}/mysql install -m 644 $libgcc $RBR%{_libdir}/mysql/libmygcc.a - else - %define WITH_LIBGCC 0 - : + echo "%{_libdir}/mysql/libmygcc.a" >>optional-files-devel fi -else - %define WITH_LIBGCC 0 - : fi ############################################################################## - %install + RBR=$RPM_BUILD_ROOT -MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}/mysql-release-%{mysql_version} +MBD=$RPM_BUILD_DIR/%{src_dir} # Ensure that needed directories exists install -d $RBR%{_sysconfdir}/{logrotate.d,init.d} 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}/ - -# 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 +( + cd $MBD/release + make DESTDIR=$RBR install +) -# 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. +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} + +# ATTENTION: Parts of this are duplicated in the "triggerpostun" ! + mysql_datadir=%{mysqldatadir} # Check if we can safely upgrade. An upgrade is only safe if it's from one # of our RPMs in the same version family. @@ -623,15 +538,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. @@ -748,12 +667,15 @@ 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} + +# ATTENTION: Parts of this are duplicated in the "triggerpostun" ! + mysql_datadir=%{mysqldatadir} NEW_VERSION=%{mysql_version}-%{release} STATUS_FILE=$mysql_datadir/RPM_UPGRADE_MARKER @@ -765,7 +687,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 @@ -782,12 +704,12 @@ if [ ! -d $mysql_datadir/test ] ; then mkdir $mysql_datadir/test; 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 # ---------------------------------------------------------------------- @@ -795,8 +717,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 # ---------------------------------------------------------------------- @@ -825,80 +749,169 @@ chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir # ---------------------------------------------------------------------- chmod -R og-rw $mysql_datadir/mysql +# ---------------------------------------------------------------------- +# install SELinux files - but don't override existing ones +# ---------------------------------------------------------------------- +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 - -# Create cluster directory if needed -if test ! -d $mysql_clusterdir; then mkdir -m 755 $mysql_clusterdir; fi -%endif +mv -f $STATUS_FILE ${STATUS_FILE}-LAST # for "triggerpostun" + + +#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 server +%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. + +mysql_datadir=%{mysqldatadir} +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} %defattr(-,root,root,0755) -%doc mysql-release-%{mysql_version}/COPYING mysql-release-%{mysql_version}/README -%doc mysql-release-%{mysql_version}/support-files/my-*.cnf -%if %{CLUSTER_BUILD} -%doc mysql-release-%{mysql_version}/support-files/ndb-*.ini +%if %{defined license_files_server} +%doc %{license_files_server} %endif +%doc %{src_dir}/Docs/ChangeLog +%doc release/support-files/my-*.cnf %doc %attr(644, root, root) %{_infodir}/mysql.info* -%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* @@ -910,14 +923,12 @@ 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_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* @@ -929,11 +940,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 @@ -941,7 +949,6 @@ fi %attr(755, root, root) %{_bindir}/myisampack %attr(755, root, root) %{_bindir}/mysql_convert_table_format %attr(755, root, root) %{_bindir}/mysql_fix_extensions -%attr(755, root, root) %{_bindir}/mysql_fix_privilege_tables %attr(755, root, root) %{_bindir}/mysql_install_db %attr(755, root, root) %{_bindir}/mysql_secure_installation %attr(755, root, root) %{_bindir}/mysql_setpermission @@ -961,27 +968,50 @@ 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* +%attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so +%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so +%attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so +%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so +%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so +%attr(755, root, root) %{_libdir}/mysql/plugin/auth.so +%attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so +%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so +%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_master.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_slave.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so +%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so + +%if %{WITH_TCMALLOC} +%attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target} %endif -%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 @@ -993,6 +1023,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* @@ -1002,129 +1033,50 @@ 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(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 @@ -1132,6 +1084,16 @@ fi # merging BK trees) ############################################################################## %changelog +* 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". * Wed Nov 24 2010 Alexander Nozdrin <alexander.nozdrin@oracle.com> @@ -1139,20 +1101,55 @@ fi * 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 @@ -1164,8 +1161,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. @@ -1180,6 +1175,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 @@ -1708,7 +1733,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 @@ -1719,7 +1744,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> |