diff options
author | Mark Felder <feld@FreeBSD.org> | 2017-01-19 22:29:04 +0000 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2017-01-19 22:29:04 +0000 |
commit | 7164158100ba470c4a1e91e89a9ea675bf5c6482 (patch) | |
tree | f3960b025d80b2da754b7ec872fe8d481af47e25 /databases/mysql56-server | |
parent | security/vuxml: Document PHP vulnerabilities (diff) |
databases/mysql56: Update to 5.6.35
- Port improvements from MySQL 5.7 port
- Use system libs instead of bundled
- Fix many open PRs
- Change MAINTAINER
PR: 216244 192657 198812 199751 205093
PR: 209618 211248 205983 209338
Notes
Notes:
svn path=/head/; revision=431919
Diffstat (limited to 'databases/mysql56-server')
-rw-r--r-- | databases/mysql56-server/Makefile | 106 | ||||
-rw-r--r-- | databases/mysql56-server/distinfo | 6 | ||||
-rw-r--r-- | databases/mysql56-server/files/my.cnf.sample.in | 63 | ||||
-rw-r--r-- | databases/mysql56-server/files/mysql-server.in | 30 | ||||
-rw-r--r-- | databases/mysql56-server/files/patch-mysys_ssl_my_default.cc | 50 | ||||
-rw-r--r-- | databases/mysql56-server/pkg-message | 17 | ||||
-rw-r--r-- | databases/mysql56-server/pkg-plist | 6 |
7 files changed, 241 insertions, 37 deletions
diff --git a/databases/mysql56-server/Makefile b/databases/mysql56-server/Makefile index c71326003746..50d3e403d622 100644 --- a/databases/mysql56-server/Makefile +++ b/databases/mysql56-server/Makefile @@ -2,37 +2,59 @@ # $FreeBSD$ PORTNAME?= mysql -PORTVERSION= 5.6.34 +PORTVERSION= 5.6.35 PORTREVISION?= 0 CATEGORIES= databases ipv6 MASTER_SITES= MYSQL/MySQL-5.6 PKGNAMESUFFIX?= 56-server -MAINTAINER= ale@FreeBSD.org +MAINTAINER= mokhi64@gmail.com COMMENT?= Multithreaded SQL database (server) -BROKEN_powerpc64= Does not build +LICENSE= GPLv2 SLAVEDIRS= databases/mysql56-client -USES= cmake shebangfix +USES= bison:build cmake:outsource compiler:c11 compiler:c++11-lib \ + cpe libedit localbase perl5 shebangfix ssl -CMAKE_ARGS+= -DINSTALL_DOCDIR="share/doc/mysql" \ +USE_PERL5= run + +MY_DBDIR= /var/db/mysql +MY_SECDIR= /var/db/mysql_secure +MY_TMPDIR= /var/db/mysql_tmpdir + +LIB_DEPENDS+= libevent.so:devel/libevent2 \ + liblz4.so:archivers/liblz4 + +CMAKE_BUILD_TYPE= Release + +CMAKE_ARGS+= -DINSTALL_LAYOUT=FREEBSD \ + -DINSTALL_LDCONFIGDIR="${LOCALBASE}/libdata/ldconfig" \ + -DINSTALL_PKGCONFIGDIR="${LOCALBASE}/libdata/pkgconfig" \ + -DINSTALL_DOCDIR="share/doc/mysql" \ -DINSTALL_DOCREADMEDIR="share/doc/mysql" \ -DINSTALL_INCLUDEDIR="include/mysql" \ -DINSTALL_INFODIR="info" \ -DINSTALL_LIBDIR="lib/mysql" \ -DINSTALL_MANDIR="man" \ - -DINSTALL_MYSQLDATADIR="/var/db/mysql" \ + -DINSTALL_MYSQLDATADIR="${MY_DBDIR}" \ + -DINSTALL_MYSQLKEYRINGDIR="etc/mysql/keyring" \ -DINSTALL_MYSQLSHAREDIR="share/mysql" \ -DINSTALL_MYSQLTESTDIR="share/mysql/tests" \ -DINSTALL_PLUGINDIR="lib/mysql/plugin" \ -DINSTALL_SBINDIR="libexec" \ -DINSTALL_SCRIPTDIR="bin" \ + -DINSTALL_SECURE_FILE_PRIVDIR="${MY_SECDIR}" \ -DINSTALL_SHAREDIR="share" \ -DINSTALL_SQLBENCHDIR="share/mysql" \ -DINSTALL_SUPPORTFILESDIR="share/mysql" \ + -DMYSQL_KEYRINGDIR="${ETCDIR}/keyring" \ + -DWITH_BOOST="${WRKSRC}/boost" \ -DWITH_EDITLINE=system \ - -DWITH_LIBWRAP=1 + -DWITH_LIBEVENT=system \ + -DWITH_LZ4=system \ + -DWITH_ZLIB=system \ + -DINSTALL_MYSQLTESTDIR=0 SHEBANG_FILES= scripts/*.pl* scripts/*.sh @@ -40,23 +62,32 @@ SHEBANG_FILES= scripts/*.pl* scripts/*.sh .error You have `USE_MYSQL' variable defined either in environment or in make(1) arguments. Please undefine and try again. .endif +SUB_LIST= MY_DBDIR=${MY_DBDIR} \ + MY_SECDIR=${MY_SECDIR} \ + MY_TMPDIR=${MY_TMPDIR} + +PLIST_SUB= MY_DBDIR=${MY_DBDIR} \ + MY_SECDIR=${MY_SECDIR} \ + MY_TMPDIR=${MY_TMPDIR} + # MySQL-Server part .if !defined(CLIENT_ONLY) -USE_MYSQL= yes -WANT_MYSQL_VER= 56 - -USES+= perl5 -USE_PERL5= run +USES+= mysql:56 CONFLICTS_INSTALL= mysql5[0-57-9]-server-* \ - mariadb*-server-* \ - percona*-server-* + mysql[0-46-9][0-9]-server-* \ + mariadb[0-9][0-9]-server-* \ + percona[0-9][0-9]-server-* USE_RC_SUBR= mysql-server +SUB_FILES= my.cnf.sample + USERS= mysql GROUPS= mysql +USE_LDCONFIG+= ${PREFIX}/lib/mysql/plugin + MMAN1= my_print_defaults.1 myisam_ftdump.1 myisamchk.1 myisamlog.1 myisampack.1 \ mysql.server.1 mysql_convert_table_format.1 mysql_fix_extensions.1 \ mysql_install_db.1 mysql_plugin.1 mysql_secure_installation.1 mysql_setpermission.1 \ @@ -65,14 +96,57 @@ MMAN1= my_print_defaults.1 myisam_ftdump.1 myisamchk.1 myisamlog.1 myisampack.1 mysqltest.1 perror.1 replace.1 resolve_stack_dump.1 resolveip.1 CMAKE_ARGS+= -DWITH_EMBEDDED_SERVER="ON" + +OPTIONS_GROUP= STORAGE +OPTIONS_GROUP_STORAGE= ARCHIVE BLACKHOLE EXAMPLE FEDERATED INNOBASE PARTITION PERFSCHEMA +OPTIONS_SUB= YES +STORAGE_DESC= Permissible "Storage Engines" (to compile statically into the server) +ARCHIVE_DESC= Compile "Archive Storage" statically in server +BLACKHOLE_DESC= Compile "Blackhole Storage" statically in server +EXAMPLE_DESC= Compile "Example Storage" statically in server +FEDERATED_DESC= Compile "Federated Storage" statically in server +INNOBASE_DESC= Compile "InnoDB Storage" statically in server +PARTITION_DESC= Compile "Partitioning support Storage" statically in server +PERFSCHEMA_DESC= Compile "Performance Schema Storage" statically in server + +ARCHIVE_CMAKE_ON= -DWITH_ARCHIVE_STORAGE_ENGINE=1 +BLACKHOLE_CMAKE_ON= -DWITH_BLACKHOLE_STORAGE_ENGINE=1 +EXAMPLE_CMAKE_ON= -DWITH_EXAMPLE_STORAGE_ENGINE=1 +FEDERATED_CMAKE_ON= -DWITH_FEDERATED_STORAGE_ENGINE=1 +INNOBASE_CMAKE_ON= -DWITH_INNOBASE_STORAGE_ENGINE=1 +PARTITION_CMAKE_ON= -DWITH_PARTITION_STORAGE_ENGINE=1 +PERFSCHEMA_CMAKE_ON= -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 + +OPTIONS_GROUP+= FEATURES +OPTIONS_GROUP_FEATURES= PERFSCHM +FEATURES_DESC= Default features knobs +PERFSCHM_DESC= Enable "Performance Schema" by default (High RAM usage) +OPTIONS_DEFAULT+= PERFSCHM + +PERFSCHM_SUB_LIST+= PERFSCHEMRC="" +PERFSCHM_SUB_LIST_OFF+= PERFSCHEMRC="--skip-performance-schema" +.endif + +.include <bsd.port.pre.mk> + +.if ${SSL_DEFAULT} == base +CMAKE_ARGS+= -DWITH_SSL=system .else -USES+= libedit +CMAKE_ARGS+= -DWITH_SSL=${OPENSSLBASE} .endif post-patch: @${REINPLACE_CMD} 's/*.1/${MMAN1}/' ${WRKSRC}/man/CMakeLists.txt -.include <bsd.port.pre.mk> +.if !defined(CLIENT_ONLY) +post-install: + ${MKDIR} ${STAGEDIR}${ETCDIR} + ${INSTALL_DATA} ${WRKDIR}/my.cnf.sample ${STAGEDIR}${ETCDIR}/my.cnf.sample + + ${MKDIR} ${STAGEDIR}${ETCDIR}/keyring + ${MKDIR} ${STAGEDIR}${MY_SECDIR} + ${MKDIR} ${STAGEDIR}${MY_TMPDIR} +.endif .if ${ARCH} == "armv6" EXTRA_PATCHES+= ${FILESDIR}/extra-patch-config.h.cmake diff --git a/databases/mysql56-server/distinfo b/databases/mysql56-server/distinfo index 36afdf25b828..4a9b5fb53d35 100644 --- a/databases/mysql56-server/distinfo +++ b/databases/mysql56-server/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1477038469 -SHA256 (mysql-5.6.34.tar.gz) = ee90bafec6af3abe2715ccb0b3cc9345ed8d1cce025d41e6ec2b2b7a7d820823 -SIZE (mysql-5.6.34.tar.gz) = 32094762 +TIMESTAMP = 1484753208 +SHA256 (mysql-5.6.35.tar.gz) = dddcba169b98844d7c65346cbd791c853edf942d78440381685087b84aa35020 +SIZE (mysql-5.6.35.tar.gz) = 32167628 diff --git a/databases/mysql56-server/files/my.cnf.sample.in b/databases/mysql56-server/files/my.cnf.sample.in new file mode 100644 index 000000000000..a7b7a804bc34 --- /dev/null +++ b/databases/mysql56-server/files/my.cnf.sample.in @@ -0,0 +1,63 @@ +# $FreeBSD$ + +[client] +port = 3306 +socket = /tmp/mysql.sock + +[mysql] +prompt = \u@\h [\d]>\_ +no_auto_rehash + +[mysqld] +user = mysql +port = 3306 +socket = /tmp/mysql.sock +bind-address = 127.0.0.1 +basedir = %%PREFIX%% +datadir = %%MY_DBDIR%% +tmpdir = %%MY_TMPDIR%% +slave-load-tmpdir = %%MY_TMPDIR%% +secure-file-priv = %%MY_SECDIR%% +log-bin = mysql-bin +log-output = TABLE +master-info-repository = TABLE +relay-log-info-repository = TABLE +relay-log-recovery = 1 +slow-query-log = 1 +server-id = 1 +sync_binlog = 1 +sync_relay_log = 1 +binlog_cache_size = 16M +expire_logs_days = 30 +log-slave-updates = 1 +enforce-gtid-consistency = 1 +gtid-mode = ON +safe-user-create = 1 +lower_case_table_names = 1 +explicit-defaults-for-timestamp = 1 +myisam-recover-options = BACKUP,FORCE +open_files_limit = 32768 +table_open_cache = 16384 +table_definition_cache = 8192 +net_retry_count = 16384 +key_buffer_size = 256M +max_allowed_packet = 64M +query_cache_type = 0 +query_cache_size = 0 +long_query_time = 0.5 +innodb_buffer_pool_size = 1G +innodb_data_home_dir = %%MY_DBDIR%% +innodb_log_group_home_dir = %%MY_DBDIR%% +innodb_data_file_path = ibdata1:128M:autoextend +innodb_flush_method = O_DIRECT +innodb_log_file_size = 256M +innodb_log_buffer_size = 16M +innodb_write_io_threads = 8 +innodb_read_io_threads = 8 +innodb_autoinc_lock_mode = 2 +skip-symbolic-links + +[mysqldump] +max_allowed_packet = 256M +quote_names +quick diff --git a/databases/mysql56-server/files/mysql-server.in b/databases/mysql56-server/files/mysql-server.in index b5015e5505f3..a3041e6478ce 100644 --- a/databases/mysql56-server/files/mysql-server.in +++ b/databases/mysql56-server/files/mysql-server.in @@ -14,10 +14,12 @@ # mysql_limits (bool): Set to "NO" by default. # Set it to yes to run `limits -e -U mysql` # just before mysql starts. -# mysql_dbdir (str): Default to "/var/db/mysql" +# mysql_dbdir (str): Default to "%%MY_DBDIR%%" # Base database directory. +# mysql_confdir (str): Default to "%%ETCDIR%%" +# Base configuration directory. # mysql_optfile (str): Server-specific option file. -# Default to "${mysql_dbdir}/my.cnf". +# Default to "${mysql_confdir}/my.cnf". # mysql_pidfile (str): Custum PID file path and name. # Default to "${mysql_dbdir}/${hostname}.pid". # mysql_args (str): Custom additional arguments to be passed @@ -33,20 +35,25 @@ load_rc_config $name : ${mysql_enable="NO"} : ${mysql_limits="NO"} -: ${mysql_dbdir="/var/db/mysql"} +: ${mysql_dbdir="%%MY_DBDIR%%"} +: ${mysql_confdir="%%ETCDIR%%"} +if [ -f "${mysql_dbdir}/my.cnf" ]; then : ${mysql_optfile="${mysql_dbdir}/my.cnf"} +else +: ${mysql_optfile="${mysql_confdir}/my.cnf"} +fi mysql_user="mysql" mysql_limits_args="-e -U ${mysql_user}" : ${hostname:=`/bin/hostname`} pidfile=${mysql_pidfile:-"${mysql_dbdir}/${hostname}.pid"} command="/usr/sbin/daemon" -command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_optfile} --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args}" +command_args="-c -f %%PREFIX%%/bin/mysqld_safe --defaults-extra-file=${mysql_optfile} --basedir=%%PREFIX%% --datadir=${mysql_dbdir} --pid-file=${pidfile} --user=${mysql_user} ${mysql_args} %%PERFSCHEMRC%%" procname="%%PREFIX%%/libexec/mysqld" start_precmd="${name}_prestart" start_postcmd="${name}_poststart" mysql_install_db="%%PREFIX%%/bin/mysql_install_db" -mysql_install_db_args="--basedir=%%PREFIX%% --defaults-extra-file=${mysql_optfile} --datadir=${mysql_dbdir} --force" +mysql_install_db_args="--defaults-extra-file=${mysql_optfile} --basedir=%%PREFIX%% --datadir=${mysql_dbdir} --user=${mysql_user} --force" mysql_create_auth_tables() { @@ -56,7 +63,18 @@ mysql_create_auth_tables() mysql_prestart() { - if [ ! -d "${mysql_dbdir}/mysql/." ]; then + if [ -f "${mysql_dbdir}/my.cnf" ]; then + echo "" + echo "Please keep in mind that the default location for my.cnf has changed" + echo "from \"%%MY_DBDIR%%/my.cnf\" to \"%%ETCDIR%%/my.cnf\". " + echo "Please merge your existing my.cnf with the new default and move" + echo "it to \"%%ETCDIR%%/my.cnf\"." + echo "If you do not want to move your my.cnf to the new location then" + echo "you must set \"mysql_optfile\" in /etc/rc.conf to \"/var/db/mysql/my.cnf\"." + echo "" + fi + + if [ ! -d "${mysql_dbdir}/mysql" ]; then mysql_create_auth_tables || return 1 fi if checkyesno mysql_limits; then diff --git a/databases/mysql56-server/files/patch-mysys_ssl_my_default.cc b/databases/mysql56-server/files/patch-mysys_ssl_my_default.cc index f6f38decb8ec..fa06468ce959 100644 --- a/databases/mysql56-server/files/patch-mysys_ssl_my_default.cc +++ b/databases/mysql56-server/files/patch-mysys_ssl_my_default.cc @@ -1,6 +1,6 @@ ---- mysys_ssl/my_default.cc.orig 2013-01-22 17:54:49.000000000 +0100 -+++ mysys_ssl/my_default.cc 2013-02-13 11:08:15.000000000 +0100 -@@ -119,7 +119,7 @@ +--- mysys_ssl/my_default.cc.orig 2016-11-28 13:36:22 UTC ++++ mysys_ssl/my_default.cc +@@ -110,7 +110,7 @@ static my_bool defaults_already_read= FA /* Which directories are searched for options (and in which order) */ @@ -9,18 +9,48 @@ #define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1) /* Terminate with NULL */ static const char **default_directories = NULL; -@@ -1395,7 +1395,10 @@ +@@ -903,6 +903,14 @@ static int search_default_file_with_ext( + return 1; /* Ignore wrong files */ + } - #if defined(DEFAULT_SYSCONFDIR) - if (DEFAULT_SYSCONFDIR[0]) ++ if (strstr(name, "/etc") == name) + { - errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs); -+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs); ++ fprintf(stderr, ++ "error: Config file %s in invalid location, please move to or merge with /usr/local%s\n", ++ name,name); ++ goto err; + } - #endif /* DEFAULT_SYSCONFDIR */ ++ + while (mysql_file_getline(buff, sizeof(buff) - 1, fp, is_login_file)) + { + line++; +@@ -1241,7 +1249,8 @@ void my_print_default_files(const char * + end[(strlen(end)-1)] = ' '; + else + strxmov(end, conf_file, *ext , " ", NullS); +- fputs(name, stdout); ++ if (strstr(name, "/etc") != name) ++ fputs(name, stdout); + } + } + } +@@ -1400,13 +1409,8 @@ static const char **init_default_directo + + #else + +- errors += add_directory(alloc, "/etc/", dirs); +- errors += add_directory(alloc, "/etc/mysql/", dirs); +- +-#if defined(DEFAULT_SYSCONFDIR) +- if (DEFAULT_SYSCONFDIR[0]) +- errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs); +-#endif /* DEFAULT_SYSCONFDIR */ ++ errors += add_directory(alloc, "/usr/local/etc/", dirs); ++ errors += add_directory(alloc, "/usr/local/etc/mysql/", dirs); #endif -@@ -1466,7 +1469,7 @@ + +@@ -1477,7 +1481,7 @@ int check_file_permissions(const char *f MY_STAT stat_info; if (!my_stat(file_name,&stat_info,MYF(0))) diff --git a/databases/mysql56-server/pkg-message b/databases/mysql56-server/pkg-message index 71d00aa80526..a047f75afd3c 100644 --- a/databases/mysql56-server/pkg-message +++ b/databases/mysql56-server/pkg-message @@ -1,6 +1,19 @@ -************************************************************************ +***************************************************************************** Remember to run mysql_upgrade the first time you start the MySQL server after an upgrade from an earlier version. -************************************************************************ +Initial password for first time use of MySQL is saved in $HOME/.mysql_secret +ie. when you want to use "mysql -u root -p" first you should see password +in /root/.mysql_secret + +***************************************************************************** + +***************************************************************************** + +Please keep in mind that the default location for my.cnf will be changed +from "/var/db/mysql/my.cnf" to "/usr/local/etc/mysql/my.cnf" in the near +future. If you do not want to move your my.cnf to the new location then +you must set "mysql_optfile" in /etc/rc.conf to "/var/db/mysql/my.cnf". + +***************************************************************************** diff --git a/databases/mysql56-server/pkg-plist b/databases/mysql56-server/pkg-plist index 07af65f87e50..04c52cb9b820 100644 --- a/databases/mysql56-server/pkg-plist +++ b/databases/mysql56-server/pkg-plist @@ -27,8 +27,10 @@ lib/mysql/libmysqld.a lib/mysql/plugin/adt_null.so lib/mysql/plugin/auth.so lib/mysql/plugin/auth_test_plugin.so +lib/mysql/plugin/connection_control.so lib/mysql/plugin/daemon_example.ini lib/mysql/plugin/libdaemon_example.so +%%EXAMPLE%%lib/mysql/plugin/ha_example.so lib/mysql/plugin/mypluglib.so lib/mysql/plugin/mysql_no_login.so lib/mysql/plugin/qa_auth_client.so @@ -130,3 +132,7 @@ man/man8/mysqld.8.gz %%DATADIR%%/spanish/errmsg.sys %%DATADIR%%/swedish/errmsg.sys %%DATADIR%%/ukrainian/errmsg.sys +@sample(root,wheel,0644) %%ETCDIR%%/my.cnf.sample +@dir(mysql,mysql,0750) %%ETCDIR%%/keyring +@dir(mysql,mysql,0750) %%MY_SECDIR%% +@dir(mysql,mysql,0750) %%MY_TMPDIR%% |