diff --git a/packages/databases/mysql/package.mk b/packages/databases/mysql/package.mk index 438b857974..a3090fc0f5 100644 --- a/packages/databases/mysql/package.mk +++ b/packages/databases/mysql/package.mk @@ -19,14 +19,14 @@ ################################################################################ PKG_NAME="mysql" -PKG_VERSION="5.1.70" +PKG_VERSION="5.6.13" PKG_REV="1" PKG_ARCH="any" PKG_LICENSE="LGPL" PKG_SITE="http://www.mysql.com" -PKG_URL="http://ftp.gwdg.de/pub/misc/$PKG_NAME/Downloads/MySQL-5.1/$PKG_NAME-$PKG_VERSION.tar.gz" +PKG_URL="http://cdn.mysql.com/Downloads/MySQL-5.6/$PKG_NAME-$PKG_VERSION.tar.gz" PKG_DEPENDS="zlib ncurses" -PKG_BUILD_DEPENDS_HOST="toolchain zlib:host" +PKG_BUILD_DEPENDS_HOST="toolchain zlib:host ncurses" PKG_BUILD_DEPENDS_TARGET="toolchain zlib ncurses mysql:host" PKG_PRIORITY="optional" PKG_SECTION="database" @@ -34,83 +34,124 @@ PKG_SHORTDESC="mysql: A database server" PKG_LONGDESC="MySQL is a SQL (Structured Query Language) database server. SQL is the most popular database language in the world. MySQL is a client server implementation that consists of a server daemon mysqld and many different client programs/libraries." PKG_IS_ADDON="no" -PKG_AUTORECONF="yes" +PKG_AUTORECONF="no" -TARGET_CFLAGS="$TARGET_CFLAGS -fPIC -DPIC" +# export MAKEFLAGS=-j1 -PKG_CONFIGURE_OPTS_HOST="--with-zlib-dir=$ROOT/$TOOLCHAIN" +pre_configure_host() { + sed -i "/ADD_SUBDIRECTORY(sql\/share)/d" ../CMakeLists.txt + sed -i "s/ADD_SUBDIRECTORY(libmysql)/&\\nADD_SUBDIRECTORY(sql\/share)/" ../CMakeLists.txt + sed -i "s@data/test@\${INSTALL_MYSQLSHAREDIR}@g" ../sql/CMakeLists.txt + sed -i "s@data/mysql@\${INSTALL_MYSQLTESTDIR}@g" ../sql/CMakeLists.txt +} -PKG_CONFIGURE_OPTS_TARGET="ac_cv_c_stack_direction=-1 \ - ac_cv_sys_restartable_syscalls=yes \ - --localstatedir=/storage/.mysql \ - --with-unix-socket-path=/var/tmp/mysql.socket \ - --with-tcp-port=3306 \ - --enable-static \ - --disable-shared \ - --with-low-memory \ - --enable-largefile \ - --with-big-tables \ - --with-mysqld-user=mysqld \ - --with-extra-charsets=all \ - --with-pthread \ - --with-named-thread-libs=-lpthread \ - --enable-thread-safe-client \ - --enable-assembler \ - --enable-local-infile \ - --without-debug \ - --without-docs \ - --without-man \ - --with-readline \ - --without-libwrap \ - --without-pstack \ - --without-server \ - --without-embedded-server \ - --without-libedit \ - --with-query-cache \ - --without-plugin-partition \ - --without-plugin-daemon_example \ - --without-plugin-ftexample \ - --without-plugin-archive \ - --without-plugin-blackhole \ - --without-plugin-example \ - --without-plugin-federated \ - --without-plugin-ibmdb2i \ - --without-plugin-innobase \ - --without-plugin-innodb_plugin \ - --without-plugin-ndbcluster" +# package specific configure options +configure_host() { + cmake -DCMAKE_INSTALL_PREFIX=$TOOLCHAIN \ + -DCMAKE_BUILD_TYPE=Release \ + -DWITHOUT_SERVER=OFF \ + -DWITH_EMBEDDED_SERVER=OFF \ + -DWITH_EXAMPLE_STORAGE_ENGINE=OFF \ + -DWITH_FEDERATED_STORAGE_ENGINE=OFF \ + -DWITH_INNOBASE_STORAGE_ENGINE=OFF \ + -DWITH_PARTITION_STORAGE_ENGINE=OFF \ + -DWITH_PERFSCHEMA_STORAGE_ENGINE=OFF \ + -DWITH_EXTRA_CHARSETS=none \ + -DWITH_EDITLINE=bundled \ + -DWITH_LIBEVENT=bundled \ + -DWITH_SSL=bundled \ + -DWITH_UNIT_TESTS=OFF \ + -DWITH_ZLIB=bundled \ + .. +} make_host() { - make -C include my_config.h - make -C mysys libmysys.a - make -C strings libmystrings.a - make -C dbug factorial - make -C vio libvio.a - make -C dbug libdbug.a - make -C regex libregex.a - make -C sql gen_lex_hash - make -C scripts comp_sql - make -C extra comp_err + make comp_err + make gen_lex_hash + make comp_sql } makeinstall_host() { - cp -PR dbug/factorial $ROOT/$TOOLCHAIN/bin/mysql-factorial - cp -PR sql/gen_lex_hash $ROOT/$TOOLCHAIN/bin/mysql-gen_lex_hash - cp -PR scripts/comp_sql $ROOT/$TOOLCHAIN/bin/mysql-comp_sql - cp -PR extra/comp_err $ROOT/$TOOLCHAIN/bin/mysql-comp_err + mkdir -p $ROOT/$TOOLCHAIN/bin + cp -PR extra/comp_err $ROOT/$TOOLCHAIN/bin + cp -PR sql/gen_lex_hash $ROOT/$TOOLCHAIN/bin + cp -PR scripts/comp_sql $ROOT/$TOOLCHAIN/bin +} + +configure_target() { +# strip_lto + cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \ + -DCMAKE_BUILD_TYPE=Release \ + -DFEATURE_SET=classic \ + -DDISABLE_SHARED=ON \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DINSTALL_DOCDIR=share/doc/mysql \ + -DINSTALL_DOCREADMEDIR=share/doc/mysql \ + -DINSTALL_INCLUDEDIR=include/mysql \ + -DINSTALL_INFODIR=share/info \ + -DINSTALL_MANDIR=share/man \ + -DINSTALL_MYSQLDATADIR=/storage/.mysql \ + -DINSTALL_MYSQLSHAREDIR=share/mysql \ + -DINSTALL_MYSQLTESTDIR=share/mysql/test \ + -DINSTALL_PLUGINDIR=lib/mysql/plugin \ + -DINSTALL_SBINDIR=sbin \ + -DINSTALL_SCRIPTDIR=bin \ + -DINSTALL_SQLBENCHDIR=share/mysql/bench \ + -DINSTALL_SUPPORTFILESDIR=share/mysql/support \ + -DMYSQL_DATADIR=/storage/.mysql \ + -DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock \ + -DSYSCONFDIR=/etc/mysql \ + -DWITHOUT_SERVER=OFF \ + -DWITH_EMBEDDED_SERVER=OFF \ + -DWITH_EXAMPLE_STORAGE_ENGINE=OFF \ + -DWITH_FEDERATED_STORAGE_ENGINE=OFF \ + -DWITH_INNOBASE_STORAGE_ENGINE=OFF \ + -DWITH_PARTITION_STORAGE_ENGINE=OFF \ + -DWITH_PERFSCHEMA_STORAGE_ENGINE=OFF \ + -DWITH_EXTRA_CHARSETS=all \ + -DENABLE_DTRACE=OFF \ + -DWITH_EDITLINE=bundled \ + -DWITH_LIBEVENT=bundled \ + -DWITH_SSL=system \ + -DWITH_UNIT_TESTS=OFF \ + -DWITH_ZLIB=system \ + -DSTACK_DIRECTION=1 \ + .. +} + +pre_make_target() { +# copy host binaries back - should be fixed + cp -PR ../.$HOST_NAME/scripts/comp_sql ../scripts/comp_sql } post_makeinstall_target() { sed -i "s|pkgincludedir=.*|pkgincludedir=\'$SYSROOT_PREFIX/usr/include/mysql\'|" scripts/mysql_config sed -i "s|pkglibdir=.*|pkglibdir=\'$SYSROOT_PREFIX/usr/lib/mysql\'|" scripts/mysql_config - cp scripts/mysql_config $SYSROOT_PREFIX/usr/bin - ln -sf $SYSROOT_PREFIX/usr/bin/mysql_config $ROOT/$TOOLCHAIN/bin/mysql_config - for i in `ls -d $SYSROOT_PREFIX/usr/lib/mysql/*.a`; do - ln -v -sf $i $SYSROOT_PREFIX/usr/lib - done + mkdir -p $ROOT/$TOOLCHAIN/bin + cp -PR scripts/mysql_config $ROOT/$TOOLCHAIN/bin rm -rf $INSTALL/usr/bin - rm -rf $INSTALL/usr/mysql-test - rm -rf $INSTALL/usr/share/mysql - rm -rf $INSTALL/usr/sql-bench + rm -rf $INSTALL/usr/sbin + rm -rf $INSTALL/usr/lib/mysql/plugin + rm -rf $INSTALL/usr/share/mysql/bench + rm -rf $INSTALL/usr/share/mysql/support + rm -rf $INSTALL/usr/share/mysql/test + + if [ "$MYSQL_SERVER" = "yes" ]; then + mkdir -p $INSTALL/usr/bin + cp -P extra/resolveip $INSTALL/usr/bin + cp -P extra/my_print_defaults $INSTALL/usr/bin + cp -P client/mysql $INSTALL/usr/bin + cp -P client/mysqladmin $INSTALL/usr/bin + cp -P scripts/mysql_install_db $INSTALL/usr/bin + + mkdir -p $INSTALL/usr/sbin + cp -P sql/mysqld $INSTALL/usr/sbin + + mkdir -p $INSTALL/etc/init.d + cp $PKG_DIR/scripts/* $INSTALL/etc/init.d + else + rm -rf $INSTALL/usr/share/mysql + fi } diff --git a/packages/databases/mysql/patches/mysql-010_crosscompiling.patch b/packages/databases/mysql/patches/mysql-010_crosscompiling.patch deleted file mode 100644 index b6c3e068a1..0000000000 --- a/packages/databases/mysql/patches/mysql-010_crosscompiling.patch +++ /dev/null @@ -1,128 +0,0 @@ -diff -Naur mysql-5.1.38/dbug/Makefile.am mysql-5.1.38.patch/dbug/Makefile.am ---- mysql-5.1.38/dbug/Makefile.am 2009-08-21 14:09:22.000000000 +0200 -+++ mysql-5.1.38.patch/dbug/Makefile.am 2009-09-10 02:57:59.000000000 +0200 -@@ -44,19 +44,19 @@ - -groff -mm user.r > $@ - - output1.r: factorial -- ./factorial 1 2 3 4 5 | cat > $@ -+ mysql-factorial 1 2 3 4 5 | cat > $@ - - output2.r: factorial -- ./factorial -\#t:o 2 3 | cat >$@ -+ mysql-factorial -\#t:o 2 3 | cat >$@ - - output3.r: factorial -- ./factorial -\#d:t:o 3 | cat >$@ -+ mysql-factorial -\#d:t:o 3 | cat >$@ - - output4.r: factorial -- ./factorial -\#d,result:o 4 | cat >$@ -+ mysql-factorial -\#d,result:o 4 | cat >$@ - - output5.r: factorial -- ./factorial -\#d:f,factorial:F:L:o 3 | cat >$@ -+ mysql-factorial -\#d:f,factorial:F:L:o 3 | cat >$@ - .c.r: - @RM@ -f $@ - @SED@ -e 's!\\!\\\\!g' $< > $@ -diff -Naur mysql-5.1.38/dbug/Makefile.in mysql-5.1.38.patch/dbug/Makefile.in ---- mysql-5.1.38/dbug/Makefile.in 2009-08-21 14:17:15.000000000 +0200 -+++ mysql-5.1.38.patch/dbug/Makefile.in 2009-09-10 02:58:14.000000000 +0200 -@@ -746,19 +746,19 @@ - -groff -mm user.r > $@ - - output1.r: factorial -- ./factorial 1 2 3 4 5 | cat > $@ -+ mysql-factorial 1 2 3 4 5 | cat > $@ - - output2.r: factorial -- ./factorial -\#t:o 2 3 | cat >$@ -+ mysql-factorial -\#t:o 2 3 | cat >$@ - - output3.r: factorial -- ./factorial -\#d:t:o 3 | cat >$@ -+ mysql-factorial -\#d:t:o 3 | cat >$@ - - output4.r: factorial -- ./factorial -\#d,result:o 4 | cat >$@ -+ mysql-factorial -\#d,result:o 4 | cat >$@ - - output5.r: factorial -- ./factorial -\#d:f,factorial:F:L:o 3 | cat >$@ -+ mysql-factorial -\#d:f,factorial:F:L:o 3 | cat >$@ - .c.r: - @RM@ -f $@ - @SED@ -e 's!\\!\\\\!g' $< > $@ -diff -Naur mysql-5.1.38/extra/Makefile.am mysql-5.1.38.patch/extra/Makefile.am ---- mysql-5.1.38/extra/Makefile.am 2009-08-21 14:09:23.000000000 +0200 -+++ mysql-5.1.38.patch/extra/Makefile.am 2009-09-10 02:53:50.000000000 +0200 -@@ -32,7 +32,7 @@ - $(top_builddir)/include/mysqld_error.h: comp_err.c \ - $(top_srcdir)/sql/share/errmsg.txt - $(MAKE) $(AM_MAKEFLAGS) comp_err$(EXEEXT) -- $(top_builddir)/extra/comp_err$(EXEEXT) \ -+ mysql-comp_err$(EXEEXT) \ - --charset=$(top_srcdir)/sql/share/charsets \ - --out-dir=$(top_builddir)/sql/share/ \ - --header_file=$(top_builddir)/include/mysqld_error.h \ -diff -Naur mysql-5.1.38/extra/Makefile.in mysql-5.1.38.patch/extra/Makefile.in ---- mysql-5.1.38/extra/Makefile.in 2009-08-21 14:17:16.000000000 +0200 -+++ mysql-5.1.38.patch/extra/Makefile.in 2009-09-10 02:53:16.000000000 +0200 -@@ -936,7 +936,7 @@ - $(top_builddir)/include/mysqld_error.h: comp_err.c \ - $(top_srcdir)/sql/share/errmsg.txt - $(MAKE) $(AM_MAKEFLAGS) comp_err$(EXEEXT) -- $(top_builddir)/extra/comp_err$(EXEEXT) \ -+ mysql-comp_err$(EXEEXT) \ - --charset=$(top_srcdir)/sql/share/charsets \ - --out-dir=$(top_builddir)/sql/share/ \ - --header_file=$(top_builddir)/include/mysqld_error.h \ -diff -Naur mysql-5.1.38/scripts/Makefile.am mysql-5.1.38.patch/scripts/Makefile.am ---- mysql-5.1.38/scripts/Makefile.am 2009-08-21 14:11:26.000000000 +0200 -+++ mysql-5.1.38.patch/scripts/Makefile.am 2009-09-10 02:57:01.000000000 +0200 -@@ -121,7 +121,7 @@ - mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql - $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT) - sleep 2 -- $(top_builddir)/scripts/comp_sql$(EXEEXT) \ -+ mysql-comp_sql$(EXEEXT) \ - mysql_fix_privilege_tables \ - $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@ - -diff -Naur mysql-5.1.38/scripts/Makefile.in mysql-5.1.38.patch/scripts/Makefile.in ---- mysql-5.1.38/scripts/Makefile.in 2009-08-21 14:17:23.000000000 +0200 -+++ mysql-5.1.38.patch/scripts/Makefile.in 2009-09-10 02:57:11.000000000 +0200 -@@ -802,7 +802,7 @@ - mysql_fix_privilege_tables_sql.c: comp_sql.c mysql_fix_privilege_tables.sql - $(MAKE) $(AM_MAKEFLAGS) comp_sql$(EXEEXT) - sleep 2 -- $(top_builddir)/scripts/comp_sql$(EXEEXT) \ -+ mysql-comp_sql$(EXEEXT) \ - mysql_fix_privilege_tables \ - $(top_srcdir)/scripts/mysql_fix_privilege_tables.sql $@ - -diff -Naur mysql-5.1.38/sql/Makefile.am mysql-5.1.38.patch/sql/Makefile.am ---- mysql-5.1.38/sql/Makefile.am 2009-08-21 14:12:24.000000000 +0200 -+++ mysql-5.1.38.patch/sql/Makefile.am 2009-09-10 02:55:09.000000000 +0200 -@@ -174,7 +174,7 @@ - # this avoid the rebuild of the built files in a source dist - lex_hash.h: gen_lex_hash.cc lex.h - $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT) -- ./gen_lex_hash$(EXEEXT) > $@-t -+ mysql-gen_lex_hash$(EXEEXT) > $@-t - $(MV) $@-t $@ - - # For testing of udf_example.so -diff -Naur mysql-5.1.38/sql/Makefile.in mysql-5.1.38.patch/sql/Makefile.in ---- mysql-5.1.38/sql/Makefile.in 2009-08-21 14:17:25.000000000 +0200 -+++ mysql-5.1.38.patch/sql/Makefile.in 2009-09-10 02:55:22.000000000 +0200 -@@ -1302,7 +1302,7 @@ - # this avoid the rebuild of the built files in a source dist - lex_hash.h: gen_lex_hash.cc lex.h - $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT) -- ./gen_lex_hash$(EXEEXT) > $@-t -+ mysql-gen_lex_hash$(EXEEXT) > $@-t - $(MV) $@-t $@ - - # We might have some stuff not built in this build, but that we want to install diff --git a/packages/databases/mysql/scripts/54_mysql b/packages/databases/mysql/scripts/54_mysql new file mode 100644 index 0000000000..214c92ff6a --- /dev/null +++ b/packages/databases/mysql/scripts/54_mysql @@ -0,0 +1,43 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# 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; either version 2, or (at your option) +# any later version. +# +# 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 OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +# start MySql Server +# +# runlevels: openelec, textmode + +( + + progress "Starting MySql server" + + if [ ! -f /storage/.mysql/data ] + then + mkdir -p /storage/.mysql + mkdir -p /storage/.mysql/data + + mysql_install_db --user=root --datadir=/storage/.mysql/data > /dev/null 2>&1 + (mysqld --user=root --datadir=/storage/.mysql/data > /dev/null 2>&1)& + mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'openelec' WITH GRANT OPTION;" > /dev/null 2>&1 + mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'openelec' WITH GRANT OPTION;" > /dev/null 2>&1 + killall mysqld + fi + + mysqld --user=root --datadir=/storage/.mysql/data > /dev/null 2>&1 +)& +