From 754e6ade8120d0b4c9ceeac3776b049f0735c19a Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 6 Aug 2012 07:21:26 +0200 Subject: [PATCH] mysql: update to 5.5.27 and finally switch to systemd. --- common/shlibs | 5 +- srcpkgs/libmysqld-devel | 1 - srcpkgs/libndbclient | 1 - srcpkgs/libndbclient-devel | 1 - srcpkgs/mysql-ndb | 1 - srcpkgs/mysql/INSTALL | 29 +----- srcpkgs/mysql/files/my.cnf | 61 +++++------ srcpkgs/mysql/files/mysqld-post | 7 ++ srcpkgs/mysql/files/mysqld.confd | 10 -- srcpkgs/mysql/files/mysqld.rc | 47 --------- srcpkgs/mysql/files/mysqld.service | 11 ++ srcpkgs/mysql/files/mysqld.tmpfilesd | 1 + srcpkgs/mysql/libmysqlclient-devel.template | 19 +--- srcpkgs/mysql/libmysqlclient.rshlibs | 3 +- srcpkgs/mysql/libmysqlclient.template | 7 +- srcpkgs/mysql/libmysqld-devel.template | 14 --- srcpkgs/mysql/libndbclient-devel.template | 21 ---- srcpkgs/mysql/libndbclient.rshlibs | 5 - srcpkgs/mysql/libndbclient.template | 14 --- srcpkgs/mysql/mysql-client.rshlibs | 6 +- srcpkgs/mysql/mysql-client.template | 19 ++-- srcpkgs/mysql/mysql-ndb.rshlibs | 7 -- srcpkgs/mysql/mysql-ndb.template | 22 ---- srcpkgs/mysql/mysql.rshlibs | 5 +- srcpkgs/mysql/template | 109 +++++++++++++------- 25 files changed, 139 insertions(+), 287 deletions(-) delete mode 120000 srcpkgs/libmysqld-devel delete mode 120000 srcpkgs/libndbclient delete mode 120000 srcpkgs/libndbclient-devel delete mode 120000 srcpkgs/mysql-ndb create mode 100644 srcpkgs/mysql/files/mysqld-post delete mode 100644 srcpkgs/mysql/files/mysqld.confd delete mode 100644 srcpkgs/mysql/files/mysqld.rc create mode 100644 srcpkgs/mysql/files/mysqld.service create mode 100644 srcpkgs/mysql/files/mysqld.tmpfilesd delete mode 100644 srcpkgs/mysql/libmysqld-devel.template delete mode 100644 srcpkgs/mysql/libndbclient-devel.template delete mode 100644 srcpkgs/mysql/libndbclient.rshlibs delete mode 100644 srcpkgs/mysql/libndbclient.template delete mode 100644 srcpkgs/mysql/mysql-ndb.rshlibs delete mode 100644 srcpkgs/mysql/mysql-ndb.template diff --git a/common/shlibs b/common/shlibs index 6ced679d419..dd7acc1297b 100644 --- a/common/shlibs +++ b/common/shlibs @@ -480,9 +480,8 @@ libecpg_compat.so.3 postgresql-libs-8.4.2_1 libecpg.so.6 postgresql-libs-8.4.2_1 libpgtypes.so.3 postgresql-libs-8.4.2_1 libpq.so.5 postgresql-libs-8.4.2_1 -libmysqlclient_r.so.16 libmysqlclient-5.1.14_1 -libmysqlclient.so.16 libmysqlclient-5.1.14_1 -libndbclient.so.16 libndbclient-5.1.14_1 +libmysqlclient_r.so.18 libmysqlclient-5.5.27_1 +libmysqlclient.so.18 libmysqlclient-5.5.27_1 libgssapi_krb5.so.2 mit-krb5-libs-1.8_1 libgssrpc.so.4 mit-krb5-libs-1.8_1 libk5crypto.so.3 mit-krb5-libs-1.8_1 diff --git a/srcpkgs/libmysqld-devel b/srcpkgs/libmysqld-devel deleted file mode 120000 index 0d46ca32142..00000000000 --- a/srcpkgs/libmysqld-devel +++ /dev/null @@ -1 +0,0 @@ -mysql \ No newline at end of file diff --git a/srcpkgs/libndbclient b/srcpkgs/libndbclient deleted file mode 120000 index 0d46ca32142..00000000000 --- a/srcpkgs/libndbclient +++ /dev/null @@ -1 +0,0 @@ -mysql \ No newline at end of file diff --git a/srcpkgs/libndbclient-devel b/srcpkgs/libndbclient-devel deleted file mode 120000 index 0d46ca32142..00000000000 --- a/srcpkgs/libndbclient-devel +++ /dev/null @@ -1 +0,0 @@ -mysql \ No newline at end of file diff --git a/srcpkgs/mysql-ndb b/srcpkgs/mysql-ndb deleted file mode 120000 index 0d46ca32142..00000000000 --- a/srcpkgs/mysql-ndb +++ /dev/null @@ -1 +0,0 @@ -mysql \ No newline at end of file diff --git a/srcpkgs/mysql/INSTALL b/srcpkgs/mysql/INSTALL index 0b8594685c4..f6506edc7d6 100644 --- a/srcpkgs/mysql/INSTALL +++ b/srcpkgs/mysql/INSTALL @@ -2,32 +2,7 @@ # case ${ACTION} in post) - cat << _EOF -========================================================================== - -PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER -To do so, start the server with: - - $ /etc/init.d/mysqld start - -and then issue the following commands: - - $ mysqladmin -u root password 'new-password' - $ mysqladmin -u root -h $hostname password 'new-password' - -Alternatively you can run: - - $ mysql_secure_installation - -which will also give you the option of removing the test -databases and anonymous user created by default. This is -strongly recommended for production servers. - -Don't forget that you should also tweak /etc/mysql/my.cnf -for server settings. Additional configuration files are available -in the /usr/share/mysql/my-*.cnf files. - -========================================================================== -_EOF + usr/bin/mysql_install_db --user=mysql --basedir=/usr + chown -R mysql:mysql var/lib/mysql ;; esac diff --git a/srcpkgs/mysql/files/my.cnf b/srcpkgs/mysql/files/my.cnf index 81a49b7e755..3870208583f 100644 --- a/srcpkgs/mysql/files/my.cnf +++ b/srcpkgs/mysql/files/my.cnf @@ -1,13 +1,14 @@ -# Example MySQL config file for large systems. +# MySQL config file for medium systems. # -# This is for a large system with memory = 512M where the system runs mainly -# MySQL. +# This is for a system with little memory (32M - 64M) where MySQL plays +# an important part, or systems up to 128M where MySQL is used together with +# other programs (such as a web server) # -# You can copy this file to -# /etc/my.cnf to set global options, -# mysql-data-dir/my.cnf to set server-specific options (in this -# installation this directory is /var) or -# ~/.my.cnf to set user-specific options. +# MySQL programs look for option files in a set of +# locations which depend on the deployment platform. +# You can copy this option file to one of those +# locations. For information about these locations, see: +# http://dev.mysql.com/doc/mysql/en/option-files.html # # In this file, you can use all long options that a program supports. # If you want to know which options a program supports, run the program @@ -17,26 +18,24 @@ [client] #password = your_password port = 3306 -socket = /var/run/mysqld/mysqld.sock +socket = /run/mysqld/mysqld.sock # Here follows entries for some specific programs # The MySQL server [mysqld] port = 3306 -socket = /var/run/mysqld/mysqld.sock -skip-locking -key_buffer_size = 256M +socket = /run/mysqld/mysqld.sock +datadir = /var/lib/mysql +skip-external-locking +key_buffer_size = 16M max_allowed_packet = 1M -table_open_cache = 256 -sort_buffer_size = 1M -read_buffer_size = 1M -read_rnd_buffer_size = 4M -myisam_sort_buffer_size = 64M -thread_cache_size = 8 -query_cache_size= 16M -# Try number of CPU's*2 for thread_concurrency -thread_concurrency = 8 +table_open_cache = 64 +sort_buffer_size = 512K +net_buffer_length = 8K +read_buffer_size = 256K +read_rnd_buffer_size = 512K +myisam_sort_buffer_size = 8M # Don't listen on a TCP/IP port at all. This can be a security enhancement, # if all processes that need to connect to mysqld run on the same host. @@ -44,7 +43,7 @@ thread_concurrency = 8 # Note that using this option without enabling named pipes on Windows # (via the "enable-named-pipe" option) will render mysqld useless! # -#skip-networking +skip-networking # Replication Master Server (default) # binary logging is required for replication @@ -113,20 +112,16 @@ server-id = 1 # binary logging - not required for slaves, but recommended #log-bin=mysql-bin -# Point the following paths to different dedicated disks -#tmpdir = /tmp/ -#log-update = /path-to-dedicated-directory/hostname - # Uncomment the following if you are using InnoDB tables -#innodb_data_home_dir = /var/ +#innodb_data_home_dir = /var/lib/mysql #innodb_data_file_path = ibdata1:10M:autoextend -#innodb_log_group_home_dir = /var/ +#innodb_log_group_home_dir = /var/lib/mysql # You can set .._buffer_pool_size up to 50 - 80 % # of RAM but beware of setting memory usage too high -#innodb_buffer_pool_size = 256M -#innodb_additional_mem_pool_size = 20M +#innodb_buffer_pool_size = 16M +#innodb_additional_mem_pool_size = 2M # Set .._log_file_size to 25 % of buffer pool size -#innodb_log_file_size = 64M +#innodb_log_file_size = 5M #innodb_log_buffer_size = 8M #innodb_flush_log_at_trx_commit = 1 #innodb_lock_wait_timeout = 50 @@ -141,8 +136,8 @@ no-auto-rehash #safe-updates [myisamchk] -key_buffer_size = 128M -sort_buffer_size = 128M +key_buffer_size = 20M +sort_buffer_size = 20M read_buffer = 2M write_buffer = 2M diff --git a/srcpkgs/mysql/files/mysqld-post b/srcpkgs/mysql/files/mysqld-post new file mode 100644 index 00000000000..50ea5da49ab --- /dev/null +++ b/srcpkgs/mysql/files/mysqld-post @@ -0,0 +1,7 @@ +#!/bin/sh + +while true; do + response=`/usr/bin/mysqladmin -uUNKNOWN_USER ping 2>&1` && break + echo "$response" | grep -q "mysqld is alive" && break + sleep 1 +done diff --git a/srcpkgs/mysql/files/mysqld.confd b/srcpkgs/mysql/files/mysqld.confd deleted file mode 100644 index 46c4d6f1bc2..00000000000 --- a/srcpkgs/mysql/files/mysqld.confd +++ /dev/null @@ -1,10 +0,0 @@ -# Configuration file for MySQL server. -# -# Directory to store database files. Set to /var/lib/mysql by default. -# -#MYSQLD_DATADIR=/var/lib/mysql -# -# Additional arguments to be passed to the MySQL server daemon. -# Please note that you should also tweak /etc/mysql/my.cnf. -# -#MYSQLD_ARGS="" diff --git a/srcpkgs/mysql/files/mysqld.rc b/srcpkgs/mysql/files/mysqld.rc deleted file mode 100644 index 103dc8cfad4..00000000000 --- a/srcpkgs/mysql/files/mysqld.rc +++ /dev/null @@ -1,47 +0,0 @@ -#!/sbin/runscript -# - -: ${MYSQLD_PIDFILE:=/var/run/mysqld/mysqld.pid} -: ${MYSQLD_DATADIR=/var/lib/mysql} - -depend() -{ - need net localmount - provide mysqld -} - -start_pre() -{ - if [ ! -d /var/run/mysqld ]; then - mkdir -p /var/run/mysqld - chown mysqld:mysqld /var/run/mysqld - fi - - if [ ! -d ${MYSQLD_DATADIR} ]; then - ebegin "Initializing MySQL datadir: ${MYSQLD_DATADIR}" - mkdir -p ${MYSQLD_DATADIR} - /usr/bin/mysql_install_db --datadir=${MYSQLD_DATADIR} \ - --user=mysqld 2>&1 >/dev/null && \ - chown -R mysqld:mysqld ${MYSQLD_DATADIR} - eend $? - fi -} - -start() -{ - ebegin "Starting MySQL server" - start-stop-daemon --start --user mysqld:mysqld \ - --pidfile ${MYSQLD_PIDFILE} --background \ - --exec /usr/sbin/mysqld -- \ - --basedir=/usr --datadir=${MYSQLD_DATADIR} \ - --user=mysqld --pid-file=${MYSQLD_PIDFILE} \ - --external-locking ${MYSQLD_ARGS} 2>&1 >/dev/null - eend $? -} - -stop() -{ - ebegin "Stopping MySQL server" - start-stop-daemon --stop --pidfile ${MYSQLD_PIDFILE} - eend $? -} diff --git a/srcpkgs/mysql/files/mysqld.service b/srcpkgs/mysql/files/mysqld.service new file mode 100644 index 00000000000..238bb712fc3 --- /dev/null +++ b/srcpkgs/mysql/files/mysqld.service @@ -0,0 +1,11 @@ +[Unit] +Description=MySQL Server + +[Service] +User=mysql +ExecStart=/usr/bin/mysqld --user=mysql +ExecStartPost=/usr/lib/systemd/scripts/mysqld-post +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/srcpkgs/mysql/files/mysqld.tmpfilesd b/srcpkgs/mysql/files/mysqld.tmpfilesd new file mode 100644 index 00000000000..6883dc79888 --- /dev/null +++ b/srcpkgs/mysql/files/mysqld.tmpfilesd @@ -0,0 +1 @@ +d /run/mysqld 0755 mysql mysql - diff --git a/srcpkgs/mysql/libmysqlclient-devel.template b/srcpkgs/mysql/libmysqlclient-devel.template index e57051f05d6..639657ee89e 100644 --- a/srcpkgs/mysql/libmysqlclient-devel.template +++ b/srcpkgs/mysql/libmysqlclient-devel.template @@ -1,23 +1,14 @@ # Template file for 'libmysqlclient-devel'. # -depends="libstdc++-devel libmysqlclient>=5.1.54" +depends="libmysqlclient>=${version}_${revision}" short_desc="MySQL database development files" long_desc="${long_desc} This package includes development libraries and header files." - -noverifyrdeps=yes - -do_install() -{ +do_install() { vmove usr/bin/mysql_config usr/bin - vmove usr/share/man/man1/mysql_config.1 usr/share/man - vmove "usr/include/mysql/*.h" usr/include/mysql - vmove usr/lib/mysql/libmysqlclient*.a usr/lib/mysql - vmove usr/share/aclocal usr/share - - for p in *example* mypluglib* *.a; do - vmove usr/lib/mysql/plugin/${p} usr/lib/mysql/plugin - done + vmove usr/share/man/man1/mysql_config.1 usr/share/man/man1 + vmove usr/include usr + vmove "usr/lib/*.a" usr/lib } diff --git a/srcpkgs/mysql/libmysqlclient.rshlibs b/srcpkgs/mysql/libmysqlclient.rshlibs index a9be04d8eb5..6d0a62360f4 100644 --- a/srcpkgs/mysql/libmysqlclient.rshlibs +++ b/srcpkgs/mysql/libmysqlclient.rshlibs @@ -1,8 +1,7 @@ libpthread.so.0 -libcrypt.so.1 -libnsl.so.1 libm.so.6 libz.so.1 libssl.so.1 libcrypto.so.1 libc.so.6 +libdl.so.2 diff --git a/srcpkgs/mysql/libmysqlclient.template b/srcpkgs/mysql/libmysqlclient.template index 906a54fcd84..c57c9c58c27 100644 --- a/srcpkgs/mysql/libmysqlclient.template +++ b/srcpkgs/mysql/libmysqlclient.template @@ -5,9 +5,6 @@ long_desc="${long_desc} This package includes the client library." - -do_install() -{ - mkdir -p ${DESTDIR}/usr/lib - mv ${SRCPKGDESTDIR}/usr/lib/mysql/libmysqlclient*.so* ${DESTDIR}/usr/lib +do_install() { + vmove "usr/lib/libmysqlclient*.so*" usr/lib } diff --git a/srcpkgs/mysql/libmysqld-devel.template b/srcpkgs/mysql/libmysqld-devel.template deleted file mode 100644 index ca963ae2256..00000000000 --- a/srcpkgs/mysql/libmysqld-devel.template +++ /dev/null @@ -1,14 +0,0 @@ -# Template file for 'libmysqld-devel'. -# -depends="glibc libmysqlclient-devel" -short_desc="MySQL embedded database development files" -long_desc="${long_desc} - - This package includes the client library." - - -do_install() -{ - mkdir -p ${DESTDIR}/usr/lib/mysql - mv ${SRCPKGDESTDIR}/usr/lib/mysql/*.a ${DESTDIR}/usr/lib/mysql -} diff --git a/srcpkgs/mysql/libndbclient-devel.template b/srcpkgs/mysql/libndbclient-devel.template deleted file mode 100644 index 88d0aef9f19..00000000000 --- a/srcpkgs/mysql/libndbclient-devel.template +++ /dev/null @@ -1,21 +0,0 @@ -# Template file for 'libndbclient-devel'. -# -depends="glibc libndbclient" -short_desc="MySQL NDB (Network Database) development files" -long_desc="${long_desc} - - This package includes the NDB development files." - - -noverifyrdeps=yes - -do_install() -{ - mkdir -p ${DESTDIR}/usr/{bin,lib} ${DESTDIR}/usr/share/man/man1 - - mv ${SRCPKGDESTDIR}/usr/lib/mysql/libndbclient*.a ${DESTDIR}/usr/lib - mv ${SRCPKGDESTDIR}/usr/bin/ndb_config ${DESTDIR}/usr/bin - mv ${SRCPKGDESTDIR}/usr/share/man/man1/ndb_config.1 \ - ${DESTDIR}/usr/share/man/man1 - mv ${SRCPKGDESTDIR}/usr/include ${DESTDIR}/usr -} diff --git a/srcpkgs/mysql/libndbclient.rshlibs b/srcpkgs/mysql/libndbclient.rshlibs deleted file mode 100644 index a2679a4b5ba..00000000000 --- a/srcpkgs/mysql/libndbclient.rshlibs +++ /dev/null @@ -1,5 +0,0 @@ -libpthread.so.0 -libcrypt.so.1 -libnsl.so.1 -libm.so.6 -libc.so.6 diff --git a/srcpkgs/mysql/libndbclient.template b/srcpkgs/mysql/libndbclient.template deleted file mode 100644 index 84b70436d92..00000000000 --- a/srcpkgs/mysql/libndbclient.template +++ /dev/null @@ -1,14 +0,0 @@ -# Template file for 'libndbclient'. -# -depends="zlib" -short_desc="MySQL NDB (Network Database) client library" -long_desc="${long_desc} - - This package includes the NDB client library." - - -do_install() -{ - mkdir -p ${DESTDIR}/usr/lib - mv ${SRCPKGDESTDIR}/usr/lib/mysql/libndbclient*.so* ${DESTDIR}/usr/lib -} diff --git a/srcpkgs/mysql/mysql-client.rshlibs b/srcpkgs/mysql/mysql-client.rshlibs index 71418337c8d..bf0b16a2286 100644 --- a/srcpkgs/mysql/mysql-client.rshlibs +++ b/srcpkgs/mysql/mysql-client.rshlibs @@ -4,11 +4,9 @@ libcrypto.so.1 libz.so.1 libstdc++.so.6 libc.so.6 -libmysqlclient_r.so.16 -libmysqlclient.so.16 libm.so.6 libdl.so.2 libcrypt.so.1 -libwrap.so.0 -libreadline.so.6 libgcc_s.so.1 i686 +libncursesw.so.6 +librt.so.1 diff --git a/srcpkgs/mysql/mysql-client.template b/srcpkgs/mysql/mysql-client.template index 9bfc0364638..7823df93c77 100644 --- a/srcpkgs/mysql/mysql-client.template +++ b/srcpkgs/mysql/mysql-client.template @@ -1,18 +1,13 @@ # Template file for 'mysql-client'. # -depends="ncurses-libs perl>=0" +depends="perl" short_desc="MySQL database client binaries" long_desc="${long_desc} This package includes the client binaries and the additional tools innotop and mysqlreport." - - -do_install() -{ - mkdir -p ${DESTDIR}/usr/{,s}bin ${DESTDIR}/usr/share/man/man{1,8} - +do_install() { for f in innochecksum innotop myisam_ftdump mysql mysql_client_test \ mysql_client_test_embedded mysqldumpslow mysqlbinlog \ mysql_find_rows mysql_fix_extensions mysql_waitpid mysqlaccess \ @@ -21,16 +16,14 @@ do_install() mysqlslap mysqltest_embedded mysqlmanager mysqltest \ mysqlhotcopy mysql_upgrade mysql_zap; do if [ -f ${SRCPKGDESTDIR}/usr/bin/${f} ]; then - mv ${SRCPKGDESTDIR}/usr/bin/${f} ${DESTDIR}/usr/bin + vmove usr/bin/${f} usr/bin elif [ -f ${SRCPKGDESTDIR}/usr/sbin/${f} ]; then - mv ${SRCPKGDESTDIR}/usr/sbin/${f} ${DESTDIR}/usr/sbin + vmove usr/sbin/${f} usr/sbin fi if [ -f ${SRCPKGDESTDIR}/usr/share/man/man1/${f}.1 ]; then - mv ${SRCPKGDESTDIR}/usr/share/man/man1/${f}.1 \ - ${DESTDIR}/usr/share/man/man1 + vmove usr/share/man/man1/${f}.1 usr/share/man/man1 elif [ -f ${SRCPKGDESTDIR}/usr/share/man/man8/${f}.8 ]; then - mv ${SRCPKGDESTDIR}/usr/share/man/man8/${f}.8 \ - ${DESTDIR}/usr/share/man/man8 + vmove usr/share/man/man8/${f}.8 usr/share/man/man8 fi done } diff --git a/srcpkgs/mysql/mysql-ndb.rshlibs b/srcpkgs/mysql/mysql-ndb.rshlibs deleted file mode 100644 index 458a991cf88..00000000000 --- a/srcpkgs/mysql/mysql-ndb.rshlibs +++ /dev/null @@ -1,7 +0,0 @@ -libpthread.so.0 -libstdc++.so.6 -libm.so.6 -libc.so.6 -libreadline.so.6 -libz.so.1 -libgcc_s.so.1 i686 diff --git a/srcpkgs/mysql/mysql-ndb.template b/srcpkgs/mysql/mysql-ndb.template deleted file mode 100644 index d82696d97b7..00000000000 --- a/srcpkgs/mysql/mysql-ndb.template +++ /dev/null @@ -1,22 +0,0 @@ -# Template file for 'mysql-ndb'. -# -depends="ncurses-libs" -short_desc="MySQL NDB (Network Database) binaries" -long_desc="${long_desc} - - This package includes the binaries for the MySQL NDB (Network Database) - component." - - - -do_install() -{ - mkdir -p ${DESTDIR}/usr/{,s}bin ${DESTDIR}/usr/share/man/man{1,8} - - mv ${SRCPKGDESTDIR}/usr/bin/ndb_* ${DESTDIR}/usr/bin - mv ${SRCPKGDESTDIR}/usr/sbin/ndb* ${DESTDIR}/usr/sbin - mv ${SRCPKGDESTDIR}/usr/share/man/man1/ndb* \ - ${DESTDIR}/usr/share/man/man1 - mv ${SRCPKGDESTDIR}/usr/share/man/man8/ndb* \ - ${DESTDIR}/usr/share/man/man8 -} diff --git a/srcpkgs/mysql/mysql.rshlibs b/srcpkgs/mysql/mysql.rshlibs index 5c3d695555d..a7b90fc4f3b 100644 --- a/srcpkgs/mysql/mysql.rshlibs +++ b/srcpkgs/mysql/mysql.rshlibs @@ -1,12 +1,11 @@ libpthread.so.0 libz.so.1 -libwrap.so.0 libdl.so.2 libssl.so.1 libcrypto.so.1 libcrypt.so.1 libstdc++.so.6 libm.so.6 -libgcc_s.so.1 libc.so.6 -libnsl.so.1 +librt.so.1 +libncursesw.so.6 diff --git a/srcpkgs/mysql/template b/srcpkgs/mysql/template index ffa33b6a69c..23db56085cb 100644 --- a/srcpkgs/mysql/template +++ b/srcpkgs/mysql/template @@ -1,24 +1,15 @@ # Template file for 'mysql' pkgname=mysql -version=5.1.54 -distfiles="http://downloads.mysql.com/archives/mysql-5.1/$pkgname-$version.tar.gz" -build_style=gnu-configure -configure_args="--sysconfdir=/etc/mysql ---with-libwrap --with-charset=utf8 --with-collation=utf8_general_ci ---with-extra-charsets=complex --with-embedded-server --enable-local-infile ---with-unix-socket-path=/var/run/mysqld/mysqld.sock --enable-assembler ---with-pthread --with-named-curses-libs=\"-lncursesw\" --with-ssl=/usr ---with-zlib-dir=/usr --with-fast-mutexes --with-big-tables ---with-plugins=all --with-embedded-privilege-control --with-mysqlmanager ---with-mysqld-user=mysqld --enable-thread-safe-client ---libexecdir=/usr/sbin --without-readline" -revision=5 +version=5.5.27 +revision=1 depends="mysql-client" -makedepends="libstdc++-devel zlib-devel tcp_wrappers-devel ncurses-devel openssl-devel readline-devel" -fulldepends="perl>=0 procps" +makedepends="perl cmake bison zlib-devel ncurses-devel openssl-devel readline-devel" short_desc="The world's most popular open source database" maintainer="Juan RP " -checksum=84370fffc4fe277645fb3a5040d153ff567576b664f0663452be077826b7ab1f +homepage="https://www.mysql.com/products/community/" +license="GPL-2" +distfiles="http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-5.5/$pkgname-$version.tar.gz" +checksum=51ffafbd82039f8afbe5b3c26f15cc338ed6cd4f67e56d7dd33efaa28c9d99e4 long_desc=" MySQL is the world's most popular open source database software, with over 100 million copies of its software downloaded or distributed throughout @@ -28,30 +19,70 @@ long_desc=" the major problems associated with downtime, maintenance and administration for modern, online applications." -# Fix build with gcc-4.4. -CFLAGS="-fPIC -fno-strict-aliasing" -CXXFLAGS="-fPIC -fno-strict-aliasing" - -subpackages="libmysqlclient libmysqlclient-devel libndbclient" -subpackages="${subpackages} libndbclient-devel libmysqld-devel" -subpackages="${subpackages} mysql-client mysql-ndb" - -conf_files="/etc/mysql/my.cnf /etc/conf.d/mysqld" -openrc_services="mysqld default false" - -# Create mysqld user/group. -system_accounts="mysqld" +subpackages="libmysqlclient libmysqlclient-devel mysql-client" +conf_files="/etc/mysql/my.cnf" +systemd_services="mysqld.service on" +system_accounts="mysql" mysqld_homedir="/var/lib/mysql" +do_configure() { + mkdir build + cd build - -post_install() -{ - # Remove tests - rm -rf ${DESTDIR}/usr/sql-bench ${DESTDIR}/usr/mysql-test - - # Install config files and OpenRC service. - install -D -m640 ${FILESDIR}/my.cnf ${DESTDIR}/etc/mysql/my.cnf - install -D -m644 ${FILESDIR}/mysqld.confd ${DESTDIR}/etc/conf.d/mysqld - install -D -m755 ${FILESDIR}/mysqld.rc ${DESTDIR}/etc/init.d/mysqld + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DSYSCONFDIR=/etc/mysql \ + -DMYSQL_DATADIR=/var/lib/mysql \ + -DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock \ + -DDEFAULT_CHARSET=utf8 \ + -DDEFAULT_COLLATION=utf8_general_ci \ + -DENABLED_LOCAL_INFILE=ON \ + -DINSTALL_INFODIR=share/mysql/docs \ + -DINSTALL_MANDIR=share/man \ + -DINSTALL_PLUGINDIR=/usr/lib/mysql/plugin \ + -DINSTALL_SCRIPTDIR=bin \ + -DINSTALL_INCLUDEDIR=include/mysql \ + -DINSTALL_DOCREADMEDIR=share/mysql \ + -DINSTALL_SUPPORTFILESDIR=share/mysql \ + -DINSTALL_MYSQLSHAREDIR=share/mysql \ + -DINSTALL_DOCDIR=share/mysql/docs \ + -DINSTALL_SHAREDIR=share/mysql \ + -DWITH_READLINE=ON \ + -DWITH_ZLIB=system \ + -DWITH_SSL=system \ + -DWITH_LIBWRAP=OFF \ + -DWITH_MYSQLD_LDFLAGS="${LDFLAGS}" \ + -DWITH_EXTRA_CHARSETS=complex \ + -DWITH_EMBEDDED_SERVER=ON \ + -DWITH_INNOBASE_STORAGE_ENGINE=1 \ + -DWITH_PARTITION_STORAGE_ENGINE=1 \ + -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \ + -DWITHOUT_ARCHIVE_STORAGE_ENGINE=1 \ + -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 \ + -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 \ + -DCMAKE_C_FLAGS="-fPIC ${CFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -fomit-frame-pointer" \ + -DCMAKE_CXX_FLAGS="-fPIC ${CXXFLAGS} -fno-strict-aliasing -DBIG_JOINS=1 -felide-constructors -fno-rtti" +} + +do_build() { + cd build + make ${makejobs} +} + +do_install() { + cd build + make DESTDIR=${DESTDIR} install + + # Remove unneeded stuff. + rm -rf ${DESTDIR}/usr/{sql-bench,mysql-test,data} + rm -f ${DESTDIR}/usr/share/man/man1/mysql-test-run.pl.1 + + # Configuration file. + vinstall ${FILESDIR}/my.cnf 640 etc/mysql + + # systemd service. + vinstall ${FILESDIR}/mysqld.service 644 usr/lib/systemd/system + vinstall ${FILESDIR}/mysqld-post 755 usr/lib/systemd/scripts + vinstall ${FILESDIR}/mysqld.tmpfilesd 644 usr/lib/tmpfiles.d mysqld.conf }