diff --git a/.mariadb.metadata b/.mariadb.metadata new file mode 100644 index 0000000..6b76a3e --- /dev/null +++ b/.mariadb.metadata @@ -0,0 +1 @@ +9154cb68504d469b1bac636b85e30b2b2da2586092476d6ad2f9d6bc462909d8 SOURCES/mariadb-10.0.15.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/README.mysql-cnf b/SOURCES/README.mysql-cnf new file mode 100644 index 0000000..3700c7f --- /dev/null +++ b/SOURCES/README.mysql-cnf @@ -0,0 +1,13 @@ +This directory contains prepared configuration files with .cnf extension, +which provide a configuration for some common MariaDB deployment scenarios. +These configuration files do not include the default configuration of datadir, +log-file and pid-file locations, as specified in the default my.cnf file, +provided in this distribution. + +Thus, it is recommended to use these configuration files as an addition to the +default my.cnf configuration file. + +Since default my.cnf contains `!includedir @INSTALL_SYSCONF2DIR@` directive, it is +recommended to copy required configuration under @INSTALL_SYSCONF2DIR@ directory, +so the default my.cnf specifications will be extended. + diff --git a/SOURCES/README.mysql-docs b/SOURCES/README.mysql-docs new file mode 100644 index 0000000..dd894a7 --- /dev/null +++ b/SOURCES/README.mysql-docs @@ -0,0 +1,4 @@ +The official MySQL documentation is not freely redistributable, so we cannot +include it in RHEL or Fedora. You can find it on-line at + +http://dev.mysql.com/doc/ diff --git a/SOURCES/README.mysql-license b/SOURCES/README.mysql-license new file mode 100644 index 0000000..ceabbcf --- /dev/null +++ b/SOURCES/README.mysql-license @@ -0,0 +1,9 @@ +MySQL is distributed under GPL v2, but there are some licensing exceptions +that allow the client libraries to be linked with a non-GPL application, +so long as the application is under a license approved by Oracle. +For details see + +http://www.mysql.com/about/legal/licensing/foss-exception/ + +Some innobase code from Percona and Google is under BSD license. +Some code related to test-suite is under LGPLv2. diff --git a/SOURCES/mariadb-basedir.patch b/SOURCES/mariadb-basedir.patch new file mode 100644 index 0000000..d548ff5 --- /dev/null +++ b/SOURCES/mariadb-basedir.patch @@ -0,0 +1,16 @@ +Don't guess basedir in mysql_config; we place it under _libdir because +of multilib conflicts, so use rather configured @prefix@ path directly. + +diff -up mariadb-10.0.13/scripts/mysql_config.sh.patch32 mariadb-10.0.13/scripts/mysql_config.sh +--- mariadb-10.0.13/scripts/mysql_config.sh.patch32 2014-08-13 17:28:51.174776518 +0200 ++++ mariadb-10.0.13/scripts/mysql_config.sh 2014-08-13 17:32:18.205275028 +0200 +@@ -76,8 +76,7 @@ get_full_path () + + me=`get_full_path $0` + +-# Script might have been renamed but assume mysql_config +-basedir=`echo $me | sed -e 's;/bin/mysql_.*config.*;;'` ++basedir='@prefix@' + + ldata='@localstatedir@' + execdir='@libexecdir@' diff --git a/SOURCES/mariadb-covscan-signexpr.patch b/SOURCES/mariadb-covscan-signexpr.patch new file mode 100644 index 0000000..54d47b5 --- /dev/null +++ b/SOURCES/mariadb-covscan-signexpr.patch @@ -0,0 +1,16 @@ +This issue has been found by Coverity - static analysis tool. + +mysql-5.5.31/strings/ctype-ucs2.c:1707:sign_extension – Suspicious implicit sign extension: "s[0]" with type "unsigned char" (8 bits, unsigned) is promoted in "(s[0] << 24) + (s[1] << 16) + (s[2] << 8) + s[3]" to type "int" (32 bits, signed), then sign-extended to type "unsigned long" (64 bits, unsigned). If "(s[0] << 24) + (s[1] << 16) + (s[2] << 8) + s[3]" is greater than 0x7FFFFFFF, the upper bits of the result will all be 1. + +diff -up mariadb-10.0.15/strings/ctype-ucs2.c.orig mariadb-10.0.15/strings/ctype-ucs2.c +--- mariadb-10.0.15/strings/ctype-ucs2.c.orig 2014-11-27 15:14:11.129554529 +0100 ++++ mariadb-10.0.15/strings/ctype-ucs2.c 2014-11-27 15:13:06.806439653 +0100 +@@ -1932,7 +1932,7 @@ my_utf32_uni(CHARSET_INFO *cs __attribut + { + if (s + 4 > e) + return MY_CS_TOOSMALL4; +- *pwc= (s[0] << 24) + (s[1] << 16) + (s[2] << 8) + (s[3]); ++ *pwc= (((my_wc_t)s[0]) << 24) + (s[1] << 16) + (s[2] << 8) + (s[3]); + return 4; + } + diff --git a/SOURCES/mariadb-covscan-stroverflow.patch b/SOURCES/mariadb-covscan-stroverflow.patch new file mode 100644 index 0000000..42f373d --- /dev/null +++ b/SOURCES/mariadb-covscan-stroverflow.patch @@ -0,0 +1,57 @@ +The following problems have been found by Coverity - static analysis tool. + +mysql-5.5.31/plugin/semisync/semisync_master.cc:672:parameter_as_source – Note: This defect has an elevated risk because the source argument is a parameter of the current function. + +mysql-5.5.31/plugin/semisync/semisync_master.cc:661:parameter_as_source – Note: This defect has an elevated risk because the source argument is a parameter of the current function. + +mysql-5.5.31/plugin/semisync/semisync_master.cc:555:parameter_as_source – Note: This defect has an elevated risk because the source argument is a parameter of the current function. + +diff -up mariadb-10.0.15/plugin/semisync/semisync_master.cc.orig mariadb-10.0.15/plugin/semisync/semisync_master.cc +--- mariadb-10.0.15/plugin/semisync/semisync_master.cc.orig 2014-11-27 15:16:59.664855517 +0100 ++++ mariadb-10.0.15/plugin/semisync/semisync_master.cc 2014-11-27 15:16:17.029779375 +0100 +@@ -553,7 +553,8 @@ int ReplSemiSyncMaster::reportReplyBinlo + + if (need_copy_send_pos) + { +- strcpy(reply_file_name_, log_file_name); ++ strncpy(reply_file_name_, log_file_name, sizeof(reply_file_name_)-1); ++ reply_file_name_[sizeof(reply_file_name_)-1] = '\0'; + reply_file_pos_ = log_file_pos; + reply_file_name_inited_ = true; + +@@ -661,7 +662,8 @@ int ReplSemiSyncMaster::commitTrx(const + if (cmp <= 0) + { + /* This thd has a lower position, let's update the minimum info. */ +- strcpy(wait_file_name_, trx_wait_binlog_name); ++ strncpy(wait_file_name_, trx_wait_binlog_name, sizeof(wait_file_name_)-1); ++ wait_file_name_[sizeof(wait_file_name_)-1] = '\0'; + wait_file_pos_ = trx_wait_binlog_pos; + + rpl_semi_sync_master_wait_pos_backtraverse++; +@@ -672,7 +674,8 @@ int ReplSemiSyncMaster::commitTrx(const + } + else + { +- strcpy(wait_file_name_, trx_wait_binlog_name); ++ strncpy(wait_file_name_, trx_wait_binlog_name, sizeof(wait_file_name_)-1); ++ wait_file_name_[sizeof(wait_file_name_)-1] = '\0'; + wait_file_pos_ = trx_wait_binlog_pos; + wait_file_name_inited_ = true; + + +mysql-5.5.31/sql/rpl_handler.cc:306:fixed_size_dest – You might overrun the 512 byte fixed-size string "log_info->log_file" by copying "log_file + dirname_length(log_file)" without checking the length. diff -up mysql-5.5.31/sql/rpl_handler.cc.covscan-stroverflow mysql-5.5.31/sql/rpl_handler.cc + +diff -up mariadb-10.0.15/sql/rpl_handler.cc.orig mariadb-10.0.15/sql/rpl_handler.cc +--- mariadb-10.0.15/sql/rpl_handler.cc.orig 2014-11-27 15:17:28.000906123 +0100 ++++ mariadb-10.0.15/sql/rpl_handler.cc 2014-11-27 15:16:17.030779377 +0100 +@@ -270,7 +270,8 @@ int Binlog_storage_delegate::after_flush + my_pthread_setspecific_ptr(RPL_TRANS_BINLOG_INFO, log_info); + } + +- strcpy(log_info->log_file, log_file+dirname_length(log_file)); ++ strncpy(log_info->log_file, log_file+dirname_length(log_file), sizeof(log_info->log_file)-1); ++ log_info->log_file[sizeof(log_info->log_file)-1] = '\0'; + log_info->log_pos = log_pos; + + int ret= 0; diff --git a/SOURCES/mariadb-dh1024.patch b/SOURCES/mariadb-dh1024.patch new file mode 100644 index 0000000..e1a2ee8 --- /dev/null +++ b/SOURCES/mariadb-dh1024.patch @@ -0,0 +1,63 @@ +Change the DH key length from 512 to 1024 bits to meet minimum requirements +of FIPS 140-2. (In principle we could use the larger size only when FIPS +mode is on, but it doesn't seem worth the trouble.) + +The new parameter value was generated using "openssl dhparam -C 1024". + + +diff -up mariadb-10.0.15/vio/viosslfactories.c.orig mariadb-10.0.15/vio/viosslfactories.c +--- mariadb-10.0.15/vio/viosslfactories.c.orig 2014-11-27 15:02:22.757315487 +0100 ++++ mariadb-10.0.15/vio/viosslfactories.c 2014-11-27 15:00:44.847144887 +0100 +@@ -20,27 +20,32 @@ + static my_bool ssl_algorithms_added = FALSE; + static my_bool ssl_error_strings_loaded= FALSE; + +-static unsigned char dh512_p[]= ++static unsigned char dh1024_p[]= + { +- 0xDA,0x58,0x3C,0x16,0xD9,0x85,0x22,0x89,0xD0,0xE4,0xAF,0x75, +- 0x6F,0x4C,0xCA,0x92,0xDD,0x4B,0xE5,0x33,0xB8,0x04,0xFB,0x0F, +- 0xED,0x94,0xEF,0x9C,0x8A,0x44,0x03,0xED,0x57,0x46,0x50,0xD3, +- 0x69,0x99,0xDB,0x29,0xD7,0x76,0x27,0x6B,0xA2,0xD3,0xD4,0x12, +- 0xE2,0x18,0xF4,0xDD,0x1E,0x08,0x4C,0xF6,0xD8,0x00,0x3E,0x7C, +- 0x47,0x74,0xE8,0x33, ++ 0xBF,0x5C,0xFA,0xD1,0xDD,0xBB,0xB3,0x0A,0x58,0x29,0x05,0xF5, ++ 0x7D,0x64,0xB2,0xE1,0xCE,0xE8,0xE0,0xE1,0x7A,0xB6,0xBC,0x5B, ++ 0x21,0x56,0xDF,0x2C,0x82,0x60,0xDC,0x31,0xCA,0x1E,0x02,0xFE, ++ 0xC4,0xE7,0x24,0x63,0x31,0xE4,0x67,0x1C,0x0B,0xFF,0x86,0x12, ++ 0x0D,0x2E,0xE6,0x35,0x0A,0x07,0x4F,0xE7,0x3F,0xDE,0xFE,0xF0, ++ 0x13,0x1C,0xA2,0x2B,0xF4,0xEE,0x2C,0x90,0x10,0x57,0x6B,0x2B, ++ 0xB9,0x1E,0x1B,0x47,0xB0,0x25,0xBF,0x45,0x86,0xDA,0x87,0x35, ++ 0x2C,0xF5,0x6A,0x41,0xA2,0x57,0xD8,0x16,0x5E,0x82,0x91,0x99, ++ 0x33,0xA0,0x8B,0x9D,0x34,0xCE,0x03,0x01,0x80,0x32,0x07,0x3B, ++ 0xF2,0x93,0xFC,0x3A,0x25,0xEC,0xB3,0xED,0x5C,0x4E,0x57,0xF2, ++ 0x3C,0x2E,0x0D,0xB1,0x59,0xA2,0x08,0x93, + }; + +-static unsigned char dh512_g[]={ ++static unsigned char dh1024_g[]={ + 0x02, + }; + +-static DH *get_dh512(void) ++static DH *get_dh1024(void) + { + DH *dh; + if ((dh=DH_new())) + { +- dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL); +- dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL); ++ dh->p=BN_bin2bn(dh1024_p,sizeof(dh1024_p),NULL); ++ dh->g=BN_bin2bn(dh1024_g,sizeof(dh1024_g),NULL); + if (! dh->p || ! dh->g) + { + DH_free(dh); +@@ -284,7 +289,7 @@ new_VioSSLFd(const char *key_file, const + } + + /* DH stuff */ +- dh=get_dh512(); ++ dh=get_dh1024(); + SSL_CTX_set_tmp_dh(ssl_fd->ssl_context, dh); + DH_free(dh); + diff --git a/SOURCES/mariadb-errno.patch b/SOURCES/mariadb-errno.patch new file mode 100644 index 0000000..8901403 --- /dev/null +++ b/SOURCES/mariadb-errno.patch @@ -0,0 +1,17 @@ +--- mariadb-10.0.10/include/my_sys.h.p1 2014-03-30 19:56:37.000000000 +0200 ++++ mariadb-10.0.10/include/my_sys.h 2014-04-07 15:30:20.627060157 +0200 +@@ -209,13 +209,7 @@ extern void my_large_free(uchar *ptr); + #define my_safe_afree(ptr, size, max_alloca_sz) my_afree(ptr) + #endif /* HAVE_ALLOCA */ + +-#ifndef errno /* did we already get it? */ +-#ifdef HAVE_ERRNO_AS_DEFINE +-#include /* errno is a define */ +-#else +-extern int errno; /* declare errno */ +-#endif +-#endif /* #ifndef errno */ ++#include /* errno is a define */ + extern char *home_dir; /* Home directory for user */ + extern MYSQL_PLUGIN_IMPORT char *mysql_data_home; + extern const char *my_progname; /* program-name (printed in errors) */ diff --git a/SOURCES/mariadb-file-contents.patch b/SOURCES/mariadb-file-contents.patch new file mode 100644 index 0000000..441f4f0 --- /dev/null +++ b/SOURCES/mariadb-file-contents.patch @@ -0,0 +1,46 @@ +Upstream chooses to install INFO_SRC and INFO_BIN into the docs dir, which +breaks at least two packaging commandments, so we put them into $libdir +instead. That means we have to hack the file_contents regression test +to know about this. + +Recommendation they change is at http://bugs.mysql.com/bug.php?id=61425 + + +diff -up mariadb-10.0.12/mysql-test/t/file_contents.test.file_contents mariadb-10.0.12/mysql-test/t/file_contents.test. +diff -up mariadb-10.0.12/mysql-test/t/file_contents.test.file_contents mariadb-10.0.12/mysql-test/t/file_contents.test +--- mariadb-10.0.12/mysql-test/t/file_contents.test.file_contents 2014-06-12 11:26:03.000000000 +0200 ++++ mariadb-10.0.12/mysql-test/t/file_contents.test 2014-07-24 23:53:49.833176793 +0200 +@@ -11,7 +11,7 @@ + --perl + print "\nChecking 'INFO_SRC' and 'INFO_BIN'\n"; + $dir_bin = $ENV{'MYSQL_BINDIR'}; +-if ($dir_bin eq '/usr/') { ++if ($dir_bin =~ '.*/usr/$') { + # RPM package + $dir_docs = $dir_bin; + $dir_docs =~ s|/lib|/share/doc|; +@@ -22,7 +22,7 @@ if ($dir_bin eq '/usr/') { + # RedHat: version number in directory name + $dir_docs = glob "$dir_docs/MySQL-server*"; + } +-} elsif ($dir_bin eq '/usr') { ++} elsif ($dir_bin =~ '.*/usr$') { + # RPM build during development + $dir_docs = "$dir_bin/share/doc"; + if(-d "$dir_docs/packages") { +@@ -32,6 +32,15 @@ if ($dir_bin eq '/usr/') { + # RedHat/Debian: version number in directory name + $dir_docs = glob "$dir_docs/mariadb-server-*"; + $dir_docs = glob "$dir_docs/MySQL-server*" unless -d $dir_docs; ++ ++ # All the above is entirely wacko, because these files are not docs; ++ # they should be kept in libdir instead. mtr does not provide a nice ++ # way to find libdir though, so we have to kluge it like this: ++ if (-d "$dir_bin/lib64/mysql") { ++ $dir_docs = "$dir_bin/lib64/mysql"; ++ } else { ++ $dir_docs = "$dir_bin/lib/mysql"; ++ } + } + # Slackware + $dir_docs = glob "$dir_bin/doc/mariadb-[0-9]*" unless -d $dir_docs; diff --git a/SOURCES/mariadb-install-db-sharedir.patch b/SOURCES/mariadb-install-db-sharedir.patch new file mode 100644 index 0000000..4949b6d --- /dev/null +++ b/SOURCES/mariadb-install-db-sharedir.patch @@ -0,0 +1,38 @@ +Use configured value instead of hardcoded path + +diff -up mariadb-10.0.13/scripts/mysql_install_db.pl.in.pbasedir mariadb-10.0.13/scripts/mysql_install_db.pl.in +--- mariadb-10.0.13/scripts/mysql_install_db.pl.in.pbasedir 2014-09-04 12:50:24.061979080 +0200 ++++ mariadb-10.0.13/scripts/mysql_install_db.pl.in 2014-09-04 12:51:22.929045559 +0200 +@@ -318,7 +318,7 @@ elsif ( $opt->{basedir} ) + find_in_basedir($opt,"file","mysqld-nt", + "bin"); # ,"sql" + $pkgdatadir = find_in_basedir($opt,"dir","fill_help_tables.sql", +- "share","share/mysql"); # ,"scripts" ++ "share","@INSTALL_MYSQLSHAREDIR@"); # ,"scripts" + $scriptdir = "$opt->{basedir}/scripts"; + } + else +diff -up mariadb-10.0.13/scripts/mysql_install_db.sh.pbasedir mariadb-10.0.13/scripts/mysql_install_db.sh +--- mariadb-10.0.13/scripts/mysql_install_db.sh.pbasedir 2014-09-04 12:51:59.005086301 +0200 ++++ mariadb-10.0.13/scripts/mysql_install_db.sh 2014-09-04 12:54:02.794222597 +0200 +@@ -280,16 +280,16 @@ then + cannot_find_file mysqld $basedir/libexec $basedir/sbin $basedir/bin + exit 1 + fi +- langdir=`find_in_basedir --dir errmsg.sys share/english share/mysql/english` ++ langdir=`find_in_basedir --dir errmsg.sys share/english @INSTALL_MYSQLSHAREDIR@/english` + if test -z "$langdir" + then +- cannot_find_file errmsg.sys $basedir/share/english $basedir/share/mysql/english ++ cannot_find_file errmsg.sys $basedir/share/english $basedir/@INSTALL_MYSQLSHAREDIR@/english + exit 1 + fi +- pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql` ++ pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share @INSTALL_MYSQLSHAREDIR@` + if test -z "$pkgdatadir" + then +- cannot_find_file fill_help_tables.sql $basedir/share $basedir/share/mysql ++ cannot_find_file fill_help_tables.sql $basedir/share $basedir/@INSTALL_MYSQLSHAREDIR@ + exit 1 + fi + scriptdir="$basedir/scripts" diff --git a/SOURCES/mariadb-install-test.patch b/SOURCES/mariadb-install-test.patch new file mode 100644 index 0000000..e377e60 --- /dev/null +++ b/SOURCES/mariadb-install-test.patch @@ -0,0 +1,56 @@ +Improve the documentation that will be installed in the mysql-test RPM. + +diff -up mariadb-10.0.10/mysql-test/README.p3 mariadb-10.0.10/mysql-test/README +--- mariadb-10.0.10/mysql-test/README.p3 2014-04-07 16:05:51.402631548 +0200 ++++ mariadb-10.0.10/mysql-test/README 2014-04-07 16:06:06.137637991 +0200 +@@ -1,15 +1,28 @@ +-This directory contains a test suite for the MySQL daemon. To run +-the currently existing test cases, simply execute ./mysql-test-run in +-this directory. It will fire up the newly built mysqld and test it. +- +-Note that you do not have to have to do "make install", and you could +-actually have a co-existing MySQL installation. The tests will not +-conflict with it. To run the test suite in a source directory, you +-must do make first. +- +-All tests must pass. If one or more of them fail on your system, please +-read the following manual section for instructions on how to report the +-problem: ++This directory contains a test suite for the MariaDB daemon. To run ++the currently existing test cases, execute ./mysql-test-run in ++this directory. ++ ++For use in Red Hat distributions, you should run the script as user mysql, ++who is created with nologin shell however, so the best bet is something like ++ $ su - ++ # cd /usr/share/mysql-test ++ # su -s /bin/bash mysql -c "./mysql-test-run --skip-test-list=rh-skipped-tests.list" ++ ++This will use the installed mysql executables, but will run a private copy ++of the server process (using data files within /usr/share/mysql-test), ++so you need not start the mysqld service beforehand. ++ ++The "--skip-test-list=rh-skipped-tests.list" option excludes tests that are ++known to fail on one or more Red-Hat-supported platforms. You can omit it ++if you want to check whether such failures occur for you. Documentation ++about the reasons for omitting such tests can be found in the file ++rh-skipped-tests.list. ++ ++To clean up afterwards, remove the created "var" subdirectory, eg ++ # su -s /bin/bash - mysql -c "rm -rf /usr/share/mysql-test/var" ++ ++If one or more tests fail on your system, please read the following manual ++section for instructions on how to report the problem: + + http://kb.askmonty.org/v/reporting-bugs + +@@ -26,7 +39,8 @@ other relevant options. + + With no test cases named on the command line, mysql-test-run falls back + to the normal "non-extern" behavior. The reason for this is that some +-tests cannot run with an external server. ++tests cannot run with an external server (because they need to control the ++options with which the server is started). + + You can create your own test cases. To create a test case, create a new + file in the t subdirectory using a text editor. The file should have a .test diff --git a/SOURCES/mariadb-logrotate.patch b/SOURCES/mariadb-logrotate.patch new file mode 100644 index 0000000..898f7f4 --- /dev/null +++ b/SOURCES/mariadb-logrotate.patch @@ -0,0 +1,71 @@ +Adjust the mysql-log-rotate script in several ways: + +* Use the correct log file pathname for Red Hat installations. +* Enable creation of the log file by logrotate (needed since + /var/log/ isn't writable by mysql user); and set the same 640 + permissions we normally use. +* Comment out the actual rotation commands, so that user must edit + the file to enable rotation. This is unfortunate, but the fact + that the script will probably fail without manual configuration + (to set a root password) means that we can't really have it turned + on by default. Fortunately, in most configurations the log file + is low-volume and so rotation is not critical functionality. + +See discussions at RH bugs 799735, 547007 + + +diff -up mariadb-10.0.10/support-files/mysql-log-rotate.sh.p5 mariadb-10.0.10/support-files/mysql-log-rotate.sh +--- mariadb-10.0.10/support-files/mysql-log-rotate.sh.p5 2014-03-30 19:56:53.000000000 +0200 ++++ mariadb-10.0.10/support-files/mysql-log-rotate.sh 2014-04-07 16:30:11.264618655 +0200 +@@ -1,9 +1,9 @@ + # This logname can be set in /etc/my.cnf +-# by setting the variable "err-log" +-# in the [safe_mysqld] section as follows: ++# by setting the variable "log-error" ++# in the [mysqld_safe] section as follows: + # +-# [safe_mysqld] +-# err-log=@localstatedir@/mysqld.log ++# [mysqld_safe] ++# log-error=@LOG_LOCATION@ + # + # If the root user has a password you have to create a + # /root/.my.cnf configuration file with the following +@@ -18,19 +18,21 @@ + # ATTENTION: This /root/.my.cnf should be readable ONLY + # for root ! + +-@localstatedir@/mysqld.log { +- # create 600 mysql mysql +- notifempty +- daily +- rotate 3 +- missingok +- compress +- postrotate +- # just if mysqld is really running +- if test -x @bindir@/mysqladmin && \ +- @bindir@/mysqladmin ping &>/dev/null +- then +- @bindir@/mysqladmin flush-logs +- fi +- endscript +-} ++# Then, un-comment the following lines to enable rotation of mysql's log file: ++ ++#@LOG_LOCATION@ { ++# create 640 mysql mysql ++# notifempty ++# daily ++# rotate 3 ++# missingok ++# compress ++# postrotate ++# # just if mysqld is really running ++# if test -x @bindir@/mysqladmin && \ ++# @bindir@/mysqladmin ping &>/dev/null ++# then ++# @bindir@/mysqladmin flush-logs ++# fi ++# endscript ++#} diff --git a/SOURCES/mariadb-s390-tsc.patch b/SOURCES/mariadb-s390-tsc.patch new file mode 100644 index 0000000..ebbf951 --- /dev/null +++ b/SOURCES/mariadb-s390-tsc.patch @@ -0,0 +1,41 @@ +Support s390/s390x in performance schema's cycle-counting functions. +Filed upstream at http://bugs.mysql.com/bug.php?id=59953 + + +diff -up mariadb-10.0.10/include/my_rdtsc.h.p4 mariadb-10.0.10/include/my_rdtsc.h +--- mariadb-10.0.10/include/my_rdtsc.h.p4 2014-03-30 19:56:36.000000000 +0200 ++++ mariadb-10.0.10/include/my_rdtsc.h 2014-04-07 16:13:55.227792169 +0200 +@@ -125,6 +125,7 @@ C_MODE_END + #define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25 + #define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26 + #define MY_TIMER_ROUTINE_ASM_SUNPRO_X86_64 27 ++#define MY_TIMER_ROUTINE_ASM_S390 28 + + #endif + +diff -up mariadb-10.0.10/mysys/my_rdtsc.c.p4 mariadb-10.0.10/mysys/my_rdtsc.c +--- mariadb-10.0.10/mysys/my_rdtsc.c.p4 2014-03-30 19:56:36.000000000 +0200 ++++ mariadb-10.0.10/mysys/my_rdtsc.c 2014-04-07 16:15:48.114901576 +0200 +@@ -224,6 +224,13 @@ ulonglong my_timer_cycles(void) + clock_gettime(CLOCK_SGI_CYCLE, &tp); + return (ulonglong) tp.tv_sec * 1000000000 + (ulonglong) tp.tv_nsec; + } ++#elif defined(__GNUC__) && defined(__s390__) ++ /* covers both s390 and s390x */ ++ { ++ ulonglong result; ++ __asm__ __volatile__ ("stck %0" : "=Q" (result) : : "cc"); ++ return result; ++ } + #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) + /* gethrtime may appear as either cycle or nanosecond counter */ + return (ulonglong) gethrtime(); +@@ -533,6 +540,8 @@ void my_timer_init(MY_TIMER_INFO *mti) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32; + #elif defined(__sgi) && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_SGI_CYCLE) + mti->cycles.routine= MY_TIMER_ROUTINE_SGI_CYCLE; ++#elif defined(__GNUC__) && defined(__s390__) ++ mti->cycles.routine= MY_TIMER_ROUTINE_ASM_S390; + #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) + mti->cycles.routine= MY_TIMER_ROUTINE_GETHRTIME; + #else diff --git a/SOURCES/mariadb-scl-env-check.patch b/SOURCES/mariadb-scl-env-check.patch new file mode 100644 index 0000000..ac45678 --- /dev/null +++ b/SOURCES/mariadb-scl-env-check.patch @@ -0,0 +1,135 @@ +diff -rup mariadb-10.0.15-orig/scripts/mysqld_safe.sh mariadb-10.0.15/scripts/mysqld_safe.sh +--- mariadb-10.0.15-orig/scripts/mysqld_safe.sh 2014-12-04 19:43:46.199488213 +0100 ++++ mariadb-10.0.15/scripts/mysqld_safe.sh 2014-12-04 19:51:33.461984234 +0100 +@@ -11,6 +11,12 @@ + # mysql.server works by first doing a cd to the base directory and from there + # executing mysqld_safe + ++# we want start daemon only inside "scl enable" invocation ++if ! scl_enabled @SCL_NAME@ ; then ++ echo "Use \"scl enable @SCL_NAME@ 'service ...'\" invocation" ++ exit 1 ++fi ++ + # Initialize script globals + KILL_MYSQLD=1; + MYSQLD= +diff -rup mariadb-10.0.15-orig/scripts/mysql.init.in mariadb-10.0.15/scripts/mysql.init.in +--- mariadb-10.0.15-orig/scripts/mysql.init.in 2014-12-04 19:43:46.310488382 +0100 ++++ mariadb-10.0.15/scripts/mysql.init.in 2014-12-04 20:00:42.273120004 +0100 +@@ -145,6 +145,18 @@ condrestart(){ + [ -e $lockfile ] && restart || : + } + ++# We have to re-enable SCL environment, because /sbin/service ++# clears almost all environment variables. ++# Since X_SCLS is cleared as well, we lose information about other ++# collections enabled. ++source @SCL_SCRIPTS@/service-environment ++source scl_source enable $MARIADB@MAJOR_VERSION@@MINOR_VERSION@_SCLS_ENABLED ++ ++# we want start daemon only inside "scl enable" invocation ++if ! scl_enabled @SCL_NAME@ ; then ++ echo "Collection @SCL_NAME@ has to be listed in @SCL_SCRIPTS@/service-environment" ++ exit 1 ++fi + + # See how we were called. + case "$1" in +diff -rup mariadb-10.0.15-orig/scripts/mysql_install_db.sh mariadb-10.0.15/scripts/mysql_install_db.sh +--- mariadb-10.0.15-orig/scripts/mysql_install_db.sh 2014-12-04 19:43:46.308488379 +0100 ++++ mariadb-10.0.15/scripts/mysql_install_db.sh 2014-12-04 19:57:02.056065525 +0100 +@@ -19,6 +19,12 @@ + # + # All unrecognized arguments to this script are passed to mysqld. + ++# we want start daemon only inside "scl enable" invocation ++if ! scl_enabled @SCL_NAME@ ; then ++ echo "Use \"scl enable @SCL_NAME@ 'service ...'\" invocation" ++ exit 1 ++fi ++ + basedir="" + builddir="" + ldata="@localstatedir@" +@@ -435,16 +441,16 @@ else + echo "The problem could be conflicting information in an external" + echo "my.cnf files. You can ignore these by doing:" + echo +- echo " shell> $scriptdir/scripts/mysql_install_db --defaults-file=~/.my.cnf" ++ echo " shell> su -s /bin/bash - mysql -c 'scl enable @SCL_NAME@ -- $scriptdir/scripts/mysql_install_db --defaults-file=~/.my.cnf'" + echo + echo "You can also try to start the mysqld daemon with:" + echo +- echo " shell> $mysqld --skip-grant --general-log &" ++ echo " shell> su -s /bin/bash - mysql -c 'scl enable @SCL_NAME@ -- $mysqld --skip-grant --general-log &'" + echo + echo "and use the command line tool $bindir/mysql" + echo "to connect to the mysql database and look at the grant tables:" + echo +- echo " shell> $bindir/mysql -u root mysql" ++ echo " shell> scl enable @SCL_NAME@ -- $bindir/mysql -u root mysql" + echo " mysql> show tables;" + echo + echo "Try 'mysqld --help' if you have problems with paths. Using" +@@ -474,19 +480,15 @@ fi + # the screen. + if test "$cross_bootstrap" -eq 0 && test -z "$srcdir" + then +- s_echo +- s_echo "To start mysqld at boot time you have to copy" +- s_echo "support-files/mysql.server to the right place for your system" +- + echo + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !" + echo "To do so, start the server, then issue the following commands:" + echo +- echo "'$bindir/mysqladmin' -u root password 'new-password'" +- echo "'$bindir/mysqladmin' -u root -h $hostname password 'new-password'" ++ echo "scl enable @SCL_NAME@ -- '$bindir/mysqladmin' -u root password 'new-password'" ++ echo "scl enable @SCL_NAME@ -- '$bindir/mysqladmin' -u root -h $hostname password 'new-password'" + echo + echo "Alternatively you can run:" +- echo "'$bindir/mysql_secure_installation'" ++ echo "scl enable @SCL_NAME@ -- '$bindir/mysql_secure_installation'" + echo + echo "which will also give you the option of removing the test" + echo "databases and anonymous user created by default. This is" +@@ -502,7 +504,8 @@ then + echo "cd '$basedir' ; $bindir/mysqld_safe --datadir='$ldata'" + echo + echo "You can test the MariaDB daemon with mysql-test-run.pl" +- echo "cd '$basedir/mysql-test' ; perl mysql-test-run.pl" ++ echo "after installing @SCL_NAME@-mariadb-test package." ++ echo "See @prefix@/share/mysql-test/README for instructions." + fi + + echo +diff -rup mariadb-10.0.15-orig/scripts/mysql.service.in mariadb-10.0.15/scripts/mysql.service.in +--- mariadb-10.0.15-orig/scripts/mysql.service.in 2014-12-04 19:43:46.310488382 +0100 ++++ mariadb-10.0.15/scripts/mysql.service.in 2014-12-04 19:49:28.626953351 +0100 +@@ -32,13 +32,19 @@ Type=simple + User=mysql + Group=mysql + +-ExecStartPre=@libexecdir@/mysql-check-socket +-ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n ++# Load collections set to enabled for this service ++EnvironmentFile=@SCL_SCRIPTS@/service-environment ++ ++# We want to start server only inside "scl enable" invocation ++ExecStartPre=/usr/bin/scl enable $MARIADB@MAJOR_VERSION@@MINOR_VERSION@_SCLS_ENABLED -- /usr/bin/scl_enabled @SCL_NAME@ ++ ++ExecStartPre=/usr/bin/scl enable $MARIADB@MAJOR_VERSION@@MINOR_VERSION@_SCLS_ENABLED -- @libexecdir@/mysql-check-socket ++ExecStartPre=/usr/bin/scl enable $MARIADB@MAJOR_VERSION@@MINOR_VERSION@_SCLS_ENABLED -- @libexecdir@/mysql-prepare-db-dir %n + # Note: we set --basedir to prevent probes that might trigger SELinux alarms, + # per bug #547485 +-ExecStart=@bindir@/mysqld_safe --basedir=@prefix@ +-ExecStartPost=@libexecdir@/mysql-wait-ready $MAINPID +-ExecStartPost=@libexecdir@/mysql-check-upgrade ++ExecStart=/usr/bin/scl enable $MARIADB@MAJOR_VERSION@@MINOR_VERSION@_SCLS_ENABLED -- @bindir@/mysqld_safe --basedir=@prefix@ ++ExecStartPost=/usr/bin/scl enable $MARIADB@MAJOR_VERSION@@MINOR_VERSION@_SCLS_ENABLED -- @libexecdir@/mysql-wait-ready $MAINPID ++ExecStartPost=/usr/bin/scl enable $MARIADB@MAJOR_VERSION@@MINOR_VERSION@_SCLS_ENABLED -- @libexecdir@/mysql-check-upgrade + + # Give a reasonable amount of time for the server to start up/shut down + TimeoutSec=300 diff --git a/SOURCES/mariadb-scripts.patch b/SOURCES/mariadb-scripts.patch new file mode 100644 index 0000000..f42c991 --- /dev/null +++ b/SOURCES/mariadb-scripts.patch @@ -0,0 +1,48 @@ +diff -up mariadb-10.0.15/scripts/CMakeLists.txt.systemd mariadb-10.0.15/scripts/CMakeLists.txt +--- mariadb-10.0.15/scripts/CMakeLists.txt.systemd 2014-11-27 15:06:24.670736998 +0100 ++++ mariadb-10.0.15/scripts/CMakeLists.txt 2014-11-27 15:04:26.252530666 +0100 +@@ -374,6 +374,32 @@ ELSE() + COMPONENT ${${file}_COMPONENT} + ) + ENDFOREACH() ++ ++ # files for systemd ++ SET(SYSTEMD_SCRIPTS ++ mysql.tmpfiles.d ++ mysql.service ++ mysql-prepare-db-dir ++ mysql-wait-ready ++ mysql-check-socket ++ mysql-check-upgrade ++ mysql-scripts-common ++ mysql_config_multilib ++ mysql.init ++ my.cnf ++ ) ++ FOREACH(file ${SYSTEMD_SCRIPTS}) ++ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh) ++ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh ++ ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY) ++ ELSEIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.in) ++ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.in ++ ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY) ++ ELSE() ++ MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file}.in in " ++ "${CMAKE_CURRENT_SOURCE_DIR}" ) ++ ENDIF() ++ ENDFOREACH() + ENDIF() + + # Install libgcc as mylibgcc.a +diff -up mariadb-10.0.15/support-files/CMakeLists.txt.cmakescripts mariadb-10.0.15/support-files/CMakeLists.txt +--- mariadb-10.0.15/support-files/CMakeLists.txt.cmakescripts 2014-11-27 15:07:13.203821563 +0100 ++++ mariadb-10.0.15/support-files/CMakeLists.txt 2014-11-27 15:04:26.252530666 +0100 +@@ -112,6 +112,8 @@ IF(UNIX) + COMPONENT SharedLibraries) + INSTALL(FILES rpm/mysql-clients.cnf DESTINATION ${INSTALL_SYSCONF2DIR} + COMPONENT Client) ++ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/rpm/server.cnf ++ ${CMAKE_CURRENT_BINARY_DIR}/rpm/server.cnf @ONLY ) + INSTALL(FILES rpm/server.cnf DESTINATION ${INSTALL_SYSCONF2DIR} + COMPONENT IniFiles) + ENDIF() diff --git a/SOURCES/mariadb-ssltest.patch b/SOURCES/mariadb-ssltest.patch new file mode 100644 index 0000000..7529d7f --- /dev/null +++ b/SOURCES/mariadb-ssltest.patch @@ -0,0 +1,30 @@ +Don't test EDH-RSA-DES-CBC-SHA cipher, it seems to be removed from openssl +which now makes mariadb/mysql FTBFS because openssl_1 test fails + +Related: #1044565 + + +diff -up mariadb-10.0.15/mysql-test/r/openssl_1.result.orig mariadb-10.0.15/mysql-test/r/openssl_1.result +--- mariadb-10.0.15/mysql-test/r/openssl_1.result.orig 2014-11-27 15:25:32.582771542 +0100 ++++ mariadb-10.0.15/mysql-test/r/openssl_1.result 2014-11-27 15:22:46.353474672 +0100 +@@ -198,8 +198,6 @@ Ssl_cipher DHE-RSA-AES256-SHA + Variable_name Value + Ssl_cipher EDH-RSA-DES-CBC3-SHA + Variable_name Value +-Ssl_cipher EDH-RSA-DES-CBC-SHA +-Variable_name Value + Ssl_cipher RC4-SHA + select 'is still running; no cipher request crashed the server' as result from dual; + result +diff -up mariadb-10.0.15/mysql-test/t/openssl_1.test.orig mariadb-10.0.15/mysql-test/t/openssl_1.test +--- mariadb-10.0.15/mysql-test/t/openssl_1.test.orig 2014-11-27 15:25:16.637743066 +0100 ++++ mariadb-10.0.15/mysql-test/t/openssl_1.test 2014-11-27 15:22:46.354474674 +0100 +@@ -222,7 +222,7 @@ DROP TABLE t1; + # Common ciphers to openssl and yassl + --exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=DHE-RSA-AES256-SHA + --exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC3-SHA +---exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC-SHA ++#--exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=EDH-RSA-DES-CBC-SHA + --exec $MYSQL --host=localhost -e "SHOW STATUS LIKE 'Ssl_cipher';" --ssl-cipher=RC4-SHA + --disable_query_log + --disable_result_log diff --git a/SOURCES/mariadb-string-overflow.patch b/SOURCES/mariadb-string-overflow.patch new file mode 100644 index 0000000..a8231bd --- /dev/null +++ b/SOURCES/mariadb-string-overflow.patch @@ -0,0 +1,22 @@ +These issues were found by Coverity static analysis tool, for more info +see messages by particular fixes (messages belong to 5.1.61). + +Filed upstream at http://bugs.mysql.com/bug.php?id=64631 + + +Error: BUFFER_SIZE_WARNING: +/builddir/build/BUILD/mysql-5.1.61/sql/sql_prepare.cc:2749: buffer_size_warning: Calling strncpy with a maximum size argument of 512 bytes on destination array "this->stmt->last_error" of size 512 bytes might leave the destination string unterminated. + + +diff -up mariadb-10.0.10/sql/sql_prepare.cc.p8 mariadb-10.0.10/sql/sql_prepare.cc +--- mariadb-10.0.10/sql/sql_prepare.cc.p8 2014-03-30 19:56:42.000000000 +0200 ++++ mariadb-10.0.10/sql/sql_prepare.cc 2014-04-07 18:43:33.901074770 +0200 +@@ -3021,7 +3021,7 @@ void mysql_stmt_get_longdata(THD *thd, c + { + stmt->state= Query_arena::STMT_ERROR; + stmt->last_errno= thd->get_stmt_da()->sql_errno(); +- strncpy(stmt->last_error, thd->get_stmt_da()->message(), MYSQL_ERRMSG_SIZE); ++ strncpy(stmt->last_error, thd->get_stmt_da()->message(), sizeof(stmt->last_error)-1); + } + thd->set_stmt_da(save_stmt_da); + diff --git a/SOURCES/mariadb-strmov.patch b/SOURCES/mariadb-strmov.patch new file mode 100644 index 0000000..c2350c4 --- /dev/null +++ b/SOURCES/mariadb-strmov.patch @@ -0,0 +1,30 @@ +Remove overly optimistic definition of strmov() as stpcpy(). + +mysql uses this macro with overlapping source and destination strings, +which is verboten per spec, and fails on some Red Hat platforms. +Deleting the definition is sufficient to make it fall back to a +byte-at-a-time copy loop, which should consistently give the +expected behavior. + +Note: the particular case that prompted this patch is reported and fixed +at http://bugs.mysql.com/bug.php?id=48864. However, my faith in upstream's +ability to detect this type of error is low, and I also see little evidence +of any real performance gain from optimizing these calls. So I'm keeping +this patch. + +diff -up mariadb-10.0.15/include/m_string.h.orig mariadb-10.0.15/include/m_string.h +--- mariadb-10.0.15/include/m_string.h.orig 2014-11-27 14:40:32.622032698 +0100 ++++ mariadb-10.0.15/include/m_string.h 2014-11-27 14:38:56.211864712 +0100 +@@ -73,12 +73,6 @@ extern void *(*my_str_malloc)(size_t); + extern void *(*my_str_realloc)(void *, size_t); + extern void (*my_str_free)(void *); + +-#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER) +-#define strmov(A,B) __builtin_stpcpy((A),(B)) +-#elif defined(HAVE_STPCPY) +-#define strmov(A,B) stpcpy((A),(B)) +-#endif +- + /* Declared in int2str() */ + extern const char _dig_vec_upper[]; + extern const char _dig_vec_lower[]; diff --git a/SOURCES/my.cnf.in b/SOURCES/my.cnf.in new file mode 100644 index 0000000..fada8de --- /dev/null +++ b/SOURCES/my.cnf.in @@ -0,0 +1,25 @@ +[mysqld] +datadir=@MYSQL_DATADIR@ +socket=/var/lib/mysql/mysql.sock +# Disabling symbolic-links is recommended to prevent assorted security risks +symbolic-links=0 +# Settings user and group are ignored when systemd is used. +# If you need to run mysqld under a different user or group, +# customize your systemd unit file for mysqld/mariadb according to the +# instructions in http://fedoraproject.org/wiki/Systemd + +# Settings for particular implementations like MariaDB are defined +# in appropriate sections; for MariaDB server in [mariadb] section in +# @INSTALL_SYSCONF2DIR@/server.cnf (part of mariadb-server). +# It doesn't matter that we set these settings only for [mysqld] here, +# because they will be read and used in mysqld_safe as well. +log-error=@LOG_LOCATION@ +pid-file=@PID_FILE_DIR@/@DAEMON_NAME@.pid + +[mysqld_safe] + +# +# include all files from the config directory +# +!includedir @INSTALL_SYSCONF2DIR@ + diff --git a/SOURCES/my_config.h b/SOURCES/my_config.h new file mode 100644 index 0000000..02baa3d --- /dev/null +++ b/SOURCES/my_config.h @@ -0,0 +1,33 @@ +/* + * Kluge to support multilib installation of both 32- and 64-bit RPMS: + * we need to arrange that header files that appear in both RPMs are + * identical. Hence, this file is architecture-independent and calls + * in an arch-dependent file that will appear in just one RPM. + * + * To avoid breaking arches not explicitly supported by Red Hat, we + * use this indirection file *only* on known multilib arches. + * + * Note: this may well fail if user tries to use gcc's -I- option. + * But that option is deprecated anyway. + */ +#if defined(__x86_64__) +#include "my_config_x86_64.h" +#elif defined(__i386__) +#include "my_config_i386.h" +#elif defined(__ppc64__) || defined(__powerpc64__) +#include "my_config_ppc64.h" +#elif defined(__ppc__) || defined(__powerpc__) +#include "my_config_ppc.h" +#elif defined(__s390x__) +#include "my_config_s390x.h" +#elif defined(__s390__) +#include "my_config_s390.h" +#elif defined(__sparc__) && defined(__arch64__) +#include "my_config_sparc64.h" +#elif defined(__sparc__) +#include "my_config_sparc.h" +#elif defined(__arm__) +#include "my_config_arm.h" +#elif defined(__aarch64__) +#include "my_config_aarch64.h" +#endif diff --git a/SOURCES/mysql-check-socket.sh b/SOURCES/mysql-check-socket.sh new file mode 100644 index 0000000..b15cd32 --- /dev/null +++ b/SOURCES/mysql-check-socket.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +# We check if there is already a process using the socket file, +# since otherwise the systemd service file could report false +# positive result when starting and mysqld_safe could remove +# a socket file, which is actually being used by a different daemon. + +source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common" + +if test -e "$socketfile" ; then + echo "Socket file $socketfile exists." >&2 + + # no write permissions + if ! test -w "$socketfile" ; then + echo "Not enough permission to write to the socket file $socketfile, which is suspicious." >&2 + echo "Please, remove $socketfile manually to start the service." >&2 + exit 1 + fi + + # not a socket file + if ! test -S "$socketfile" ; then + echo "The file $socketfile is not a socket file, which is suspicious." >&2 + echo "Please, remove $socketfile manually to start the service." >&2 + exit 1 + fi + + # some process uses the socket file + if fuser "$socketfile" &>/dev/null ; then + socketpid=$(fuser "$socketfile" 2>/dev/null) + echo "Is another MySQL daemon already running with the same unix socket?" >&2 + echo "Please, stop the process $socketpid or remove $socketfile manually to start the service." >&2 + exit 1 + fi + + # socket file is a garbage + echo "No process is using $socketfile, which means it is a garbage, so it will be removed automatically." >&2 +fi + +exit 0 diff --git a/SOURCES/mysql-check-upgrade.sh b/SOURCES/mysql-check-upgrade.sh new file mode 100644 index 0000000..9c8a8bd --- /dev/null +++ b/SOURCES/mysql-check-upgrade.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common" + +upgrade_info_file="$datadir/mysql_upgrade_info" +version=0 +# get version as integer from mysql_upgrade_info file +if [ -f "$upgrade_info_file" ] && [ -r "$upgrade_info_file" ] ; then + version_major=$(cat "$upgrade_info_file" | head -n 1 | sed -e 's/\([0-9]*\)\.\([0-9]*\)\..*$/\1/') + version_minor=$(cat "$upgrade_info_file" | head -n 1 | sed -e 's/\([0-9]*\)\.\([0-9]*\)\..*$/\2/') + if [[ $version_major =~ ^[0-9]+$ ]] && [[ $version_minor =~ ^[0-9]+$ ]] ; then + version=$((version_major*100+version_minor)) + fi +fi + +# compute current version as integer +thisversion=$((@MAJOR_VERSION@*100+@MINOR_VERSION@)) + +# provide warning in cases we should run mysql_upgrade +if [ $version -ne $thisversion ] ; then + + # give extra warning if some version seems to be skipped + if [ $version -gt 0 ] && [ $version -lt 505 ] ; then + echo "The datadir located at $datadir seems to be older than of a version 5.5. Please, mind that as a general rule, to upgrade from one release series to another, go to the next series rather than skipping a series." >&2 + fi + + cat <&2 +The datadir located at $datadir needs to be upgraded using 'mysql_upgrade' tool. This can be done using the following steps: + + 1. Back-up your data before running 'mysql_upgrade' + 2. Start the database daemon using 'systemctl start @DAEMON_NAME@.service' + 3. Run 'mysql_upgrade' with a database user that has sufficient privileges + +Read more about 'mysql_upgrade' usage at: +https://mariadb.com/kb/en/mariadb/documentation/sql-commands/table-commands/mysql_upgrade/ +EOF +fi + +exit 0 diff --git a/SOURCES/mysql-embedded-check.c b/SOURCES/mysql-embedded-check.c new file mode 100644 index 0000000..8bf8ca5 --- /dev/null +++ b/SOURCES/mysql-embedded-check.c @@ -0,0 +1,26 @@ +/* simple test program to see if we can link the embedded server library */ + +#include +#include +#include + +#include "mysql.h" + +MYSQL *mysql; + +static char *server_options[] = \ + { "mysql_test", "--defaults-file=my.cnf", NULL }; +int num_elements = (sizeof(server_options) / sizeof(char *)) - 1; + +static char *server_groups[] = { "libmysqld_server", + "libmysqld_client", NULL }; + +int main(int argc, char **argv) +{ + mysql_library_init(num_elements, server_options, server_groups); + mysql = mysql_init(NULL); + mysql_close(mysql); + mysql_library_end(); + + return 0; +} diff --git a/SOURCES/mysql-prepare-db-dir.sh b/SOURCES/mysql-prepare-db-dir.sh new file mode 100644 index 0000000..1905f09 --- /dev/null +++ b/SOURCES/mysql-prepare-db-dir.sh @@ -0,0 +1,89 @@ +#!/bin/sh + +# This script creates the mysql data directory during first service start. +# In subsequent starts, it does nothing much. + +source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common" + +# If two args given first is user, second is group +# otherwise the arg is the systemd service file +if [ "$#" -eq 2 ] +then + myuser="$1" + mygroup="$2" +else + # Absorb configuration settings from the specified systemd service file, + # or the default service if not specified + SERVICE_NAME="$1" + if [ x"$SERVICE_NAME" = x ] + then + SERVICE_NAME=@DAEMON_NAME@.service + fi + + myuser=`systemctl show -p User "${SERVICE_NAME}" | + sed 's/^User=//'` + if [ x"$myuser" = x ] + then + myuser=mysql + fi + + mygroup=`systemctl show -p Group "${SERVICE_NAME}" | + sed 's/^Group=//'` + if [ x"$mygroup" = x ] + then + mygroup=mysql + fi +fi + +# Set up the errlogfile with appropriate permissions +touch "$errlogfile" +ret=$? +# Provide some advice if the log file cannot be touched +if [ $ret -ne 0 ] ; then + errlogdir=$(dirname $errlogfile) + if ! [ -d "$errlogdir" ] ; then + echo "The directory $errlogdir does not exist." + elif [ -f "$errlogfile" ] ; then + echo "The log file $errlogfile cannot be touched, please, fix its permissions." + else + echo "The log file $errlogfile could not be created." + fi + echo "The daemon will be run under $myuser:$mygroup" + exit 1 +fi +chown "$myuser:$mygroup" "$errlogfile" +chmod 0640 "$errlogfile" +[ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile" + +# Make the data directory +if [ ! -d "$datadir/mysql" ] ; then + # First, make sure $datadir is there with correct permissions + # (note: if it's not, and we're not root, this'll fail ...) + if [ ! -e "$datadir" -a ! -h "$datadir" ] + then + mkdir -p "$datadir" || exit 1 + fi + chown "$myuser:$mygroup" "$datadir" + chmod 0755 "$datadir" + [ -x /sbin/restorecon ] && /sbin/restorecon "$datadir" + + # Now create the database + echo "Initializing @NICE_PROJECT_NAME@ database" + @bindir@/mysql_install_db --rpm --datadir="$datadir" --user="$myuser" + ret=$? + if [ $ret -ne 0 ] ; then + echo "Initialization of @NICE_PROJECT_NAME@ database failed." >&2 + echo "Perhaps @sysconfdir@/my.cnf is misconfigured." >&2 + # Clean up any partially-created database files + if [ ! -e "$datadir/mysql/user.frm" ] ; then + rm -rf "$datadir"/* + fi + exit $ret + fi + # upgrade does not need to be run on a fresh datadir + echo "@VERSION@-MariaDB" >"$datadir/mysql_upgrade_info" + # In case we're running as root, make sure files are owned properly + chown -R "$myuser:$mygroup" "$datadir" +fi + +exit 0 diff --git a/SOURCES/mysql-scripts-common.sh b/SOURCES/mysql-scripts-common.sh new file mode 100644 index 0000000..925cf9c --- /dev/null +++ b/SOURCES/mysql-scripts-common.sh @@ -0,0 +1,58 @@ +#!/bin/sh + +# Some useful functions used in other MySQL helper scripts +# This scripts defines variables datadir, errlogfile, socketfile + +export LC_ALL=C + +# extract value of a MySQL option from config files +# Usage: get_mysql_option VARNAME DEFAULT SECTION [ SECTION, ... ] +# result is returned in $result +# We use my_print_defaults which prints all options from multiple files, +# with the more specific ones later; hence take the last match. +get_mysql_option(){ + if [ $# -ne 3 ] ; then + echo "get_mysql_option requires 3 arguments: section option default_value" + return + fi + sections="$1" + option_name="$2" + default_value="$3" + result=`@bindir@/my_print_defaults $sections | sed -n "s/^--${option_name}=//p" | tail -n 1` + if [ -z "$result" ]; then + # not found, use default + result="${default_value}" + fi +} + +# Defaults here had better match what mysqld_safe will default to +# The option values are generally defined on three important places +# on the default installation: +# 1) default values are hardcoded in the code of mysqld daemon or +# mysqld_safe script +# 2) configurable values are defined in @sysconfdir@/my.cnf +# 3) default values for helper scripts are specified bellow +# So, in case values are defined in my.cnf, we need to get that value. +# In case they are not defined in my.cnf, we need to get the same value +# in the daemon, as in the helper scripts. Thus, default values here +# must correspond with values defined in mysqld_safe script and source +# code itself. + +server_sections="mysqld_safe mysqld server mysqld-@MAJOR_VERSION@.@MINOR_VERSION@ mariadb mariadb-@MAJOR_VERSION@.@MINOR_VERSION@ client-server" + +get_mysql_option "$server_sections" datadir "@MYSQL_DATADIR@" +datadir="$result" + +# if there is log_error in the my.cnf, my_print_defaults still +# returns log-error +# log-error might be defined in mysqld_safe and mysqld sections, +# the former has bigger priority +get_mysql_option "$server_sections" log-error "$datadir/`hostname`.err" +errlogfile="$result" + +get_mysql_option "$server_sections" socket "@MYSQL_UNIX_ADDR@" +socketfile="$result" + +get_mysql_option "$server_sections" pid-file "$datadir/`hostname`.pid" +pidfile="$result" + diff --git a/SOURCES/mysql-wait-ready.sh b/SOURCES/mysql-wait-ready.sh new file mode 100644 index 0000000..2ed5fe1 --- /dev/null +++ b/SOURCES/mysql-wait-ready.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common" + +# This script waits for mysqld to be ready to accept connections +# (which can be many seconds or even minutes after launch, if there's +# a lot of crash-recovery work to do). +# Running this as ExecStartPost is useful so that services declared as +# "After mysqld" won't be started until the database is really ready. + +if [ $# -ne 1 ] ; then + echo "You need to pass daemon pid as an argument for this script." + exit 20 +fi + +# Service file passes us the daemon's PID (actually, mysqld_safe's PID) +daemon_pid="$1" + +# Wait for the server to come up or for the mysqld process to disappear +ret=0 +while /bin/true; do + # Check process still exists + if ! [ -d "/proc/${daemon_pid}" ] ; then + ret=1 + break + fi + RESPONSE=`@bindir@/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1` + mret=$? + if [ $mret -eq 0 ] ; then + break + fi + # exit codes 1, 11 (EXIT_CANNOT_CONNECT_TO_SERVICE) are expected, + # anything else suggests a configuration error + if [ $mret -ne 1 -a $mret -ne 11 ]; then + echo "Cannot check for @NICE_PROJECT_NAME@ Daemon startup because of mysqladmin failure." >&2 + ret=$mret + break + fi + # "Access denied" also means the server is alive + echo "$RESPONSE" | grep -q "Access denied for user" && break + + sleep 1 +done + +exit $ret diff --git a/SOURCES/mysql.init.in b/SOURCES/mysql.init.in new file mode 100644 index 0000000..d6b43d3 --- /dev/null +++ b/SOURCES/mysql.init.in @@ -0,0 +1,177 @@ +#!/bin/sh +# +# @DAEMON_NAME@ This shell script takes care of starting and stopping +# the MySQL subsystem (mysqld). +# +# chkconfig: - 64 36 +# description: MySQL database server. +# processname: mysqld +# config: @sysconfdir@/my.cnf +# pidfile: /var/run/@DAEMON_NAME@/@DAEMON_NAME@.pid +### BEGIN INIT INFO +# Provides: mysqld +# Required-Start: $local_fs $remote_fs $network $named $syslog $time +# Required-Stop: $local_fs $remote_fs $network $named $syslog $time +# Short-Description: start and stop MySQL server +# Description: MySQL database server +### END INIT INFO + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + + +exec="@bindir@/mysqld_safe" +prog="@DAEMON_NAME@" + +# Set timeouts here so they can be overridden from /etc/sysconfig/@DAEMON_NAME@ +STARTTIMEOUT=300 +STOPTIMEOUT=60 + +# User and group the daemon will run under +MYUSER=mysql +MYGROUP=mysql + +[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog + +lockfile=/var/lock/subsys/$prog + +# get options from my.cnf +source "@libexecdir@/mysql-scripts-common" + +start(){ + [ -x $exec ] || exit 5 + # check to see if it's already running + MYSQLDRUNNING=0 + if [ -f "$pidfile" ]; then + MYSQLPID=`cat "$pidfile" 2>/dev/null` + if [ -n "$MYSQLPID" ] && [ -d "/proc/$MYSQLPID" ] ; then + MYSQLDRUNNING=1 + fi + fi + RESPONSE=`@bindir@/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1` + if [ $MYSQLDRUNNING = 1 ] && [ $? = 0 ]; then + # already running, do nothing + action $"Starting $prog: " /bin/true + ret=0 + elif [ $MYSQLDRUNNING = 1 ] && echo "$RESPONSE" | grep -q "Access denied for user" + then + # already running, do nothing + action $"Starting $prog: " /bin/true + ret=0 + else + @libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP || return 4 + @libexecdir@/mysql-check-socket || return 1 + + # Pass all the options determined above, to ensure consistent behavior. + # In many cases mysqld_safe would arrive at the same conclusions anyway + # but we need to be sure. (An exception is that we don't force the + # log-error setting, since this script doesn't really depend on that, + # and some users might prefer to configure logging to syslog.) + # Note: set --basedir to prevent probes that might trigger SELinux + # alarms, per bug #547485 + $exec --datadir="$datadir" --socket="$socketfile" \ + --pid-file="$pidfile" \ + --basedir=@prefix@ --user=$MYUSER >/dev/null 2>&1 & + safe_pid=$! + + # Wait until the daemon is up + @libexecdir@/mysql-wait-ready "$safe_pid" + ret=$? + + if [ $ret -eq 0 ]; then + action $"Starting $prog: " /bin/true + chmod o+r $pidfile >/dev/null 2>&1 + touch $lockfile + else + action $"Starting $prog: " /bin/false + fi + fi + return $ret +} + +stop(){ + if [ ! -f "$pidfile" ]; then + # not running; per LSB standards this is "ok" + action $"Stopping $prog: " /bin/true + return 0 + fi + MYSQLPID=`cat "$pidfile" 2>/dev/null` + if [ -n "$MYSQLPID" ]; then + if ! [ -d "/proc/$MYSQLPID" ] ; then + # process doesn't run anymore + action $"Stopping $prog: " /bin/true + return 0 + fi + /bin/kill "$MYSQLPID" >/dev/null 2>&1 + ret=$? + if [ $ret -eq 0 ]; then + TIMEOUT="$STOPTIMEOUT" + while [ $TIMEOUT -gt 0 ]; do + /bin/kill -0 "$MYSQLPID" >/dev/null 2>&1 || break + sleep 1 + let TIMEOUT=${TIMEOUT}-1 + done + if [ $TIMEOUT -eq 0 ]; then + echo "Timeout error occurred trying to stop MySQL Daemon." + ret=1 + action $"Stopping $prog: " /bin/false + else + rm -f $lockfile + rm -f "$socketfile" + action $"Stopping $prog: " /bin/true + fi + else + # kill command failed, probably insufficient permissions + action $"Stopping $prog: " /bin/false + ret=4 + fi + else + # failed to read pidfile, probably insufficient permissions + action $"Stopping $prog: " /bin/false + ret=4 + fi + return $ret +} + +restart(){ + stop + start +} + +condrestart(){ + [ -e $lockfile ] && restart || : +} + + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status -p "$pidfile" $prog + ;; + restart) + restart + ;; + condrestart|try-restart) + condrestart + ;; + reload) + exit 3 + ;; + force-reload) + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 +esac + +exit $? diff --git a/SOURCES/mysql.service.in b/SOURCES/mysql.service.in new file mode 100644 index 0000000..a33df16 --- /dev/null +++ b/SOURCES/mysql.service.in @@ -0,0 +1,50 @@ +# It's not recommended to modify this file in-place, because it will be +# overwritten during package upgrades. If you want to customize, the +# best way is to create a file "/etc/systemd/system/@DAEMON_NAME@.service", +# containing +# .include /usr/lib/systemd/system/@DAEMON_NAME@.service +# ...make your changes here... +# or create a file "/etc/systemd/system/@DAEMON_NAME@.service.d/foo.conf", +# which doesn't need to include ".include" call and which will be parsed +# after the file @DAEMON_NAME@.service itself is parsed. +# +# For more info about custom unit files, see systemd.unit(5) or +# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F + +# For example, if you want to increase mysql's open-files-limit to 10000, +# you need to increase systemd's LimitNOFILE setting, so create a file named +# "/etc/systemd/system/@DAEMON_NAME@.service.d/limits.conf" containing: +# [Service] +# LimitNOFILE=10000 + +# Note: /usr/lib/... is recommended in the .include line though /lib/... +# still works. +# Don't forget to reload systemd daemon after you change unit configuration: +# root> systemctl --system daemon-reload + +[Unit] +Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server +After=syslog.target +After=network.target + +[Service] +Type=simple +User=mysql +Group=mysql + +ExecStartPre=@libexecdir@/mysql-check-socket +ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n +# Note: we set --basedir to prevent probes that might trigger SELinux alarms, +# per bug #547485 +ExecStart=@bindir@/mysqld_safe --basedir=@prefix@ +ExecStartPost=@libexecdir@/mysql-wait-ready $MAINPID +ExecStartPost=@libexecdir@/mysql-check-upgrade + +# Give a reasonable amount of time for the server to start up/shut down +TimeoutSec=300 + +# Place temp files in a secure directory, not /tmp +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/mysql.tmpfiles.d.in b/SOURCES/mysql.tmpfiles.d.in new file mode 100644 index 0000000..d2c4b31 --- /dev/null +++ b/SOURCES/mysql.tmpfiles.d.in @@ -0,0 +1 @@ +d @PID_FILE_DIR@ 0755 mysql mysql - diff --git a/SOURCES/mysql_config_multilib.sh b/SOURCES/mysql_config_multilib.sh new file mode 100644 index 0000000..06c2a2b --- /dev/null +++ b/SOURCES/mysql_config_multilib.sh @@ -0,0 +1,26 @@ +#! /bin/sh +# +# Wrapper script for mysql_config to support multilib +# +# This command respects setarch + +bits=$(rpm --eval %__isa_bits) + +case $bits in + 32|64) status=known ;; + *) status=unknown ;; +esac + +if [ "$status" = "unknown" ] ; then + echo "$0: error: command 'rpm --eval %__isa_bits' returned unknown value: $bits" + exit 1 +fi + + +if [ -x @bindir@/mysql_config-$bits ] ; then + @bindir@/mysql_config-$bits "$@" +else + echo "$0: error: needed binary: @bindir@/mysql_config-$bits is missing" + exit 1 +fi + diff --git a/SOURCES/rh-skipped-tests-arm.list b/SOURCES/rh-skipped-tests-arm.list new file mode 100644 index 0000000..061d0c5 --- /dev/null +++ b/SOURCES/rh-skipped-tests-arm.list @@ -0,0 +1,12 @@ + +# Disable perfschema.func_file_io and perfschema.func_mutex, which fail +# because cycle counter returns 0 every time on ARM architectures. +# This is caused by missing hardware performance counter support on ARM. +# Discussion about fixing that can be found in RH bug #741325. + +perfschema.func_file_io : rhbz#773116 cycle counter does not work on arm +perfschema.func_mutex : rhbz#773116 cycle counter does not work on arm + +connect.bin : rhbz#1096787 (pass on aarch64) +main.key_cache : rhbz#1096787 (pass on aarch64) +perfschema.setup_objects : rhbz#1096787 diff --git a/SOURCES/rh-skipped-tests-base.list b/SOURCES/rh-skipped-tests-base.list new file mode 100644 index 0000000..794bea7 --- /dev/null +++ b/SOURCES/rh-skipped-tests-base.list @@ -0,0 +1,13 @@ +# These tests fail with MariaDB 10: + +main.func_str : rhbz#1096787 +main.openssl_1 : rhbz#1096787 +main.ssl : rhbz#1096787 +main.ssl_compress : rhbz#1096787 +main.ssl_crl_clients : rhbz#1096787 +main.ssl_8k_key : rhbz#1096787 +perfschema.nesting : rhbz#1096787 +perfschema.socket_summary_by_event_name_func : rhbz#1096787 +perfschema.socket_summary_by_instance_func : rhbz#1096787 +vcol.vcol_supported_sql_funcs_innodb : rhbz#1096787 +vcol.vcol_supported_sql_funcs_myisam : rhbz#1096787 diff --git a/SOURCES/rh-skipped-tests-intel.list b/SOURCES/rh-skipped-tests-intel.list new file mode 100644 index 0000000..1660a88 --- /dev/null +++ b/SOURCES/rh-skipped-tests-intel.list @@ -0,0 +1 @@ +main.openssl_1 : rhbz#1096787 diff --git a/SOURCES/rh-skipped-tests-ppc-s390.list b/SOURCES/rh-skipped-tests-ppc-s390.list new file mode 100644 index 0000000..c484996 --- /dev/null +++ b/SOURCES/rh-skipped-tests-ppc-s390.list @@ -0,0 +1,24 @@ +connect.alter : rhbz#1096787 +connect.bin : rhbz#1096787 +connect.dbf : rhbz#1096787 +connect.index : rhbz#1096787 +connect.mrr : rhbz#1149647#c6 +connect.part_file : rhbz#1149647 +connect.part_table : rhbz#1149647 +connect.updelx : rhbz#1149647 +connect.updelx2 : rhbz#1149647#c6 +main.gis-precise : rhbz#1096787 +main.statistics : rhbz#1096787 +multi_source.skip_counter : rhbz#1096787 +rpl.rpl_auto_increment : rhbz#1096787 +rpl.rpl_gtid_basic : rhbz#1096787 +rpl.rpl_gtid_master_promote : rhbz#1096787 +rpl.rpl_gtid_stop_start : rhbz#1096787 +rpl.rpl_gtid_until : rhbz#1096787 +rpl.rpl_mixed_binlog_max_cache_size : rhbz#1096787 +rpl.rpl_rotate_logs : rhbz#1096787 +rpl.rpl_skip_replication : rhbz#1096787 +rpl.rpl_slave_skip : rhbz#1096787 +rpl.rpl_stm_max_relay_size : rhbz#1096787 +sys_vars.max_relay_log_size_basic : rhbz#1096787 +sys_vars.sql_slave_skip_counter_basic : rhbz#1096787 diff --git a/SOURCES/rh-skipped-tests-ppc64le.list b/SOURCES/rh-skipped-tests-ppc64le.list new file mode 100644 index 0000000..85fe832 --- /dev/null +++ b/SOURCES/rh-skipped-tests-ppc64le.list @@ -0,0 +1,6 @@ +main.gis-precise : rhbz#1096787 +main.mysqlslap : rhbz#1096787 +rpl.rpl_insert : rhbz#1096787 +connect.part_file : rhbz#1149647 +connect.part_table : rhbz#1149647 +connect.updelx : rhbz#1149647 diff --git a/SOURCES/rh-skipped-tests-s390.list b/SOURCES/rh-skipped-tests-s390.list new file mode 100644 index 0000000..48daec1 --- /dev/null +++ b/SOURCES/rh-skipped-tests-s390.list @@ -0,0 +1,2 @@ +main.key_cache : rhbz#1149647 + diff --git a/SPECS/mariadb.spec b/SPECS/mariadb.spec new file mode 100644 index 0000000..4bb0a84 --- /dev/null +++ b/SPECS/mariadb.spec @@ -0,0 +1,1594 @@ +# SCL stuff +%{?scl:%scl_package mariadb} +%{!?scl:%global pkg_name %{name}} + +# Prefix that is used for patches +%global pkgnamepatch mariadb + +# Regression tests may take a long time (many cores recommended), skip them by +# passing --nocheck to rpmbuild or by setting runselftest to 0 if defining +# --nocheck is not possible (e.g. in koji build) +%{!?runselftest:%global runselftest 0} + +# In f20+ use unversioned docdirs, otherwise the old versioned one +%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} + +# Use Full RELRO for all binaries (RHBZ#1092548) +%global _hardened_build 1 + +# By default, patch(1) creates backup files when chunks apply with offsets. +# Turn that off to ensure such files don't get included in RPMs (cf bz#884755). +%global _default_patch_flags --no-backup-if-mismatch + +# TokuDB engine is now part of MariaDB, but it is available only for x86_64; +# variable tokudb allows to build with TokuDB storage engine +# Temporarily disabled in F21+ for https://mariadb.atlassian.net/browse/MDEV-6446 +%ifarch 0%{?fedora} < 21 #x86_64 +%bcond_without tokudb +%else +%bcond_with tokudb +%endif + +# Mroonga engine is now part of MariaDB, but it only builds for x86_64; +# variable mroonga allows to build with Mroonga storage engine +%ifarch x86_64 i686 +%bcond_without mroonga +%else +%bcond_with mroonga +%endif + +# The Open Query GRAPH engine (OQGRAPH) is a computation engine allowing +# hierarchies and more complex graph structures to be handled in a relational +# fashion; enabled by default +%if 0%{?scl:1} +%bcond_with oqgraph +%else +%bcond_with oqgraph +%endif + +# For some use cases we do not need some parts of the package +%bcond_without clibrary +%bcond_without devel +%bcond_without client +%bcond_without common +%bcond_without errmsg +%bcond_without bench +%bcond_without test +%bcond_without connect + +%if 0%{?scl:1} +%bcond_with embedded +%else +%bcond_with embedded +%endif + +# When there is already another package that ships /etc/my.cnf, +# rather include it than ship the file again, since conflicts between +# those files may create issues +%bcond_without config + +# For deep debugging we need to build binaries with extra debug info +%bcond_with debug + +# Include files for SysV init or systemd +%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 +%bcond_without init_systemd +%bcond_with init_sysv +%global daemon_default %{?scl_prefix}%{pkg_name} +%if ! 0%{?scl:1} +%global mysqld_pid_dir mysqld +%endif +%else +%bcond_with init_systemd +%bcond_without init_sysv +%global daemon_default %{?scl:%{?scl_prefix}%{pkg_name}}%{!?scl:mysqld} +%endif +%global daemon_name %{?scl_mariadb_daemonname}%{!?scl_mariadb_daemonname:%{daemon_default}} + +# MariaDB 10.0 and later requires pcre >= 8.35, otherwise we need to use +# the bundled library, since the package cannot be build with older version +%if 0%{?fedora} >= 21 +%bcond_without pcre +%else +%bcond_with pcre +%endif + +# We define some system's well known locations here so we can use them easily +# later when building to another location (like SCL) +%global logrotateddir %{?scl:%_root_sysconfdir}%{!?scl:%_sysconfdir}/logrotate.d +%global logfiledir %{?scl_mariadb_logfiledir}%{!?scl_mariadb_logfiledir:%{_localstatedir}/log/%{daemon_name}} +%global logfile %{logfiledir}/%{daemon_name}.log + +# Defining where database data live +%global dbdatadir %{?scl_mariadb_dbdatadir}%{!?scl_mariadb_dbdatadir:%{_localstatedir}/lib/mysql} + +# Home directory of mysql user should be same for all packages that create it +%global mysqluserhome /var/lib/mysql + +# The evr of mysql we want to obsolete +%if ! 0%{?scl:1} +%global obsoleted_mysql_evr 5.6-0 +%global obsoleted_mysql_case_evr 5.5.30-5 +%endif + +# Provide mysql names for compatibility +%if 0%{?scl:1} +%bcond_with mysql_names +%bcond_with conflicts +%else +%bcond_without mysql_names +%bcond_without conflicts +%endif + +# Make long macros shorter +%global sameevr %{epoch}:%{version}-%{release} +%global compatver 10.0 +%global bugfixver 15 + +Name: %{?scl_prefix}mariadb +Version: %{compatver}.%{bugfixver} +Release: 4%{?with_debug:.debug}%{?dist} +Epoch: 1 + +Summary: A community developed branch of MySQL +Group: Applications/Databases +URL: http://mariadb.org +# Exceptions allow client libraries to be linked with most open source SW, +# not only GPL code. See README.mysql-license +License: GPLv2 with exceptions and LGPLv2 and BSD + +Source0: http://mirrors.syringanetworks.net/mariadb/mariadb-%{version}/source/mariadb-%{version}.tar.gz +Source2: mysql_config_multilib.sh +Source3: my.cnf.in +Source4: my_config.h +Source5: README.mysql-cnf +Source6: README.mysql-docs +Source7: README.mysql-license +Source9: mysql-embedded-check.c +Source10: mysql.tmpfiles.d.in +Source11: mysql.service.in +Source12: mysql-prepare-db-dir.sh +Source13: mysql-wait-ready.sh +Source14: mysql-check-socket.sh +Source15: mysql-scripts-common.sh +Source16: mysql-check-upgrade.sh +Source19: mysql.init.in +Source50: rh-skipped-tests-base.list +Source51: rh-skipped-tests-intel.list +Source52: rh-skipped-tests-arm.list +Source53: rh-skipped-tests-ppc-s390.list +Source54: rh-skipped-tests-ppc64le.list +Source55: rh-skipped-tests-s390.list + +# Comments for these patches are in the patch files +# Patches common for more mysql-like packages +Patch1: %{pkgnamepatch}-strmov.patch +Patch2: %{pkgnamepatch}-install-test.patch +Patch3: %{pkgnamepatch}-s390-tsc.patch +Patch4: %{pkgnamepatch}-logrotate.patch +Patch5: %{pkgnamepatch}-file-contents.patch +Patch6: %{pkgnamepatch}-dh1024.patch +Patch7: %{pkgnamepatch}-scripts.patch +Patch8: %{pkgnamepatch}-install-db-sharedir.patch + +# Patches specific for this mysql package +Patch30: %{pkgnamepatch}-errno.patch +Patch31: %{pkgnamepatch}-string-overflow.patch +Patch32: %{pkgnamepatch}-basedir.patch +Patch33: %{pkgnamepatch}-covscan-signexpr.patch +Patch34: %{pkgnamepatch}-covscan-stroverflow.patch +Patch36: %{pkgnamepatch}-ssltest.patch + +# Patches specific for scl +Patch90: %{pkgnamepatch}-scl-env-check.patch + +BuildRequires: cmake +BuildRequires: libaio-devel +BuildRequires: openssl-devel +BuildRequires: ncurses-devel +BuildRequires: perl +BuildRequires: libedit-devel +BuildRequires: systemtap-sdt-devel +BuildRequires: zlib-devel +# auth_pam.so plugin will be build if pam-devel is installed +BuildRequires: pam-devel +%{?with_pcre:BuildRequires: pcre-devel >= 8.35} +# Tests requires time and ps and some perl modules +BuildRequires: procps +BuildRequires: time +BuildRequires: perl(Env) +BuildRequires: perl(Exporter) +BuildRequires: perl(Fcntl) +BuildRequires: perl(File::Temp) +BuildRequires: perl(Data::Dumper) +BuildRequires: perl(Getopt::Long) +BuildRequires: perl(IPC::Open3) +BuildRequires: perl(Socket) +BuildRequires: perl(Sys::Hostname) +BuildRequires: perl(Test::More) +BuildRequires: perl(Time::HiRes) +%{?with_init_systemd:BuildRequires: systemd} + +Requires: bash +Requires: fileutils +Requires: grep +Requires: %{name}-common%{?_isa} = %{sameevr} +%{?scl:Requires:%scl_runtime} + +%if %{with mysql_names} +Provides: mysql = %{sameevr} +Provides: mysql%{?_isa} = %{sameevr} +Provides: mysql-compat-client = %{sameevr} +Provides: mysql-compat-client%{?_isa} = %{sameevr} +%endif + +# MySQL (with caps) is upstream's spelling of their own RPMs for mysql +%{?obsoleted_mysql_case_evr:Obsoletes: MySQL < %{obsoleted_mysql_case_evr}} +%{?obsoleted_mysql_evr:Obsoletes: mysql < %{obsoleted_mysql_evr}} +%{?with_conflicts:Conflicts: community-mysql} + +# Filtering: https://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering +%if 0%{?fedora} > 14 || 0%{?rhel} > 6 +%global __requires_exclude ^perl\\((hostnames|lib::mtr|lib::v1|mtr_|My::) +%global __provides_exclude_from ^(%{_datadir}/(mysql|mysql-test)/.*|%{_libdir}/mysql/plugin/.*\\.so)$ +%else +%filter_from_requires /perl(\(hostnames\|lib::mtr\|lib::v1\|mtr_\|My::\)/d +%filter_provides_in -P (%{_datadir}/(mysql|mysql-test)/.*|%{_libdir}/mysql/plugin/.*\\.so)$ +%filter_setup +%endif + +%description +MariaDB is a community developed branch of MySQL. +MariaDB is a multi-user, multi-threaded SQL database server. +It is a client/server implementation consisting of a server daemon (mysqld) +and many different client programs and libraries. The base package +contains the standard MariaDB/MySQL client programs and generic MySQL files. + + +%if %{with clibrary} +%package libs +Summary: The shared libraries required for MariaDB/MySQL clients +Group: Applications/Databases +Requires: %{name}-common%{?_isa} = %{sameevr} +%{?scl:Requires:%scl_runtime} +%if %{with mysql_names} +Provides: mysql-libs = %{sameevr} +Provides: mysql-libs%{?_isa} = %{sameevr} +%endif +%{?obsoleted_mysql_case_evr:Obsoletes: MySQL-libs < %{obsoleted_mysql_case_evr}} +%{?obsoleted_mysql_evr:Obsoletes: mysql-libs < %{obsoleted_mysql_evr}} + +%description libs +The mariadb-libs package provides the essential shared libraries for any +MariaDB/MySQL client program or interface. You will need to install this +package to use any other MariaDB package or any clients that need to connect +to a MariaDB/MySQL server. MariaDB is a community developed branch of MySQL. +%endif + + +%if %{with config} +%package config +Summary: The config files required by server and client +Group: Applications/Databases +%{?scl:Requires:%scl_runtime} + +%description config +The package provides the config file my.cnf and my.cnf.d directory used by any +MariaDB or MySQL program. You will need to install this package to use any +other MariaDB or MySQL package if the config files are not provided in the +package itself. +%endif + + +%if %{with common} +%package common +Summary: The shared files required by server and client +Group: Applications/Databases +Requires: %{_sysconfdir}/my.cnf +%{?scl:Requires:%scl_runtime} + +%description common +The package provides the essential shared files for any MariaDB program. +You will need to install this package to use any other MariaDB package. +%endif + + +%if %{with errmsg} +%package errmsg +Summary: The error messages files required by server and embedded +Group: Applications/Databases +Requires: %{name}-common%{?_isa} = %{sameevr} +%{?scl:Requires:%scl_runtime} + +%description errmsg +The package provides error messages files for the MariaDB daemon and the +embedded server. You will need to install this package to use any of those +MariaDB packages. +%endif + + +%package server +Summary: The MariaDB server and related files +Group: Applications/Databases + +# note: no version here = %%{version}-%%{release} +%if %{with mysql_names} +Requires: mysql-compat-client%{?_isa} +Requires: mysql%{?_isa} +%else +Requires: %{name}%{?_isa} +%endif +Requires: %{name}-common%{?_isa} = %{sameevr} +Requires: %{_sysconfdir}/my.cnf +Requires: %{_sysconfdir}/my.cnf.d +Requires: %{name}-errmsg%{?_isa} = %{sameevr} +Requires: sh-utils +Requires(pre): /usr/sbin/useradd +%if %{with init_systemd} +# We require this to be present for %%{_tmpfilesdir} +Requires: systemd +# Make sure it's there when scriptlets run, too +Requires(pre): systemd +Requires(posttrans): systemd +%{?systemd_requires: %systemd_requires} +%endif +# mysqlhotcopy needs DBI/DBD support +Requires: perl(DBI) +Requires: perl(DBD::mysql) +%{?scl:Requires:%scl_runtime} +%if %{with mysql_names} +Provides: mysql-server = %{sameevr} +Provides: mysql-server%{?_isa} = %{sameevr} +Provides: mysql-compat-server = %{sameevr} +Provides: mysql-compat-server%{?_isa} = %{sameevr} +%endif +%{?obsoleted_mysql_case_evr:Obsoletes: MySQL-server < %{obsoleted_mysql_case_evr}} +%{?with_conflicts:Conflicts: community-mysql-server} +%{?with_conflicts:Conflicts: mariadb-galera-server} +%{?obsoleted_mysql_evr:Obsoletes: mysql-server < %{obsoleted_mysql_evr}} + +%description server +MariaDB is a multi-user, multi-threaded SQL database server. It is a +client/server implementation consisting of a server daemon (mysqld) +and many different client programs and libraries. This package contains +the MariaDB server and some accompanying files and directories. +MariaDB is a community developed branch of MySQL. + + +%if %{with oqgraph} +%package oqgraph-engine +Summary: The Open Query GRAPH engine for MariaDB +Group: Applications/Databases +Requires: %{name}-server%{?_isa} = %{sameevr} +%{?scl:Requires:%scl_runtime} +# boost and Judy required for oograph +BuildRequires: boost-devel +BuildRequires: Judy-devel + +%description oqgraph-engine +The package provides Open Query GRAPH engine (OQGRAPH) as plugin for MariaDB +database server. OQGRAPH is a computation engine allowing hierarchies and more +complex graph structures to be handled in a relational fashion. In a nutshell, +tree structures and friend-of-a-friend style searches can now be done using +standard SQL syntax, and results joined onto other tables. +%endif + + +%if %{with connect} +%package connect-engine +Summary: The CONNECT storage engine for MariaDB +Group: Applications/Databases +Requires: %{name}-server%{?_isa} = %{sameevr} +%{?scl:Requires:%scl_runtime} + +%description connect-engine +The CONNECT storage engine enables MariaDB to access external local or +remote data (MED). This is done by defining tables based on different data +types, in particular files in various formats, data extracted from other DBMS +or products (such as Excel), or data retrieved from the environment +(for example DIR, WMI, and MAC tables). +%endif + + +%if %{with devel} +%package devel +Summary: Files for development of MariaDB/MySQL applications +Group: Applications/Databases +Requires: %{name}-libs%{?_isa} = %{sameevr} +Requires: openssl-devel%{?_isa} +%{?scl:Requires:%scl_runtime} +%if %{with mysql_names} +Provides: mysql-devel = %{sameevr} +Provides: mysql-devel%{?_isa} = %{sameevr} +%endif +%{?obsoleted_mysql_case_evr:Obsoletes: MySQL-devel < %{obsoleted_mysql_case_evr}} +%{?obsoleted_mysql_evr:Obsoletes: mysql-devel < %{obsoleted_mysql_evr}} +%{?with_conflicts:Conflicts: community-mysql-devel} + +%description devel +MariaDB is a multi-user, multi-threaded SQL database server. This +package contains the libraries and header files that are needed for +developing MariaDB/MySQL client applications. +MariaDB is a community developed branch of MySQL. +%endif + + +%if %{with embedded} +%package embedded +Summary: MariaDB as an embeddable library +Group: Applications/Databases +Requires: %{name}-common%{?_isa} = %{sameevr} +Requires: %{name}-errmsg%{?_isa} = %{sameevr} +%{?scl:Requires:%scl_runtime} +%if %{with mysql_names} +Provides: mysql-embedded = %{sameevr} +Provides: mysql-embedded%{?_isa} = %{sameevr} +%endif +%{?obsoleted_mysql_case_evr:Obsoletes: MySQL-embedded < %{obsoleted_mysql_case_evr}} +%{?obsoleted_mysql_evr:Obsoletes: mysql-embedded < %{obsoleted_mysql_evr}} + +%description embedded +MariaDB is a multi-user, multi-threaded SQL database server. This +package contains a version of the MariaDB server that can be embedded +into a client application instead of running as a separate process. +MariaDB is a community developed branch of MySQL. + + +%package embedded-devel +Summary: Development files for MariaDB as an embeddable library +Group: Applications/Databases +Requires: %{name}-embedded%{?_isa} = %{sameevr} +Requires: %{name}-devel%{?_isa} = %{sameevr} +%{?scl:Requires:%scl_runtime} +%if %{with mysql_names} +Provides: mysql-embedded-devel = %{sameevr} +Provides: mysql-embedded-devel%{?_isa} = %{sameevr} +%endif +%{?with_conflicts:Conflicts: community-mysql-embedded-devel} +%{?obsoleted_mysql_case_evr:Obsoletes: MySQL-embedded-devel < %{obsoleted_mysql_case_evr}} +%{?obsoleted_mysql_evr:Obsoletes: mysql-embedded-devel < %{obsoleted_mysql_evr}} + +%description embedded-devel +MariaDB is a multi-user, multi-threaded SQL database server. This +package contains files needed for developing and testing with +the embedded version of the MariaDB server. +MariaDB is a community developed branch of MySQL. +%endif + + +%if %{with bench} +%package bench +Summary: MariaDB benchmark scripts and data +Group: Applications/Databases +Requires: %{name}%{?_isa} = %{sameevr} +%{?scl:Requires:%scl_runtime} +%if %{with mysql_names} +Provides: mysql-bench = %{sameevr} +Provides: mysql-bench%{?_isa} = %{sameevr} +%endif +%{?with_conflicts:Conflicts: community-mysql-bench} +%{?obsoleted_mysql_case_evr:Obsoletes: MySQL-bench < %{obsoleted_mysql_case_evr}} +%{?obsoleted_mysql_evr:Obsoletes: mysql-bench < %{obsoleted_mysql_evr}} + +%description bench +MariaDB is a multi-user, multi-threaded SQL database server. This +package contains benchmark scripts and data for use when benchmarking +MariaDB. +MariaDB is a community developed branch of MySQL. +%endif + + +%if %{with test} +%package test +Summary: The test suite distributed with MariaD +Group: Applications/Databases +Requires: %{name}%{?_isa} = %{sameevr} +Requires: %{name}-common%{?_isa} = %{sameevr} +Requires: %{name}-server%{?_isa} = %{sameevr} +Requires: perl(Env) +Requires: perl(Exporter) +Requires: perl(Fcntl) +Requires: perl(File::Temp) +Requires: perl(Data::Dumper) +Requires: perl(Getopt::Long) +Requires: perl(IPC::Open3) +Requires: perl(Socket) +Requires: perl(Sys::Hostname) +Requires: perl(Test::More) +Requires: perl(Time::HiRes) +%{?scl:Requires:%scl_runtime} +%{?with_conflicts:Conflicts: community-mysql-test} +%if %{with mysql_names} +Provides: mysql-test = %{sameevr} +Provides: mysql-test%{?_isa} = %{sameevr} +%endif +%{?obsoleted_mysql_case_evr:Obsoletes: MySQL-test < %{obsoleted_mysql_case_evr}} +%{?obsoleted_mysql_evr:Obsoletes: mysql-test < %{obsoleted_mysql_evr}} + +%description test +MariaDB is a multi-user, multi-threaded SQL database server. This +package contains the regression test suite distributed with +the MariaDB sources. +MariaDB is a community developed branch of MySQL. +%endif + +%prep +%setup -q -n mariadb-%{version} + +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 +%patch33 -p1 +%patch34 -p1 +%patch36 -p1 + +# removing bundled cmd-line-utils +rm -r cmd-line-utils + +sed -i -e 's/2.8.7/2.6.4/g' cmake/cpack_rpm.cmake + +# workaround for upstream bug #56342 +rm -f mysql-test/t/ssl_8k_key-master.opt + +# generate a list of tests that fail, but are not disabled by upstream +cat %{SOURCE50} > mysql-test/rh-skipped-tests.list + +# disable some tests failing on different architectures +%ifarch x86_64 i686 +cat %{SOURCE51} >> mysql-test/rh-skipped-tests.list +%endif + +%ifarch %{arm} aarch64 +cat %{SOURCE52} >> mysql-test/rh-skipped-tests.list +%endif + +%ifarch ppc ppc64 ppc64p7 s390 s390x +cat %{SOURCE53} >> mysql-test/rh-skipped-tests.list +%endif + +%ifarch ppc64le +cat %{SOURCE54} >> mysql-test/rh-skipped-tests.list +%endif + +%ifarch s390 +cat %{SOURCE55} >> mysql-test/rh-skipped-tests.list +%endif + +cp %{SOURCE2} %{SOURCE3} %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ + %{SOURCE14} %{SOURCE15} %{SOURCE16} %{SOURCE19} \ + scripts + +%if 0%{?scl:1} +%patch90 -p1 +%endif + +%build + +# fail quickly and obviously if user tries to build as root +%if %runselftest + if [ x"$(id -u)" = "x0" ]; then + echo "mysql's regression tests fail if run as root." + echo "If you really need to build the RPM as root, use" + echo "--nocheck to skip the regression tests." + exit 1 + fi +%endif + +CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" +# force PIC mode so that we can build libmysqld.so +CFLAGS="$CFLAGS -fPIC" +# GCC 4.9 causes segfaults: https://mariadb.atlassian.net/browse/MDEV-6360 +CFLAGS="$CFLAGS -fno-delete-null-pointer-checks" +# gcc seems to have some bugs on sparc as of 4.4.1, back off optimization +# submitted as bz #529298 +%ifarch sparc sparcv9 sparc64 +CFLAGS=`echo $CFLAGS| sed -e "s|-O2|-O1|g" ` +%endif +# significant performance gains can be achieved by compiling with -O3 optimization +# rhbz#1051069 +%ifarch ppc64 +CFLAGS=`echo $CFLAGS| sed -e "s|-O2|-O3|g" ` +%endif +CXXFLAGS="$CFLAGS" +export CFLAGS CXXFLAGS + +%if 0%{?_hardened_build} +# building with PIE +LDFLAGS="$LDFLAGS -pie -Wl,-z,relro,-z,now" +export LDFLAGS +%endif + +# The INSTALL_xxx macros have to be specified relative to CMAKE_INSTALL_PREFIX +# so we can't use %%{_datadir} and so forth here. +%cmake . \ + -DBUILD_CONFIG=mysql_release \ + -DFEATURE_SET="community" \ + -DINSTALL_LAYOUT=RPM \ + -DDAEMON_NAME="%{daemon_name}" \ +%if 0%{?scl:1} + -DSCL_NAME="%{?scl}" \ + -DSCL_SCRIPTS="%{?_scl_scripts}" \ +%endif + -DLOG_LOCATION="%{logfile}" \ + -DPID_FILE_DIR="%{_localstatedir}/run/%{daemon_name}" \ + -DNICE_PROJECT_NAME="MariaDB" \ + -DRPM="%{?rhel:rhel%{rhel}}%{!?rhel:fedora%{fedora}}" \ + -DCMAKE_INSTALL_PREFIX="%{_prefix}" \ + -DINSTALL_SYSCONFDIR="%{_sysconfdir}" \ + -DINSTALL_SYSCONF2DIR="%{_sysconfdir}/my.cnf.d" \ +%if 0%{?fedora} >= 20 + -DINSTALL_DOCDIR="share/doc/%{name}" \ + -DINSTALL_DOCREADMEDIR="share/doc/%{name}" \ +%else + -DINSTALL_DOCDIR="share/doc/%{name}-%{version}" \ + -DINSTALL_DOCREADMEDIR="share/doc/%{name}-%{version}" \ +%endif + -DINSTALL_INCLUDEDIR=include/mysql \ + -DINSTALL_INFODIR=share/info \ + -DINSTALL_LIBDIR="%{_lib}/mysql" \ + -DINSTALL_MANDIR=share/man \ + -DINSTALL_MYSQLSHAREDIR=share/%{name} \ + -DINSTALL_MYSQLTESTDIR=share/mysql-test \ + -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \ + -DINSTALL_SBINDIR=libexec \ + -DINSTALL_SCRIPTDIR=bin \ + -DINSTALL_SQLBENCHDIR=share \ + -DINSTALL_SUPPORTFILESDIR=share/%{name} \ + -DMYSQL_DATADIR="%{dbdatadir}" \ + -DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \ + -DENABLED_LOCAL_INFILE=ON \ + -DENABLE_DTRACE=ON \ + -DWITH_EMBEDDED_SERVER=ON \ + -DWITH_SSL=system \ + -DWITH_ZLIB=system \ +%{?with_pcre: -DWITH_PCRE=system}\ + -DWITH_JEMALLOC=no \ +%{!?with_tokudb: -DWITHOUT_TOKUDB=ON}\ +%{!?with_mroonga: -DWITHOUT_MROONGA=ON}\ + -DTMPDIR=/var/tmp \ +%{?with_debug: -DCMAKE_BUILD_TYPE=Debug}\ + %{?_hardened_build:-DWITH_MYSQLD_LDFLAGS="-pie -Wl,-z,relro,-z,now"} + +make %{?_smp_mflags} VERBOSE=1 + +# debuginfo extraction scripts fail to find source files in their real +# location -- satisfy them by copying these files into location, which +# is expected by scripts +for e in innobase xtradb ; do + for f in pars0grm.y pars0lex.l ; do + cp -p "storage/$e/pars/$f" "storage/$e/$f" + done +done + +%install +make DESTDIR=%{buildroot} install + +# cmake generates some completely wacko references to -lprobes_mysql when +# building with dtrace support. Haven't found where to shut that off, +# so resort to this blunt instrument. While at it, let's not reference +# libmysqlclient_r anymore either. +sed -e 's/-lprobes_mysql//' -e 's/-lmysqlclient_r/-lmysqlclient/' \ + %{buildroot}%{_bindir}/mysql_config >mysql_config.tmp +cp -p -f mysql_config.tmp %{buildroot}%{_bindir}/mysql_config +chmod 755 %{buildroot}%{_bindir}/mysql_config + +# multilib header support +# we only apply this to known Red Hat multilib arches, per bug #181335 +unamei=$(uname -i) +%ifarch %{arm} +unamei=arm +%endif +%ifarch %{power64} +unamei=ppc64 +%endif +%ifarch %{arm} aarch64 %{ix86} x86_64 ppc %{power64} %{sparc} s390 s390x +mv %{buildroot}%{_includedir}/mysql/my_config.h %{buildroot}%{_includedir}/mysql/my_config_${unamei}.h +mv %{buildroot}%{_includedir}/mysql/private/config.h %{buildroot}%{_includedir}/mysql/private/my_config_${unamei}.h +install -p -m 644 %{SOURCE4} %{buildroot}%{_includedir}/mysql/ +install -p -m 644 %{SOURCE4} %{buildroot}%{_includedir}/mysql/private/config.h +mv %{buildroot}%{_bindir}/mysql_config %{buildroot}%{_bindir}/mysql_config-%{__isa_bits} +install -p -m 0755 scripts/mysql_config_multilib %{buildroot}%{_bindir}/mysql_config +%endif + +# install INFO_SRC, INFO_BIN into libdir (upstream thinks these are doc files, +# but that's pretty wacko --- see also %%{name}-file-contents.patch) +install -p -m 644 Docs/INFO_SRC %{buildroot}%{_libdir}/mysql/ +install -p -m 644 Docs/INFO_BIN %{buildroot}%{_libdir}/mysql/ +rm -rf %{buildroot}%{_pkgdocdir}/MariaDB-server-%{version}/ + +mkdir -p %{buildroot}%{logfiledir} +chmod 0750 %{buildroot}%{logfiledir} +touch %{buildroot}%{logfile} + +# current setting in my.cnf is to use /var/run/mariadb for creating pid file, +# however since my.cnf is not updated by RPM if changed, we need to create mysqld +# as well because users can have odd settings in their /etc/my.cnf +mkdir -p %{buildroot}%{_localstatedir}/run/%{daemon_name} +install -p -m 0755 -d %{buildroot}%{dbdatadir} + +%if %{with config} +install -D -p -m 0644 scripts/my.cnf %{buildroot}%{_sysconfdir}/my.cnf +%else +rm -f %{buildroot}%{_sysconfdir}/my.cnf.d/mysql-clients.cnf +rm -f %{buildroot}%{_sysconfdir}/my.cnf +%endif + +# install systemd unit files and scripts for handling server startup +%if %{with init_systemd} +install -D -p -m 644 scripts/mysql.service %{buildroot}%{_unitdir}/%{daemon_name}.service +install -D -p -m 0644 scripts/mysql.tmpfiles.d %{buildroot}%{_tmpfilesdir}/%{name}.conf +%if 0%{?mysqld_pid_dir:1} +echo "d %{_localstatedir}/run/%{mysqld_pid_dir} 0755 mysql mysql -" >>%{buildroot}%{_tmpfilesdir}/%{name}.conf +%endif +%endif + +# install SysV init script +%if %{with init_sysv} +install -D -p -m 755 scripts/mysql.init %{buildroot}%{_initddir}/%{daemon_name} +%endif + +# helper scripts for service starting +install -p -m 755 scripts/mysql-prepare-db-dir %{buildroot}%{_libexecdir}/mysql-prepare-db-dir +install -p -m 755 scripts/mysql-wait-ready %{buildroot}%{_libexecdir}/mysql-wait-ready +install -p -m 755 scripts/mysql-check-socket %{buildroot}%{_libexecdir}/mysql-check-socket +install -p -m 755 scripts/mysql-check-upgrade %{buildroot}%{_libexecdir}/mysql-check-upgrade +install -p -m 644 scripts/mysql-scripts-common %{buildroot}%{_libexecdir}/mysql-scripts-common + +# Remove libmysqld.a +rm -f %{buildroot}%{_libdir}/mysql/libmysqld.a + +# libmysqlclient_r is no more. Upstream tries to replace it with symlinks +# but that really doesn't work (wrong soname in particular). We'll keep +# just the devel libmysqlclient_r.so link, so that rebuilding without any +# source change is enough to get rid of dependency on libmysqlclient_r. +rm -f %{buildroot}%{_libdir}/mysql/libmysqlclient_r.so* +ln -s libmysqlclient.so %{buildroot}%{_libdir}/mysql/libmysqlclient_r.so + +# mysql-test includes one executable that doesn't belong under /usr/share, +# so move it and provide a symlink +mv %{buildroot}%{_datadir}/mysql-test/lib/My/SafeProcess/my_safe_process %{buildroot}%{_bindir} +ln -s ../../../../../bin/my_safe_process %{buildroot}%{_datadir}/mysql-test/lib/My/SafeProcess/my_safe_process + +# should move this to /etc/ ? +rm -f %{buildroot}%{_bindir}/mysql_embedded +rm -f %{buildroot}%{_libdir}/mysql/*.a +rm -f %{buildroot}%{_datadir}/%{name}/binary-configure +rm -f %{buildroot}%{_datadir}/%{name}/magic +rm -f %{buildroot}%{_datadir}/%{name}/ndb-config-2-node.ini +rm -f %{buildroot}%{_datadir}/%{name}/mysql.server +rm -f %{buildroot}%{_datadir}/%{name}/mysqld_multi.server +rm -f %{buildroot}%{_mandir}/man1/mysql-stress-test.pl.1* +rm -f %{buildroot}%{_mandir}/man1/mysql-test-run.pl.1* +rm -f %{buildroot}%{_bindir}/mytop + +# put logrotate script where it needs to be +mkdir -p %{buildroot}%{logrotateddir} +mv %{buildroot}%{_datadir}/%{name}/mysql-log-rotate %{buildroot}%{logrotateddir}/%{daemon_name} +chmod 644 %{buildroot}%{logrotateddir}/%{daemon_name} + +mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d +echo "%{_libdir}/mysql" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf + +# copy additional docs into build tree so %%doc will find them +install -p -m 0644 %{SOURCE5} %{basename:%{SOURCE5}} +install -p -m 0644 %{SOURCE6} %{basename:%{SOURCE6}} +install -p -m 0644 %{SOURCE7} %{basename:%{SOURCE7}} +install -p -m 0644 %{SOURCE16} %{basename:%{SOURCE16}} + +# install the list of skipped tests to be available for user runs +install -p -m 0644 mysql-test/rh-skipped-tests.list %{buildroot}%{_datadir}/mysql-test + +# remove unneeded RHEL-4 SELinux stuff +rm -rf %{buildroot}%{_datadir}/%{name}/SELinux/ + +# remove SysV init script +rm -f %{buildroot}%{_sysconfdir}/init.d/mysql + +# remove duplicate logrotate script +rm -f %{buildroot}%{_sysconfdir}/logrotate.d/mysql + +# remove solaris files +rm -rf %{buildroot}%{_datadir}/%{name}/solaris/ + +%if %{without clibrary} +rm -rf %{buildroot}%{_libdir}/mysql/libmysqlclient*.so.* +rm -rf %{buildroot}%{_sysconfdir}/ld.so.conf.d +rm -f %{buildroot}%{_sysconfdir}/my.cnf.d/client.cnf +%endif + +%if %{without embedded} +rm -f %{buildroot}%{_libdir}/mysql/libmysqld.so* +rm -f %{buildroot}%{_bindir}/{mysql_client_test_embedded,mysqltest_embedded} +rm -f %{buildroot}%{_mandir}/man1/{mysql_client_test_embedded,mysqltest_embedded}.1* +%endif + +%if %{without devel} +rm -f %{buildroot}%{_bindir}/mysql_config* +rm -rf %{buildroot}%{_includedir}/mysql +rm -f %{buildroot}%{_datadir}/aclocal/mysql.m4 +rm -f %{buildroot}%{_libdir}/mysql/libmysqlclient*.so +rm -f %{buildroot}%{_mandir}/man1/mysql_config.1* +%endif + +%if %{without client} +rm -f %{buildroot}%{_bindir}/{msql2mysql,mysql,mysql_find_rows,\ +mysql_plugin,mysql_waitpid,mysqlaccess,mysqladmin,mysqlbinlog,mysqlcheck,\ +mysqldump,mysqlimport,mysqlshow,mysqlslap,my_print_defaults} +rm -f %{buildroot}%{_mandir}/man1/{msql2mysql,mysql,mysql_find_rows,\ +mysql_plugin,mysql_waitpid,mysqlaccess,mysqladmin,mysqlbinlog,mysqlcheck,\ +mysqldump,mysqlimport,mysqlshow,mysqlslap,my_print_defaults}.1* +%endif + +%if %{without connect} +rm -f %{buildroot}%{_sysconfdir}/my.cnf.d/connect.cnf +%endif + +%if %{without config} +rm -f %{buildroot}%{_sysconfdir}/my.cnf +rm -f %{buildroot}%{_sysconfdir}/my.cnf.d/mysql-clients.cnf +%endif + +%if %{without common} +rm -rf %{buildroot}%{_datadir}/%{name}/charsets +%endif + +%if %{without errmsg} +rm -f %{buildroot}%{_datadir}/%{name}/errmsg-utf8.txt +rm -rf %{buildroot}%{_datadir}/%{name}/{english,czech,danish,dutch,estonian,\ +french,german,greek,hungarian,italian,japanese,korean,norwegian,norwegian-ny,\ +polish,portuguese,romanian,russian,serbian,slovak,spanish,swedish,ukrainian} +%endif + +%if %{without bench} +rm -rf %{buildroot}%{_datadir}/sql-bench +%endif + +%if %{without test} +rm -f %{buildroot}%{_bindir}/{mysql_client_test,my_safe_process} +rm -rf %{buildroot}%{_datadir}/mysql-test +rm -f %{buildroot}%{_mandir}/man1/mysql_client_test.1* +%endif + +%check +%if %{with test} +%if %runselftest +%{?with_init_sysv:LD_LIBRARY_PATH=$(pwd)/unittest/mytap }make test VERBOSE=1 +# hack to let 32- and 64-bit tests run concurrently on same build machine +export MTR_PARALLEL=1 +# builds might happen at the same host, avoid collision +export MTR_BUILD_THREAD=%{__isa_bits} + +# The cmake build scripts don't provide any simple way to control the +# options for mysql-test-run, so ignore the make target and just call it +# manually. Nonstandard options chosen are: +# --force to continue tests after a failure +# no retries please +# test SSL with --ssl +# skip tests that are listed in rh-skipped-tests.list +# avoid redundant test runs with --binlog-format=mixed +# increase timeouts to prevent unwanted failures during mass rebuilds +( + cd mysql-test + perl ./mysql-test-run.pl --force --retry=0 --ssl \ + --skip-test-list=rh-skipped-tests.list \ + --suite-timeout=720 --testcase-timeout=30 \ + --mysqld=--binlog-format=mixed --force-restart \ + --shutdown-timeout=60 --max-test-fail=0 + # cmake build scripts will install the var cruft if left alone :-( + rm -rf var +) +%endif +%endif + +%pre server +/usr/sbin/groupadd -g 27 -o -r mysql >/dev/null 2>&1 || : +/usr/sbin/useradd -M -N -g mysql -o -r -d %{mysqluserhome} -s /sbin/nologin \ + -c "MySQL Server" -u 27 mysql >/dev/null 2>&1 || : + +%if %{with clibrary} +%post libs -p /sbin/ldconfig +%endif + +%if %{with embedded} +%post embedded -p /sbin/ldconfig +%endif + +%post server +%if %{with init_systemd} +%systemd_post %{daemon_name}.service +%endif +%if %{with init_sysv} +if [ $1 = 1 ]; then + /sbin/chkconfig --add %{daemon_name} +fi +%endif +/bin/chmod 0755 %{dbdatadir} + +%preun server +%if %{with init_systemd} +%systemd_preun %{daemon_name}.service +%endif +%if %{with init_sysv} +if [ $1 = 0 ]; then + /sbin/service %{daemon_name} stop >/dev/null 2>&1 + /sbin/chkconfig --del %{daemon_name} +fi +%endif + +%if %{with clibrary} +%postun libs -p /sbin/ldconfig +%endif + +%if %{with embedded} +%postun embedded -p /sbin/ldconfig +%endif + +%postun server +%if %{with init_systemd} +%systemd_postun_with_restart %{daemon_name}.service +%endif +%if %{with init_sysv} +if [ $1 -ge 1 ]; then + /sbin/service %{daemon_name} condrestart >/dev/null 2>&1 || : +fi +%endif + +%if %{with client} +%files +%{_bindir}/msql2mysql +%{_bindir}/mysql +%{_bindir}/mysql_find_rows +%{_bindir}/mysql_plugin +%{_bindir}/mysql_waitpid +%{_bindir}/mysqlaccess +%{_bindir}/mysqladmin +%{_bindir}/mysqlbinlog +%{_bindir}/mysqlcheck +%{_bindir}/mysqldump +%{_bindir}/mysqlimport +%{_bindir}/mysqlshow +%{_bindir}/mysqlslap +%{_bindir}/my_print_defaults + +%{_mandir}/man1/msql2mysql.1* +%{_mandir}/man1/mysql.1* +%{_mandir}/man1/mysql_find_rows.1* +%{_mandir}/man1/mysql_plugin.1* +%{_mandir}/man1/mysql_waitpid.1* +%{_mandir}/man1/mysqlaccess.1* +%{_mandir}/man1/mysqladmin.1* +%{_mandir}/man1/mysqlbinlog.1* +%{_mandir}/man1/mysqlcheck.1* +%{_mandir}/man1/mysqldump.1* +%{_mandir}/man1/mysqlimport.1* +%{_mandir}/man1/mysqlshow.1* +%{_mandir}/man1/mysqlslap.1* +%{_mandir}/man1/my_print_defaults.1* +%endif + +%if %{with clibrary} +%files libs +%dir %{_libdir}/mysql +%{_libdir}/mysql/libmysqlclient.so.* +%{_libdir}/mysql/plugin/dialog.so +%{_libdir}/mysql/plugin/mysql_clear_password.so +%{_sysconfdir}/ld.so.conf.d/* +%config(noreplace) %{_sysconfdir}/my.cnf.d/client.cnf +%endif + +%if %{with config} +%files config +# although the default my.cnf contains only server settings, we put it in the +# common package because it can be used for client settings too. +%config(noreplace) %{_sysconfdir}/my.cnf +%dir %{_sysconfdir}/my.cnf.d +%config(noreplace) %{_sysconfdir}/my.cnf.d/mysql-clients.cnf +%endif + +%if %{with common} +%files common +%doc README COPYING COPYING.LESSER README.mysql-license README.mysql-docs +%doc storage/innobase/COPYING.Percona storage/innobase/COPYING.Google +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/charsets +%endif + +%if %{with errmsg} +%files errmsg +%{_datadir}/%{name}/errmsg-utf8.txt +%{_datadir}/%{name}/english +%lang(cs) %{_datadir}/%{name}/czech +%lang(da) %{_datadir}/%{name}/danish +%lang(nl) %{_datadir}/%{name}/dutch +%lang(et) %{_datadir}/%{name}/estonian +%lang(fr) %{_datadir}/%{name}/french +%lang(de) %{_datadir}/%{name}/german +%lang(el) %{_datadir}/%{name}/greek +%lang(hu) %{_datadir}/%{name}/hungarian +%lang(it) %{_datadir}/%{name}/italian +%lang(ja) %{_datadir}/%{name}/japanese +%lang(ko) %{_datadir}/%{name}/korean +%lang(no) %{_datadir}/%{name}/norwegian +%lang(no) %{_datadir}/%{name}/norwegian-ny +%lang(pl) %{_datadir}/%{name}/polish +%lang(pt) %{_datadir}/%{name}/portuguese +%lang(ro) %{_datadir}/%{name}/romanian +%lang(ru) %{_datadir}/%{name}/russian +%lang(sr) %{_datadir}/%{name}/serbian +%lang(sk) %{_datadir}/%{name}/slovak +%lang(es) %{_datadir}/%{name}/spanish +%lang(sv) %{_datadir}/%{name}/swedish +%lang(uk) %{_datadir}/%{name}/ukrainian +%endif + +%files server +%doc README.mysql-cnf + +%{_bindir}/aria_chk +%{_bindir}/aria_dump_log +%{_bindir}/aria_ftdump +%{_bindir}/aria_pack +%{_bindir}/aria_read_log +%{_bindir}/myisamchk +%{_bindir}/myisam_ftdump +%{_bindir}/myisamlog +%{_bindir}/myisampack +%{_bindir}/mysql_convert_table_format +%{_bindir}/mysql_fix_extensions +%{_bindir}/mysql_install_db +%{_bindir}/mysql_secure_installation +%{_bindir}/mysql_setpermission +%{_bindir}/mysql_tzinfo_to_sql +%{_bindir}/mysql_upgrade +%{_bindir}/mysql_zap +%{_bindir}/mysqlbug +%{_bindir}/mysqldumpslow +%{_bindir}/mysqld_multi +%{_bindir}/mysqld_safe +%{_bindir}/mysqlhotcopy +%{_bindir}/mysqltest +%{_bindir}/innochecksum +%{_bindir}/perror +%{_bindir}/replace +%{_bindir}/resolve_stack_dump +%{_bindir}/resolveip +%{?with_tokudb:%{_bindir}/tokuftdump} + +%config(noreplace) %{_sysconfdir}/my.cnf.d/server.cnf +%{?with_tokudb:%config(noreplace) %{_sysconfdir}/my.cnf.d/tokudb.cnf} + +%{_libexecdir}/mysqld + +%{_libdir}/mysql/INFO_SRC +%{_libdir}/mysql/INFO_BIN +%if %{without common} +%dir %{_datadir}/%{name} +%endif + +%{_libdir}/mysql/plugin +%{?with_oqgraph:%exclude %{_libdir}/mysql/plugin/ha_oqgraph.so} +%{?with_connect:%exclude %{_libdir}/mysql/plugin/ha_connect.so} +%exclude %{_libdir}/mysql/plugin/dialog.so +%exclude %{_libdir}/mysql/plugin/mysql_clear_password.so + +%{_mandir}/man1/aria_chk.1.gz +%{_mandir}/man1/aria_dump_log.1.gz +%{_mandir}/man1/aria_ftdump.1.gz +%{_mandir}/man1/aria_pack.1.gz +%{_mandir}/man1/aria_read_log.1.gz +%{_mandir}/man1/myisamchk.1* +%{_mandir}/man1/myisamlog.1* +%{_mandir}/man1/myisampack.1* +%{_mandir}/man1/mysql_convert_table_format.1* +%{_mandir}/man1/myisam_ftdump.1* +%{_mandir}/man1/mysql.server.1* +%{_mandir}/man1/mysql_fix_extensions.1* +%{_mandir}/man1/mysql_install_db.1* +%{_mandir}/man1/mysql_secure_installation.1* +%{_mandir}/man1/mysql_upgrade.1* +%{_mandir}/man1/mysql_zap.1* +%{_mandir}/man1/mysqlbug.1* +%{_mandir}/man1/mysqldumpslow.1* +%{_mandir}/man1/mysqld_multi.1* +%{_mandir}/man1/mysqld_safe.1* +%{_mandir}/man1/mysqlhotcopy.1* +%{_mandir}/man1/mysql_setpermission.1* +%{_mandir}/man1/mysqltest.1* +%{_mandir}/man1/innochecksum.1* +%{_mandir}/man1/perror.1* +%{_mandir}/man1/replace.1* +%{_mandir}/man1/resolve_stack_dump.1* +%{_mandir}/man1/resolveip.1* +%{_mandir}/man1/mysql_tzinfo_to_sql.1* +%{_mandir}/man8/mysqld.8* + +%{_datadir}/%{name}/fill_help_tables.sql +%{_datadir}/%{name}/install_spider.sql +%{_datadir}/%{name}/mysql_system_tables.sql +%{_datadir}/%{name}/mysql_system_tables_data.sql +%{_datadir}/%{name}/mysql_test_data_timezone.sql +%{_datadir}/%{name}/mysql_performance_tables.sql +%{?with_mroonga:%{_datadir}/%{name}/mroonga/install.sql} +%{?with_mroonga:%{_datadir}/%{name}/mroonga/uninstall.sql} +%{_datadir}/%{name}/my-*.cnf + +%{?with_init_systemd:%{_unitdir}/%{daemon_name}.service} +%{?with_init_sysv:%{_initddir}/%{daemon_name}} +%{_libexecdir}/mysql-prepare-db-dir +%{_libexecdir}/mysql-wait-ready +%{_libexecdir}/mysql-check-socket +%{_libexecdir}/mysql-check-upgrade +%{_libexecdir}/mysql-scripts-common + +%{?with_init_systemd:%{_tmpfilesdir}/%{name}.conf} +%attr(0755,mysql,mysql) %dir %{_localstatedir}/run/%{daemon_name} +%attr(0755,mysql,mysql) %dir %{dbdatadir} +%attr(0750,mysql,mysql) %dir %{logfiledir} +%attr(0640,mysql,mysql) %config %ghost %verify(not md5 size mtime) %{logfile} +%config(noreplace) %{logrotateddir}/%{daemon_name} + +%if %{with oqgraph} +%files oqgraph-engine +%config(noreplace) %{_sysconfdir}/my.cnf.d/oqgraph.cnf +%{_libdir}/mysql/plugin/ha_oqgraph.so +%endif + +%if %{with connect} +%files connect-engine +%config(noreplace) %{_sysconfdir}/my.cnf.d/connect.cnf +%{_libdir}/mysql/plugin/ha_connect.so +%endif + +%if %{with devel} +%files devel +%{_bindir}/mysql_config +%{_bindir}/mysql_config-%{__isa_bits} +%{_includedir}/mysql +%{_datadir}/aclocal/mysql.m4 +%{_libdir}/mysql/libmysqlclient.so +%{_libdir}/mysql/libmysqlclient_r.so +%{_mandir}/man1/mysql_config.1* +%endif + +%if %{with embedded} +%files embedded +%{_libdir}/mysql/libmysqld.so.* + +%files embedded-devel +%{_libdir}/mysql/libmysqld.so +%{_bindir}/mysql_client_test_embedded +%{_bindir}/mysqltest_embedded +%{_mandir}/man1/mysql_client_test_embedded.1* +%{_mandir}/man1/mysqltest_embedded.1* +%endif + +%if %{with bench} +%files bench +%{_datadir}/sql-bench +%endif + +%if %{with test} +%files test +%{_bindir}/mysql_client_test +%{_bindir}/my_safe_process +%attr(-,mysql,mysql) %{_datadir}/mysql-test +%{_mandir}/man1/mysql_client_test.1* +%endif + +%changelog +* Fri Dec 05 2014 Honza Horak - 1:10.0.15-3 +- Rework usage of macros and use macros defined in the meta package + Remove some compatibility artefacts +- Fix macros paths in my.cnf +- Create old location for pid file if it remained in my.cnf +- Disable failing tests connect.mrr, connect.updelx2 on ppc and s390 + +* Fri Dec 05 2014 Honza Horak - 1:10.0.15-2 +- Merging changes from Fedora and upgrading to 10.0.15 + +* Thu Nov 27 2014 Jakub Dorňák - 1:10.0.15-1 +- Update to 10.0.15 + +* Thu Nov 20 2014 Jan Stanek - 1:10.0.14-8 +- Applied upstream fix for mysql_config --cflags output. + Resolves: #1160845 + +* Fri Oct 24 2014 Jan Stanek - 1:10.0.14-7 +- Fixed compat service file. + Resolves: #1155700 + +* Mon Oct 13 2014 Honza Horak - 1:10.0.14-6 +- Remove bundled cmd-line-utils + Related: #1079637 +- Move mysqlimport man page to proper package +- Disable main.key_cache test on s390 + Releated: #1149647 + +* Wed Oct 08 2014 Honza Horak - 1:10.0.14-5 +- Disable tests connect.part_file, connect.part_table + and connect.updelx + Related: #1149647 + +* Wed Oct 01 2014 Honza Horak - 1:10.0.14-4 +- Add bcond_without mysql_names + Use more correct path when deleting mysql logrotate script + +* Wed Oct 01 2014 Honza Horak - 1:10.0.14-3 +- Build with system libedit + Resolves: #1079637 + +* Mon Sep 29 2014 Honza Horak - 1:10.0.14-2 +- Add with_debug option + +* Mon Sep 29 2014 Honza Horak - 1:10.0.14-1 +- Update to 10.0.14 + +* Wed Sep 24 2014 Honza Horak - 1:10.0.13-8 +- Move connect engine to a separate package + Rename oqgraph engine to align with upstream packages +- Move some files to correspond with MariaDB upstream packages + client.cnf into -libs, mysql_plugin and msql2mysql into base, + tokuftdump and aria_* into -server, errmsg-utf8.txt into -errmsg +- Remove duplicate cnf files packaged using %%doc +- Check upgrade script added to warn about need for mysql_upgrade + +* Wed Sep 24 2014 Matej Muzila - 1:10.0.13-7 +- Client related libraries moved from mariadb-server to mariadb-libs + Related: #1138843 + +* Mon Sep 08 2014 Honza Horak - 1:10.0.13-6 +- Disable vcol_supported_sql_funcs_myisam test on all arches + Related: #1096787 +- Install systemd service file on RHEL-7+ + Server requires any mysql package, so it should be fine with older client + +* Thu Sep 04 2014 Honza Horak - 1:10.0.13-5 +- Fix paths in mysql_install_db script + Resolves: #1134328 +- Use %%cmake macro + +* Tue Aug 19 2014 Honza Horak - 1:10.0.13-4 +- Build config subpackage everytime +- Disable failing tests: innodb_simulate_comp_failures_small, key_cache + rhbz#1096787 + +* Sun Aug 17 2014 Fedora Release Engineering - 1:10.0.13-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Thu Aug 14 2014 Honza Horak - 1:10.0.13-2 +- Include mysqld_unit only if required; enable tokudb in f20- + +* Wed Aug 13 2014 Honza Horak - 1:10.0.13-1 +- Rebase to version 10.0.13 + +* Tue Aug 12 2014 Honza Horak - 1:10.0.12-8 +- Introduce -config subpackage and ship base config files here + +* Tue Aug 5 2014 Honza Horak - 1:10.0.12-7 +- Adopt changes from mysql, thanks Bjorn Munch + +* Mon Jul 28 2014 Honza Horak - 1:10.0.12-6 +- Use explicit sysconfdir +- Absolut path for default value for pid file and error log + +* Tue Jul 22 2014 Honza Horak - 1:10.0.12-5 +- Hardcoded paths removed to work fine in chroot +- Spec rewrite to be more similar to oterh MySQL implementations +- Use variable for daemon unit name +- Include SysV init script if built on older system +- Add possibility to not ship some sub-packages + +* Mon Jul 21 2014 Honza Horak - 1:10.0.12-4 +- Reformating spec and removing unnecessary snippets + +* Tue Jul 15 2014 Honza Horak - 1:10.0.12-3 +- Enable OQGRAPH engine and package it as a sub-package +- Add support for TokuDB engine for x86_64 (currently still disabled) +- Re-enable tokudb_innodb_xa_crash again, seems to be fixed now +- Drop superfluous -libs and -embedded ldconfig deps (thanks Ville Skyttä) +- Separate -lib and -common sub-packages +- Require /etc/my.cnf instead of shipping it +- Include README.mysql-cnf +- Multilib support re-worked +- Introduce new option with_mysqld_unit +- Removed obsolete mysql-cluster, the package should already be removed +- Improve error message when log file is not writable +- Compile all binaries with full RELRO (RHBZ#1092548) +- Use modern symbol filtering with compatible backup +- Add more groupnames for server's my.cnf +- Error messages now provided by a separate package (thanks Alexander Barkov) +- Expand paths in helper scripts using cmake + +* Wed Jun 18 2014 Mikko Tiihonen - 1:10.0.12-2 +- Use -fno-delete-null-pointer-checks to avoid segfaults with gcc 4.9 + +* Tue Jun 17 2014 Jakub Dorňák - 1:10.0.12-1 +- Rebase to version 10.0.12 + +* Sat Jun 07 2014 Fedora Release Engineering - 1:10.0.11-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue Jun 3 2014 Jakub Dorňák - 1:10.0.11-4 +- rebuild with tests failing on different arches disabled (#1096787) + +* Thu May 29 2014 Dan Horák - 1:10.0.11-2 +- rebuild with tests failing on big endian arches disabled (#1096787) + +* Wed May 14 2014 Jakub Dorňák - 1:10.0.11-1 +- Rebase to version 10.0.11 + +* Mon May 05 2014 Honza Horak - 1:10.0.10-3 +- Script for socket check enhanced + +* Thu Apr 10 2014 Jakub Dorňák - 1:10.0.10-2 +- use system pcre library + +* Thu Apr 10 2014 Jakub Dorňák - 1:10.0.10-1 +- Rebase to version 10.0.10 + +* Wed Mar 12 2014 Honza Horak - 1:5.5.36-2 +- Server crashes on SQL select containing more group by and left join statements using innodb tables + Resolves: #1065676 +- Fix paths in helper scripts +- Move language files into mariadb directory + +* Thu Mar 06 2014 Honza Horak - 1:5.5.36-1 +- Rebase to 5.5.36 + https://kb.askmonty.org/en/mariadb-5536-changelog/ + +* Tue Feb 25 2014 Honza Horak 1:5.5.35-5 +- Daemon helper scripts sanity changes and spec files clean-up + +* Tue Feb 11 2014 Honza Horak 1:5.5.35-4 +- Fix typo in mysqld.service + Resolves: #1063981 + +* Wed Feb 5 2014 Honza Horak 1:5.5.35-3 +- Do not touch the log file in post script, so it does not get wrong owner + Resolves: #1061045 + +* Thu Jan 30 2014 Honza Horak 1:5.5.35-1 +- Rebase to 5.5.35 + https://kb.askmonty.org/en/mariadb-5535-changelog/ + Also fixes: CVE-2014-0001, CVE-2014-0412, CVE-2014-0437, CVE-2013-5908, + CVE-2014-0420, CVE-2014-0393, CVE-2013-5891, CVE-2014-0386, CVE-2014-0401, + CVE-2014-0402 + Resolves: #1054043 + Resolves: #1059546 + +* Tue Jan 14 2014 Honza Horak - 1:5.5.34-9 +- Adopt compatible system versioning + Related: #1045013 +- Use compatibility mysqld.service instead of link + Related: #1014311 + +* Mon Jan 13 2014 Rex Dieter 1:5.5.34-8 +- move mysql_config alternatives scriptlets to -devel too + +* Fri Jan 10 2014 Honza Horak 1:5.5.34-7 +- Build with -O3 on ppc64 + Related: #1051069 +- Move mysql_config to -devel sub-package and remove Require: mariadb + Related: #1050920 + +* Fri Jan 10 2014 Marcin Juszkiewicz 1:5.5.34-6 +- Disable main.gis-precise test also for AArch64 +- Disable perfschema.func_file_io and perfschema.func_mutex for AArch64 + (like it is done for 32-bit ARM) + +* Fri Jan 10 2014 Honza Horak 1:5.5.34-5 +- Clean all non-needed doc files properly + +* Wed Jan 8 2014 Honza Horak 1:5.5.34-4 +- Read socketfile location in mariadb-prepare-db-dir script + +* Mon Jan 6 2014 Honza Horak 1:5.5.34-3 +- Don't test EDH-RSA-DES-CBC-SHA cipher, it seems to be removed from openssl + which now makes mariadb/mysql FTBFS because openssl_1 test fails + Related: #1044565 +- Use upstream's layout for symbols version in client library + Related: #1045013 +- Check if socket file is not being used by another process at a time + of starting the service + Related: #1045435 +- Use %%ghost directive for the log file + Related: 1043501 + +* Wed Nov 27 2013 Honza Horak 1:5.5.34-2 +- Fix mariadb-wait-ready script + +* Fri Nov 22 2013 Honza Horak 1:5.5.34-1 +- Rebase to 5.5.34 + +* Mon Nov 4 2013 Honza Horak 1:5.5.33a-4 +- Fix spec file to be ready for backport by Oden Eriksson + Resolves: #1026404 + +* Mon Nov 4 2013 Honza Horak 1:5.5.33a-3 +- Add pam-devel to build-requires in order to build + Related: #1019945 +- Check if correct process is running in mysql-wait-ready script + Related: #1026313 + +* Mon Oct 14 2013 Honza Horak 1:5.5.33a-2 +- Turn on test suite + +* Thu Oct 10 2013 Honza Horak 1:5.5.33a-1 +- Rebase to 5.5.33a + https://kb.askmonty.org/en/mariadb-5533-changelog/ + https://kb.askmonty.org/en/mariadb-5533a-changelog/ +- Enable outfile_loaddata test +- Disable tokudb_innodb_xa_crash test + +* Mon Sep 2 2013 Honza Horak - 1:5.5.32-12 +- Re-organize my.cnf to include only generic settings + Resolves: #1003115 +- Move pid file location to /var/run/mariadb +- Make mysqld a symlink to mariadb unit file rather than the opposite way + Related: #999589 + +* Thu Aug 29 2013 Honza Horak - 1:5.5.32-11 +- Move log file into /var/log/mariadb/mariadb.log +- Rename logrotate script to mariadb +- Resolves: #999589 + +* Wed Aug 14 2013 Rex Dieter 1:5.5.32-10 +- fix alternatives usage + +* Tue Aug 13 2013 Honza Horak - 1:5.5.32-9 +- Multilib issues solved by alternatives + Resolves: #986959 + +* Sat Aug 03 2013 Petr Pisar - 1:5.5.32-8 +- Perl 5.18 rebuild + +* Wed Jul 31 2013 Honza Horak - 1:5.5.32-7 +- Do not use login shell for mysql user + +* Tue Jul 30 2013 Honza Horak - 1:5.5.32-6 +- Remove unneeded systemd-sysv requires +- Provide mysql-compat-server symbol +- Create mariadb.service symlink +- Fix multilib header location for arm +- Enhance documentation in the unit file +- Use scriptstub instead of links to avoid multilib conflicts +- Add condition for doc placement in F20+ + +* Sun Jul 28 2013 Dennis Gilmore - 1:5.5.32-5 +- remove "Requires(pretrans): systemd" since its not possible +- when installing mariadb and systemd at the same time. as in a new install + +* Sat Jul 27 2013 Kevin Fenzi 1:5.5.32-4 +- Set rpm doc macro to install docs in unversioned dir + +* Fri Jul 26 2013 Dennis Gilmore 1:5.5.32-3 +- add Requires(pre) on systemd for the server package + +* Tue Jul 23 2013 Dennis Gilmore 1:5.5.32-2 +- replace systemd-units requires with systemd +- remove solaris files + +* Fri Jul 19 2013 Honza Horak 1:5.5.32-1 +- Rebase to 5.5.32 + https://kb.askmonty.org/en/mariadb-5532-changelog/ +- Clean-up un-necessary systemd snippets + +* Wed Jul 17 2013 Petr Pisar - 1:5.5.31-7 +- Perl 5.18 rebuild + +* Mon Jul 1 2013 Honza Horak 1:5.5.31-6 +- Test suite params enhanced to decrease server condition influence +- Fix misleading error message when uninstalling built-in plugins + Related: #966873 + +* Thu Jun 27 2013 Honza Horak 1:5.5.31-5 +- Apply fixes found by Coverity static analysis tool + +* Wed Jun 19 2013 Honza Horak 1:5.5.31-4 +- Do not use pretrans scriptlet, which doesn't work in anaconda + Resolves: #975348 + +* Fri Jun 14 2013 Honza Horak 1:5.5.31-3 +- Explicitly enable mysqld if it was enabled in the beginning + of the transaction. + +* Thu Jun 13 2013 Honza Horak 1:5.5.31-2 +- Apply man page fix from Jan Stanek + +* Fri May 24 2013 Honza Horak 1:5.5.31-1 +- Rebase to 5.5.31 + https://kb.askmonty.org/en/mariadb-5531-changelog/ +- Preserve time-stamps in case of installed files +- Use /var/tmp instead of /tmp, since the later is using tmpfs, + which can cause problems + Resolves: #962087 +- Fix test suite requirements + +* Sun May 5 2013 Honza Horak 1:5.5.30-2 +- Remove mytop utility, which is packaged separately +- Resolve multilib conflicts in mysql/private/config.h + +* Fri Mar 22 2013 Honza Horak 1:5.5.30-1 +- Rebase to 5.5.30 + https://kb.askmonty.org/en/mariadb-5530-changelog/ + +* Fri Mar 22 2013 Honza Horak 1:5.5.29-11 +- Obsolete MySQL since it is now renamed to community-mysql +- Remove real- virtual names + +* Thu Mar 21 2013 Honza Horak 1:5.5.29-10 +- Adding epoch to have higher priority than other mysql implementations + when comes to provider comparison + +* Wed Mar 13 2013 Honza Horak 5.5.29-9 +- Let mariadb-embedded-devel conflict with MySQL-embedded-devel +- Adjust mariadb-sortbuffer.patch to correspond with upstream patch + +* Mon Mar 4 2013 Honza Horak 5.5.29-8 +- Mask expected warnings about setrlimit in test suite + +* Thu Feb 28 2013 Honza Horak 5.5.29-7 +- Use configured prefix value instead of guessing basedir + in mysql_config +Resolves: #916189 +- Export dynamic columns and non-blocking API functions documented + by upstream + +* Wed Feb 27 2013 Honza Horak 5.5.29-6 +- Fix sort_buffer_length option type + +* Wed Feb 13 2013 Honza Horak 5.5.29-5 +- Suppress warnings in tests and skip tests also on ppc64p7 + +* Tue Feb 12 2013 Honza Horak 5.5.29-4 +- Suppress warning in tests on ppc +- Enable fixed index_merge_myisam test case + +* Thu Feb 07 2013 Honza Horak 5.5.29-3 +- Packages need to provide also %%_isa version of mysql package +- Provide own symbols with real- prefix to distinguish from mysql + unambiguously +- Fix format for buffer size in error messages (MDEV-4156) +- Disable some tests that fail on ppc and s390 +- Conflict only with real-mysql, otherwise mariadb conflicts with ourself + +* Tue Feb 05 2013 Honza Horak 5.5.29-2 +- Let mariadb-libs to own /etc/my.cnf.d + +* Thu Jan 31 2013 Honza Horak 5.5.29-1 +- Rebase to 5.5.29 + https://kb.askmonty.org/en/mariadb-5529-changelog/ +- Fix inaccurate default for socket location in mysqld-wait-ready + Resolves: #890535 + +* Thu Jan 31 2013 Honza Horak 5.5.28a-8 +- Enable obsoleting mysql + +* Wed Jan 30 2013 Honza Horak 5.5.28a-7 +- Adding necessary hacks for perl dependency checking, rpm is still + not wise enough +- Namespace sanity re-added for symbol default_charset_info + +* Mon Jan 28 2013 Honza Horak 5.5.28a-6 +- Removed %%{_isa} from provides/obsoletes, which doesn't allow + proper obsoleting +- Do not obsolete mysql at the time of testing + +* Thu Jan 10 2013 Honza Horak 5.5.28a-5 +- Added licenses LGPLv2 and BSD +- Removed wrong usage of %%{epoch} +- Test-suite is run in %%check +- Removed perl dependency checking adjustment, rpm seems to be smart enough +- Other minor spec file fixes + +* Tue Dec 18 2012 Honza Horak 5.5.28a-4 +- Packaging of MariaDB based on MySQL package +