Package: libdbi-drivers
Version: 0.8.2-1-4
Severity: serious
Tags: sid patch

The libdbi-drivers package fails to build with freetds 0.82 in unstable,
because the upstream checks for libraries (in acinclude.m4) are absurd:

        if test "$ac_freetds_incdir" = "no" || test "$ac_freetds_libs" = "no"; 
then
                freetds_incdirs="/usr/include /usr/local/include"
                AC_FIND_FILE(tds.h, $freetds_incdirs, ac_freetds_incdir)
                freetds_libdirs="/usr/lib /usr/local/lib"
                AC_FIND_FILE(libtds.so, $freetds_libdirs, ac_freetds_libdir)
                if test "$ac_freetds_incdir" = "no"; then
                        AC_MSG_RESULT(no)
                        AC_MSG_ERROR([Invalid Freetds directory - include
                        files not found.])
                fi
                if test "$ac_freetds_libdir" = "no"; then
                        AC_MSG_RESULT(no)
                        AC_MSG_ERROR([Invalid Freetds directory - libraries
                        not found.])
                fi
        fi

AC_FIND_FILE() is the wrong thing.  We have compilers with system lib and
include paths, and autoconf macros AC_CHECK_HEADERS() and AC_CHECK_LIB()
which do the right thing with the compiler.  AC_FIND_FILE() here is
reinventing the wheel - poorly.

Besides which, this check uses AC_FIND_FILE() to look for a file *which is
never used in the build*.  libtds.so /was/ an internal library in previous
versions of FreeTDS, which has now been removed.  libdbi-drivers /never/
linked against this library; it linked against libct, which is the correct
public interface.  So it should be checking for the library it will actually
use!  (but using AC_CHECK_LIB(), not AC_FIND_FILE()!)

There is fortunately a way to bypass this wrong check by passing a
--with-freetds-dir argument to ./configure.  A patch to do this is attached.
Let me know if you would like me to upload this as an NMU.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
[EMAIL PROTECTED]                                     [EMAIL PROTECTED]
diff -u libdbi-drivers-0.8.2-1/debian/rules libdbi-drivers-0.8.2-1/debian/rules
--- libdbi-drivers-0.8.2-1/debian/rules
+++ libdbi-drivers-0.8.2-1/debian/rules
@@ -20,7 +20,10 @@
 	cp /usr/share/misc/config.sub .
 	cp /usr/share/misc/config.guess .
 
-	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --with-pgsql --with-mysql --with-sqlite --with-sqlite3 --with-freetds --enable-docs --enable-libdbi
+	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
+		--prefix=/usr --with-pgsql --with-mysql --with-sqlite \
+		--with-sqlite3 --with-freetds --with-freetds-dir=/usr \
+		--enable-docs --enable-libdbi
 # This is for the moment removed until the upstream fixes the problems with
 # the new API: --with-firebird
 
diff -u libdbi-drivers-0.8.2-1/debian/changelog libdbi-drivers-0.8.2-1/debian/changelog
--- libdbi-drivers-0.8.2-1/debian/changelog
+++ libdbi-drivers-0.8.2-1/debian/changelog
@@ -1,3 +1,13 @@
+libdbi-drivers (0.8.2-1-4.1) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * High urgency upload for RC bugfix.
+  * Pass --freetds-inc-dir to configure, to bypass the ridiculous upstream
+    AC_FIND_FILE() checks for files that *aren't used during the build*;
+    fixes a build failure with FreeTDS 0.82.
+
+ -- Steve Langasek <[EMAIL PROTECTED]>  Sat, 02 Aug 2008 09:00:11 +0000
+
 libdbi-drivers (0.8.2-1-4) unstable; urgency=low
 
   * Updated the dbd_pgsql.c so it doesn't conflicts with the declaration of

Reply via email to