SHARE
TWEET

le mysql 5.7.12

a guest Apr 30th, 2016 155 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ################################################################################
  2. #      This file is part of OpenELEC - http://www.openelec.tv
  3. #      Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
  4. #
  5. #  OpenELEC is free software: you can redistribute it and/or modify
  6. #  it under the terms of the GNU General Public License as published by
  7. #  the Free Software Foundation, either version 2 of the License, or
  8. #  (at your option) any later version.
  9. #
  10. #  OpenELEC is distributed in the hope that it will be useful,
  11. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. #  GNU General Public License for more details.
  14. #
  15. #  You should have received a copy of the GNU General Public License
  16. #  along with OpenELEC.  If not, see <http://www.gnu.org/licenses/>.
  17. ################################################################################
  18.  
  19. PKG_NAME="mysql"
  20. PKG_VERSION="5.7.12"
  21. PKG_REV="1"
  22. PKG_ARCH="any"
  23. PKG_LICENSE="LGPL"
  24. PKG_SITE="http://www.mysql.com"
  25. PKG_URL="http://ftp.gwdg.de/pub/misc/$PKG_NAME/Downloads/MySQL-5.7/$PKG_NAME-$PKG_VERSION.tar.gz"
  26. PKG_DEPENDS_HOST="zlib:host glibc"
  27. PKG_DEPENDS_TARGET="toolchain zlib:host boost ncurses mysql:host"
  28. PKG_PRIORITY="optional"
  29. PKG_SECTION="database"
  30. PKG_SHORTDESC="mysql: A database server"
  31. 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."
  32. PKG_IS_ADDON="no"
  33. PKG_AUTORECONF="no"
  34.  
  35. #TARGET_CFLAGS="$TARGET_CFLAGS -fPIC -DPIC -I$SYSROOT_PREFIX/usr/include/ncurses"
  36.  
  37. #PKG_CONFIGURE_OPTS_HOST="--with-glib-dir=$ROOT/$TOOLCHAIN"
  38.  
  39. post_unpack() {
  40.     if [ ! -f $ROOT/$BUILD/boost_1_59_0.tar.gz ]; then
  41.     wget -O $ROOT/$BUILD/boost_1_59_0.tar.gz http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz
  42.     fi
  43.  
  44.   if [ ! -d $ROOT/$BUILD/boost_1_59_0 ]; then
  45.     echo "extracting boost_1_59_0..."
  46.     tar xzf $ROOT/$BUILD/boost_1_59_0.tar.gz -C $ROOT/$BUILD
  47.   fi
  48.  
  49.   # openssl  1.0.2h
  50.   # libressl 2.2.6
  51.   sed -i 's|OPENSSL_MAJOR_VERSION STREQUAL "1"|OPENSSL_MAJOR_VERSION STREQUAL "2"|' $ROOT/$PKG_BUILD/cmake/ssl.cmake
  52.  
  53.   # hack!
  54.   sed -i 's|GET_TARGET_PROPERTY(LIBMYSQL_OS_OUTPUT_NAME libmysql OUTPUT_NAME)|SET(LIBMYSQL_OS_OUTPUT_NAME "mysqlclient")|' $ROOT/$PKG_BUILD/scripts/CMakeLists.txt
  55. }
  56.  
  57. configure_host() {
  58.   cmake -DCMAKE_INSTALL_PREFIX=$TOOLCHAIN             \
  59.         -DCMAKE_BUILD_TYPE=Release                    \
  60.         -DWITHOUT_SERVER=OFF                          \
  61.         -DWITH_EMBEDDED_SERVER=OFF                    \
  62.         -DWITH_INNOBASE_STORAGE_ENGINE=OFF            \
  63.         -DWITH_PARTITION_STORAGE_ENGINE=OFF           \
  64.         -DWITH_PERFSCHEMA_STORAGE_ENGINE=OFF          \
  65.         -DWITH_EXTRA_CHARSETS=none                    \
  66.         -DWITH_EDITLINE=bundled                       \
  67.         -DWITH_LIBEVENT=bundled                       \
  68.         -DLOCAL_BOOST_DIR=$ROOT/$BUILD/boost_1_59_0   \
  69.         -DBOOST_INCLUDE_DIR=$ROOT/$BUILD/boost_1_59_0 \
  70.         -DWITH_UNIT_TESTS=OFF                         \
  71.         -DWITH_ZLIB=bundled                           \
  72.         ..
  73. }
  74.  
  75. make_host() {
  76.   make comp_err
  77.   make gen_lex_hash
  78.   make comp_sql
  79. }
  80.  
  81. post_make_host() {
  82.   # copy host binaries back - should be fixed
  83.   cp scripts/comp_sql ../scripts/comp_sql
  84. }
  85.  
  86. makeinstall_host() {
  87.   mkdir -p $ROOT/$TOOLCHAIN/bin
  88.   cp -PR extra/comp_err $ROOT/$TOOLCHAIN/bin
  89.   cp -PR sql/gen_lex_hash $ROOT/$TOOLCHAIN/bin
  90.   cp -PR scripts/comp_sql $ROOT/$TOOLCHAIN/bin
  91. }
  92.  
  93. configure_target() {   
  94. #  strip_lto
  95.   cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF            \
  96.         -DCMAKE_BUILD_TYPE=Release                    \
  97.         -DFEATURE_SET=classic                         \
  98.         -DDISABLE_SHARED=ON                           \
  99.         -DCMAKE_INSTALL_PREFIX=/usr                   \
  100.         -DINSTALL_DOCDIR=share/doc/mysql              \
  101.         -DINSTALL_DOCREADMEDIR=share/doc/mysql        \
  102.         -DINSTALL_INCLUDEDIR=include/mysql            \
  103.         -DINSTALL_INFODIR=share/info                  \
  104.         -DINSTALL_MANDIR=share/man                    \
  105.         -DINSTALL_MYSQLDATADIR=/storage/.mysql        \
  106.         -DINSTALL_MYSQLSHAREDIR=share/mysql           \
  107.         -DINSTALL_MYSQLTESTDIR=share/mysql/test       \
  108.         -DINSTALL_PLUGINDIR=lib/mysql/plugin          \
  109.         -DINSTALL_SBINDIR=sbin                        \
  110.         -DINSTALL_SCRIPTDIR=bin                       \
  111.         -DINSTALL_SUPPORTFILESDIR=share/mysql/support \
  112.         -DMYSQL_DATADIR=/storage/.mysql               \
  113.         -DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock     \
  114.         -DSYSCONFDIR=/etc/mysql                       \
  115.         -DWITH_EMBEDDED_SERVER=OFF                    \
  116.         -DWITH_INNOBASE_STORAGE_ENGINE=OFF            \
  117.         -DWITH_PARTITION_STORAGE_ENGINE=OFF           \
  118.         -DWITH_PERFSCHEMA_STORAGE_ENGINE=OFF          \
  119.         -DWITH_EXTRA_CHARSETS=all                     \
  120.         -DENABLE_DTRACE=OFF                           \
  121.         -DWITH_EDITLINE=bundled                       \
  122.         -DWITH_LIBEVENT=bundled                       \
  123.         -DWITH_UNIT_TESTS=OFF                         \
  124.         -DWITHOUT_SERVER=1                            \
  125.         -DWITH_ZLIB=system                            \
  126.         -DSTACK_DIRECTION=1                           \
  127.         -DLOCAL_BOOST_DIR=$ROOT/$BUILD/boost_1_59_0   \
  128.         -DBOOST_INCLUDE_DIR=$ROOT/$BUILD/boost_1_59_0 \
  129.         -DHAVE_LLVM_LIBCPP=1                          \
  130.                 -DWITH_SSL=$SYSROOT_PREFIX/usr                \
  131.         ..
  132. }
  133.  
  134. aa_post_make_target() {
  135.     # hack!
  136.     sed -i "s|LIBMYSQL_OS_OUTPUT_NAME-NOTFOUND|mysqlclient|" scripts/mysql_config
  137.     sed -i "s|LIBMYSQL_OS_OUTPUT_NAME-NOTFOUND|mysqlclient|" scripts/cmake_install.cmake
  138.     sed -i "s|LIBMYSQL_OS_OUTPUT_NAME-NOTFOUND|mysqlclient|" scripts/LIBMYSQL_OS_OUTPUT_NAME-NOTFOUND.pc
  139.     sed -i "s|LIBMYSQL_OS_OUTPUT_NAME-NOTFOUND|mysqlclient|" scripts/mysql_config.pl
  140.     mv scripts/LIBMYSQL_OS_OUTPUT_NAME-NOTFOUND.pc scripts/mysqlclient.pc
  141. }
  142.  
  143. post_makeinstall_target() {
  144.   sed -i "s|pkgincludedir=.*|pkgincludedir=\'$SYSROOT_PREFIX/usr/include/mysql\'|" scripts/mysql_config
  145.   sed -i "s|pkglibdir=.*|pkglibdir=\'$SYSROOT_PREFIX/usr/lib/mysql\'|" scripts/mysql_config
  146.   #mkdir -p $ROOT/$TOOLCHAIN/bin
  147.   #cp -PR scripts/mysql_config $ROOT/$TOOLCHAIN/bin
  148.    
  149.   cp scripts/mysql_config $SYSROOT_PREFIX/usr/bin
  150.   ln -sf $SYSROOT_PREFIX/usr/bin/mysql_config $ROOT/$TOOLCHAIN/bin/mysql_config
  151.  
  152.   #for i in `ls -d $SYSROOT_PREFIX/usr/lib/mysql/*.a`; do
  153.   #  ln -v -sf $i $SYSROOT_PREFIX/usr/lib
  154.   #done
  155.  
  156.   rm -rf $INSTALL/usr/bin
  157.   rm -rf $INSTALL/usr/sbin
  158.   rm -rf $INSTALL/usr/lib/mysql/plugin
  159.   rm -rf $INSTALL/usr/share/mysql/bench
  160.   rm -rf $INSTALL/usr/share/mysql/support
  161.   rm -rf $INSTALL/usr/share/mysql/test
  162.  
  163.   if [ "$MYSQL_SERVER" = "yes" ]; then
  164.     mkdir -p $INSTALL/usr/bin
  165.       cp -P extra/resolveip $INSTALL/usr/bin
  166.       cp -P extra/my_print_defaults $INSTALL/usr/bin
  167.       cp -P client/mysql $INSTALL/usr/bin
  168.       cp -P client/mysqladmin $INSTALL/usr/bin
  169.       cp -P scripts/mysql_install_db $INSTALL/usr/bin
  170.  
  171.     mkdir -p $INSTALL/usr/sbin
  172.       cp -P sql/mysqld $INSTALL/usr/sbin
  173.  
  174.     mkdir -p $INSTALL/etc/init.d
  175.       cp $PKG_DIR/scripts/* $INSTALL/etc/init.d
  176.   else
  177.     rm -rf $INSTALL/usr/share/mysql
  178.   fi
  179. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top