summaryrefslogtreecommitdiff
path: root/dev-db/myodbc
diff options
context:
space:
mode:
Diffstat (limited to 'dev-db/myodbc')
-rw-r--r--dev-db/myodbc/Manifest21
-rw-r--r--dev-db/myodbc/files/5.2.7-mariadb-dynamic-array.patch79
-rw-r--r--dev-db/myodbc/files/5.2.7-my_malloc.patch18
-rw-r--r--dev-db/myodbc/files/5.2.7-r1-cxxlinkage.patch40
-rw-r--r--dev-db/myodbc/files/5.3-cmake-doc-path.patch43
-rw-r--r--dev-db/myodbc/files/5.3-cxxlinkage.patch43
-rw-r--r--dev-db/myodbc/files/5.3-mariadb-buffer_length.patch93
-rw-r--r--dev-db/myodbc/files/5.3-mariadb-dynamic-array.patch96
-rw-r--r--dev-db/myodbc/files/cmake-doc-path.patch43
-rw-r--r--dev-db/myodbc/files/odbc.ini.m417
-rw-r--r--dev-db/myodbc/files/odbcinst.ini.m45
-rw-r--r--dev-db/myodbc/metadata.xml8
-rw-r--r--dev-db/myodbc/myodbc-5.2.7-r1.ebuild121
-rw-r--r--dev-db/myodbc/myodbc-5.2.7-r2.ebuild124
-rw-r--r--dev-db/myodbc/myodbc-5.3.8-r1.ebuild115
-rw-r--r--dev-db/myodbc/myodbc-5.3.8.ebuild137
16 files changed, 1003 insertions, 0 deletions
diff --git a/dev-db/myodbc/Manifest b/dev-db/myodbc/Manifest
new file mode 100644
index 000000000000..e2b563d4bcd4
--- /dev/null
+++ b/dev-db/myodbc/Manifest
@@ -0,0 +1,21 @@
+AUX 5.2.7-mariadb-dynamic-array.patch 3053 SHA256 132b49d939fe26939e3c794a1db7dc50f28e552c81db7913006dfee45cb4b503 SHA512 26d35effbf4e74ef634c6e42dced40830402aa0925571f4bd55acd3dfe06f1c8c8f3bab4e9bb4bcd3f72dc87ecc3a093b984df4837548710899f97d8bdeca7b6 WHIRLPOOL a778ec270547a4fd0f7907f7eb5005da966575f77c9c886f545c393e4a21ac58656316202d5bd48cc7523d35e61a97c806564dbf7a7573009780c8c936d502ee
+AUX 5.2.7-my_malloc.patch 594 SHA256 288e79c561f40213b2f2290a5fd39993ea8ab7273b8114de156707ba5bf30687 SHA512 bcd26b2f8de21404c741fec51bb7e7bec32a5d3fbc90471c157ee275dc6136a44a6ef4d2ad8dd170e2852679d3fcb0cc74cf4acca0570702206b4cded1cb1fa5 WHIRLPOOL 99936627e17eb2b77b2fac5ff6eb779a23d67131efec705f59b72b8a402059fdf76f982b4a52c157697df6658f6ae372a201fb193c28e6dc4dd0af209dde99cb
+AUX 5.2.7-r1-cxxlinkage.patch 1707 SHA256 323beef3086506a7313507403ff632ac00ab86a082eb71e44bdffd5dc2f176dd SHA512 3d0f1839e1b200d7746d2c7161ee2a85813bf40517a70777d361e482efd6d6b0be88415d339d6dccc49de865a0d714fbbce2b74abb1bbc12c4f4681a5bd5abf8 WHIRLPOOL 2823b2bf237c999ddb0caac94abd7bcd3ec04dda01d3440982d537557aee29f4cf14b464607dcc6681c8b990b87caedc9864a04ebe3fe831bb4e0dab9a1c1e80
+AUX 5.3-cmake-doc-path.patch 1480 SHA256 651402ff7247b0412f80beb8b511083dd2383ffc576d18f1d2d1d014b252a2ef SHA512 aa2303161af2b53608acc127464951cf77492a1a90e869a58893ba10a014077d7f8f319325b77713fffceeaa002943f4ce52b6cb9571b0b3d3d7ab562601968d WHIRLPOOL 890c50110dfd50dd5da8074a2cdd3f2eae637d1bdb7744b506f43e877d52d06706fe1dafaeeb224982d57952724285b1eaf839baeb498ad0447fb8394775aee2
+AUX 5.3-cxxlinkage.patch 1687 SHA256 319fa52311bf0e61f65ba6e656528a09bb882a735e6b755b959e3ef85cb459ec SHA512 404242e009e3c22000d599be20856e7610f845abc086519082d9b45ad3a904cfcc569cdcab5eade904a8b27b59af954df0cba870520792290187259a9b0012bc WHIRLPOOL 634cd57264ebd67cb0cd2b20b86245bff1cca0631499412a2d3d87f78cd18a9800689cba5e25512ffe69faa8277ea66c3381b229e99643e0d9ea92b454367be9
+AUX 5.3-mariadb-buffer_length.patch 3242 SHA256 6794dc5eea55fb3d5dda50a2b610c2e49bfc0e503a93278e76fd812dd15a3015 SHA512 b267c76da77594715edff83aa223d0e45f7b369a142707f91f44a7c862fdf319d6ffd8726927fd7f44b32a779a0fc96b87e04f882d6cf99f7df0385eaa8021c2 WHIRLPOOL 62d3eb8d937902026143d2f94c9a19976a91ec7e5d5a497560992dd11946c2ceca87a5c7071a5f778340656d42b299e638e98dfbed10381b1611aada0a60fdb8
+AUX 5.3-mariadb-dynamic-array.patch 3654 SHA256 ffb6402a4352c510913e9c74cbebeb370146c6905d7f052a83f8125d66e1129c SHA512 8599fb01062db680dbfd0f054eab0f91b5ca8f1799fd602ff4634241936ab4d8f5e26e6149f6d92e97241c953369259a142b1ab02e9b8bbe6fb16cd44d78ffff WHIRLPOOL 11b8da64803a72f5ca4958d734be22fc7a43525f547cf61df74946e6009eb72b94625767de2958ec7940fe505fc718cd46636303babc9710aed148db44906c51
+AUX cmake-doc-path.patch 1498 SHA256 75477998ba483fb1f6a5dde6cbd4719ac2e98e32540e7eb46bd334a0b354abe2 SHA512 2e48af11efb55a1508402d5d1d717a3dfc9897bf0ccce5aa190792fb673ac78b27a9480e951a6347a2c8d0e2fe08a28c11fd08c55dbea835a93f525decaaf09e WHIRLPOOL 0631c7cef81bb8541ca0af96afcf9ed8118aef87702d89d5237a8744bc6d9324b6cb148f3c32e4d225df038d15ad5c8583d0a6a49e33e9fc7b9cd44b319982be
+AUX odbc.ini.m4 406 SHA256 e411dc47ade65b0c408dd37d6a390f0ee6b6997f34e79077e2b9684f69a1300e SHA512 84ab2a3aab594123d42b65205a7faf8e91fe9416a9e3c4c4c354533b9a298395f59172649c91dc0b671392bfbe5baeaddb6aa47119ce4c825917f3977d9dd521 WHIRLPOOL 79f919fd0da516b308d58dab2d98f6f7d65f76baf4a7d425fa95641b13081688aa82476ccd513b104ed09df4164884fcaecfef49992c40d5e275bab402d60930
+AUX odbcinst.ini.m4 118 SHA256 4e15c14ca1d16d1bea9a81601cee228405ccd1934a02d83e89cb695f7c24e69f SHA512 6d929bbffd602a9f060a05998149a6b16334f8a5e3db30d02ff5d38c0065085d085042521e700b87a63766e32aa27ae92be72cef33c2a7aa8f6767b6b71c82c8 WHIRLPOOL ec32bca678d1c7fbada53691feaaf28acc7a2e672a4544ad95c8da21296b2419b491e6e154060b90b4fe09241e02b86b8b0f22416569440a3eeb687a1340e33e
+DIST mysql-connector-odbc-5.2.7-src.tar.gz 606472 SHA256 0ad8fcccb4c41c7100fe02ec0aa87938d33329d23f7b68d1b9031c87750392c9 SHA512 f54ac8a23ade71da85e1335e95eccdccfd68a8687d17a584ced103812bdc5aee8014769a84eaa22724bb2cb23d34c7188c964d3283723defeaef5157a4b3c60f WHIRLPOOL 928808ac5b623ec345c8c1b8495ca1de7f10e65f0d14720e9bee6ab154ccf818ca690745a57fa7fa1c008ba57b24705657398cd9146fbf2e385c178deca0e499
+DIST mysql-connector-odbc-5.3.8-linux-debian8-x86-32bit.tar.gz 11295329 SHA256 67b7648f896c059aa7686b6384eadaddfe7043160b6f23edf3f78499e02cff45 SHA512 5d13d8545f3868eeaceb6e5d8b0f1a3ba8e5ce916ffa6d94467f0b5a0c057129d09fedb0084b25fe36da250aaf8bb21ba991696c1ed0def338792c2e4b592b56 WHIRLPOOL 00fd263c7eec68108b0f53c726a656f66a77627798c13ec9ec15aa3b6e4c51f8ef3562f7fbc3872b33320262b913fe646adc0013e8f8ba9c0dd931bc8f46b94f
+DIST mysql-connector-odbc-5.3.8-linux-debian8-x86-64bit.tar.gz 11782557 SHA256 e224456af3af1121e655c04cf809aad97471fcf2ff0082a21ed7b3ac69437776 SHA512 c28c1851a6ca560db78f96610b631edeeefb0006032eb17e3bd55da955abbbdfcf72d4a9b305a21151bb08a28b141ac89b3688cf778bfbc91393bfabb5e63783 WHIRLPOOL 4b9fd8169c77323247f61c6d2f3c843d5f8b3f5b89f9b134a3eec2d2a24c1b8a6a5b1d54241e6f3a6a05636d7701be5fac9a8f4b559555e7b12d65c4eda3172c
+DIST mysql-connector-odbc-5.3.8-src.tar.gz 690403 SHA256 eca40e1ad359cd1d7e23b6692e60179c8e3daa66337e7a0232de4162664d9885 SHA512 4703deab548f2953a58421b20977ced8dfd197d5274f89dd9e080cebdf35da007e558d5d52b6b09109744eddc2905c834f1e3e2ac83df4249d069d5e14fd34ee WHIRLPOOL 9286058a7d57e13e9a2e683682d87e0226e0e451880a20579867b673144d69f7941fbe16706267ca2caa058b1aef15fb4516445af8ab164fb745cd81a0c2814f
+EBUILD myodbc-5.2.7-r1.ebuild 3365 SHA256 beb1762ace59190dae72894cc53471a1e8b6bce2b476ce6f45b155f2db2aad3c SHA512 a88183fe7f51a2ba092b9128e686bfcc2e087e538e25d2a112b8854203f027e25f4119edae2ea8c6247697fa1dcbc678e6502daa480a84ca0bac983edcff3c45 WHIRLPOOL 89bcf6787cc1844e8bb7ced0a853f8a5cad600f89c22dda7fadd69870457cca462fd9a3861d1a562800b86271a43dcbbc6ebdef7a6c24687aae52ab5634152d6
+EBUILD myodbc-5.2.7-r2.ebuild 3484 SHA256 48d19a7e86803836f33f1395851c38053afe9547478f202682f280d465bef836 SHA512 af941381825c2bcc6de112ecf3fa928c178c41af43d29d708ac052f906591452ff0eb7c1e44eed27ee533826663699172ba321af7c27ba3705eaf8447149604f WHIRLPOOL bf867c41c25e8ccb43ba9ac577b83ffe3c614385fdcd2a7acdce9c53f08d1871226b408249a66460b7b4cf3bc9193bfc000fb359fc32d958ce700e28dbee5ee9
+EBUILD myodbc-5.3.8-r1.ebuild 3075 SHA256 deffff566e4f65458e1d5c094c318b8a0df82f7d8d095d477ae4c4fddb4fb5e9 SHA512 1629ffe70f9f960b7e9e9bba95193c9e75e20d77c90324c70fd259b7e983374d85fd2591e6fcab908480e82ec264ea1d5d27d21532de05a68fb1977465dd8b1e WHIRLPOOL 65e20a131a0170fe7941bb49fdac480b0434cb21d7f0a5fa55a3b88559fec04e3912073d9ea293092ff4bfd252a471a7b14eb135f00d1adf9981172558a15d47
+EBUILD myodbc-5.3.8.ebuild 3932 SHA256 a3b56805b7ea781ffc3ffe0bd9d809b687cb959fd8a60216f595274f00d6989c SHA512 9e8e780e7f5c190716a4568184e168b55912d9e079f810debbeba691ca9764200fc7a6f518063f86b1722609ed287f08375a7f2223b1eee955654cb5b0fd62f7 WHIRLPOOL b6fd8800d5f13ddea6b75720a8a97905c9494db304f9faef99ca5d93b42122db14238fc2f90aee9ad30e5e9387601c8e7e8b40bc84d8229be287e23a3942a86b
+MISC ChangeLog 2825 SHA256 89bf310dd222a30144be56460c6fb96d1c11e587930127bdaec28f0de2788836 SHA512 f5c55bde847b658bb57d5a0d33678c500e3ae2454b33f73198d6a8bc8721b41e72c1c8af6aafe8cc90be74f5fdecc60959395450efc46aadc8871b48aa14a304 WHIRLPOOL d420c0aa58cf427abdc3631982f7f5ed41bd9931cb5ec2cb11f38074ab7fcdf861634c5437d964b259ae861781097ee98b0f83fdd5c04796400facad4d22cd16
+MISC ChangeLog-2015 6332 SHA256 9d1fd022bebea13d7e022ae399c5bd9d7f6736d6861fc0bcca5d4a3100e089e0 SHA512 7dcf5931409c9570a1e9e328dfdc30974cd38a6e1207a81e6c8eb6a045e4f65d23b23fc1c3289f3cb25c5a9dc1f021ca566390e96e2c24a4d65ff6dc56ee5eed WHIRLPOOL d1ce37c34ad52b688a9a7493a787b3eae72d6498191600afdf7a3c1fb322ef491d28e7a87f84ac07a995d68f17225dea8a8c4fa622e305aa72ab0c7867b4cae4
+MISC metadata.xml 239 SHA256 a35e1476a1677a91f06dd6e4f955fcebc58c3a07f934b5e62fbf801573a5c82b SHA512 e6e2fafe2f503db1d12e3d2368a99631ee8d014b7ea802d9879e7e3e2c0f9378675fffccd78ed09b914ae781ac3902567b1a53a721906e3ea63ceb51d0a1654b WHIRLPOOL 3ed1945907fa58cbc9997c311d1d0431d481586576ce45b4bc5caf7704ddefe2117305879a97e8021694b86af0d570a34517212b6cc9528224b85e568eee3d75
diff --git a/dev-db/myodbc/files/5.2.7-mariadb-dynamic-array.patch b/dev-db/myodbc/files/5.2.7-mariadb-dynamic-array.patch
new file mode 100644
index 000000000000..6cfe7cd274b3
--- /dev/null
+++ b/dev-db/myodbc/files/5.2.7-mariadb-dynamic-array.patch
@@ -0,0 +1,79 @@
+diff -aurN a/driver/catalog_no_i_s.c b/driver/catalog_no_i_s.c
+--- a/driver/catalog_no_i_s.c 2014-06-18 18:50:16.000000000 -0400
++++ b/driver/catalog_no_i_s.c 2014-08-20 14:08:33.997339096 -0400
+@@ -1093,7 +1093,11 @@
+ unsigned long *lengths;
+ SQLRETURN rc= SQL_SUCCESS;
+
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ my_init_dynamic_array(&records, sizeof(MY_FOREIGN_KEY_FIELD), 0, 0, MYF(0));
++#else
+ my_init_dynamic_array(&records, sizeof(MY_FOREIGN_KEY_FIELD), 0, 0);
++#endif
+
+ /* Get the list of tables that match szCatalog and szTable */
+ pthread_mutex_lock(&stmt->dbc->lock);
+diff -aurN a/driver/desc.c b/driver/desc.c
+--- a/driver/desc.c 2014-06-18 18:50:16.000000000 -0400
++++ b/driver/desc.c 2014-08-20 14:07:37.409169269 -0400
+@@ -63,8 +63,12 @@
+ but in desc_get_rec we manually get a pointer to it. This avoids
+ having to call set_dynamic after modifying the DESCREC.
+ */
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ if (my_init_dynamic_array(&desc->records, sizeof(DESCREC), 0, 0, MYF(0)))
++#else
+ if (my_init_dynamic_array(&desc->records, sizeof(DESCREC), 0, 0))
++#endif
+ {
+ x_free((char *)desc);
+ return NULL;
+ }
+@@ -995,9 +1003,15 @@
+
+ /* copy the records */
+ delete_dynamic(&dest->records);
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ if (my_init_dynamic_array(&dest->records, sizeof(DESCREC),
++ src->records.max_element,
++ src->records.alloc_increment, MYF(0)))
++#else
+ if (my_init_dynamic_array(&dest->records, sizeof(DESCREC),
+ src->records.max_element,
+ src->records.alloc_increment))
++#endif
+ {
+ return set_desc_error(dest, "HY001",
+ "Memory allocation error",
+diff -aurN a/driver/handle.c b/driver/handle.c
+--- a/driver/handle.c 2014-06-18 18:50:16.000000000 -0400
++++ b/driver/handle.c 2014-08-20 14:05:00.364248403 -0400
+@@ -403,7 +403,11 @@
+ }
+ }
+
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ my_init_dynamic_array(*param_bind, sizeof(MYSQL_BIND), elements, 10, MYF(0));
++#else
+ my_init_dynamic_array(*param_bind, sizeof(MYSQL_BIND), elements, 10);
++#endif
+ memset((*param_bind)->buffer, 0, sizeof(MYSQL_BIND) *
+ (*param_bind)->max_element);
+
+diff -aurN a/driver/parse.c b/driver/parse.c
+--- a/driver/parse.c 2014-06-18 18:50:16.000000000 -0400
++++ b/driver/parse.c 2014-08-20 14:03:54.336383876 -0400
+@@ -129,8 +129,13 @@
+
+ /* TODO: Store offsets rather than ptrs. In this case we will be fine
+ if work with copy of the originally parsed string */
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ my_init_dynamic_array(&pq->token, sizeof(uint), 20, 10, MYF(0));
++ my_init_dynamic_array(&pq->param_pos, sizeof(uint), 10, 10, MYF(0));
++#else
+ my_init_dynamic_array(&pq->token, sizeof(uint), 20, 10);
+ my_init_dynamic_array(&pq->param_pos, sizeof(uint), 10, 10);
++#endif
+ }
+
+ return pq;
diff --git a/dev-db/myodbc/files/5.2.7-my_malloc.patch b/dev-db/myodbc/files/5.2.7-my_malloc.patch
new file mode 100644
index 000000000000..bc6c65ef3011
--- /dev/null
+++ b/dev-db/myodbc/files/5.2.7-my_malloc.patch
@@ -0,0 +1,18 @@
+diff -Brau a/util/odbcinstw.c b/util/odbcinstw.c
+--- a/util/odbcinstw.c 2014-04-23 21:54:40.000000000 +0200
++++ b/util/odbcinstw.c 2015-05-08 15:29:09.400568356 +0200
+@@ -68,13 +68,7 @@
+
+ if (lpszRetBuffer && cbRetBuffer)
+ {
+- ret= malloc(cbRetBuffer + 1);
+- /*
+- We cannot rely on getting correct results from the next call of
+- SQLGetPrivateProfileString. So, taking precautions against unititialized
+- values in the allocated buffer.
+- */
+- memset(ret, 0, cbRetBuffer + 1);
++ ret= my_malloc(cbRetBuffer + 1, MYF(MY_ZEROFILL));
+ }
+ else
+ ret= NULL;
diff --git a/dev-db/myodbc/files/5.2.7-r1-cxxlinkage.patch b/dev-db/myodbc/files/5.2.7-r1-cxxlinkage.patch
new file mode 100644
index 000000000000..2bdb4a581c89
--- /dev/null
+++ b/dev-db/myodbc/files/5.2.7-r1-cxxlinkage.patch
@@ -0,0 +1,40 @@
+diff -uarN a/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake
+--- a/cmake/FindMySQL.cmake 2014-06-18 18:50:16.000000000 -0400
++++ b/cmake/FindMySQL.cmake 2014-08-20 10:05:00.191485304 -0400
+@@ -105,16 +105,16 @@
+ # Finally remove the dot
+ STRING(REGEX REPLACE "[.]" "" MYSQL_NUM_VERSION "${MYSQL_NUM_VERSION}")
+
+- IF(MYSQL_CXX_LINKAGE OR MYSQL_NUM_VERSION GREATER 50603)
++ IF(MYSQL_CXX_LINKAGE)
+ EXECUTE_PROCESS(COMMAND ${MYSQL_CONFIG_EXECUTABLE} "--cxxflags"
+ OUTPUT_VARIABLE _mysql_config_output
+ )
+ SET(MYSQL_CXX_LINKAGE 1)
+- ELSE (MYSQL_CXX_LINKAGE OR MYSQL_NUM_VERSION GREATER 50603)
++ ELSE (MYSQL_CXX_LINKAGE)
+ EXECUTE_PROCESS(COMMAND ${MYSQL_CONFIG_EXECUTABLE} "--cflags"
+ OUTPUT_VARIABLE _mysql_config_output
+ )
+- ENDIF(MYSQL_CXX_LINKAGE OR MYSQL_NUM_VERSION GREATER 50603)
++ ENDIF(MYSQL_CXX_LINKAGE)
+
+ # Remove the stl4port dependency
+ STRING(REGEX REPLACE "-library=stlport4" "" _mysql_config_output "${_mysql_config_output}")
+diff -aurN mysql-connector-odbc-5.2.7-src.orig/CMakeLists.txt mysql-connector-odbc-5.2.7-src/CMakeLists.txt
+--- a/CMakeLists.txt 2014-08-27 13:51:27.050553560 -0400
++++ b/CMakeLists.txt 2014-08-27 13:55:41.702359680 -0400
+@@ -256,10 +256,9 @@
+ SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
+ SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib")
+
+-SET(LIB_SUBDIR "lib")
+-IF(RPM_BUILD AND CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|ppc64|ppc64p7|s390x|sparc64)")
+- SET(LIB_SUBDIR "lib64")
+-ENDIF()
++IF(NOT LIB_SUBDIR)
++ MESSAGE(ERROR "LIB_SUBDIR is not set")
++ENDIF(NOT LIB_SUBDIR)
+ MESSAGE(STATUS "Installation library subdir: ${LIB_SUBDIR}")
+
+ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
diff --git a/dev-db/myodbc/files/5.3-cmake-doc-path.patch b/dev-db/myodbc/files/5.3-cmake-doc-path.patch
new file mode 100644
index 000000000000..54f35d41d96a
--- /dev/null
+++ b/dev-db/myodbc/files/5.3-cmake-doc-path.patch
@@ -0,0 +1,43 @@
+=== modified file 'CMakeLists.txt'
+--- a/CMakeLists.txt 2013-03-09 09:51:06 +0000
++++ b/CMakeLists.txt 2013-03-09 11:05:27 +0000
+@@ -33,6 +33,12 @@
+
+ INCLUDE(version.cmake)
+
++IF(WITH_DOCUMENTATION_INSTALL_PATH)
++ set(DOCUMENTATION_INSTALL_PATH ${WITH_DOCUMENTATION_INSTALL_PATH})
++ELSE(WITH_DOCUMENTATION_INSTALL_PATH)
++ set(DOCUMENTATION_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/doc/myodbc-${CONNECTOR_MAJOR}.${CONNECTOR_MINOR})
++ENDIF(WITH_DOCUMENTATION_INSTALL_PATH)
++
+ #Default is to build both drivers
+ IF(UNICODE OR NOT ANSI)
+ MESSAGE(STATUS "Configuring to build Unicode driver")
+@@ -329,19 +335,17 @@
+
+ ELSE(WIN32)
+
+- INSTALL(FILES ChangeLog DESTINATION .)
+- INSTALL(FILES README DESTINATION .)
+- INSTALL(FILES README.debug DESTINATION .)
+- INSTALL(FILES INSTALL DESTINATION .)
++ INSTALL(FILES ChangeLog DESTINATION ${DOCUMENTATION_INSTALL_PATH})
++ INSTALL(FILES README DESTINATION ${DOCUMENTATION_INSTALL_PATH})
++ INSTALL(FILES README.debug DESTINATION ${DOCUMENTATION_INSTALL_PATH})
++ INSTALL(FILES INSTALL DESTINATION ${DOCUMENTATION_INSTALL_PATH})
+ IF(EXISTS "${CMAKE_SOURCE_DIR}/COPYING")
+- INSTALL(FILES COPYING DESTINATION .)
+ ELSE()
+- INSTALL(FILES LICENSE.mysql DESTINATION .)
+ ENDIF()
+
+ ENDIF(WIN32)
+
+-INSTALL(FILES Licenses_for_Third-Party_Components.txt DESTINATION .)
++INSTALL(FILES Licenses_for_Third-Party_Components.txt DESTINATION ${DOCUMENTATION_INSTALL_PATH})
+
+ INCLUDE(CPack)
+
+
+
diff --git a/dev-db/myodbc/files/5.3-cxxlinkage.patch b/dev-db/myodbc/files/5.3-cxxlinkage.patch
new file mode 100644
index 000000000000..319262c81ca3
--- /dev/null
+++ b/dev-db/myodbc/files/5.3-cxxlinkage.patch
@@ -0,0 +1,43 @@
+diff -aurN a/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake
+--- a/cmake/FindMySQL.cmake 2016-11-29 07:40:13.000000000 -0500
++++ b/cmake/FindMySQL.cmake 2017-02-17 13:59:18.115389096 -0500
+@@ -747,7 +747,7 @@
+ endif()
+
+ if(NOT MYSQL_CXXFLAGS)
+- if(MYSQL_CXX_LINKAGE OR MYSQL_VERSION_ID GREATER 50603)
++ if(MYSQL_CXX_LINKAGE)
+ _mysql_conf(MYSQL_CXXFLAGS "--cxxflags")
+ set(MYSQL_CXX_LINKAGE 1)
+ else()
+diff -aurN a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 2017-02-17 13:50:43.556006202 -0500
++++ b/CMakeLists.txt 2017-02-17 13:57:15.745676184 -0500
+@@ -242,10 +242,9 @@
+ SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
+ SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib")
+
+-SET(LIB_SUBDIR "lib")
+-IF(RPM_BUILD AND CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|ppc64|ppc64p7|s390x|sparc64)")
+- SET(LIB_SUBDIR "lib64")
+-ENDIF()
++IF(NOT LIB_SUBDIR)
++ MESSAGE(ERROR "LIB_SUBDIR is not set")
++ENDIF(NOT LIB_SUBDIR)
+
+ MESSAGE(STATUS "Installation library subdir: ${LIB_SUBDIR}")
+
+diff -aurN a/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake
+--- a/cmake/FindMySQL.cmake 2017-02-17 14:44:29.532733308 -0500
++++ b/cmake/FindMySQL.cmake 2017-02-17 14:48:56.756740330 -0500
+@@ -270,8 +270,8 @@
+ set(_static_lib_ext ".lib") # Careful, can be import library for DLL
+ elseif(MYSQLCLIENT_NO_THREADS)
+ # In 5.1 and below there is a single threaded library
+- set(_dynamic_libs "mysqlclient")
+- set(_static_libs "libmysqlclient.a")
++ set(_dynamic_libs "${MYSQLCLIENT_LIB_NAME}")
++ set(_static_libs "lib${MYSQLCLIENT_LIB_NAME}.a")
+ set(_static_lib_ext ".a")
+ else()
+ # We try the multithreaded "libmysqlclient_r" first and if not
diff --git a/dev-db/myodbc/files/5.3-mariadb-buffer_length.patch b/dev-db/myodbc/files/5.3-mariadb-buffer_length.patch
new file mode 100644
index 000000000000..1be9cc466b65
--- /dev/null
+++ b/dev-db/myodbc/files/5.3-mariadb-buffer_length.patch
@@ -0,0 +1,93 @@
+diff -aurN a/driver/connect.c b/driver/connect.c
+--- a/driver/connect.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/connect.c 2017-02-17 16:14:48.116640371 -0500
+@@ -510,11 +510,11 @@
+ }
+ }
+
+-#if MYSQL_VERSION_ID >= 50709
+- mysql_get_option(mysql, MYSQL_OPT_NET_BUFFER_LENGTH, &dbc->net_buffer_length);
++#if MYSQL_VERSION_ID >= 50709 && !defined(MARIADB_BASE_VERSION)
++ mysql_get_option(mysql, MYSQL_OPT_NET_BUFFER_LENGTH, &dbc->net_buffer_length_value);
+ #else
+ // for older versions just use net_buffer_length() macro
+- dbc->net_buffer_length = net_buffer_length;
++ dbc->net_buffer_length_value = net_buffer_length;
+ #endif
+ return rc;
+
+diff -aurN a/driver/cursor.c b/driver/cursor.c
+--- a/driver/cursor.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/cursor.c 2017-02-17 16:13:19.163299885 -0500
+@@ -1485,7 +1485,7 @@
+ We have a limited capacity to shove data across the wire, but
+ we handle this by sending in multiple calls to exec_stmt_query()
+ */
+- if (ext_query->length + length >= (SQLULEN) stmt->dbc->net_buffer_length)
++ if (ext_query->length + length >= (SQLULEN) stmt->dbc->net_buffer_length_value)
+ {
+ break_insert= TRUE;
+ break;
+diff -aurN a/driver/driver.h b/driver/driver.h
+--- a/driver/driver.h 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/driver.h 2017-02-17 16:10:57.072950723 -0500
+@@ -378,7 +378,7 @@
+ int txn_isolation;
+ uint port;
+ uint cursor_count;
+- ulong net_buffer_length;
++ ulong net_buffer_length_value;
+ uint commit_flag;
+ #ifdef THREAD
+ myodbc_mutex_t lock;
+diff -aurN a/driver/info.c b/driver/info.c
+--- a/driver/info.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/info.c 2017-02-17 16:12:54.315763441 -0500
+@@ -587,7 +587,7 @@
+ MYINFO_SET_USHORT(0);
+
+ case SQL_MAX_STATEMENT_LEN:
+- MYINFO_SET_ULONG(dbc->net_buffer_length);
++ MYINFO_SET_ULONG(dbc->net_buffer_length_value);
+
+ case SQL_MAX_TABLE_NAME_LEN:
+ MYINFO_SET_USHORT(NAME_LEN);
+diff -aurN a/driver/connect.c b/driver/connect.c
+--- a/driver/connect.c 2017-02-17 16:16:14.609026769 -0500
++++ b/driver/connect.c 2017-02-17 16:34:29.637592664 -0500
+@@ -179,7 +179,7 @@
+ /* Set other connection options */
+
+ if (ds->allow_big_results || ds->safe)
+-#if MYSQL_VERSION_ID >= 50709
++#if MYSQL_VERSION_ID >= 50709 && !defined(MARIADB_BASE_VERSION)
+ mysql_options(mysql, MYSQL_OPT_MAX_ALLOWED_PACKET, &max_long);
+ #else
+ /* max_allowed_packet is a magical mysql macro. */
+@@ -252,7 +252,7 @@
+ ds_get_utf8attr(ds->rsakey, &ds->rsakey8));
+ }
+
+-#if MYSQL_VERSION_ID >= 50710
++#if MYSQL_VERSION_ID >= 50710 && !defined(MARIADB_BASE_VERSION)
+ {
+ char tls_options[128] = { 0 };
+ if (!ds->no_tls_1)
+@@ -323,7 +323,7 @@
+ #endif
+
+ mysql->options.use_ssl = !ds->disable_ssl_default;
+-#if MYSQL_VERSION_ID >= 50703
++#if MYSQL_VERSION_ID >= 50703 && !defined(MARIADB_BASE_VERSION)
+ {
+ if (ds->ssl_enforce)
+ {
+@@ -332,7 +332,7 @@
+ }
+ #endif
+
+-#if MYSQL_VERSION_ID >= 50711
++#if MYSQL_VERSION_ID >= 50711 && !defined(MARIADB_BASE_VERSION)
+ if (ds->sslmode)
+ {
+ unsigned int mode = 0;
diff --git a/dev-db/myodbc/files/5.3-mariadb-dynamic-array.patch b/dev-db/myodbc/files/5.3-mariadb-dynamic-array.patch
new file mode 100644
index 000000000000..96720618a586
--- /dev/null
+++ b/dev-db/myodbc/files/5.3-mariadb-dynamic-array.patch
@@ -0,0 +1,96 @@
+diff -aurN a/driver/catalog_no_i_s.c b/driver/catalog_no_i_s.c
+--- a/driver/catalog_no_i_s.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/catalog_no_i_s.c 2017-02-17 14:07:03.979683613 -0500
+@@ -1093,7 +1093,11 @@
+ unsigned long *lengths;
+ SQLRETURN rc= SQL_SUCCESS;
+
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ myodbc_init_dynamic_array(&records, sizeof(MY_FOREIGN_KEY_FIELD), 0, 0, MYF(0));
++#else
+ myodbc_init_dynamic_array(&records, sizeof(MY_FOREIGN_KEY_FIELD), 0, 0);
++#endif
+
+ /* Get the list of tables that match szCatalog and szTable */
+ myodbc_mutex_lock(&stmt->dbc->lock);
+diff -aurN a/driver/desc.c b/driver/desc.c
+--- a/driver/desc.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/desc.c 2017-02-17 14:09:30.139954232 -0500
+@@ -63,13 +63,21 @@
+ but in desc_get_rec we manually get a pointer to it. This avoids
+ having to call set_dynamic after modifying the DESCREC.
+ */
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ if (myodbc_init_dynamic_array(&desc->records, sizeof(DESCREC), 0, 0, MYF(0)))
++#else
+ if (myodbc_init_dynamic_array(&desc->records, sizeof(DESCREC), 0, 0))
++#endif
+ {
+ x_free((char *)desc);
+ return NULL;
+ }
+
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ if (myodbc_init_dynamic_array(&desc->bookmark, sizeof(DESCREC), 0, 0, MYF(0)))
++#else
+ if (myodbc_init_dynamic_array(&desc->bookmark, sizeof(DESCREC), 0, 0))
++#endif
+ {
+ delete_dynamic(&desc->records);
+ x_free((char *)desc);
+@@ -997,7 +1005,11 @@
+ delete_dynamic(&dest->records);
+ if (myodbc_init_dynamic_array(&dest->records, sizeof(DESCREC),
+ src->records.max_element,
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ src->records.alloc_increment, MYF(0)))
++#else
+ src->records.alloc_increment))
++#endif
+ {
+ return set_desc_error(dest, "HY001",
+ "Memory allocation error",
+diff -aurN a/driver/handle.c b/driver/handle.c
+--- a/driver/handle.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/handle.c 2017-02-17 14:10:32.078797593 -0500
+@@ -409,7 +409,11 @@
+ }
+ }
+
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ myodbc_init_dynamic_array(*param_bind, sizeof(MYSQL_BIND), elements, 10, MYF(0));
++#else
+ myodbc_init_dynamic_array(*param_bind, sizeof(MYSQL_BIND), elements, 10);
++#endif
+ memset((*param_bind)->buffer, 0, sizeof(MYSQL_BIND) *
+ (*param_bind)->max_element);
+
+diff -aurN a/driver/parse.c b/driver/parse.c
+--- a/driver/parse.c 2016-11-29 07:40:13.000000000 -0500
++++ b/driver/parse.c 2017-02-17 14:12:00.638143846 -0500
+@@ -139,8 +139,13 @@
+
+ /* TODO: Store offsets rather than ptrs. In this case we will be fine
+ if work with copy of the originally parsed string */
++#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID > 100001
++ myodbc_init_dynamic_array(&pq->token, sizeof(uint), 20, 10, MYF(0));
++ myodbc_init_dynamic_array(&pq->param_pos, sizeof(uint), 10, 10, MYF(0));
++#else
+ myodbc_init_dynamic_array(&pq->token, sizeof(uint), 20, 10);
+ myodbc_init_dynamic_array(&pq->param_pos, sizeof(uint), 10, 10);
++#endif
+ }
+
+ return pq;
+diff -aurN a/MYODBC_MYSQL.h b/MYODBC_MYSQL.h
+--- a/MYODBC_MYSQL.h 2016-11-29 07:40:13.000000000 -0500
++++ b/MYODBC_MYSQL.h 2017-02-17 15:04:47.153994839 -0500
+@@ -44,7 +44,7 @@
+ #endif
+
+ #ifdef THREAD
+-#if MYSQL_VERSION_ID < 50703
++#if MYSQL_VERSION_ID < 50703 || defined(MARIADB_BASE_VERSION)
+ #include <my_pthread.h>
+ #define myodbc_mutex_t pthread_mutex_t
+ #define myodbc_key_t pthread_key_t
diff --git a/dev-db/myodbc/files/cmake-doc-path.patch b/dev-db/myodbc/files/cmake-doc-path.patch
new file mode 100644
index 000000000000..c7f7d9d37ce7
--- /dev/null
+++ b/dev-db/myodbc/files/cmake-doc-path.patch
@@ -0,0 +1,43 @@
+=== modified file 'CMakeLists.txt'
+--- CMakeLists.txt 2013-03-09 09:51:06 +0000
++++ CMakeLists.txt 2013-03-09 11:05:27 +0000
+@@ -33,6 +33,12 @@
+ SET(CONNECTOR_MAJOR "5")
+ SET(CONNECTOR_MINOR "2")
+
++IF(WITH_DOCUMENTATION_INSTALL_PATH)
++ set(DOCUMENTATION_INSTALL_PATH ${WITH_DOCUMENTATION_INSTALL_PATH})
++ELSE(WITH_DOCUMENTATION_INSTALL_PATH)
++ set(DOCUMENTATION_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/doc/myodbc-${CONNECTOR_MAJOR}.${CONNECTOR_MINOR})
++ENDIF(WITH_DOCUMENTATION_INSTALL_PATH)
++
+ IF(CONNECTOR_MINOR LESS 10)
+ SET(CONNECTOR_MINOR_PADDED "0${CONNECTOR_MINOR}")
+ ELSE(CONNECTOR_MINOR LESS 10)
+@@ -329,19 +335,17 @@
+
+ ELSE(WIN32)
+
+- INSTALL(FILES ChangeLog DESTINATION .)
+- INSTALL(FILES README DESTINATION .)
+- INSTALL(FILES README.debug DESTINATION .)
+- INSTALL(FILES INSTALL DESTINATION .)
++ INSTALL(FILES ChangeLog DESTINATION ${DOCUMENTATION_INSTALL_PATH})
++ INSTALL(FILES README DESTINATION ${DOCUMENTATION_INSTALL_PATH})
++ INSTALL(FILES README.debug DESTINATION ${DOCUMENTATION_INSTALL_PATH})
++ INSTALL(FILES INSTALL DESTINATION ${DOCUMENTATION_INSTALL_PATH})
+ IF(EXISTS "${CMAKE_SOURCE_DIR}/COPYING")
+- INSTALL(FILES COPYING DESTINATION .)
+ ELSE()
+- INSTALL(FILES LICENSE.mysql DESTINATION .)
+ ENDIF()
+
+ ENDIF(WIN32)
+
+-INSTALL(FILES Licenses_for_Third-Party_Components.txt DESTINATION .)
++INSTALL(FILES Licenses_for_Third-Party_Components.txt DESTINATION ${DOCUMENTATION_INSTALL_PATH})
+
+ INCLUDE(CPack)
+
+
+
diff --git a/dev-db/myodbc/files/odbc.ini.m4 b/dev-db/myodbc/files/odbc.ini.m4
new file mode 100644
index 000000000000..4255730a3e21
--- /dev/null
+++ b/dev-db/myodbc/files/odbc.ini.m4
@@ -0,0 +1,17 @@
+# vim:ts=4 noexpandtab ft=dosini:
+#
+[ODBC Data Sources]
+__PN__-test = MySQL ODBC __PF__ Driver Testing DSN
+
+# see http://www.mysql.com/products/myodbc/faq_toc.html
+# for details about the following entry
+[__PN__-test]
+Description = MySQL ODBC __PF__ Driver Testing DSN
+Driver = __PN__
+Socket = /var/run/mysqld/mysqld.sock
+Server = localhost
+User = root
+Database = test
+Option = 3
+#Port =
+#Password =
diff --git a/dev-db/myodbc/files/odbcinst.ini.m4 b/dev-db/myodbc/files/odbcinst.ini.m4
new file mode 100644
index 000000000000..744503c5ac05
--- /dev/null
+++ b/dev-db/myodbc/files/odbcinst.ini.m4
@@ -0,0 +1,5 @@
+# vim:ts=4 noexpandtab ft=dosini:
+#
+[__PN__]
+Description = MySQL ODBC __PF__ Driver
+Driver = /usr/lib/libmyodbc3.so
diff --git a/dev-db/myodbc/metadata.xml b/dev-db/myodbc/metadata.xml
new file mode 100644
index 000000000000..709689b06053
--- /dev/null
+++ b/dev-db/myodbc/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>mysql-bugs@gentoo.org</email>
+ <name>MySQL</name>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-db/myodbc/myodbc-5.2.7-r1.ebuild b/dev-db/myodbc/myodbc-5.2.7-r1.ebuild
new file mode 100644
index 000000000000..22819c507ced
--- /dev/null
+++ b/dev-db/myodbc/myodbc-5.2.7-r1.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit cmake-multilib eutils flag-o-matic versionator
+
+MAJOR="$(get_version_component_range 1-2 $PV)"
+MY_PN="mysql-connector-odbc"
+MY_P="${MY_PN}-${PV/_p/r}-src"
+
+DESCRIPTION="ODBC driver for MySQL"
+HOMEPAGE="http://www.mysql.com/products/myodbc/"
+SRC_URI="mirror://mysql/Downloads/Connector-ODBC/${MAJOR}/${MY_P}.tar.gz"
+RESTRICT="primaryuri"
+
+LICENSE="GPL-2"
+SLOT="${MAJOR}"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+
+RDEPEND="
+ dev-db/unixODBC[${MULTILIB_USEDEP}]
+ >=virtual/mysql-5.5[${MULTILIB_USEDEP}]
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ )
+"
+DEPEND="${RDEPEND}"
+S=${WORKDIR}/${MY_P}
+
+# Careful!
+DRIVER_NAME="${PN}-${SLOT}"
+
+src_prepare() {
+ # Remove Tests
+ sed -i -e "s/ADD_SUBDIRECTORY(test)//" \
+ "${S}/CMakeLists.txt"
+
+ # Fix as-needed on the installer binary
+ echo "TARGET_LINK_LIBRARIES(myodbc-installer odbc)" >> "${S}/installer/CMakeLists.txt"
+
+ # Patch document path so it doesn't install files to /usr
+ epatch "${FILESDIR}/cmake-doc-path.patch" \
+ "${FILESDIR}/${PVR}-cxxlinkage.patch" \
+ "${FILESDIR}/${PV}-mariadb-dynamic-array.patch"
+
+ # Fix undefined references due to standards change
+ append-cflags -std=gnu89
+}
+
+multilib_src_configure() {
+ # The RPM_BUILD flag does nothing except install to /usr/lib64 when "x86_64"
+ # MYSQL_CXX_LINKAGE expects "mysql_config --cxxflags" which doesn't exist on MariaDB
+ mycmakeargs+=(
+ -DMYSQL_CXX_LINKAGE=0
+ -DWITH_UNIXODBC=1
+ -DMYSQLCLIENT_LIB_NAME="libmysqlclient_r.so"
+ -DWITH_DOCUMENTATION_INSTALL_PATH=/usr/share/doc/${PF}
+ -DMYSQL_LIB_DIR="${ROOT}/usr/$(get_libdir)"
+ -DLIB_SUBDIR="$(get_libdir)"
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_install_all() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ dodir /usr/share/${PN}-${SLOT}
+ for i in odbc.ini odbcinst.ini; do
+ einfo "Building $i"
+ sed \
+ -e "s,__PN__,${DRIVER_NAME},g" \
+ -e "s,__PF__,${MAJOR},g" \
+ -e "s,libmyodbc3.so,libmyodbc${SLOT:0:1}a.so,g" \
+ >"${D}"/usr/share/${PN}-${SLOT}/${i} \
+ <"${FILESDIR}"/${i}.m4 \
+ || die "Failed to build $i"
+ done;
+ mv "${D}/usr/bin/myodbc-installer" \
+ "${D}/usr/bin/myodbc-installer-${MAJOR}" || die "failed to move slotted binary"
+}
+
+pkg_config() {
+
+ [ "${ROOT}" != "/" ] && \
+ die 'Sorry, non-standard ROOT setting is not supported :-('
+
+ local msg='MySQL ODBC driver'
+ local drivers=$(/usr/bin/odbcinst -q -d)
+
+ if echo $drivers | grep -vq "^\[${DRIVER_NAME}\]$" ; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -d -f /usr/share/${PN}-${SLOT}/odbcinst.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+
+ local sources=$(/usr/bin/odbcinst -q -s)
+ msg='sample MySQL ODBC DSN'
+ if echo $sources | grep -vq "^\[${DRIVER_NAME}-test\]$"; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -s -l -f /usr/share/${PN}-${SLOT}/odbc.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+}
+
+pkg_postinst() {
+
+ elog "If this is a new install, please run the following command"
+ elog "to configure the MySQL ODBC drivers and sources:"
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog "Please note that the driver name used to form the DSN now includes the SLOT."
+ elog "The myodbc-install utility is installed as myodbc-install-${MAJOR}"
+}
diff --git a/dev-db/myodbc/myodbc-5.2.7-r2.ebuild b/dev-db/myodbc/myodbc-5.2.7-r2.ebuild
new file mode 100644
index 000000000000..e475faca21ee
--- /dev/null
+++ b/dev-db/myodbc/myodbc-5.2.7-r2.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit cmake-multilib eutils flag-o-matic versionator
+
+MAJOR="$(get_version_component_range 1-2 $PV)"
+MY_PN="mysql-connector-odbc"
+MY_P="${MY_PN}-${PV/_p/r}-src"
+
+DESCRIPTION="ODBC driver for MySQL"
+HOMEPAGE="http://www.mysql.com/products/myodbc/"
+SRC_URI="mirror://mysql/Downloads/Connector-ODBC/${MAJOR}/${MY_P}.tar.gz"
+RESTRICT="primaryuri"
+
+LICENSE="GPL-2"
+SLOT="${MAJOR}"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+# Does not build with mysql-connector-c
+RDEPEND="
+ dev-db/unixODBC[${MULTILIB_USEDEP}]
+ ~virtual/libmysqlclient-18[${MULTILIB_USEDEP}]
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ )
+ !dev-db/mysql-connector-c
+"
+DEPEND="${RDEPEND}"
+S=${WORKDIR}/${MY_P}
+
+# Careful!
+DRIVER_NAME="${PN}-${SLOT}"
+
+src_prepare() {
+ # Remove Tests
+ sed -i -e "s/ADD_SUBDIRECTORY(test)//" \
+ "${S}/CMakeLists.txt"
+
+ # Fix as-needed on the installer binary
+ echo "TARGET_LINK_LIBRARIES(myodbc-installer odbc)" >> "${S}/installer/CMakeLists.txt"
+
+ # Patch document path so it doesn't install files to /usr
+ epatch "${FILESDIR}/cmake-doc-path.patch" \
+ "${FILESDIR}/${PV}-r1-cxxlinkage.patch" \
+ "${FILESDIR}/${PV}-mariadb-dynamic-array.patch" \
+ "${FILESDIR}/${PV}-my_malloc.patch"
+
+ # Fix undefined references due to standards change
+ append-cflags -std=gnu89
+}
+
+multilib_src_configure() {
+ # The RPM_BUILD flag does nothing except install to /usr/lib64 when "x86_64"
+ # MYSQL_CXX_LINKAGE expects "mysql_config --cxxflags" which doesn't exist on MariaDB
+ mycmakeargs+=(
+ -DMYSQL_CXX_LINKAGE=0
+ -DWITH_UNIXODBC=1
+ -DMYSQLCLIENT_LIB_NAME="libmysqlclient_r.so"
+ -DWITH_DOCUMENTATION_INSTALL_PATH=/usr/share/doc/${PF}
+ -DMYSQL_LIB_DIR="${ROOT}/usr/$(get_libdir)"
+ -DLIB_SUBDIR="$(get_libdir)"
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_install_all() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ dodir /usr/share/${PN}-${SLOT}
+ for i in odbc.ini odbcinst.ini; do
+ einfo "Building $i"
+ sed \
+ -e "s,__PN__,${DRIVER_NAME},g" \
+ -e "s,__PF__,${MAJOR},g" \
+ -e "s,libmyodbc3.so,libmyodbc${SLOT:0:1}a.so,g" \
+ >"${D}"/usr/share/${PN}-${SLOT}/${i} \
+ <"${FILESDIR}"/${i}.m4 \
+ || die "Failed to build $i"
+ done;
+ mv "${D}/usr/bin/myodbc-installer" \
+ "${D}/usr/bin/myodbc-installer-${MAJOR}" || die "failed to move slotted binary"
+}
+
+pkg_config() {
+
+ [ "${ROOT}" != "/" ] && \
+ die 'Sorry, non-standard ROOT setting is not supported :-('
+
+ local msg='MySQL ODBC driver'
+ local drivers=$(/usr/bin/odbcinst -q -d)
+
+ if echo $drivers | grep -vq "^\[${DRIVER_NAME}\]$" ; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -d -f /usr/share/${PN}-${SLOT}/odbcinst.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+
+ local sources=$(/usr/bin/odbcinst -q -s)
+ msg='sample MySQL ODBC DSN'
+ if echo $sources | grep -vq "^\[${DRIVER_NAME}-test\]$"; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -s -l -f /usr/share/${PN}-${SLOT}/odbc.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+}
+
+pkg_postinst() {
+
+ elog "If this is a new install, please run the following command"
+ elog "to configure the MySQL ODBC drivers and sources:"
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog "Please note that the driver name used to form the DSN now includes the SLOT."
+ elog "The myodbc-install utility is installed as myodbc-install-${MAJOR}"
+}
diff --git a/dev-db/myodbc/myodbc-5.3.8-r1.ebuild b/dev-db/myodbc/myodbc-5.3.8-r1.ebuild
new file mode 100644
index 000000000000..8dafc3edf903
--- /dev/null
+++ b/dev-db/myodbc/myodbc-5.3.8-r1.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit multilib-minimal versionator
+
+MAJOR="$(get_version_component_range 1-2 $PV)"
+MY_PN="mysql-connector-odbc"
+MY_P="${MY_PN}-${PV/_p/r}-linux-debian8-x86"
+
+DESCRIPTION="ODBC driver for MySQL"
+HOMEPAGE="http://www.mysql.com/products/myodbc/"
+BASE_URI="https://cdn.mysql.com/Downloads/Connector-ODBC/${MAJOR}/${MY_P}"
+#https://cdn.mysql.com//Downloads/Connector-ODBC/5.3/mysql-connector-odbc-5.3.8-linux-debian8-x86-64bit.tar.gz
+SRC_URI="amd64? ( ${BASE_URI}-64bit.tar.gz abi_x86_32? ( ${BASE_URI}-32bit.tar.gz ) )
+ x86? ( ${BASE_URI}-32bit.tar.gz )"
+
+LICENSE="GPL-2"
+SLOT="${MAJOR}"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-db/unixODBC[${MULTILIB_USEDEP}]
+ sys-libs/zlib[${MULTILIB_USEDEP}]
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ )
+"
+S=${WORKDIR}
+
+#src_configure(){ :; }
+
+src_compile(){ :; }
+
+multilib_src_install() {
+ cd "${S}" || die
+ local prefix
+ if use amd64 && multilib_is_native_abi ; then
+ prefix="${MY_P}-64bit"
+ else
+ prefix="${MY_P}-32bit"
+ fi
+ exeinto /usr/$(get_libdir)/${PN}-${MAJOR}
+ doexe ${prefix}/lib/libmyodbc5a.so ${prefix}/lib/libmyodbc5w.so
+# use gtk && doexe ${prefix}/lib/libmyodbc5S.so
+}
+
+multilib_src_install_all() {
+ local DRIVER_NAME="${PN}-${SLOT}"
+ local prefix
+ if use amd64 ; then
+ prefix="${MY_P}-64bit"
+ else
+ prefix="${MY_P}-32bit"
+ fi
+ exeinto /usr/bin
+ newexe "${prefix}/bin/myodbc-installer" myodbc-installer-${MAJOR}
+
+ dodir /usr/share/${PN}-${SLOT}
+ for i in odbc.ini odbcinst.ini; do
+ einfo "Building $i"
+ sed \
+ -e "s,__PN__,${DRIVER_NAME},g" \
+ -e "s,__PF__,${MAJOR},g" \
+ -e "s,libmyodbc3.so,libmyodbc${SLOT:0:1}a.so,g" \
+ >"${D}/usr/share/${DRIVER_NAME}/${i}" \
+ <"${FILESDIR}"/${i}.m4 \
+ || die "Failed to build $i"
+ done;
+
+ dodoc ${prefix}/{ChangeLog,INSTALL,README,Licenses_for_Third-Party_Components.txt}
+}
+
+pkg_config() {
+
+ [ "${ROOT}" != "/" ] && \
+ die 'Sorry, non-standard ROOT setting is not supported :-('
+
+ local msg='MySQL ODBC driver'
+ local drivers=$(/usr/bin/odbcinst -q -d)
+
+ if echo $drivers | grep -vq "^\[${DRIVER_NAME}\]$" ; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -d -f /usr/share/${PN}-${SLOT}/odbcinst.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+
+ local sources=$(/usr/bin/odbcinst -q -s)
+ msg='sample MySQL ODBC DSN'
+ if echo $sources | grep -vq "^\[${DRIVER_NAME}-test\]$"; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -s -l -f /usr/share/${PN}-${SLOT}/odbc.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+}
+
+pkg_postinst() {
+
+ elog "If this is a new install, please run the following command"
+ elog "to configure the MySQL ODBC drivers and sources:"
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog "Please note that the driver name used to form the DSN now includes the SLOT."
+ elog "The myodbc-install utility is installed as myodbc-install-${MAJOR}"
+}
diff --git a/dev-db/myodbc/myodbc-5.3.8.ebuild b/dev-db/myodbc/myodbc-5.3.8.ebuild
new file mode 100644
index 000000000000..228a5be73d57
--- /dev/null
+++ b/dev-db/myodbc/myodbc-5.3.8.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit cmake-multilib flag-o-matic versionator
+
+MAJOR="$(get_version_component_range 1-2 $PV)"
+MY_PN="mysql-connector-odbc"
+MY_P="${MY_PN}-${PV/_p/r}-src"
+
+DESCRIPTION="ODBC driver for MySQL"
+HOMEPAGE="http://www.mysql.com/products/myodbc/"
+SRC_URI="https://dev.mysql.com/get/Downloads/Connector-ODBC/${MAJOR}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="${MAJOR}"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+# Does not build with mysql-connector-c
+RDEPEND="
+ dev-db/unixODBC[${MULTILIB_USEDEP}]
+ ~virtual/libmysqlclient-18[${MULTILIB_USEDEP}]
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+ )
+ !dev-db/mysql-connector-c
+"
+DEPEND="${RDEPEND}"
+S=${WORKDIR}/${MY_P}
+
+# Careful!
+DRIVER_NAME="${PN}-${SLOT}"
+
+# Patch document path so it doesn't install files to /usr
+PATCHES=(
+ "${FILESDIR}/${MAJOR}-cmake-doc-path.patch"
+ "${FILESDIR}/${MAJOR}-cxxlinkage.patch"
+ "${FILESDIR}/${MAJOR}-mariadb-dynamic-array.patch"
+ "${FILESDIR}/5.2.7-my_malloc.patch"
+ "${FILESDIR}/${MAJOR}-mariadb-buffer_length.patch"
+)
+
+src_prepare() {
+ # Fix undefined references due to standards change
+ append-cflags -std=gnu89
+
+ # Remove Tests
+ sed -i -e "s/ADD_SUBDIRECTORY(test)//" \
+ "${S}/CMakeLists.txt"
+
+ # Fix as-needed on the installer binary
+ echo "TARGET_LINK_LIBRARIES(myodbc-installer odbc)" >> "${S}/installer/CMakeLists.txt"
+ default
+}
+
+multilib_src_configure() {
+ local clientlib
+ for clientlib in "mariadb" "perconaclient" "mysqlclient" "notfound" ; do
+ [[ -x "${EPREFIX}/usr/$(get_libdir)/lib${clientlib}.so" ]] && break
+ done
+ [[ "${clientlib}x" == "notfoundx" ]] && \
+ die "Installed client library name could not be determined"
+
+ # The RPM_BUILD flag does nothing except install to /usr/lib64 when "x86_64"
+ # MYSQL_CXX_LINKAGE expects "mysql_config --cxxflags" which doesn't exist on MariaDB
+ mycmakeargs+=(
+ -DMYSQL_CXX_LINKAGE=0
+ -DWITH_UNIXODBC=1
+ -DMYSQLCLIENT_LIB_NAME="${clientlib}"
+ -DWITH_DOCUMENTATION_INSTALL_PATH=/usr/share/doc/${PF}
+ -DMYSQL_LIB_DIR="${EPREFIX}/usr/$(get_libdir)"
+ -DLIB_SUBDIR="$(get_libdir)/${PN}-${MAJOR}"
+ -DMYSQL_INCLUDE_DIR="$(mysql_config --variable=pkgincludedir)"
+ -DMYSQLCLIENT_NO_THREADS=ON
+ -DDISABLE_GUI=ON
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_install_all() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ dodir /usr/share/${PN}-${SLOT}
+ for i in odbc.ini odbcinst.ini; do
+ einfo "Building $i"
+ sed \
+ -e "s,__PN__,${DRIVER_NAME},g" \
+ -e "s,__PF__,${MAJOR},g" \
+ -e "s,libmyodbc3.so,libmyodbc${SLOT:0:1}a.so,g" \
+ >"${D}"/usr/share/${PN}-${SLOT}/${i} \
+ <"${FILESDIR}"/${i}.m4 \
+ || die "Failed to build $i"
+ done;
+ mv "${D}/usr/bin/myodbc-installer" \
+ "${D}/usr/bin/myodbc-installer-${MAJOR}" || die "failed to move slotted binary"
+}
+
+pkg_config() {
+
+ [ "${ROOT}" != "/" ] && \
+ die 'Sorry, non-standard ROOT setting is not supported :-('
+
+ local msg='MySQL ODBC driver'
+ local drivers=$(/usr/bin/odbcinst -q -d)
+
+ if echo $drivers | grep -vq "^\[${DRIVER_NAME}\]$" ; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -d -f /usr/share/${PN}-${SLOT}/odbcinst.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+
+ local sources=$(/usr/bin/odbcinst -q -s)
+ msg='sample MySQL ODBC DSN'
+ if echo $sources | grep -vq "^\[${DRIVER_NAME}-test\]$"; then
+ ebegin "Installing ${msg}"
+ /usr/bin/odbcinst -i -s -l -f /usr/share/${PN}-${SLOT}/odbc.ini
+ rc=$?
+ eend $rc
+ [ $rc -ne 0 ] && die
+ else
+ einfo "Skipping already installed ${msg}"
+ fi
+}
+
+pkg_postinst() {
+
+ elog "If this is a new install, please run the following command"
+ elog "to configure the MySQL ODBC drivers and sources:"
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog "Please note that the driver name used to form the DSN now includes the SLOT."
+ elog "The myodbc-install utility is installed as myodbc-install-${MAJOR}"
+}