# HG changeset patch # User Michael Schloh von Bennewitz # Date 1346171325 -7200 # Node ID 3b08e6396b455bc84ce4d083d9b9cc9a672a0d6b # Parent 7b145ccff1e9b448279d0c58a908b8cf1496e862 Massively update from 5.1 to 5.5 release, completely changing from autotools to cmake build configuration along with the corresponding corrections. Correct some less important problems like typical german english mistakes, as well as use parallel make for faster builds with SMP and multicore architectures. Warning, the 5.5 releases of MySQL seem to be equally bug ridden as the 5.1 are, for example building the NDBCluster storage engine fails. diff -r 7b145ccff1e9 -r 3b08e6396b45 mysql/mysql.patch --- a/mysql/mysql.patch Tue Aug 28 18:28:40 2012 +0200 +++ b/mysql/mysql.patch Tue Aug 28 18:28:45 2012 +0200 @@ -1,42 +1,7 @@ -Index: configure ---- configure.orig 2010-10-11 22:40:59.000000000 +0200 -+++ configure 2010-11-03 13:05:31.000000000 +0100 -@@ -19652,7 +19652,7 @@ - - # Enable the abi_check rule only if gcc is available - --if test "$GCC" != "yes" || expr "$CC" : ".*icc.*" -+if true - then - ABI_CHECK="" - else -Index: include/Makefile.in ---- include/Makefile.in.orig 2010-10-11 22:40:17.000000000 +0200 -+++ include/Makefile.in 2010-11-03 13:07:11.000000000 +0100 -@@ -405,7 +405,8 @@ - decimal.h errmsg.h my_global.h my_net.h \ - my_getopt.h sslopt-longopts.h my_dir.h \ - sslopt-vars.h sslopt-case.h sql_common.h keycache.h \ -- m_ctype.h my_attribute.h my_compiler.h \ -+ m_ctype.h my_attribute.h my_compiler.h rijndael.h sha1.h \ -+ my_aes.h \ - $(HEADERS_GEN_CONFIGURE) \ - $(HEADERS_GEN_MAKE) - -@@ -413,8 +414,7 @@ - heap.h my_bitmap.h my_uctype.h \ - myisam.h myisampack.h myisammrg.h ft_global.h\ - mysys_err.h my_base.h help_start.h help_end.h \ -- my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ -- my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \ -+ my_nosys.h my_alarm.h queues.h my_tree.h my_trie.h hash.h thr_alarm.h \ - thr_lock.h t_ctype.h violite.h my_md5.h base64.h \ - my_handler.h my_time.h my_vle.h my_user.h \ - my_libwrap.h my_stacktrace.h Index: mysys/default.c ---- mysys/default.c.orig 2010-10-11 22:34:24.000000000 +0200 -+++ mysys/default.c 2010-11-03 13:05:31.000000000 +0100 -@@ -1123,8 +1123,7 @@ +--- mysys/default.c.orig 2012-08-22 19:47:54.486251769 +0200 ++++ mysys/default.c 2012-08-22 19:48:07.379075804 +0200 +@@ -1222,8 +1222,7 @@ #else @@ -46,25 +11,10 @@ #if defined(DEFAULT_SYSCONFDIR) if (DEFAULT_SYSCONFDIR[0]) -Index: scripts/mysql_config.sh ---- scripts/mysql_config.sh.orig 2010-10-11 22:34:28.000000000 +0200 -+++ scripts/mysql_config.sh 2010-11-03 13:05:31.000000000 +0100 -@@ -104,9 +104,9 @@ - - # Create options - # We intentionally add a space to the beginning and end of lib strings, simplifies replace later --libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" -+libs=" $ldflags -L$pkglibdir -lmysqlclient -lmysys @ZLIB_DEPS@ @NON_THREADED_LIBS@" - libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ " --libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@ " -+libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r -lmysys @ZLIB_DEPS@ @LIBS@ @openssl_libs@ " - embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ @openssl_libs@ " - - if [ -r "$pkglibdir/libmygcc.a" ]; then Index: scripts/mysql_system_tables_data.sql ---- scripts/mysql_system_tables_data.sql.orig 2010-10-11 22:34:29.000000000 +0200 -+++ scripts/mysql_system_tables_data.sql 2010-11-03 13:05:31.000000000 +0100 -@@ -11,8 +11,6 @@ +--- scripts/mysql_system_tables_data.sql.orig 2012-08-22 19:49:42.514877593 +0200 ++++ scripts/mysql_system_tables_data.sql 2012-08-22 19:49:52.671510387 +0200 +@@ -26,8 +26,6 @@ -- Fill "db" table with default grants for anyone to -- access database 'test' and 'test_%' if "db" table didn't exist CREATE TEMPORARY TABLE tmp_db LIKE db; @@ -73,15 +23,3 @@ INSERT INTO db SELECT * FROM tmp_db WHERE @had_db_table=0; DROP TABLE tmp_db; -Index: sql/Makefile.in ---- sql/Makefile.in.orig 2010-10-11 22:40:27.000000000 +0200 -+++ sql/Makefile.in 2010-11-03 13:05:31.000000000 +0100 -@@ -538,7 +538,7 @@ - $(top_builddir)/strings/libmystrings.a - - mysqld_DEPENDENCIES = @mysql_plugin_libs@ $(SUPPORTING_LIBS) libndb.la --LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@ @NDB_SCI_LIBS@ -+LDADD = $(SUPPORTING_LIBS) @NDB_SCI_LIBS@ - mysqld_LDADD = libndb.la \ - @MYSQLD_EXTRA_LDFLAGS@ \ - @pstack_libs@ \ diff -r 7b145ccff1e9 -r 3b08e6396b45 mysql/mysql.spec --- a/mysql/mysql.spec Tue Aug 28 18:28:40 2012 +0200 +++ b/mysql/mysql.spec Tue Aug 28 18:28:45 2012 +0200 @@ -22,8 +22,8 @@ ## # package version -%define V_major 5.1 -%define V_minor 63 +%define V_major 5.5 +%define V_minor 27 %define V_mysql %{V_major}.%{V_minor} %define V_opkg %{V_major}.%{V_minor} %define V_jdbc 5.1.21 @@ -39,7 +39,7 @@ Group: Database License: GPL Version: %{V_opkg} -Release: 20120704 +Release: 20120800 # package options %option with_server yes @@ -49,20 +49,21 @@ %option with_federated no %option with_ndbcluster no %option with_partition no +%option with_perfschema no %option with_ssl no %option with_embedded no %option with_charset utf8 %option with_collation utf8_unicode_ci %option with_jdbc no -# fixing implicit inter-plugin dependencies and correlations +# fixing implicit interplugin dependencies and correlations %if "%{with_ndbcluster}" == "yes" %undefine with_partition %define with_partition yes %endif # list of sources -Source0: http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-%{V_major}/mysql-%{V_mysql}.tar.gz +Source0: http://www.mysql.com/Downloads/MySQL-%{V_major}/mysql-%{V_mysql}.tar.gz Source1: http://ftp.gwdg.de/pub/misc/mysql/Downloads/Connector-J/mysql-connector-java-%{V_jdbc}.tar.gz Source2: my.cnf Source3: my.pwd @@ -83,9 +84,9 @@ %endif %description - MySQL is a multi-user Relational Database Management System (RDBMS), + MySQL is a multiuser Relational Database Management System (RDBMS), which is controlled through Structured Query Language (SQL) - operating in full multi-threading mode. The main goals of MySQL are + operating in full multithreading mode. The main goals of MySQL are speed, robustness and ease of use. MySQL was originally developed because of the need for a SQL server that could handle very big databases with magnitude higher speed than what any database vendor @@ -110,7 +111,6 @@ %endif %patch -p0 -%build # patch file search path %{l_shtool} subst %{l_value -s -a} \ mysys/default.c @@ -121,119 +121,135 @@ -e 's;^#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \ scripts/* - # determine additional configure options - case "%{l_platform -t}" in - *-freebsd* ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;; - *-linux* ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;; - *-sunos* ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;; - esac +%build + # create build subdirectory + %{l_shtool} mkdir -p objbld + cd objbld - # configure source tree - CC="%{l_cc}" \ - CXX="%{l_cxx}" \ - CFLAGS="%{l_cflags -O}" \ - CXXFLAGS="%{l_cxxflags -O}" \ - CPPFLAGS="%{l_cppflags ncurses}" \ - LDFLAGS="-L`pwd`/libmysql %{l_ldflags}" \ - LIBS="-lz" \ - ./configure \ - --prefix=%{l_prefix} \ - --mandir=%{l_prefix}/man \ - --infodir=%{l_prefix}/info \ - --sysconfdir=%{l_prefix}/etc/mysql \ - --localstatedir=%{l_prefix}/var/mysql \ - --libexecdir=%{l_prefix}/libexec/mysql \ - --with-unix-socket-path=%{l_prefix}/var/mysql/mysql.sock \ - --with-mysqld-user=%{l_musr} \ - --enable-thread-safe-client \ - --with-comment="%{l_openpkg_release}" \ + # configure environment + export CC="%{l_cc}" + export CXX="%{l_cxx}" + export CFLAGS="%{l_cflags -O}" + export CXXFLAGS="%{l_cxxflags -O} -felide-constructors -fno-exceptions -fno-rtti" + export CPPFLAGS="%{l_cppflags ncurses}" + export LDFLAGS="-L`pwd`/libmysql %{l_ldflags}" + export LIBS="-lz" + + # Configure source tree. + # Tips are in mysql_release.cmake + # or run cmake(1) -L for all opts + # Disable dtrace(1) to avoid 'mysqld_dtrace_all.o: file not recognized: Bad value' + %{l_prefix}/bin/cmake \ + -DCMAKE_INSTALL_PREFIX="%{l_prefix}" \ + -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ + -DINSTALL_DOCDIR="share/mysql/doc" \ + -DINSTALL_DOCREADMEDIR="share/mysql/doc" \ + -DINSTALL_INCLUDEDIR="include/mysql" \ + -DINSTALL_INFODIR:STRING="info" \ + -DINSTALL_MYSQLSHAREDIR="share/mysql" \ + -DINSTALL_SBINDIR="libexec/mysql" \ + -DINSTALL_SHAREDIR="share/mysql" \ + -DINSTALL_SCRIPTDIR="bin" \ + -DINSTALL_SUPPORTFILESDIR="share/mysql" \ + -DMYSQL_UNIX_ADDR="%{l_prefix}/var/mysql/mysql.sock" \ + -DFEATURE_SET="community" \ + -DCOMPILATION_COMMENT="%{l_openpkg_release}" \ + -DMANUFACTURER="Built from OpenPKG sources" \ + -DDEFAULT_CHARSET="%{with_charset}" \ + -DDEFAULT_COLLATION="%{with_collation}" \ + -DMYSQL_USER="%{l_musr}" \ + -DWITH_ZLIB=system \ + -DWITH_READLINE=YES \ + -DWITH_LIBEDIT=NO \ + -DWITH_LIBWRAP=NO \ + -DDISABLE_SHARED=YES \ + -DENABLE_DTRACE=NO \ + -DZLIB_INCLUDE_DIR=%{l_cppflags zlib} \ + -DPKG_CONFIG_EXECUTABLE="PKG_CONFIG_EXECUTABLE-NOTFOUND" \ %if "%{with_server}" != "yes" - --without-server \ + -DWITHOUT_SERVER=YES \ +%endif +%if "%{with_ssl}" == "yes" + -DWITH_SSL=system \ + -DOPENSSL_INCLUDE_DIR="%{l_cppflags openssl}" \ + -DOPENSSL_SSL_LIBRARY="%{l_prefix}/lib/libssl.a" \ + -DOPENSSL_CRYPTO_LIBRARY="%{l_prefix}/lib/libcrypto.a" \ + -DCRYPTO_LIBRARY="%{l_prefix}/lib/libcrypto.a" \ %else - --with-server \ - --with-plugin-csv \ - --with-plugin-heap \ - --with-plugin-myisam \ - --with-plugin-myisammrg \ + -DWITH_SSL=NO \ +%endif %if "%{with_innobase}" == "yes" - --with-plugin-innobase \ + -DWITH_INNOBASE_STORAGE_ENGINE=YES \ %else - --without-plugin-innobase \ + -DWITH_INNOBASE_STORAGE_ENGINE=NO \ %endif %if "%{with_archive}" == "yes" - --with-plugin-archive \ + -DWITH_ARCHIVE_STORAGE_ENGINE=YES \ %else - --without-plugin-archive \ + -DWITH_ARCHIVE_STORAGE_ENGINE=NO \ %endif %if "%{with_blackhole}" == "yes" - --with-plugin-blackhole \ + -DWITH_BLACKHOLE_STORAGE_ENGINE=YES \ %else - --without-plugin-blackhole \ + -DWITH_BLACKHOLE_STORAGE_ENGINE=NO \ %endif %if "%{with_federated}" == "yes" - --with-plugin-federated \ + -DWITH_FEDERATED_STORAGE_ENGINE=YES \ %else - --without-plugin-federated \ + -DWITH_FEDERATED_STORAGE_ENGINE=NO \ %endif %if "%{with_ndbcluster}" == "yes" - --with-plugin-ndbcluster \ + -DWITH_NDBCLUSTER_STORAGE_ENGINE=YES \ %else - --without-plugin-ndbcluster \ + -DWITH_NDBCLUSTER_STORAGE_ENGINE=NO \ %endif %if "%{with_partition}" == "yes" - --with-plugin-partition \ + -DWITH_PARTITION_STORAGE_ENGINE=YES \ %else - --without-plugin-partition \ + -DWITH_PARTITION_STORAGE_ENGINE=NO \ %endif -%endif - --with-zlib-dir=%{l_prefix} \ -%if "%{with_ssl}" == "yes" - --with-ssl=%{l_prefix} \ +%if "%{with_perfschema}" == "yes" + -DWITH_PERFSCHEMA_STORAGE_ENGINE=YES \ +%else + -DWITH_PERFSCHEMA_STORAGE_ENGINE=NO \ %endif %if "%{with_embedded}" == "yes" - --with-embedded-server \ + -DWITH_EMBEDDED_SERVER=YES \ +%else + -DWITH_EMBEDDED_SERVER=NO \ %endif - --with-charset=%{with_charset} \ - --with-collation=%{with_collation} \ - --without-readline \ - --without-libedit \ - --with-big-tables \ - --with-low-memory \ - --disable-shared \ - $opt + .. - # build source tree - %{l_make} %{l_mflags} + # build source tree (VERBOSE=1) + %{l_make} %{l_mflags -O} %install + # install from build subdirectory + cd objbld - # patch init script - %{l_shtool} subst %{l_value -s -a} \ - scripts/mysql_install_db.sh + ## patch init script (this broken) + #%{l_shtool} subst %{l_value -s -a} \ + # bin/mysql_install_db.sh # perform standard installation procedure %{l_make} %{l_mflags} install \ - AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" \ DESTDIR=$RPM_BUILD_ROOT - # cleanup mysql_config script + # cleanup scripts %{l_shtool} subst \ -e 's;^\(ldflags=.\).*\(.\)$;\1%{l_ldflags}\2;' \ $RPM_BUILD_ROOT%{l_prefix}/bin/mysql_config - # move utility 'replace', msql2mysql is patched for new path + # move utilities, patched for new paths mv $RPM_BUILD_ROOT%{l_prefix}/bin/replace \ $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/ # strip installation area + rm -rf $RPM_BUILD_ROOT%{l_prefix}/data rm -rf $RPM_BUILD_ROOT%{l_prefix}/mysql-test rm -rf $RPM_BUILD_ROOT%{l_prefix}/sql-bench - rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir - rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/mysql-%{V_mysql}.spec rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/binary-configure - rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/make_win_src_distribution - rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/make_win_binary_distribution - rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/comp_err + rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/ndb-config-2-node.ini strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true strip $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/* 2>/dev/null || true %if "%{with_ndbcluster}" == "yes" @@ -243,7 +259,6 @@ rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/mysql/storage/ndb rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/mysql/libndb* rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/ndb* - rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/ndb-config-2-node.ini %endif # install global configuration @@ -261,11 +276,15 @@ %{SOURCE my.pwd} \ $RPM_BUILD_ROOT%{l_prefix}/etc/mysql/ - # install run-command script + # install runcommand script %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d %{l_shtool} install -c -m 755 %{l_value -s -a} \ %{SOURCE rc.mysql} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + # mitigate complex buildconf + %{l_shtool} install -c -m 644 \ + INSTALL-SOURCE $RPM_BUILD_ROOT%{l_prefix}/share/mysql/doc/ + # make sure the database directory exists %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/mysql @@ -305,16 +324,14 @@ # determine the package files %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ %if "%{with_server}" == "yes" - %{l_files_std} \ '%config %attr(644,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.cnf' \ '%config %attr(600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.pwd' \ '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql' \ - '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql/tmp' -%else + '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql/tmp' \ +%endif %{l_files_std} -%endif -%files -f files +%files -f objbld/files %clean