[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#639300: please build against unixodbc-dev instead of libiodbc2-dev



Package: soprano-daemon
Followup-For: Bug #639300

Just to tell that unixodbc 2.3.1 has support for driver library name
in connection string (though debian ships 2.2.14).
Thus if a connection manager is wished and also wished is the
ability to provide the library name via connection string it
is reachable.

The only issue with the first patch to get the testsuite completing to
the same level as with iodbc is to provide an odbcinst template that
is lacking from virtuoso.

Updated version of the connection manager and virtuoso odbcinst template
attached.


-- System Information:
Debian Release: 7.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.8.0-rc2test0-00197-ge364127 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages soprano-daemon depends on:
ii  libc6           2.16-0experimental1
ii  libgcc1         1:4.8-20130105-1
ii  libodbc1        2.2.14p2-5
ii  libqt4-dbus     4:4.8.2+dfsg-9
ii  libqt4-network  4:4.8.2+dfsg-9
ii  libqtcore4      4:4.8.2+dfsg-9
ii  libraptor2-0    2.0.8-2
ii  librdf0         1.0.15-1+b1
ii  libstdc++6      4.8-20130105-1
ii  unixodbc        2.2.14p2-5

Versions of packages soprano-daemon recommends:
pn  libsoprano4  <none>

Versions of packages soprano-daemon suggests:
ii  virtuoso-minimal  6.1.4+dfsg1-2

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/lib/soprano/libsoprano_virtuosobackend.so (from soprano-daemon package)
[Virtuoso ANSI]
Description	= Virtuoso ODBC driver (ANSI version)
Driver		= virtodbc_r.so
Setup		= virtodbc_r.so
Debug		= 0
CommLog		= 1

[Virtuoso Unicode]
Description	= Virtuoso ODBC driver (Unicode version)
Driver		= virtodbcu_r.so
Setup		= virtodbcu_r.so
Debug		= 0
CommLog		= 1
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -90,7 +90,7 @@
   include(CheckIncludeFiles)
   check_include_files("windows.h;sql.h" HAVE_SQL_H)
 else(WIN32)
-  find_package(IODBC)
+  find_package(ODBC)
 endif(WIN32)
 endif(NOT SOPRANO_DISABLE_VIRTUOSO_BACKEND)
 
@@ -119,9 +119,9 @@
   set(BUILD_DBUS_SUPPORT TRUE)
 endif(NOT SOPRANO_DISABLE_DBUS AND QT_QTDBUS_FOUND)
 if(NOT SOPRANO_DISABLE_VIRTUOSO_BACKEND)
-  if(IODBC_FOUND OR HAVE_SQL_H)
+  if(ODBC_FOUND OR HAVE_SQL_H)
     set(BUILD_VIRTUOSO_BACKEND TRUE)
-  endif(IODBC_FOUND OR HAVE_SQL_H)
+  endif(ODBC_FOUND OR HAVE_SQL_H)
 endif(NOT SOPRANO_DISABLE_VIRTUOSO_BACKEND)
 set(HAVE_DBUS BUILD_DBUS_SUPPORT)
 
@@ -307,7 +307,7 @@
   if(WIN32)
     message("   * Virtuoso storage backend (missing ODBC headers - http://msdn.microsoft.com/en-us/windows/bb980924.aspx)")
   else(WIN32)
-    message("   * Virtuoso storage backend (missing libiodbc - http://www.iodbc.org)")
+    message("   * Virtuoso storage backend (missing unixodbc - http://www.unixodbc.org/)")
   endif(WIN32)
 endif(NOT BUILD_VIRTUOSO_BACKEND)
 
--- a/backends/virtuoso/CMakeLists.txt
+++ b/backends/virtuoso/CMakeLists.txt
@@ -10,7 +10,7 @@
   ${soprano_SOURCE_DIR}
   ${soprano_SOURCE_DIR}/server
   ${virtuoso_BINARY_DIR}
-  ${IODBC_INCLUDE_DIR}
+  ${ODBC_INCLUDE_DIR}
 )
 
 set(SRC
@@ -36,7 +36,7 @@
 if(WIN32)
 target_link_libraries(soprano_virtuosobackend odbc32)
 else(WIN32)
-target_link_libraries(soprano_virtuosobackend ${IODBC_LIBRARIES})
+target_link_libraries(soprano_virtuosobackend ${ODBC_LIBRARIES})
 endif(WIN32)
 
 if(WIN32)
--- a/backends/virtuoso/virtuosobackend.cpp
+++ b/backends/virtuoso/virtuosobackend.cpp
@@ -117,14 +117,18 @@
 #ifdef Q_OS_WIN
     const QString odbcDriver = QLatin1String( "{Virtuoso (Open Source)}" );
 #else
+#if 0 /* library name require unixodbc 2.3.1 */
     const QString odbcDriver = findVirtuosoDriver();
     if ( odbcDriver.isEmpty() ) {
         setError( "Could not find Virtuoso ODBC driver" );
         return 0;
     }
+#else
+   const QString odbcDriver = QLatin1String( "{Virtuoso ANSI}" ); 
+#endif
 #endif
 
-    const QString connectString = QString::fromLatin1( "host=%1:%2;uid=%3;pwd=%4;driver=%5" )
+    const QString connectString = QString::fromLatin1( "host=%1:%2;uid=%3;pwd=%4;DRIVER=%5" )
                                   .arg( host, QString::number( port ), uid, pwd, odbcDriver );
     QStringList connectionSetupCommands;
     if ( queryTimeout > 1000 ) {
--- /dev/null
+++ b/cmake/modules/FindODBC.cmake
@@ -0,0 +1,22 @@
+# Taken from gammu project
+# Find ODBC (or UnixODBC)
+
+find_path(ODBC_INCLUDE_DIR NAMES sql.h
+          DOC "The ODBC include directory"
+)
+
+find_library(ODBC_LIBRARY NAMES odbc odbc32
+          DOC "The ODBC library"
+)
+
+# handle the QUIETLY and REQUIRED arguments and set ODBC_FOUND to TRUE if
+# all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ODBC DEFAULT_MSG ODBC_LIBRARY ODBC_INCLUDE_DIR)
+
+if(ODBC_FOUND)
+  set( ODBC_LIBRARIES ${ODBC_LIBRARY} )
+  set( ODBC_INCLUDE_DIRS ${ODBC_INCLUDE_DIR} )
+endif(ODBC_FOUND)
+
+mark_as_advanced(ODBC_INCLUDE_DIR ODBC_LIBRARY)
--- a/backends/virtuoso/test.cpp
+++ b/backends/virtuoso/test.cpp
@@ -16,7 +16,7 @@
     bp.isAvailable();
 
     VirtuosoModel model( 0 );
-    if ( !model.connect( "host=localhost:1111;uid=dba;pwd=dba;driver=/usr/local/lib/virtodbc.so;" ) ) {
+    if ( !model.connect( "host=localhost:1111;uid=dba;pwd=dba;DRIVER={Virtuoso ANSI};" ) ) {
         qDebug() << "Failed to connect to db";
         return 1;
     }
--- a/backends/virtuoso/virtuosotools.cpp
+++ b/backends/virtuoso/virtuosotools.cpp
@@ -42,11 +42,11 @@
                                           buf,
                                           512,
                                           &len ) ) ) {
-        msg = QLatin1String( "iODBC Error: " ) + QString::fromLatin1( ( const char* )buf, len );
+        msg = QLatin1String( "ODBC Error: " ) + QString::fromLatin1( ( const char* )buf, len );
     }
 
     if ( msg.isEmpty() ) {
-        return msg = "Failed to retrieve error information from iODBC";
+        return msg = "Failed to retrieve error information from ODBC";
     }
 
     if ( !extraMessage.isEmpty() ) {

Reply to: