- Add support for el7 (with systemd enabled)

- Enable shared libmysqld by cmake option
parent 7c12a9e5
...@@ -28,8 +28,8 @@ IF(UNIX) ...@@ -28,8 +28,8 @@ IF(UNIX)
FOREACH(fedfile my.cnf my_config.h mysql_config.sh FOREACH(fedfile my.cnf my_config.h mysql_config.sh
mysqld.service mysql-systemd-start mysql.conf mysqld.service mysql-systemd-start mysql.conf
filter-requires.sh filter-provides.sh filter-requires.sh filter-provides.sh mysql.init
mysql-embedded-check.c mysql.init) mysql-5.5-libmysqlclient-symbols.patch)
CONFIGURE_FILE(${fedfile} ${CMAKE_CURRENT_BINARY_DIR}/${fedfile} COPYONLY) CONFIGURE_FILE(${fedfile} ${CMAKE_CURRENT_BINARY_DIR}/${fedfile} COPYONLY)
ENDFOREACH() ENDFOREACH()
ENDIF() ENDIF()
......
diff -rup old/libmysql/CMakeLists.txt new/libmysql/CMakeLists.txt
--- old/libmysql/CMakeLists.txt 2013-11-05 08:19:26.000000000 +0100
+++ new/libmysql/CMakeLists.txt 2014-01-10 15:41:30.530068723 +0100
@@ -205,13 +205,14 @@ IF(NOT DISABLE_SHARED)
OUTPUT_NAME mysqlclient
VERSION "${OS_SHARED_LIB_VERSION}"
SOVERSION "${SHARED_LIB_MAJOR_VERSION}")
+ CONFIGURE_FILE(libmysql.ver.in ${CMAKE_CURRENT_BINARY_DIR}/libmysql.ver)
IF(LINK_FLAG_NO_UNDEFINED)
GET_TARGET_PROPERTY(libmysql_link_flags libmysql LINK_FLAGS)
IF(NOT libmysql_link_flag)
SET(libmysql_link_flags)
ENDIF()
SET_TARGET_PROPERTIES(libmysql PROPERTIES LINK_FLAGS
- "${libmysql_link_flags} ${LINK_FLAG_NO_UNDEFINED}")
+ "${libmysql_link_flags} -Wl,--version-script=libmysql.ver ${LINK_FLAG_NO_UNDEFINED}")
ENDIF()
# clean direct output needs to be set several targets have the same name
#(mysqlclient in this case)
diff -rup old/libmysql/libmysql.c new/libmysql/libmysql.c
--- old/libmysql/libmysql.c 2013-11-05 08:19:26.000000000 +0100
+++ new/libmysql/libmysql.c 2014-01-10 15:46:35.708928462 +0100
@@ -4870,3 +4870,612 @@ my_bool STDCALL mysql_read_query_result(
return (*mysql->methods->read_query_result)(mysql);
}
+#ifndef EMBEDDED_LIBRARY
+
+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
+
+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
+
+void STDCALL symver16_myodbc_remove_escape(MYSQL *mysql,char *name)
+{
+ return myodbc_remove_escape(mysql, name);
+}
+SYM_16(myodbc_remove_escape);
+
+
+my_ulonglong STDCALL symver16_mysql_affected_rows(MYSQL *mysql)
+{
+ return mysql_affected_rows(mysql);
+}
+SYM_16(mysql_affected_rows);
+
+
+my_bool STDCALL symver16_mysql_autocommit(MYSQL * mysql, my_bool auto_mode)
+{
+ return mysql_autocommit(mysql, auto_mode);
+}
+SYM_16(mysql_autocommit);
+
+
+my_bool STDCALL symver16_mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db)
+{
+ return mysql_change_user(mysql, user, passwd, db);
+}
+SYM_16(mysql_change_user);
+
+
+const char * STDCALL symver16_mysql_character_set_name(MYSQL *mysql)
+{
+ return mysql_character_set_name(mysql);
+}
+SYM_16(mysql_character_set_name);
+
+
+my_bool STDCALL symver16_mysql_commit(MYSQL * mysql)
+{
+ return mysql_commit(mysql);
+}
+SYM_16(mysql_commit);
+
+
+void STDCALL symver16_mysql_data_seek(MYSQL_RES *result, my_ulonglong row)
+{
+ return mysql_data_seek(result, row);
+}
+SYM_16(mysql_data_seek);
+
+
+void STDCALL symver16_mysql_debug(const char *debug __attribute__((unused)))
+{
+ return mysql_debug(debug);
+}
+SYM_16(mysql_debug);
+
+
+int STDCALL symver16_mysql_dump_debug_info(MYSQL *mysql)
+{
+ return mysql_dump_debug_info(mysql);
+}
+SYM_16(mysql_dump_debug_info);
+
+
+my_bool STDCALL symver16_mysql_embedded(void)
+{
+ return mysql_embedded();
+}
+SYM_16(mysql_embedded);
+
+
+my_bool STDCALL symver16_mysql_eof(MYSQL_RES *res)
+{
+ return mysql_eof(res);
+}
+SYM_16(mysql_eof);
+
+
+ulong STDCALL symver16_mysql_escape_string(char *to,const char *from,ulong length)
+{
+ return mysql_escape_string(to, from, length);
+}
+SYM_16(mysql_escape_string);
+
+
+MYSQL_FIELD * STDCALL symver16_mysql_fetch_field(MYSQL_RES *result)
+{
+ return mysql_fetch_field(result);
+}
+SYM_16(mysql_fetch_field);
+
+
+MYSQL_FIELD * STDCALL symver16_mysql_fetch_field_direct(MYSQL_RES *res,uint fieldnr)
+{
+ return mysql_fetch_field_direct(res, fieldnr);
+}
+SYM_16(mysql_fetch_field_direct);
+
+
+MYSQL_FIELD * STDCALL symver16_mysql_fetch_fields(MYSQL_RES *res)
+{
+ return mysql_fetch_fields(res);
+}
+SYM_16(mysql_fetch_fields);
+
+
+unsigned int STDCALL symver16_mysql_field_count(MYSQL *mysql)
+{
+ return mysql_field_count(mysql);
+}
+SYM_16(mysql_field_count);
+
+
+MYSQL_FIELD_OFFSET STDCALL symver16_mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET field_offset)
+{
+ return mysql_field_seek(result, field_offset);
+}
+SYM_16(mysql_field_seek);
+
+
+MYSQL_FIELD_OFFSET STDCALL symver16_mysql_field_tell(MYSQL_RES *res)
+{
+ return mysql_field_tell(res);
+}
+SYM_16(mysql_field_tell);
+
+
+void STDCALL symver16_mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo)
+{
+ return mysql_get_character_set_info(mysql, csinfo);
+}
+SYM_16(mysql_get_character_set_info);
+
+
+const char * STDCALL symver16_mysql_get_client_info(void)
+{
+ return mysql_get_client_info();
+}
+SYM_16(mysql_get_client_info);
+
+ulong STDCALL symver16_mysql_get_client_version(void)
+{
+ return mysql_get_client_version();
+}
+SYM_16(mysql_get_client_version);
+
+
+const char * STDCALL symver16_mysql_get_host_info(MYSQL *mysql)
+{
+ return mysql_get_host_info(mysql);
+}
+SYM_16(mysql_get_host_info);
+
+
+MYSQL_PARAMETERS *STDCALL symver16_mysql_get_parameters(void)
+{
+ return mysql_get_parameters();
+}
+SYM_16(mysql_get_parameters);
+
+
+uint STDCALL symver16_mysql_get_proto_info(MYSQL *mysql)
+{
+ return mysql_get_proto_info(mysql);
+}
+SYM_16(mysql_get_proto_info);
+
+
+const char * STDCALL symver16_mysql_get_server_info(MYSQL *mysql)
+{
+ return mysql_get_server_info(mysql);
+}
+SYM_16(mysql_get_server_info);
+
+
+ulong STDCALL symver16_mysql_hex_string(char *to, const char *from, ulong length)
+{
+ return mysql_hex_string(to, from, length);
+}
+SYM_16(mysql_hex_string);
+
+
+const char *STDCALL symver16_mysql_info(MYSQL *mysql)
+{
+ return mysql_info(mysql);
+}
+SYM_16(mysql_info);
+
+
+my_ulonglong STDCALL symver16_mysql_insert_id(MYSQL *mysql)
+{
+ return mysql_insert_id(mysql);
+}
+SYM_16(mysql_insert_id);
+
+
+int STDCALL symver16_mysql_kill(MYSQL *mysql,ulong pid)
+{
+ return mysql_kill(mysql, pid);
+}
+SYM_16(mysql_kill);
+
+
+MYSQL_RES * STDCALL symver16_mysql_list_dbs(MYSQL *mysql, const char *wild)
+{
+ return mysql_list_dbs(mysql, wild);
+}
+SYM_16(mysql_list_dbs);
+
+
+MYSQL_RES * STDCALL symver16_mysql_list_fields(MYSQL *mysql, const char *table, const char *wild)
+{
+ return mysql_list_fields(mysql, table, wild);
+}
+SYM_16(mysql_list_fields);
+
+
+MYSQL_RES * STDCALL symver16_mysql_list_processes(MYSQL *mysql)
+{
+ return mysql_list_processes(mysql);
+}
+SYM_16(mysql_list_processes);
+
+
+MYSQL_RES * STDCALL symver16_mysql_list_tables(MYSQL *mysql, const char *wild)
+{
+ return mysql_list_tables(mysql, wild);
+}
+SYM_16(mysql_list_tables);
+
+
+my_bool STDCALL symver16_mysql_more_results(MYSQL *mysql)
+{
+ return mysql_more_results(mysql);
+}
+SYM_16(mysql_more_results);
+
+
+int STDCALL symver16_mysql_next_result(MYSQL *mysql)
+{
+ return mysql_next_result(mysql);
+}
+SYM_16(mysql_next_result);
+
+
+int STDCALL symver16_mysql_ping(MYSQL *mysql)
+{
+ return mysql_ping(mysql);
+}
+SYM_16(mysql_ping);
+
+
+int STDCALL symver16_mysql_query(MYSQL *mysql, const char *query)
+{
+ return mysql_query(mysql, query);
+}
+SYM_16(mysql_query);
+
+
+my_bool STDCALL symver16_mysql_read_query_result(MYSQL *mysql)
+{
+ return mysql_read_query_result(mysql);
+}
+SYM_16(mysql_read_query_result);
+
+
+ulong STDCALL symver16_mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, ulong length)
+{
+ return mysql_real_escape_string(mysql, to, from, length);
+}
+SYM_16(mysql_real_escape_string);
+
+
+int STDCALL symver16_mysql_refresh(MYSQL *mysql,uint options)
+{
+ return mysql_refresh(mysql, options);
+}
+SYM_16(mysql_refresh);
+
+
+my_bool STDCALL symver16_mysql_rollback(MYSQL * mysql)
+{
+ return mysql_rollback(mysql);
+}
+SYM_16(mysql_rollback);
+
+
+MYSQL_ROW_OFFSET STDCALL symver16_mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET row)
+{
+ return mysql_row_seek(result, row);
+}
+SYM_16(mysql_row_seek);
+
+
+MYSQL_ROW_OFFSET STDCALL symver16_mysql_row_tell(MYSQL_RES *res)
+{
+ return mysql_row_tell(res);
+}
+SYM_16(mysql_row_tell);
+
+
+void STDCALL symver16_mysql_server_end()
+{
+ return mysql_server_end();
+}
+SYM_16(mysql_server_end);
+
+
+int STDCALL symver16_mysql_server_init(int argc __attribute__((unused)), char **argv __attribute__((unused)), char **groups __attribute__((unused)))
+{
+ return mysql_server_init(argc, argv, groups);
+}
+SYM_16(mysql_server_init);
+
+
+void symver16_mysql_set_local_infile_default(MYSQL *mysql)
+{
+ return mysql_set_local_infile_default(mysql);
+}
+SYM_16(mysql_set_local_infile_default);
+
+
+void symver16_mysql_set_local_infile_handler(MYSQL *mysql, int (*local_infile_init)(void **, const char *, void *), int (*local_infile_read)(void *, char *, uint), void (*local_infile_end)(void *), int (*local_infile_error)(void *, char *, uint), void *userdata)
+{
+ return mysql_set_local_infile_handler(mysql, local_infile_init, local_infile_read, local_infile_end, local_infile_error, userdata);
+}
+SYM_16(mysql_set_local_infile_handler);
+
+
+int STDCALL symver16_mysql_set_server_option(MYSQL *mysql, enum enum_mysql_set_option option)
+{
+ return mysql_set_server_option(mysql, option);
+}
+SYM_16(mysql_set_server_option);
+
+
+int STDCALL symver16_mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level)
+{
+ return mysql_shutdown(mysql, shutdown_level);
+}
+SYM_16(mysql_shutdown);
+
+
+const char *STDCALL symver16_mysql_sqlstate(MYSQL *mysql)
+{
+ return mysql_sqlstate(mysql);
+}
+SYM_16(mysql_sqlstate);
+
+
+const char * STDCALL symver16_mysql_stat(MYSQL *mysql)
+{
+ return mysql_stat(mysql);
+}
+SYM_16(mysql_stat);
+
+
+my_ulonglong STDCALL symver16_mysql_stmt_affected_rows(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_affected_rows(stmt);
+}
+SYM_16(mysql_stmt_affected_rows);
+
+
+my_bool STDCALL symver16_mysql_stmt_attr_get(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, void *value)
+{
+ return mysql_stmt_attr_get(stmt, attr_type, value);
+}
+SYM_16(mysql_stmt_attr_get);
+
+
+my_bool STDCALL symver16_mysql_stmt_attr_set(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, const void *value)
+{
+ return mysql_stmt_attr_set(stmt, attr_type, value);
+}
+SYM_16(mysql_stmt_attr_set);
+
+
+my_bool STDCALL symver16_mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *my_bind)
+{
+ return mysql_stmt_bind_param(stmt, my_bind);
+}
+SYM_16(mysql_stmt_bind_param);
+
+
+my_bool STDCALL symver16_mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *my_bind)
+{
+ return mysql_stmt_bind_result(stmt, my_bind);
+}
+SYM_16(mysql_stmt_bind_result);
+
+
+my_bool STDCALL symver16_mysql_stmt_close(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_close(stmt);
+}
+SYM_16(mysql_stmt_close);
+
+
+void STDCALL symver16_mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
+{
+ return mysql_stmt_data_seek(stmt, row);
+}
+SYM_16(mysql_stmt_data_seek);
+
+
+uint STDCALL symver16_mysql_stmt_errno(MYSQL_STMT * stmt)
+{
+ return mysql_stmt_errno(stmt);
+}
+SYM_16(mysql_stmt_errno);
+
+
+const char *STDCALL symver16_mysql_stmt_error(MYSQL_STMT * stmt)
+{
+ return mysql_stmt_error(stmt);
+}
+SYM_16(mysql_stmt_error);
+
+
+int STDCALL symver16_mysql_stmt_execute(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_execute(stmt);
+}
+SYM_16(mysql_stmt_execute);
+
+
+int STDCALL symver16_mysql_stmt_fetch(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_fetch(stmt);
+}
+SYM_16(mysql_stmt_fetch);
+
+
+int STDCALL symver16_mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *my_bind, uint column, ulong offset)
+{
+ return mysql_stmt_fetch_column(stmt, my_bind, column, offset);
+}
+SYM_16(mysql_stmt_fetch_column);
+
+
+unsigned int STDCALL symver16_mysql_stmt_field_count(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_field_count(stmt);
+}
+SYM_16(mysql_stmt_field_count);
+
+
+my_bool STDCALL symver16_mysql_stmt_free_result(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_free_result(stmt);
+}
+SYM_16(mysql_stmt_free_result);
+
+
+MYSQL_STMT * STDCALL symver16_mysql_stmt_init(MYSQL *mysql)
+{
+ return mysql_stmt_init(mysql);
+}
+SYM_16(mysql_stmt_init);
+
+
+my_ulonglong STDCALL symver16_mysql_stmt_insert_id(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_insert_id(stmt);
+}
+SYM_16(mysql_stmt_insert_id);
+
+
+my_ulonglong STDCALL symver16_mysql_stmt_num_rows(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_num_rows(stmt);
+}
+SYM_16(mysql_stmt_num_rows);
+
+
+ulong STDCALL symver16_mysql_stmt_param_count(MYSQL_STMT * stmt)
+{
+ return mysql_stmt_param_count(stmt);
+}
+SYM_16(mysql_stmt_param_count);
+
+
+MYSQL_RES * STDCALL symver16_mysql_stmt_param_metadata(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_param_metadata(stmt);
+}
+SYM_16(mysql_stmt_param_metadata);
+
+
+int STDCALL symver16_mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
+{
+ return mysql_stmt_prepare(stmt, query, length);
+}
+SYM_16(mysql_stmt_prepare);
+
+
+my_bool STDCALL symver16_mysql_stmt_reset(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_reset(stmt);
+}
+SYM_16(mysql_stmt_reset);
+
+
+MYSQL_RES * STDCALL symver16_mysql_stmt_result_metadata(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_result_metadata(stmt);
+}
+SYM_16(mysql_stmt_result_metadata);
+
+
+MYSQL_ROW_OFFSET STDCALL symver16_mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET row)
+{
+ return mysql_stmt_row_seek(stmt, row);
+}
+SYM_16(mysql_stmt_row_seek);
+
+
+MYSQL_ROW_OFFSET STDCALL symver16_mysql_stmt_row_tell(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_row_tell(stmt);
+}
+SYM_16(mysql_stmt_row_tell);
+
+
+my_bool STDCALL symver16_mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, const char *data, ulong length)
+{
+ return mysql_stmt_send_long_data(stmt, param_number, data, length);
+}
+SYM_16(mysql_stmt_send_long_data);
+
+
+const char *STDCALL symver16_mysql_stmt_sqlstate(MYSQL_STMT * stmt)
+{
+ return mysql_stmt_sqlstate(stmt);
+}
+SYM_16(mysql_stmt_sqlstate);
+
+
+int STDCALL symver16_mysql_stmt_store_result(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_store_result(stmt);
+}
+SYM_16(mysql_stmt_store_result);
+
+
+void STDCALL symver16_mysql_thread_end()
+{
+ return mysql_thread_end();
+}
+SYM_16(mysql_thread_end);
+
+
+ulong STDCALL symver16_mysql_thread_id(MYSQL *mysql)
+{
+ return mysql_thread_id(mysql);
+}
+SYM_16(mysql_thread_id);
+
+
+my_bool STDCALL symver16_mysql_thread_init()
+{
+ return mysql_thread_init();
+}
+SYM_16(mysql_thread_init);
+
+
+uint STDCALL symver16_mysql_thread_safe(void)
+{
+ return mysql_thread_safe();
+}
+SYM_16(mysql_thread_safe);
+
+
+MYSQL_RES * STDCALL symver16_mysql_use_result(MYSQL *mysql)
+{
+ return mysql_use_result(mysql);
+}
+SYM_16(mysql_use_result);
+
+
+uint STDCALL symver16_mysql_warning_count(MYSQL *mysql)
+{
+ return mysql_warning_count(mysql);
+}
+SYM_16(mysql_warning_count);
+
+/*****/
+
+MYSQL * STDCALL symver16_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, uint port, const char *unix_socket,ulong client_flag)
+{
+ return mysql_real_connect(mysql, host, user, passwd, db, port, unix_socket, client_flag);
+}
+SYM_16(mysql_real_connect);
+
+/*****/
+
+my_bool symver16_my_init(void)
+{
+ return my_init();
+}
+SYM_16(my_init);
+
+#endif
diff -rup old/libmysql/libmysql.ver.in new/libmysql/libmysql.ver.in
--- old/libmysql/libmysql.ver.in 2013-11-05 08:19:26.000000000 +0100
+++ new/libmysql/libmysql.ver.in 2014-01-10 15:41:30.545182782 +0100
@@ -1 +1,136 @@
-libmysqlclient_@SHARED_LIB_MAJOR_VERSION@ { global: *; };
+libmysqlclient_16
+{
+ local:
+ symver16_*;
+};
+
+libmysqlclient_18
+{
+ global:
+ my_init;
+ myodbc_remove_escape;
+ mysql_affected_rows;
+ mysql_autocommit;
+ mysql_change_user;
+ mysql_character_set_name;
+ mysql_close;
+ mysql_commit;
+ mysql_data_seek;
+ mysql_debug;
+ mysql_dump_debug_info;
+ mysql_embedded;
+ mysql_eof;
+ mysql_errno;
+ mysql_error;
+ mysql_escape_string;
+ mysql_fetch_field;
+ mysql_fetch_field_direct;
+ mysql_fetch_fields;
+ mysql_fetch_lengths;
+ mysql_fetch_row;
+ mysql_field_count;
+ mysql_field_seek;
+ mysql_field_tell;
+ mysql_free_result;
+ mysql_get_character_set_info;
+ mysql_get_client_info;
+ mysql_get_client_version;
+ mysql_get_host_info;
+ mysql_get_parameters;
+ mysql_get_proto_info;
+ mysql_get_server_info;
+ mysql_get_server_version;
+ mysql_get_ssl_cipher;
+ mysql_hex_string;
+ mysql_info;
+ mysql_init;
+ mysql_insert_id;
+ mysql_kill;
+ mysql_list_dbs;
+ mysql_list_fields;
+ mysql_list_processes;
+ mysql_list_tables;
+ mysql_more_results;
+ mysql_next_result;
+ mysql_num_fields;
+ mysql_num_rows;
+ mysql_options;
+ mysql_ping;
+ mysql_query;
+ mysql_read_query_result;
+ mysql_real_connect;
+ mysql_real_escape_string;
+ mysql_real_query;
+ mysql_refresh;
+ mysql_rollback;
+ mysql_row_seek;
+ mysql_row_tell;
+ mysql_select_db;
+ mysql_send_query;
+ mysql_server_end;
+ mysql_server_init;
+ mysql_set_character_set;
+ mysql_set_local_infile_default;
+ mysql_set_local_infile_handler;
+ mysql_set_server_option;
+ mysql_shutdown;
+ mysql_sqlstate;
+ mysql_ssl_set;
+ mysql_stat;
+ mysql_stmt_affected_rows;
+ mysql_stmt_attr_get;
+ mysql_stmt_attr_set;
+ mysql_stmt_bind_param;
+ mysql_stmt_bind_result;
+ mysql_stmt_close;
+ mysql_stmt_data_seek;
+ mysql_stmt_errno;
+ mysql_stmt_error;
+ mysql_stmt_execute;
+ mysql_stmt_fetch;
+ mysql_stmt_fetch_column;
+ mysql_stmt_field_count;
+ mysql_stmt_free_result;
+ mysql_stmt_init;
+ mysql_stmt_insert_id;
+ mysql_stmt_num_rows;
+ mysql_stmt_param_count;
+ mysql_stmt_param_metadata;
+ mysql_stmt_prepare;
+ mysql_stmt_reset;
+ mysql_stmt_result_metadata;
+ mysql_stmt_row_seek;
+ mysql_stmt_row_tell;
+ mysql_stmt_send_long_data;
+ mysql_stmt_sqlstate;
+ mysql_stmt_store_result;
+ mysql_store_result;
+ mysql_thread_end;
+ mysql_thread_id;
+ mysql_thread_init;
+ mysql_thread_safe;
+ mysql_use_result;
+ mysql_warning_count;
+
+ free_defaults;
+ handle_options;
+ load_defaults;
+ my_print_help;
+
+ #my_make_scrambled_password;
+ THR_KEY_mysys;
+
+ mysql_client_find_plugin;
+ mysql_client_register_plugin;
+ mysql_load_plugin;
+ mysql_load_plugin_v;
+ mysql_plugin_options;
+ mysql_stmt_next_result;
+
+ #mysql_default_charset_info;
+ mysql_get_charset;
+ mysql_get_charset_by_csname;
+ mysql_net_realloc;
+ #mysql_client_errors;
+ *;
+} libmysqlclient_16;
diff -rup old/mysys/charset.c new/mysys/charset.c
--- old/mysys/charset.c 2013-11-05 08:19:26.000000000 +0100
+++ new/mysys/charset.c 2014-01-10 15:41:30.552919678 +0100
@@ -941,3 +941,20 @@ size_t escape_quotes_for_mysql(CHARSET_I
*to= 0;
return overflow ? (ulong)~0 : (ulong) (to - to_start);
}
+
+#ifndef EMBEDDED_LIBRARY
+
+// Hack to provide Fedora symbols
+
+CHARSET_INFO *mysql_get_charset(uint cs_number, myf flags)
+{
+ return get_charset(cs_number, flags);
+}
+
+
+CHARSET_INFO * mysql_get_charset_by_csname(const char *cs_name, uint cs_flags, myf flags)
+{
+ return get_charset_by_csname(cs_name, cs_flags, flags);
+}
+
+#endif
diff -rup old/sql/net_serv.cc new/sql/net_serv.cc
--- old/sql/net_serv.cc 2013-11-05 08:19:26.000000000 +0100
+++ new/sql/net_serv.cc 2014-01-10 15:41:30.563377346 +0100
@@ -1190,3 +1190,17 @@ void my_net_set_write_timeout(NET *net,
#endif
DBUG_VOID_RETURN;
}
+
+#ifndef EMBEDDED_LIBRARY
+C_MODE_START
+
+// Hack to provide Fedora symbols
+
+my_bool mysql_net_realloc(NET *net, size_t length)
+{
+ return net_realloc(net, length);
+}
+
+C_MODE_END
+#endif
+
diff -rup old/sql/password.c new/sql/password.c
--- old/sql/password.c 2013-11-05 08:19:26.000000000 +0100
+++ new/sql/password.c 2014-01-10 15:41:30.567134663 +0100
@@ -563,3 +563,17 @@ void make_password_from_salt(char *to, c
*to++= PVERSION41_CHAR;
octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE);
}
+
+#ifndef EMBEDDED_LIBRARY
+
+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
+
+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
+
+void symver16_my_make_scrambled_password(char *to, const char *password, size_t pass_len)
+{
+ my_make_scrambled_password(to, password, pass_len);
+}
+SYM_16(my_make_scrambled_password);
+
+#endif
diff -rup old/sql-common/client.c new/sql-common/client.c
--- old/sql-common/client.c 2013-11-05 08:19:26.000000000 +0100
+++ new/sql-common/client.c 2014-01-10 15:41:30.574151024 +0100
@@ -4399,3 +4399,136 @@ static int clear_password_auth_client(MY
return res ? CR_ERROR : CR_OK;
}
+
+#ifndef EMBEDDED_LIBRARY
+
+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
+
+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
+
+void STDCALL symver16_mysql_close(MYSQL *mysql)
+{
+ return mysql_close(mysql);
+}
+SYM_16(mysql_close);
+
+
+uint STDCALL symver16_mysql_errno(MYSQL *mysql)
+{
+ return mysql_errno(mysql);
+}
+SYM_16(mysql_errno);
+
+
+const char * STDCALL symver16_mysql_error(MYSQL *mysql)
+{
+ return mysql_error(mysql);
+}
+SYM_16(mysql_error);
+
+
+ulong * STDCALL symver16_mysql_fetch_lengths(MYSQL_RES *res)
+{
+ return mysql_fetch_lengths(res);
+}
+SYM_16(mysql_fetch_lengths);
+
+
+MYSQL_ROW STDCALL symver16_mysql_fetch_row(MYSQL_RES *res)
+{
+ return mysql_fetch_row(res);
+}
+SYM_16(mysql_fetch_row);
+
+
+void STDCALL symver16_mysql_free_result(MYSQL_RES *result)
+{
+ return mysql_free_result(result);
+}
+SYM_16(mysql_free_result);
+
+
+ulong STDCALL symver16_mysql_get_server_version(MYSQL *mysql)
+{
+ return mysql_get_server_version(mysql);
+}
+SYM_16(mysql_get_server_version);
+
+
+const char * STDCALL symver16_mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused)))
+{
+ return mysql_get_ssl_cipher(mysql);
+}
+SYM_16(mysql_get_ssl_cipher);
+
+
+MYSQL * STDCALL symver16_mysql_init(MYSQL *mysql)
+{
+ return mysql_init(mysql);
+}
+SYM_16(mysql_init);
+
+
+unsigned int STDCALL symver16_mysql_num_fields(MYSQL_RES *res)
+{
+ return mysql_num_fields(res);
+}
+SYM_16(mysql_num_fields);
+
+
+my_ulonglong STDCALL symver16_mysql_num_rows(MYSQL_RES *res)
+{
+ return mysql_num_rows(res);
+}
+SYM_16(mysql_num_rows);
+
+
+int STDCALL symver16_mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
+{
+ return mysql_options(mysql, option, arg);
+}
+SYM_16(mysql_options);
+
+
+int STDCALL symver16_mysql_real_query(MYSQL *mysql, const char *query, ulong length)
+{
+ return mysql_real_query(mysql, query, length);
+}
+SYM_16(mysql_real_query);
+
+
+int STDCALL symver16_mysql_select_db(MYSQL *mysql, const char *db)
+{
+ return mysql_select_db(mysql, db);
+}
+SYM_16(mysql_select_db);
+
+
+int STDCALL symver16_mysql_send_query(MYSQL* mysql, const char* query, ulong length)
+{
+ return mysql_send_query(mysql, query, length);
+}
+SYM_16(mysql_send_query);
+
+
+int STDCALL symver16_mysql_set_character_set(MYSQL *mysql, const char *cs_name)
+{
+ return mysql_set_character_set(mysql, cs_name);
+}
+SYM_16(mysql_set_character_set);
+
+
+my_bool STDCALL symver16_mysql_ssl_set(MYSQL *mysql __attribute__((unused)), const char *key __attribute__((unused)), const char *cert __attribute__((unused)), const char *ca __attribute__((unused)), const char *capath __attribute__((unused)), const char *cipher __attribute__((unused)))
+{
+ return mysql_ssl_set(mysql, key, cert, ca, capath, cipher);
+}
+SYM_16(mysql_ssl_set);
+
+
+MYSQL_RES * STDCALL symver16_mysql_store_result(MYSQL *mysql)
+{
+ return mysql_store_result(mysql);
+}
+SYM_16(mysql_store_result);
+
+#endif
/* simple test program to see if we can link the embedded server library */
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#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;
}
# Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
# MA 02110-1301 USA. # MA 02110-1301 USA.
# Rebuild on OL5/RHEL5 needs following rpmbuild options:
# rpmbuild --define 'dist .el5' --define 'rhel 5' --define 'el5 1' mysql.spec
# NOTE: "vendor" is used in upgrade/downgrade check, so you can't # NOTE: "vendor" is used in upgrade/downgrade check, so you can't
# change these, has to be exactly as is. # change these, has to be exactly as is.
...@@ -28,6 +30,7 @@ ...@@ -28,6 +30,7 @@
%{!?runselftest:%global runselftest 0} %{!?runselftest:%global runselftest 0}
%{!?with_systemd: %global systemd 0} %{!?with_systemd: %global systemd 0}
%{?el7: %global systemd 1}
%{!?with_debuginfo: %global nodebuginfo 1} %{!?with_debuginfo: %global nodebuginfo 1}
%{!?product_suffix: %global product_suffix community} %{!?product_suffix: %global product_suffix community}
%{!?feature_set: %global feature_set community} %{!?feature_set: %global feature_set community}
...@@ -35,11 +38,31 @@ ...@@ -35,11 +38,31 @@
%{!?compilation_comment_debug: %global compilation_comment_debug MySQL Community Server - Debug (GPL)} %{!?compilation_comment_debug: %global compilation_comment_debug MySQL Community Server - Debug (GPL)}
%{!?src_base: %global src_base mysql} %{!?src_base: %global src_base mysql}
%global libmysqld_so_major 0
%global libmysqld_so_long 0.0.1
# Version for compat libs # Version for compat libs
%if 0%{?rhel} == 5
%global compatver 5.0.96
%global compatlib 15
%global compatsrc http://downloads.mysql.com/archives/mysql-5.0/mysql-%{compatver}.tar.gz
%endif
%if 0%{?rhel} == 6
%global compatver 5.1.72 %global compatver 5.1.72
%global compatlib 16
%global compatsrc https://cdn.mysql.com/Downloads/MySQL-5.1/mysql-%{compatver}.tar.gz
%endif
# multiarch
%global multiarchs ppc %{power64} %{ix86} x86_64 %{sparc}
# Hack to support el5 where __isa_bits not defined. Note: supports i386 and x86_64 only, sorry.
%if x%{?__isa_bits} == x
%ifarch %{ix86}
%global __isa_bits 32
%endif
%ifarch x86_64
%global __isa_bits 64
%endif
%endif
%global src_dir %{src_base}-%{version} %global src_dir %{src_base}-%{version}
...@@ -50,9 +73,6 @@ ...@@ -50,9 +73,6 @@
%global __os_install_post /usr/lib/rpm/brp-compress %{nil} %global __os_install_post /usr/lib/rpm/brp-compress %{nil}
%endif %endif
# multiarch
%global multiarchs ppc %{power64} %{ix86} x86_64 %{sparc}
%if 0%{?commercial} %if 0%{?commercial}
%global license_files_server %{src_dir}/LICENSE.mysql %global license_files_server %{src_dir}/LICENSE.mysql
%global license_type Commercial %global license_type Commercial
...@@ -77,25 +97,35 @@ Source2: mysqld.service ...@@ -77,25 +97,35 @@ Source2: mysqld.service
Source3: mysql.conf Source3: mysql.conf
Source4: my_config.h Source4: my_config.h
Source5: mysql_config.sh Source5: mysql_config.sh
Source6: mysql-embedded-check.c %if 0%{?compatlib}
Source7: https://cdn.mysql.com/Downloads/MySQL-5.5/mysql-%{compatver}.tar.gz Source7: %{compatsrc}
%endif
Source90: filter-provides.sh Source90: filter-provides.sh
Source91: filter-requires.sh Source91: filter-requires.sh
Patch0: mysql-5.5-libmysqlclient-symbols.patch
BuildRequires: cmake BuildRequires: cmake
BuildRequires: perl BuildRequires: perl
%{?el7:BuildRequires: perl(Time::HiRes)}
%{?el7:BuildRequires: perl(Env)}
BuildRequires: time BuildRequires: time
BuildRequires: libaio-devel BuildRequires: libaio-devel
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
BuildRequires: openssl-devel BuildRequires: openssl-devel
BuildRequires: zlib-devel BuildRequires: zlib-devel
%if 0%{?systemd} %if 0%{?systemd}
BuildRequires: systemd-units BuildRequires: systemd
%endif %endif
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%if 0%{?rhel} > 6
# For rpm => 4.9 only: https://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering
%global __requires_exclude ^perl\\((hostnames|lib::mtr|lib::v1|mtr_|My::)
%global __provides_exclude_from ^(/usr/share/(mysql|mysql-test)/.*|%{_libdir}/mysql/plugin/.*\\.so)$
%else
# https://fedoraproject.org/wiki/EPEL:Packaging#Generic_Filtering_on_EPEL6 # https://fedoraproject.org/wiki/EPEL:Packaging#Generic_Filtering_on_EPEL6
%global __perl_provides %{SOURCE90} %global __perl_provides %{SOURCE90}
%global __perl_requires %{SOURCE91} %global __perl_requires %{SOURCE91}
%endif
%description %description
The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
...@@ -132,6 +162,7 @@ Requires: mysql-community-client%{?_isa} = %{version}-%{release} ...@@ -132,6 +162,7 @@ Requires: mysql-community-client%{?_isa} = %{version}-%{release}
Requires: mysql-community-common%{?_isa} = %{version}-%{release} Requires: mysql-community-common%{?_isa} = %{version}-%{release}
%endif %endif
Obsoletes: mysql-server < %{version}-%{release} Obsoletes: mysql-server < %{version}-%{release}
Obsoletes: mariadb-server
Provides: mysql-server = %{version}-%{release} Provides: mysql-server = %{version}-%{release}
Provides: mysql-server%{?_isa} = %{version}-%{release} Provides: mysql-server%{?_isa} = %{version}-%{release}
%if 0%{?systemd} %if 0%{?systemd}
...@@ -175,6 +206,7 @@ Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release} ...@@ -175,6 +206,7 @@ Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release}
Requires: mysql-community-libs%{?_isa} = %{version}-%{release} Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
%endif %endif
Obsoletes: mysql < %{version}-%{release} Obsoletes: mysql < %{version}-%{release}
Obsoletes: mariadb
Provides: mysql = %{version}-%{release} Provides: mysql = %{version}-%{release}
Provides: mysql%{?_isa} = %{version}-%{release} Provides: mysql%{?_isa} = %{version}-%{release}
...@@ -206,6 +238,7 @@ Requires: mysql-enterprise-server%{?_isa} = %{version}-%{release} ...@@ -206,6 +238,7 @@ Requires: mysql-enterprise-server%{?_isa} = %{version}-%{release}
Requires: mysql-community-server%{?_isa} = %{version}-%{release} Requires: mysql-community-server%{?_isa} = %{version}-%{release}
%endif %endif
Obsoletes: mysql-test < %{version}-%{release} Obsoletes: mysql-test < %{version}-%{release}
Obsoletes: mariadb-test
Provides: mysql-test = %{version}-%{release} Provides: mysql-test = %{version}-%{release}
Provides: mysql-test%{?_isa} = %{version}-%{release} Provides: mysql-test%{?_isa} = %{version}-%{release}
...@@ -225,6 +258,7 @@ Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release} ...@@ -225,6 +258,7 @@ Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release}
Requires: mysql-community-libs%{?_isa} = %{version}-%{release} Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
%endif %endif
Obsoletes: mysql-devel < %{version}-%{release} Obsoletes: mysql-devel < %{version}-%{release}
Obsoletes: mariadb-devel
Provides: mysql-devel = %{version}-%{release} Provides: mysql-devel = %{version}-%{release}
Provides: mysql-devel%{?_isa} = %{version}-%{release} Provides: mysql-devel%{?_isa} = %{version}-%{release}
...@@ -242,6 +276,7 @@ Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release} ...@@ -242,6 +276,7 @@ Requires: mysql-enterprise-common%{?_isa} = %{version}-%{release}
Requires: mysql-community-common%{?_isa} = %{version}-%{release} Requires: mysql-community-common%{?_isa} = %{version}-%{release}
%endif %endif
Obsoletes: mysql-libs < %{version}-%{release} Obsoletes: mysql-libs < %{version}-%{release}
Obsoletes: mariadb-libs
Provides: mysql-libs = %{version}-%{release} Provides: mysql-libs = %{version}-%{release}
Provides: mysql-libs%{?_isa} = %{version}-%{release} Provides: mysql-libs%{?_isa} = %{version}-%{release}
...@@ -249,16 +284,18 @@ Provides: mysql-libs%{?_isa} = %{version}-%{release} ...@@ -249,16 +284,18 @@ Provides: mysql-libs%{?_isa} = %{version}-%{release}
This package contains the shared libraries for MySQL client This package contains the shared libraries for MySQL client
applications. applications.
%if 0%{?compatlib}
%package libs-compat %package libs-compat
Summary: Shared compat libraries for MySQL 5.1 database client applications Summary: Shared compat libraries for MySQL %{compatver} database client applications
Group: Applications/Databases Group: Applications/Databases
Obsoletes: mysql-libs-compat < %{version}-%{release} Obsoletes: mysql-libs-compat < %{version}-%{release}
Provides: mysql-libs-compat = %{version}-%{release} Provides: mysql-libs-compat = %{version}-%{release}
Provides: mysql-libs-compat%{?_isa} = %{version}-%{release} Provides: mysql-libs-compat%{?_isa} = %{version}-%{release}
%description libs-compat %description libs-compat
This package contains the shared compat libraries for MySQL 5.1 client This package contains the shared compat libraries for MySQL %{compatver} client
applications. applications.
%endif
%package embedded %package embedded
Summary: MySQL embedded library Summary: MySQL embedded library
...@@ -274,7 +311,7 @@ Provides: mysql-embedded = %{version}-%{release} ...@@ -274,7 +311,7 @@ Provides: mysql-embedded = %{version}-%{release}
Provides: mysql-emdedded%{?_isa} = %{version}-%{release} Provides: mysql-emdedded%{?_isa} = %{version}-%{release}
%description embedded %description embedded
This package contains the mysql server as an embedded library. This package contains the MySQL server as an embedded library.
The embedded MySQL server library makes it possible to run a full-featured The embedded MySQL server library makes it possible to run a full-featured
MySQL server inside the client application. The main benefits are increased MySQL server inside the client application. The main benefits are increased
...@@ -305,8 +342,13 @@ This package contains files needed for developing applicatison using ...@@ -305,8 +342,13 @@ This package contains files needed for developing applicatison using
the embedded version of the MySQL server. the embedded version of the MySQL server.
%prep %prep
%if 0%{?compatlib}
%setup -q -T -a 0 -a 7 -c -n %{src_dir} %setup -q -T -a 0 -a 7 -c -n %{src_dir}
cd %{src_dir} %else
%setup -q -T -a 0 -c -n %{src_dir}
%endif # 0%{?compatlib}
pushd %{src_dir}
%{?el7:%patch0 -p1}
%build %build
# Fail quickly and obviously if user tries to build as root # Fail quickly and obviously if user tries to build as root
...@@ -319,36 +361,49 @@ if [ "x$(id -u)" = "x0" ] ; then ...@@ -319,36 +361,49 @@ if [ "x$(id -u)" = "x0" ] ; then
fi fi
%endif %endif
%if 0%{?compatlib}
# Build compat libs # Build compat libs
( (
export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv" export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv"
export CXXFLAGS="$CFLAGS -felide-constructors -fno-rtti -fno-exceptions" export CXXFLAGS="$CFLAGS %{?el6:-felide-constructors} -fno-rtti -fno-exceptions"
pushd mysql-%{compatver} pushd mysql-%{compatver}
%configure \ %configure \
--with-readline \ --with-readline \
--with-ssl=%{_prefix} \
--without-debug \ --without-debug \
--enable-shared \ --enable-shared \
--with-embedded-server \
--localstatedir=/var/lib/mysql \ --localstatedir=/var/lib/mysql \
--with-unix-socket-path=/var/lib/mysql/mysql.sock \ --with-unix-socket-path=/var/lib/mysql/mysql.sock \
--with-mysqld-user="mysql" \ --with-mysqld-user="mysql" \
--with-extra-charsets=all \ --with-extra-charsets=all \
--enable-local-infile \
--enable-largefile \
--enable-thread-safe-client \
%if 0%{?rhel} == 6
--with-ssl=%{_prefix} \
--with-embedded-server \
--with-big-tables \ --with-big-tables \
--with-pic \ --with-pic \
--with-plugin-innobase \ --with-plugin-innobase \
--with-plugin-innodb_plugin \ --with-plugin-innodb_plugin \
--with-plugin-partition \ --with-plugin-partition \
--enable-local-infile \ %endif
--enable-largefile \ %if 0%{?rhel} == 5
--enable-thread-safe-client \ --with-openssl \
--with-bench \
-with-innodb \
--with-berkeley-db \
--enable-community-features \
--enable-profiling \
--with-named-thread-libs="-lpthread" \
%endif
--disable-dependency-tracking --disable-dependency-tracking
make %{?_smp_mflags} make %{?_smp_mflags}
popd popd
) )
%endif # 0%{?compatlib}
export CFLAGS="%{optflags}" export CFLAGS="%{optflags} %{?el7:-DTAOCRYPT_DISABLE_X86ASM}"
export CXXFLAGS="%{optflags}" export CXXFLAGS="%{optflags} %{?el7:-DTAOCRYPT_DISABLE_X86ASM}"
# Build debug versions of mysqld and libmysqld.a # Build debug versions of mysqld and libmysqld.a
mkdir debug mkdir debug
...@@ -360,12 +415,13 @@ mkdir debug ...@@ -360,12 +415,13 @@ mkdir debug
cmake ../%{src_dir} \ cmake ../%{src_dir} \
-DBUILD_CONFIG=mysql_release \ -DBUILD_CONFIG=mysql_release \
-DINSTALL_LAYOUT=RPM \ -DINSTALL_LAYOUT=RPM \
-DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_BUILD_TYPE=Debug %{?el7:-DENABLE_DTRACE=OFF} \
-DWITH_INNODB_MEMCACHED=1 \
-DINSTALL_LIBDIR="%{_lib}/mysql" \ -DINSTALL_LIBDIR="%{_lib}/mysql" \
-DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \ -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \ -DFEATURE_SET="%{feature_set}" \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_EMBEDDED_SHARED_LIBRARY=1 \
%{?ssl_option} \ %{?ssl_option} \
-DCOMPILATION_COMMENT="%{compilation_comment_debug}" \ -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \
-DMYSQL_SERVER_SUFFIX="%{?server_suffix}" -DMYSQL_SERVER_SUFFIX="%{?server_suffix}"
...@@ -380,38 +436,22 @@ mkdir release ...@@ -380,38 +436,22 @@ mkdir release
cmake ../%{src_dir} \ cmake ../%{src_dir} \
-DBUILD_CONFIG=mysql_release \ -DBUILD_CONFIG=mysql_release \
-DINSTALL_LAYOUT=RPM \ -DINSTALL_LAYOUT=RPM \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo %{?el7:-DENABLE_DTRACE=OFF} \
-DWITH_INNODB_MEMCACHED=1 \
-DINSTALL_LIBDIR="%{_lib}/mysql" \ -DINSTALL_LIBDIR="%{_lib}/mysql" \
-DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \ -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \ -DFEATURE_SET="%{feature_set}" \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_EMBEDDED_SHARED_LIBRARY=1 \
%{?ssl_option} \ %{?ssl_option} \
-DCOMPILATION_COMMENT="%{compilation_comment_release}" \ -DCOMPILATION_COMMENT="%{compilation_comment_release}" \
-DMYSQL_SERVER_SUFFIX="%{?server_suffix}" -DMYSQL_SERVER_SUFFIX="%{?server_suffix}"
echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG
make %{?_smp_mflags} VERBOSE=1 make %{?_smp_mflags} VERBOSE=1
# Need to build libmysqld.so for distros
mkdir libmysqld/work
pushd libmysqld/work
ar -x ../libmysqld.a
[ -e ../../extra/yassl/libyassl.a ] && ar -x ../../extra/yassl/libyassl.a
rm -f sql_binlog.cc.o rpl_utility.cc.o
%{__cc} $CFLAGS $LDFLAGS -DEMBEDDED_LIBRARY -shared -Wl,-soname,libmysqld.so.%{libmysqld_so_major} \
-o libmysqld.so.%{libmysqld_so_long} *.o \
-lpthread -laio -lcrypt -lssl -lcrypto -lz -lrt -lstdc++ -ldl -lm -lc
# Compile check
cp %{SOURCE6} .
ln -s libmysqld.so.%{libmysqld_so_long} libmysqld.so.%{libmysqld_so_major}
%{__cc} -I../../../%{src_dir}/include -I../../include $CFLAGS \
mysql-embedded-check.c libmysqld.so.%{libmysqld_so_major}
LD_LIBRARY_PATH=. ldd ./a.out
) )
%install %install
%if 0%{?compatlib}
# Install compat libs # Install compat libs
for dir in libmysql libmysql_r ; do for dir in libmysql libmysql_r ; do
pushd mysql-%{compatver}/$dir pushd mysql-%{compatver}/$dir
...@@ -419,6 +459,7 @@ for dir in libmysql libmysql_r ; do ...@@ -419,6 +459,7 @@ for dir in libmysql libmysql_r ; do
popd popd
done done
rm -f %{buildroot}%{_libdir}/mysql/libmysqlclient{,_r}.{a,la,so} rm -f %{buildroot}%{_libdir}/mysql/libmysqlclient{,_r}.{a,la,so}
%endif # 0%{?compatlib}
MBD=$RPM_BUILD_DIR/%{src_dir} MBD=$RPM_BUILD_DIR/%{src_dir}
...@@ -442,12 +483,6 @@ install -D -m 0755 $MBD/release/packaging/rpm-oel/mysql.init %{buildroot}%{_sysc ...@@ -442,12 +483,6 @@ install -D -m 0755 $MBD/release/packaging/rpm-oel/mysql.init %{buildroot}%{_sysc
%endif %endif
install -D -m 0644 %{SOURCE3} %{buildroot}%{_prefix}/lib/tmpfiles.d/mysql.conf install -D -m 0644 %{SOURCE3} %{buildroot}%{_prefix}/lib/tmpfiles.d/mysql.conf
install -m 0755 $MBD/release/libmysqld/work/libmysqld.so.%{libmysqld_so_long} \
%{buildroot}%{_libdir}/mysql/libmysqld.so.%{libmysqld_so_long}
ln -s libmysqld.so.%{libmysqld_so_long} %{buildroot}%{_libdir}/mysql/libmysqld.so.%{libmysqld_so_major}
ln -s libmysqld.so.%{libmysqld_so_long} %{buildroot}%{_libdir}/mysql/libmysqld.so
# Make library links # Make library links
install -d -m 0755 %{buildroot}%{_sysconfdir}/ld.so.conf.d install -d -m 0755 %{buildroot}%{_sysconfdir}/ld.so.conf.d
echo "%{_libdir}/mysql" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf echo "%{_libdir}/mysql" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf
...@@ -489,8 +524,9 @@ pushd mysql-test ...@@ -489,8 +524,9 @@ pushd mysql-test
./mtr \ ./mtr \
--mem --parallel=auto --force --retry=0 \ --mem --parallel=auto --force --retry=0 \
--mysqld=--binlog-format=mixed \ --mysqld=--binlog-format=mixed \
--suite-timeout=720 --testcase-timeout=30 --suite-timeout=720 --testcase-timeout=30 \
rm -rf var/* --clean-vardir
rm -r $(readlink var) var
%endif %endif
%pre server %pre server
...@@ -532,9 +568,11 @@ fi ...@@ -532,9 +568,11 @@ fi
%postun libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig
%if 0%{?compatlib}
%post libs-compat -p /sbin/ldconfig %post libs-compat -p /sbin/ldconfig
%postun libs-compat -p /sbin/ldconfig %postun libs-compat -p /sbin/ldconfig
%endif
%post embedded -p /sbin/ldconfig %post embedded -p /sbin/ldconfig
...@@ -617,7 +655,7 @@ fi ...@@ -617,7 +655,7 @@ fi
%attr(644, root, root) %{_datadir}/mysql/magic %attr(644, root, root) %{_datadir}/mysql/magic
%attr(644, root, root) %{_prefix}/lib/tmpfiles.d/mysql.conf %attr(644, root, root) %{_prefix}/lib/tmpfiles.d/mysql.conf
%if 0%{?systemd} %if 0%{?systemd}
%attr(644, root, root) %{_unitdir}/mysql.service %attr(644, root, root) %{_unitdir}/mysqld.service
%else %else
%attr(755, root, root) %{_sysconfdir}/init.d/mysqld %attr(755, root, root) %{_sysconfdir}/init.d/mysqld
%endif %endif
...@@ -706,14 +744,16 @@ fi ...@@ -706,14 +744,16 @@ fi
%{_libdir}/mysql/libmysqlclient.so.18* %{_libdir}/mysql/libmysqlclient.so.18*
%{_libdir}/mysql/libmysqlclient_r.so.18* %{_libdir}/mysql/libmysqlclient_r.so.18*
%if 0%{?compatlib}
%files libs-compat %files libs-compat
%defattr(-, root, root, -) %defattr(-, root, root, -)
%dir %attr(755, root, root) %{_libdir}/mysql %dir %attr(755, root, root) %{_libdir}/mysql
%attr(644, root, root) %{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf %attr(644, root, root) %{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf
%{_libdir}/mysql/libmysqlclient.so.16 %{_libdir}/mysql/libmysqlclient.so.%{compatlib}
%{_libdir}/mysql/libmysqlclient.so.16.0.0 %{_libdir}/mysql/libmysqlclient.so.%{compatlib}.0.0
%{_libdir}/mysql/libmysqlclient_r.so.16 %{_libdir}/mysql/libmysqlclient_r.so.%{compatlib}
%{_libdir}/mysql/libmysqlclient_r.so.16.0.0 %{_libdir}/mysql/libmysqlclient_r.so.%{compatlib}.0.0
%endif
%files test %files test
%defattr(-, root, root, -) %defattr(-, root, root, -)
...@@ -731,7 +771,7 @@ fi ...@@ -731,7 +771,7 @@ fi
%defattr(-, root, root, -) %defattr(-, root, root, -)
%dir %attr(755, root, root) %{_libdir}/mysql %dir %attr(755, root, root) %{_libdir}/mysql
%attr(644, root, root) %{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf %attr(644, root, root) %{_sysconfdir}/ld.so.conf.d/mysql-%{_arch}.conf
%attr(644, root, root) %{_libdir}/mysql/libmysqld.so.* %attr(755, root, root) %{_libdir}/mysql/libmysqld.so.*
%files embedded-devel %files embedded-devel
%defattr(-, root, root, -) %defattr(-, root, root, -)
...@@ -740,65 +780,12 @@ fi ...@@ -740,65 +780,12 @@ fi
%attr(755, root, root) %{_libdir}/mysql/libmysqld.so %attr(755, root, root) %{_libdir}/mysql/libmysqld.so
%changelog %changelog
* Fri Oct 25 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.15-1 * Mon Feb 10 2014 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.5.37-1
- Fixed uln advanced rpm libyassl.a error - Add support for el7 (with systemd enabled)
- Updated to 5.6.15 - Enable shared libmysqld by cmake option
* Wed Oct 16 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.14-3
- Fixed mysql_install_db usage
- Improved handling of plugin directory
* Fri Sep 27 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.14-2
- Refresh mysql-install patch and service renaming
* Mon Sep 16 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.14-1
- Updated to 5.6.14
* Wed Sep 04 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.13-5
- Support upgrade from 5.5 ULN packages to 5.6
* Tue Aug 27 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.13-4
- Enhanced perl filtering
- Added openssl-devel to buildreq
* Wed Aug 21 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.13-3
- Removed mysql_embedded binary to resolve multilib conflict issue
* Fri Aug 16 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.13-2
- Fixed Provides and Obsoletes issues in server, test packages
* Wed Aug 14 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.13-1
- Updated to 5.6.13
* Mon Aug 05 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-9
- Added files list to embedded packages
* Thu Aug 01 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-8
- Updated libmysqld.a with libmysqld.so in embedded package
* Mon Jul 29 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-7
- Updated test package dependency from client to server
* Wed Jul 24 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-6
- Added libs-compat dependency under libs package to resolve server
installation conflicts issue.
* Wed Jul 17 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-5
- Removed libmysqlclient.so.16 from libs package
* Fri Jul 05 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-4
- Adjusted to work on OEL6
* Wed Jun 26 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-3
- Move libs to mysql/
- Basic multi arch support
- Fix changelog dates
* Thu Jun 20 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-2
- Major cleanup
* Tue Jun 04 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.12-1 * Fri Oct 25 2013 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.5.35-1
- Updated to 5.6.12 - Backport changes from 5.6
* Mon Nov 05 2012 Joerg Bruehe <joerg.bruehe@oracle.com> * Mon Nov 05 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
...@@ -879,7 +866,7 @@ fi ...@@ -879,7 +866,7 @@ fi
* Fri Aug 19 2011 Joerg Bruehe <joerg.bruehe@oracle.com> * Fri Aug 19 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Null-upmerge the fix of bug#37165: This spec file is not affected. - Null-upmerge the fix of bug#37165: This spec file is not affected.
- Replace "/var/lib/mysql" by the spec file variable "%{mysqldatadir}". - Replace "/var/lib/mysql" by the spec file variable "%%{mysqldatadir}".
* Fri Aug 12 2011 Daniel Fischer <daniel.fischer@oracle.com> * Fri Aug 12 2011 Daniel Fischer <daniel.fischer@oracle.com>
...@@ -1139,7 +1126,7 @@ fi ...@@ -1139,7 +1126,7 @@ fi
* Thu Nov 30 2006 Joerg Bruehe <joerg@mysql.com> * Thu Nov 30 2006 Joerg Bruehe <joerg@mysql.com>
- Call "make install" using "benchdir_root=%{_datadir}", - Call "make install" using "benchdir_root=%%{_datadir}",
because that is affecting the regression test suite as well. because that is affecting the regression test suite as well.
* Thu Nov 16 2006 Joerg Bruehe <joerg@mysql.com> * Thu Nov 16 2006 Joerg Bruehe <joerg@mysql.com>
...@@ -1235,7 +1222,7 @@ fi ...@@ -1235,7 +1222,7 @@ fi
- Added zlib to the list of (static) libraries installed - Added zlib to the list of (static) libraries installed
- Added check against libtool wierdness (WRT: sql/mysqld || sql/.libs/mysqld) - Added check against libtool wierdness (WRT: sql/mysqld || sql/.libs/mysqld)
- Compile MySQL with bundled zlib - Compile MySQL with bundled zlib
- Fixed %packager name to "MySQL Production Engineering Team" - Fixed %%packager name to "MySQL Production Engineering Team"
* Mon Dec 05 2005 Joerg Bruehe <joerg@mysql.com> * Mon Dec 05 2005 Joerg Bruehe <joerg@mysql.com>
...@@ -1266,7 +1253,7 @@ fi ...@@ -1266,7 +1253,7 @@ fi
- Give mode arguments the same way in all places - Give mode arguments the same way in all places
lenz@mysql.com> lenz@mysql.com>
- fixed the removing of the RPM_BUILD_ROOT in the %clean section (the - fixed the removing of the RPM_BUILD_ROOT in the %%clean section (the
$RBR variable did not get expanded, thus leaving old build roots behind) $RBR variable did not get expanded, thus leaving old build roots behind)
* Thu Aug 04 2005 Lenz Grimmer <lenz@mysql.com> * Thu Aug 04 2005 Lenz Grimmer <lenz@mysql.com>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment