diff --git a/.mysql-connector-odbc.metadata b/.mysql-connector-odbc.metadata new file mode 100644 index 0000000..ffde255 --- /dev/null +++ b/.mysql-connector-odbc.metadata @@ -0,0 +1,2 @@ +c8dabdda0faa89f7e1225fa367aedc9b1da7ae80 SOURCES/mysql-connector-odbc-5.2.5-src.tar.gz +7ad2042f853f0fd5852f2208520ae1571d4594ec SOURCES/mysql-mysys.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/myodbc-64bit.patch b/SOURCES/myodbc-64bit.patch new file mode 100644 index 0000000..3e8e1eb --- /dev/null +++ b/SOURCES/myodbc-64bit.patch @@ -0,0 +1,66 @@ +Fix some 64-bitness issues arising from unixODBC 2.2.14 changes. + +diff -up mysql-connector-odbc-5.2.4-src/driver/utility.c.p3 mysql-connector-odbc-5.2.4-src/driver/utility.c +--- mysql-connector-odbc-5.2.4-src/driver/utility.c.p3 2013-01-24 18:43:33.000000000 +0100 ++++ mysql-connector-odbc-5.2.4-src/driver/utility.c 2013-02-22 13:22:14.142767103 +0100 +@@ -1219,7 +1219,7 @@ SQLLEN fill_display_size_buff(char *buff + { + /* See comment for fill_transfer_oct_len_buff()*/ + SQLLEN size= get_display_size(stmt, field); +- sprintf(buff,size == SQL_NO_TOTAL ? "%d" : (sizeof(SQLLEN) == 4 ? "%lu" : "%lld"), size); ++ sprintf(buff, (size == SQL_NO_TOTAL ? "%ld" : "%lu"), size); + + return size; + } +@@ -1242,7 +1242,7 @@ SQLLEN fill_transfer_oct_len_buff(char * + */ + SQLLEN len= get_transfer_octet_length(stmt, field); + +- sprintf(buff, len == SQL_NO_TOTAL ? "%d" : (sizeof(SQLLEN) == 4 ? "%lu" : "%lld"), len ); ++ sprintf(buff, (len == SQL_NO_TOTAL ? "%ld" : "%lu"), len ); + + return len; + } +@@ -1259,8 +1259,7 @@ SQLLEN fill_transfer_oct_len_buff(char * + SQLULEN fill_column_size_buff(char *buff, STMT *stmt, MYSQL_FIELD *field) + { + SQLULEN size= get_column_size(stmt, field); +- sprintf(buff, (size== SQL_NO_TOTAL ? "%d" : +- (sizeof(SQLULEN) == 4 ? "%lu" : "%llu")), size); ++ sprintf(buff, (size== SQL_NO_TOTAL ? "%ld" : "%lu"), size); + return size; + } + +diff -up mysql-connector-odbc-5.2.4-src/test/my_catalog1.c.p3 mysql-connector-odbc-5.2.4-src/test/my_catalog1.c +--- mysql-connector-odbc-5.2.4-src/test/my_catalog1.c.p3 2013-02-22 13:23:30.260761898 +0100 ++++ mysql-connector-odbc-5.2.4-src/test/my_catalog1.c 2013-02-22 13:25:08.554755176 +0100 +@@ -623,7 +623,7 @@ DECLARE_TEST(t_tables_bug) + fprintf(stdout, "# Column Name : %s\n", szColName); + fprintf(stdout, "# NameLengh : %d\n", pcbColName); + fprintf(stdout, "# DataType : %d\n", pfSqlType); +- fprintf(stdout, "# ColumnSize : %d\n", pcbColDef); ++ fprintf(stdout, "# ColumnSize : %ld\n", pcbColDef); + fprintf(stdout, "# DecimalDigits : %d\n", pibScale); + fprintf(stdout, "# Nullable : %d\n", pfNullable); + +diff -up mysql-connector-odbc-5.2.4-src/test/my_cursor.c.p3 mysql-connector-odbc-5.2.4-src/test/my_cursor.c +--- mysql-connector-odbc-5.2.4-src/test/my_cursor.c.p3 2013-01-24 18:43:33.000000000 +0100 ++++ mysql-connector-odbc-5.2.4-src/test/my_cursor.c 2013-02-22 13:22:16.812766920 +0100 +@@ -711,7 +711,7 @@ DECLARE_TEST(t_pos_datetime_delete1) + + rc = SQLRowCount(hstmt1,&row_count); + mystmt(hstmt1,rc); +- fprintf(stdout, "rows affected: %d\n", row_count); ++ fprintf(stdout, "rows affected: %ld\n", row_count); + myassert(row_count == 1); + + rc = SQLExtendedFetch(hstmt,SQL_FETCH_NEXT,1,NULL,&rgfRowStatus); +@@ -732,7 +732,7 @@ DECLARE_TEST(t_pos_datetime_delete1) + + rc = SQLRowCount(hstmt1,&row_count); + mystmt(hstmt1,rc); +- fprintf(stdout, "rows affected: %d\n", row_count); ++ fprintf(stdout, "rows affected: %ld\n", row_count); + myassert(row_count == 1); + + SQLFreeStmt(hstmt,SQL_UNBIND); diff --git a/SOURCES/myodbc-add-mysys.patch b/SOURCES/myodbc-add-mysys.patch new file mode 100644 index 0000000..7f1efa5 --- /dev/null +++ b/SOURCES/myodbc-add-mysys.patch @@ -0,0 +1,31 @@ +Add files extracted from mysql into the driver build script. + +diff -up mysql-connector-odbc-5.2.4-src/util/CMakeLists.txt.mysys mysql-connector-odbc-5.2.4-src/util/CMakeLists.txt +--- mysql-connector-odbc-5.2.4-src/util/CMakeLists.txt.mysys 2013-01-24 18:43:33.000000000 +0100 ++++ mysql-connector-odbc-5.2.4-src/util/CMakeLists.txt 2013-03-25 19:17:17.320764909 +0100 +@@ -26,7 +26,24 @@ SET(myodbc3u_SRCS stringutil.c + stringutil.h + unicode_transcode.c + installer.c +- installer.h) ++ installer.h ++ array.c ++ list.c ++ my_alloc.c ++ my_malloc.c ++ string.c ++ int2str.c ++ is_prefix.c ++ longlong2str.c ++ strcend.c ++ strend.c ++ strfill.c ++ strmake.c ++ strmov.c ++ strxmov.c ++ mysys_err.h ++ mysys_priv.h ++) + + IF(NOT WIN32) + SET(myodbc3u_SRCS ${myodbc3u_SRCS} diff --git a/SOURCES/myodbc-libdir.patch b/SOURCES/myodbc-libdir.patch new file mode 100644 index 0000000..5ecf2bb --- /dev/null +++ b/SOURCES/myodbc-libdir.patch @@ -0,0 +1,12 @@ +diff -up mysql-connector-odbc-5.2.4-src/CMakeLists.txt.libdir mysql-connector-odbc-5.2.4-src/CMakeLists.txt +--- mysql-connector-odbc-5.2.4-src/CMakeLists.txt.libdir 2013-04-03 02:18:49.002164793 -0400 ++++ mysql-connector-odbc-5.2.4-src/CMakeLists.txt 2013-04-03 03:05:55.840694007 -0400 +@@ -228,7 +228,7 @@ SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINA + SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib") + + SET(LIB_SUBDIR "lib") +-IF(RPM_BUILD AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") ++IF(RPM_BUILD AND CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|ppc64|ppc64p7|s390x|sparc64)") + SET(LIB_SUBDIR "lib64") + ENDIF() + diff --git a/SOURCES/myodbc-libname.patch b/SOURCES/myodbc-libname.patch new file mode 100644 index 0000000..987da14 --- /dev/null +++ b/SOURCES/myodbc-libname.patch @@ -0,0 +1,24 @@ +We use only mysqlclient library, but upstream still tends to use mysqlclient_r, +so we need to change the library we link against. + +diff -up mysql-connector-odbc-5.2.4-src/cmake/FindMySQL.cmake.p1 mysql-connector-odbc-5.2.4-src/cmake/FindMySQL.cmake +--- mysql-connector-odbc-5.2.4-src/cmake/FindMySQL.cmake.p1 2013-01-24 18:43:33.000000000 +0100 ++++ mysql-connector-odbc-5.2.4-src/cmake/FindMySQL.cmake 2013-02-25 16:30:07.458164848 +0100 +@@ -64,7 +64,7 @@ IF (WIN32) + $ENV{ProgramFiles}/MySQL/*/lib + $ENV{SystemDrive}/MySQL/*/lib/${libsuffixDist}) + ELSE (WIN32) +- FIND_LIBRARY(MYSQL_LIB NAMES mysqlclient_r ++ FIND_LIBRARY(MYSQL_LIB NAMES mysqlclient + PATHS + $ENV{MYSQL_DIR}/libmysql_r/.libs + $ENV{MYSQL_DIR}/lib +@@ -93,7 +93,7 @@ IF (MYSQL_INCLUDE_DIR AND MYSQL_LIB_DIR) + IF (WIN32) + SET(MYSQL_CLIENT_LIBS mysqlclient) + ELSE (WIN32) +- SET(MYSQL_CLIENT_LIBS mysqlclient_r) ++ SET(MYSQL_CLIENT_LIBS mysqlclient) + ENDIF (WIN32) + IF (MYSQL_ZLIB) + SET(MYSQL_CLIENT_LIBS ${MYSQL_CLIENT_LIBS} zlib) diff --git a/SOURCES/myodbc-maria.patch b/SOURCES/myodbc-maria.patch new file mode 100644 index 0000000..91c2824 --- /dev/null +++ b/SOURCES/myodbc-maria.patch @@ -0,0 +1,30 @@ +MariaDB has slightly changed data types of some variables, so we need to reflect +that in own local copy of mysys files. + +diff -up mysql-connector-odbc-5.1.11-src/util/array.c.maria mysql-connector-odbc-5.1.11-src/util/array.c +--- mysql-connector-odbc-5.1.11-src/util/array.c.maria 2013-02-22 11:51:24.627139740 +0100 ++++ mysql-connector-odbc-5.1.11-src/util/array.c 2013-02-22 11:53:27.766131320 +0100 +@@ -92,7 +92,7 @@ my_bool init_dynamic_array(DYNAMIC_ARRAY + FALSE Ok + */ + +-my_bool insert_dynamic(DYNAMIC_ARRAY *array, uchar* element) ++my_bool insert_dynamic(DYNAMIC_ARRAY *array, const uchar* element) + { + uchar* buffer; + if (array->elements == array->max_element) +diff -up mysql-connector-odbc-5.1.11-src/util/int2str.c.maria mysql-connector-odbc-5.1.11-src/util/int2str.c +--- mysql-connector-odbc-5.1.11-src/util/int2str.c.maria 2013-02-22 12:00:37.188101956 +0100 ++++ mysql-connector-odbc-5.1.11-src/util/int2str.c 2013-02-22 12:00:44.097101484 +0100 +@@ -19,9 +19,9 @@ + /* + _dig_vec arrays are public because they are used in several outer places. + */ +-char _dig_vec_upper[] = ++const char _dig_vec_upper[] = + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; +-char _dig_vec_lower[] = ++const char _dig_vec_lower[] = + "0123456789abcdefghijklmnopqrstuvwxyz"; + + diff --git a/SOURCES/myodbc-movecmpfunc.patch b/SOURCES/myodbc-movecmpfunc.patch new file mode 100644 index 0000000..ddca78c --- /dev/null +++ b/SOURCES/myodbc-movecmpfunc.patch @@ -0,0 +1,104 @@ +The symbol my_charset_latin1 is not exported, but upstream uses it probably, +since they use some weird environment with mysql buildroot. Anyway, it is only +used only for case-insensitive comparison of encoding identificators, which +should include only ASCII chars. So we really don't need any charset +information and can use simple case-insensitive strcmp. + +However, the only function doing that is defined at driver/utility.c so it +would be better to move it to util/stringutil.c and have it available as +a general purpose function. That's basically what this patch does. + +diff -up mysql-connector-odbc-5.2.4-src/driver/utility.c.p5 mysql-connector-odbc-5.2.4-src/driver/utility.c +--- mysql-connector-odbc-5.2.4-src/driver/utility.c.p5 2013-02-25 14:37:53.459350162 +0100 ++++ mysql-connector-odbc-5.2.4-src/driver/utility.c 2013-02-25 14:37:53.494350161 +0100 +@@ -2239,33 +2239,6 @@ my_bool reget_current_catalog(DBC FAR *d + + + /* +- @type : myodbc internal +- @purpose : compare strings without regarding to case +-*/ +- +-int myodbc_strcasecmp(const char *s, const char *t) +-{ +- while (toupper((uchar) *s) == toupper((uchar) *t++)) +- if (!*s++) +- return 0; +- return((int) toupper((uchar) s[0]) - (int) toupper((uchar) t[-1])); +-} +- +- +-/* +- @type : myodbc internal +- @purpose : compare strings without regarding to case +-*/ +- +-int myodbc_casecmp(const char *s, const char *t, uint len) +-{ +- while (len-- != 0 && toupper(*s++) == toupper(*t++)) +- ; +- return (int)len + 1; +-} +- +- +-/* + @type : myodbc3 internal + @purpose : logs the queries sent to server + */ +diff -up mysql-connector-odbc-5.2.4-src/util/stringutil.c.p5 mysql-connector-odbc-5.2.4-src/util/stringutil.c +--- mysql-connector-odbc-5.2.4-src/util/stringutil.c.p5 2013-01-24 18:43:33.000000000 +0100 ++++ mysql-connector-odbc-5.2.4-src/util/stringutil.c 2013-02-25 14:38:37.263348956 +0100 +@@ -905,13 +906,40 @@ static const MY_CSET_OS_NAME charsets[]= + }; + + ++/* ++ * @type : myodbc internal ++ * @purpose : compare strings without regarding to case ++ */ ++ ++int myodbc_strcasecmp(const char *s, const char *t) ++{ ++ while (toupper(*s) == toupper(*t++)) ++ if (!*s++) ++ return 0; ++ return((int) toupper(s[0]) - (int) toupper(t[-1])); ++} ++ ++ ++/* ++ @type : myodbc internal ++ @purpose : compare strings without regarding to case ++*/ ++ ++int myodbc_casecmp(const char *s, const char *t, uint len) ++{ ++ while (len-- != 0 && toupper(*s++) == toupper(*t++)) ++ ; ++ return (int)len + 1; ++} ++ ++ + const char * + my_os_charset_to_mysql_charset(const char *csname) + { + const MY_CSET_OS_NAME *csp; + for (csp= charsets; csp->os_name; ++csp) + { +- if (!my_strcasecmp(&my_charset_latin1, csp->os_name, csname)) ++ if (!myodbc_strcasecmp(csp->os_name, csname)) + { + switch (csp->param) + { +diff -up mysql-connector-odbc-5.2.4-src/util/stringutil.h.p5 mysql-connector-odbc-5.2.4-src/util/stringutil.h +--- mysql-connector-odbc-5.2.4-src/util/stringutil.h.p5 2013-01-24 18:43:33.000000000 +0100 ++++ mysql-connector-odbc-5.2.4-src/util/stringutil.h 2013-02-25 14:37:53.498350161 +0100 +@@ -117,6 +117,8 @@ size_t sqlwcharncat2(SQLWCHAR *dest, con + SQLWCHAR *sqlwcharncpy(SQLWCHAR *dest, const SQLWCHAR *src, size_t n); + + char * myodbc_strlwr(char *target, size_t len); ++int myodbc_strcasecmp(const char *s, const char *t); ++int myodbc_casecmp(const char *s, const char *t, uint len); + #ifdef __cplusplus + } + #endif diff --git a/SOURCES/myodbc-shutdown.patch b/SOURCES/myodbc-shutdown.patch new file mode 100644 index 0000000..424774d --- /dev/null +++ b/SOURCES/myodbc-shutdown.patch @@ -0,0 +1,27 @@ +myodbc_end is really only usable during Windows DLL unload, since it's not +connection-specific and not thread-safe either. This bit of brain fade +accounts for our bug #185343 and several bugs filed at mysql.com. + +Furthermore, my_end() isn't exported from libmysqlclient anymore. +Hence, best fix is to turn the function into a no-op. + + +diff -Naur mysql-connector-odbc-5.1.9.orig/driver/dll.c mysql-connector-odbc-5.1.9/driver/dll.c +--- mysql-connector-odbc-5.1.9.orig/driver/dll.c 2011-10-04 16:19:00.000000000 -0400 ++++ mysql-connector-odbc-5.1.9/driver/dll.c 2012-01-10 15:56:41.988087855 -0500 +@@ -94,6 +94,7 @@ + */ + void myodbc_end() + { ++#if 0 + if (!--myodbc_inited) + { + x_free(decimal_point); +@@ -121,6 +122,7 @@ + my_end(0); + #endif + } ++#endif + } + + diff --git a/SOURCES/mysql-connector-odbc-buffsize.patch b/SOURCES/mysql-connector-odbc-buffsize.patch new file mode 100644 index 0000000..9219d58 --- /dev/null +++ b/SOURCES/mysql-connector-odbc-buffsize.patch @@ -0,0 +1,15 @@ +It seems the buffer size is not sufficient in some situations, so we enlarge it as sanity fix. +RHBZ#948619 + +diff -up mysql-connector-odbc-5.2.5-src/driver/catalog.c.buffsize mysql-connector-odbc-5.2.5-src/driver/catalog.c +--- mysql-connector-odbc-5.2.5-src/driver/catalog.c.buffsize 2013-05-24 14:13:00.148674573 +0200 ++++ mysql-connector-odbc-5.2.5-src/driver/catalog.c 2013-05-24 14:13:14.338674325 +0200 +@@ -153,7 +153,7 @@ static MYSQL_RES *mysql_table_status_i_s + { + MYSQL *mysql= &stmt->dbc->mysql; + /** the buffer size should count possible escapes */ +- char buff[255+4*NAME_CHAR_LEN], *to; ++ char buff[1024+4*NAME_CHAR_LEN], *to; + my_bool clause_added= FALSE; + + to= strmov(buff, "SELECT TABLE_NAME, TABLE_COMMENT, TABLE_TYPE, TABLE_SCHEMA \ diff --git a/SOURCES/mysql-connector-odbc-cleartext.patch b/SOURCES/mysql-connector-odbc-cleartext.patch new file mode 100644 index 0000000..83e7d2e --- /dev/null +++ b/SOURCES/mysql-connector-odbc-cleartext.patch @@ -0,0 +1,18 @@ +MySQL added a new connection option MYSQL_ENABLE_CLEARTEXT_PLUGIN and believes +that it is there in every version > 5.5.27. However, it is not in mariadb-5.5.31, +so we cannot use it. + +MariaDB upstream report: https://mariadb.atlassian.net/browse/MDEV-4573 + +diff -up mysql-connector-odbc-5.2.5-src/driver/connect.c.cleartext mysql-connector-odbc-5.2.5-src/driver/connect.c +--- mysql-connector-odbc-5.2.5-src/driver/connect.c.cleartext 2013-05-24 15:57:18.954565190 +0200 ++++ mysql-connector-odbc-5.2.5-src/driver/connect.c 2013-05-24 15:58:03.194564417 +0200 +@@ -257,7 +257,7 @@ SQLRETURN myodbc_do_connect(DBC *dbc, Da + } + #endif + +-#if (MYSQL_VERSION_ID >= 50527 && MYSQL_VERSION_ID < 50600) || MYSQL_VERSION_ID >= 50607 ++#if ((MYSQL_VERSION_ID >= 50527 && MYSQL_VERSION_ID < 50600) || MYSQL_VERSION_ID >= 50607) && defined (MYSQL_ENABLE_CLEARTEXT_PLUGIN) + if (ds->enable_cleartext_plugin) + { + mysql_options(mysql, MYSQL_ENABLE_CLEARTEXT_PLUGIN, (char *)&on); diff --git a/SOURCES/mysql-connector-odbc-cond.patch b/SOURCES/mysql-connector-odbc-cond.patch new file mode 100644 index 0000000..ece8302 --- /dev/null +++ b/SOURCES/mysql-connector-odbc-cond.patch @@ -0,0 +1,26 @@ +When looking for a terminating null character that isn't there and apparently +isn't supposed to be there as the length of the string is kept in a separate +variable. The code then tries to avoid a disaster by doing the right test after +it has done the wrong test, but with a bit of bad luck the out-of-bounds read +could cause a segmentation fault. Even if the error wouldn't affect the +operation of the code, fixing it will save programmers from wasting their time +chasing false alarms. + +This patch reverses the order of the two tests. I suppose checking for null +characters is OK as an additional safety measure, but it needs to be done +conditionally after the length test to avoid an out-of-bounds read. + +Upstream bug report: http://bugs.mysql.com/bug.php?id=64105 + +diff -up mysql-connector-odbc-5.2.5-src/util/stringutil.c.cond mysql-connector-odbc-5.2.5-src/util/stringutil.c +--- mysql-connector-odbc-5.2.5-src/util/stringutil.c.cond 2013-06-17 08:45:54.382640969 +0200 ++++ mysql-connector-odbc-5.2.5-src/util/stringutil.c 2013-06-17 08:45:58.084640903 +0200 +@@ -94,7 +94,7 @@ SQLWCHAR *sqlchar_as_sqlwchar(CHARSET_IN + return NULL; + } + +- for (pos= str, i= 0; *pos && pos < str_end; ) ++ for (pos= str, i= 0; pos < str_end && *pos; ) + { + if (sizeof(SQLWCHAR) == 4) + { diff --git a/SPECS/mysql-connector-odbc.spec b/SPECS/mysql-connector-odbc.spec new file mode 100644 index 0000000..41af4df --- /dev/null +++ b/SPECS/mysql-connector-odbc.spec @@ -0,0 +1,209 @@ +Summary: ODBC driver for MySQL +Name: mysql-connector-odbc +Version: 5.2.5 +Release: 2%{?dist} +Group: System Environment/Libraries +URL: http://dev.mysql.com/downloads/connector/odbc/ +# exceptions allow library to be linked with most open source SW, +# not only GPL code. +License: GPLv2 with exceptions + +# Upstream has a mirror redirector for downloads, so the URL is hard to +# represent statically. You can get the tarball by following a link from +# http://dev.mysql.com/downloads/connector/odbc/ +Source0: %{name}-%{version}-src.tar.gz + +# mysql-connector-odbc expects to be able to get at a bunch of utility +# functions inside libmysqlclient. Now that we are restricting what symbols +# are exported by libmysqlclient, that doesn't work. Instead, copy those +# functions here. mysql and mysql-connector-odbc are published under the same +# license, so this creates no legal issues. (Note: we don't worry about +# polluting application namespace in mysql-connector-odbc, since it's never +# directly statically linked with any application code.) +Source1: mysql-mysys.tar.gz + +Patch1: myodbc-add-mysys.patch +Patch2: myodbc-shutdown.patch +Patch3: myodbc-64bit.patch +Patch4: myodbc-maria.patch +Patch5: myodbc-movecmpfunc.patch +Patch6: myodbc-libname.patch +Patch7: myodbc-libdir.patch +Patch8: mysql-connector-odbc-buffsize.patch +Patch9: mysql-connector-odbc-cleartext.patch +Patch10: mysql-connector-odbc-cond.patch + +BuildRequires: mysql-devel unixODBC-devel +BuildRequires: cmake +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root + +%description +An ODBC (rev 3) driver for MySQL, for use with unixODBC. + +%prep +%setup -q -n %{name}-%{version}-src + +tar xfz %{SOURCE1} + +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 + +%build +# mysql 5.5.10 has stopped #define'ing THREAD in its exports, and has +# started #define'ing MY_PTHREAD_FASTMUTEX, and neither of those changes +# sit well with mysql-connector-odbc 5.1.10. Revisit need for these hacks +# when updating to newer release. +export CFLAGS="%{optflags} -fno-strict-aliasing -DTHREAD=1 -UMY_PTHREAD_FASTMUTEX -DDBUG_OFF" + +cmake . -G "Unix Makefiles" \ + -DWITH_UNIXODBC=1 \ + -DRPM_BUILD=1 \ + -DCMAKE_INSTALL_PREFIX="%{_prefix}" + +make %{?_smp_mflags} VERBOSE=1 + +%install +export tagname=CC +make DESTDIR=$RPM_BUILD_ROOT install + +# Remove stuff not to be packaged (possibly reconsider later) +rm -f $RPM_BUILD_ROOT%{_bindir}/myodbc-installer + +rm -f $RPM_BUILD_ROOT/usr/COPYING +rm -f $RPM_BUILD_ROOT/usr/README +rm -f $RPM_BUILD_ROOT/usr/README.debug +rm -f $RPM_BUILD_ROOT/usr/ChangeLog +rm -f $RPM_BUILD_ROOT/usr/INSTALL +rm -f $RPM_BUILD_ROOT/usr/Licenses_for_Third-Party_Components.txt + +# Create a symlink for library to offer name that users are used to +ln -sf libmyodbc5w.so $RPM_BUILD_ROOT%{_libdir}/libmyodbc5.so + +# Upstream provides a test suite with functional and regression tests. +# However, some tests fail, so it would deserve some more investigation. +# We don't include the test suite until it works fine. +rm -rf $RPM_BUILD_ROOT/usr/test + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%doc README README.debug ChangeLog COPYING +%{_libdir}/lib*so + +%changelog +* Mon Jun 17 2013 Honza Horak - 5.2.5-2 +- Avoid potential segfault + Resolves: #974794 + +* Fri May 24 2013 Honza Horak - 5.2.5-1 +- Update to 5.2.5 +- Enlarge buffer size for query string when getting info about tables + Related: #948619 + +* Wed Apr 3 2013 Honza Horak - 5.2.4-2 +- Fix libdir in cmake for ppc64 + +* Tue Mar 5 2013 Honza Horak - 5.2.4-1 +- Update to 5.2.4 + +* Fri Mar 1 2013 Honza Horak - 5.1.11-3 +- Fix data types for mariadb + +* Thu Feb 14 2013 Fedora Release Engineering - 5.1.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sun Jul 22 2012 Tom Lane 5.1.11-1 +- Update to 5.1.11 + +* Fri Jul 20 2012 Fedora Release Engineering - 5.1.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sun Feb 5 2012 Tom Lane 5.1.10-1 +- Update to 5.1.10 + +* Tue Jan 10 2012 Tom Lane 5.1.9-1 +- Update to 5.1.9 +- Add --with-unixODBC-libs to configure command for safer multilib behavior +Related: #757088 + +* Wed Mar 23 2011 Tom Lane 5.1.8-3 +- Rebuild for libmysqlclient 5.5.10 soname version bump + +* Tue Feb 08 2011 Fedora Release Engineering - 5.1.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Dec 23 2010 Tom Lane 5.1.8-1 +- Update to 5.1.8 +- Deal with mysql packaging changes that prevent us from using mysys + utility functions directly + +* Wed Jan 20 2010 Tom Lane 5.1.5r1144-7 +- Correct Source: tag and comment to reflect how to get the tarball + +* Fri Aug 21 2009 Tomas Mraz - 5.1.5r1144-6 +- rebuilt with new openssl + +* Sat Jul 25 2009 Fedora Release Engineering - 5.1.5r1144-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 5.1.5r1144-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Fri Feb 20 2009 Tom Lane 5.1.5r1144-3 +- Fix some 64-bitness issues with unixODBC 2.2.14. + +* Fri Feb 20 2009 Tom Lane 5.1.5r1144-2 +- Rebuild for unixODBC 2.2.14. +- Fix problem with null username/password specifications + +* Thu Jan 22 2009 Tom Lane 5.1.5r1144-1 +- Update to mysql-connector-odbc 5.1.5r1144, to go with MySQL 5.1.x. + Note the library name has changed from libmyodbc3 to libmyodbc5. + +* Tue Aug 5 2008 Tom Lane 3.51.26r1127-1 +- Update to mysql-connector-odbc 3.51.26r1127 + +* Tue Mar 25 2008 Tom Lane 3.51.24r1071-1 +- Update to mysql-connector-odbc 3.51.24r1071 + +* Tue Feb 12 2008 Tom Lane 3.51.23r998-1 +- Update to mysql-connector-odbc 3.51.23r998 + +* Wed Dec 5 2007 Tom Lane 3.51.14r248-3 +- Rebuild for new openssl + +* Thu Aug 2 2007 Tom Lane 3.51.14r248-2 +- Update License tag to match code. + +* Fri Apr 20 2007 Tom Lane 3.51.14r248-1 +- Update to mysql-connector-odbc 3.51.14r248 +Resolves: #236473 +- Fix build problem on multilib machines + +* Mon Jul 17 2006 Tom Lane 3.51.12-2.2 +- rebuild + +* Mon Mar 27 2006 Tom Lane 3.51.12-2 +- Remove DLL-unload cleanup call from connection shutdown (bz#185343) + +* Fri Feb 10 2006 Jesse Keating - 3.51.12-1.2.1 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 3.51.12-1.2 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Fri Nov 11 2005 Tom Lane 3.51.12-1 +- New package replacing MyODBC.