I've created a patch to fix the freexl compatibility issues. Together with the patch from Evgeni this seem to fix the build failure.
I'm attaching the debdiff. Hopefully someone can test the resulting package. Felix
diff -Nru spatialite-3.0.0~beta20110817/debian/changelog spatialite-3.0.0~beta20110817/debian/changelog --- spatialite-3.0.0~beta20110817/debian/changelog 2011-11-21 12:12:12.000000000 +0100 +++ spatialite-3.0.0~beta20110817/debian/changelog 2013-01-04 11:48:56.000000000 +0100 @@ -1,3 +1,12 @@ +spatialite (3.0.0~beta20110817-3+deb7u1) testing-proposed-updates; urgency=low + + * Non-maintainer upload. + * Fix FTBFS in wheezy. (Closes: #683075) + - Add 05-fix_libgeos_search.patch from Evgeni Golov to fix configure checks. + - Add 06-freexl_compat.patch to restore compatibility with freexl in wheezy. + + -- Felix Geyer <fge...@debian.org> Fri, 04 Jan 2013 10:27:35 +0100 + spatialite (3.0.0~beta20110817-3) unstable; urgency=medium [ Francesco Paolo Lovergine ] diff -Nru spatialite-3.0.0~beta20110817/debian/patches/05-fix_libgeos_search.patch spatialite-3.0.0~beta20110817/debian/patches/05-fix_libgeos_search.patch --- spatialite-3.0.0~beta20110817/debian/patches/05-fix_libgeos_search.patch 1970-01-01 01:00:00.000000000 +0100 +++ spatialite-3.0.0~beta20110817/debian/patches/05-fix_libgeos_search.patch 2013-01-04 10:27:16.000000000 +0100 @@ -0,0 +1,70 @@ +Index: spatialite-3.0.0~beta20110817/libspatialite/configure +=================================================================== +--- spatialite-3.0.0~beta20110817.orig/libspatialite/configure 2011-08-17 17:50:56.000000000 +0200 ++++ spatialite-3.0.0~beta20110817/libspatialite/configure 2012-11-25 13:31:19.000000000 +0100 +@@ -16593,7 +16593,7 @@ + ac_res="none required" + else + ac_res=-l$ac_lib +- LIBS="-l$ac_lib -lm -lgeos $ac_func_search_save_LIBS" ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_GEOSTopologyPreserveSimplify=$ac_res +@@ -16663,7 +16663,7 @@ + ac_res="none required" + else + ac_res=-l$ac_lib +- LIBS="-l$ac_lib -lm -lgeos $ac_func_search_save_LIBS" ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_GEOSCoveredBy=$ac_res +Index: spatialite-3.0.0~beta20110817/libspatialite/configure.ac +=================================================================== +--- spatialite-3.0.0~beta20110817.orig/libspatialite/configure.ac 2011-08-17 17:50:56.000000000 +0200 ++++ spatialite-3.0.0~beta20110817/libspatialite/configure.ac 2012-11-25 13:31:19.000000000 +0100 +@@ -120,7 +120,7 @@ + if test x"$enable_geos" != "xno"; then + OMIT_GEOS_FLAGS= + AC_CHECK_HEADERS(geos_c.h,, [AC_MSG_ERROR([cannot find geos_c.h, bailing out])]) +- AC_SEARCH_LIBS(GEOSTopologyPreserveSimplify,geos_c,,AC_MSG_ERROR(['libgeos_c' is required but it doesn't seems to be installed on this system.]),-lm -lgeos) ++ AC_SEARCH_LIBS(GEOSTopologyPreserveSimplify,geos_c,,AC_MSG_ERROR(['libgeos_c' is required but it doesn't seems to be installed on this system.]),) + #----------------------------------------------------------------------- + # --enable-geosadvanced + # +@@ -129,7 +129,7 @@ + [], [geosadvanced=yes]) + if test x"$enable_geosadvanced" != "xno"; then + GEOSADVANCED_FLAGS=-DGEOS_ADVANCED +- AC_SEARCH_LIBS(GEOSCoveredBy,geos_c,,AC_MSG_ERROR([obsolete 'libgeos_c' (< v.3.3.0). please retry specifying: --disable-geosadvanced.]),-lm -lgeos) ++ AC_SEARCH_LIBS(GEOSCoveredBy,geos_c,,AC_MSG_ERROR([obsolete 'libgeos_c' (< v.3.3.0). please retry specifying: --disable-geosadvanced.]),) + else + GEOSADVANCED_FLAGS= + fi +Index: spatialite-3.0.0~beta20110817/spatialite-tools/configure +=================================================================== +--- spatialite-3.0.0~beta20110817.orig/spatialite-tools/configure 2012-11-25 13:31:19.000000000 +0100 ++++ spatialite-3.0.0~beta20110817/spatialite-tools/configure 2012-11-25 13:34:04.917588983 +0100 +@@ -16547,7 +16547,7 @@ + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lgeos_c -lm -lgeos $LIBS" ++LIBS="-lgeos_c $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +Index: spatialite-3.0.0~beta20110817/spatialite-tools/configure.ac +=================================================================== +--- spatialite-3.0.0~beta20110817.orig/spatialite-tools/configure.ac 2012-11-25 13:31:19.000000000 +0100 ++++ spatialite-3.0.0~beta20110817/spatialite-tools/configure.ac 2012-11-25 13:33:53.009624090 +0100 +@@ -72,7 +72,7 @@ + + AC_CHECK_LIB(expat,XML_ParserCreate,,AC_MSG_ERROR(['expat' is required but it doesn't seems to be installed on this system.])) + AC_CHECK_LIB(proj,pj_init_plus,,AC_MSG_ERROR(['libproj' is required but it doesn't seems to be installed on this system.]),-lm) +-AC_CHECK_LIB(geos_c,GEOSTopologyPreserveSimplify,,AC_MSG_ERROR(['libgeos_c' is required but it doesn't seems to be installed on this system.]),-lm -lgeos) ++AC_CHECK_LIB(geos_c,GEOSTopologyPreserveSimplify,,AC_MSG_ERROR(['libgeos_c' is required but it doesn't seems to be installed on this system.]),) + + PKG_CHECK_MODULES([LIBFREEXL], [freexl], , AC_MSG_ERROR(['libfreexl' is required but it doesn't seems to be installed on this system.])) + LIBSPATIALITE_CFLAGS= diff -Nru spatialite-3.0.0~beta20110817/debian/patches/06-freexl_compat.patch spatialite-3.0.0~beta20110817/debian/patches/06-freexl_compat.patch --- spatialite-3.0.0~beta20110817/debian/patches/06-freexl_compat.patch 1970-01-01 01:00:00.000000000 +0100 +++ spatialite-3.0.0~beta20110817/debian/patches/06-freexl_compat.patch 2013-01-04 11:14:54.000000000 +0100 @@ -0,0 +1,404 @@ +--- a/libspatialite/src/spatialite/virtualXL.c ++++ b/libspatialite/src/spatialite/virtualXL.c +@@ -262,34 +262,29 @@ + if (firstLineTitles == 'Y') + { + /* fetching comun names */ + for (col = 0; col < columns; col++) + { +- unsigned char type; +- int int_value; +- double dbl_value; +- const char *text_value; +- int ret = +- freexl_get_cell_value (handle, 0, col, &type, &int_value, +- &dbl_value, &text_value); ++ FreeXL_CellValue cell; ++ int ret = freexl_get_cell_value (handle, 0, col, &cell); + if (ret != FREEXL_OK) + sprintf (dummyName, "col_%d", col); + else + { +- if (type == FREEXL_CELL_INT) +- sprintf (dummyName, "%d", int_value); +- else if (type == FREEXL_CELL_DOUBLE) +- sprintf (dummyName, "%1.2f", dbl_value); +- else if (type == FREEXL_CELL_TEXT +- || type == FREEXL_CELL_SST_TEXT +- || type == FREEXL_CELL_DATE +- || type == FREEXL_CELL_DATETIME +- || type == FREEXL_CELL_TIME) ++ if (cell.type == FREEXL_CELL_INT) ++ sprintf (dummyName, "%d", cell.value.int_value); ++ else if (cell.type == FREEXL_CELL_DOUBLE) ++ sprintf (dummyName, "%1.2f", cell.value.double_value); ++ else if (cell.type == FREEXL_CELL_TEXT ++ || cell.type == FREEXL_CELL_SST_TEXT ++ || cell.type == FREEXL_CELL_DATE ++ || cell.type == FREEXL_CELL_DATETIME ++ || cell.type == FREEXL_CELL_TIME) + { +- int len = strlen (text_value); ++ int len = strlen (cell.value.text_value); + if (len < 256) +- strcpy (dummyName, text_value); ++ strcpy (dummyName, cell.value.text_value); + else + sprintf (dummyName, "col_%d", col); + } + else + sprintf (dummyName, "col_%d", col); +@@ -493,14 +488,11 @@ + + static int + vXL_eval_constraints (VirtualXLCursorPtr cursor) + { + /* evaluating Filter constraints */ +- unsigned char type; +- int int_value; +- double dbl_value; +- const char *text_value; ++ FreeXL_CellValue cell; + VirtualXLConstraintPtr pC = cursor->firstConstraint; + if (pC == NULL) + return 1; + while (pC) + { +@@ -542,129 +534,130 @@ + if (cursor->pVtab->XL_handle != NULL + && cursor->current_row <= cursor->pVtab->rows + && pC->iColumn <= cursor->pVtab->columns) + freexl_get_cell_value (cursor->pVtab->XL_handle, + cursor->current_row - 1, pC->iColumn - 1, +- &type, &int_value, &dbl_value, +- &text_value); ++ &cell); + else +- type = FREEXL_CELL_NULL; +- if (type == FREEXL_CELL_INT) ++ cell.type = FREEXL_CELL_NULL; ++ if (cell.type == FREEXL_CELL_INT) + { + if (pC->valueType == 'I') + { + switch (pC->op) + { + case SQLITE_INDEX_CONSTRAINT_EQ: +- if (int_value == pC->intValue) ++ if (cell.value.int_value == pC->intValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_GT: +- if (int_value > pC->intValue) ++ if (cell.value.int_value > pC->intValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_LE: +- if (int_value <= pC->intValue) ++ if (cell.value.int_value <= pC->intValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_LT: +- if (int_value < pC->intValue) ++ if (cell.value.int_value < pC->intValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_GE: +- if (int_value >= pC->intValue) ++ if (cell.value.int_value >= pC->intValue) + ok = 1; + break; + }; + } + if (pC->valueType == 'D') + { + switch (pC->op) + { + case SQLITE_INDEX_CONSTRAINT_EQ: +- if (int_value == pC->dblValue) ++ if (cell.value.int_value == pC->dblValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_GT: +- if (int_value > pC->dblValue) ++ if (cell.value.int_value > pC->dblValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_LE: +- if (int_value <= pC->dblValue) ++ if (cell.value.int_value <= pC->dblValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_LT: +- if (int_value < pC->dblValue) ++ if (cell.value.int_value < pC->dblValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_GE: +- if (int_value >= pC->dblValue) ++ if (cell.value.int_value >= pC->dblValue) + ok = 1; + break; + }; + } + } +- if (type == FREEXL_CELL_DOUBLE) ++ if (cell.type == FREEXL_CELL_DOUBLE) + { + if (pC->valueType == 'I') + { + switch (pC->op) + { + case SQLITE_INDEX_CONSTRAINT_EQ: +- if (dbl_value == pC->intValue) ++ if (cell.value.double_value == pC->intValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_GT: +- if (dbl_value > pC->intValue) ++ if (cell.value.double_value > pC->intValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_LE: +- if (dbl_value <= pC->intValue) ++ if (cell.value.double_value <= pC->intValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_LT: +- if (dbl_value < pC->intValue) ++ if (cell.value.double_value < pC->intValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_GE: +- if (dbl_value >= pC->intValue) ++ if (cell.value.double_value >= pC->intValue) + ok = 1; + break; + }; + } + if (pC->valueType == 'D') + { + switch (pC->op) + { + case SQLITE_INDEX_CONSTRAINT_EQ: +- if (dbl_value == pC->dblValue) ++ if (cell.value.double_value == pC->dblValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_GT: +- if (dbl_value > pC->dblValue) ++ if (cell.value.double_value > pC->dblValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_LE: +- if (dbl_value <= pC->dblValue) ++ if (cell.value.double_value <= pC->dblValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_LT: +- if (dbl_value < pC->dblValue) ++ if (cell.value.double_value < pC->dblValue) + ok = 1; + break; + case SQLITE_INDEX_CONSTRAINT_GE: +- if (dbl_value >= pC->dblValue) ++ if (cell.value.double_value >= pC->dblValue) + ok = 1; + break; + }; + } + } +- if ((type == FREEXL_CELL_TEXT || type == FREEXL_CELL_SST_TEXT +- || type == FREEXL_CELL_DATE || type == FREEXL_CELL_DATETIME +- || type == FREEXL_CELL_TIME) && pC->valueType == 'T') ++ if ((cell.type == FREEXL_CELL_TEXT ++ || cell.type == FREEXL_CELL_SST_TEXT ++ || cell.type == FREEXL_CELL_DATE ++ || cell.type == FREEXL_CELL_DATETIME ++ || cell.type == FREEXL_CELL_TIME) && pC->valueType == 'T') + { +- int ret = strcmp (text_value, pC->txtValue); ++ int ret = strcmp (cell.value.text_value, pC->txtValue); + switch (pC->op) + { + case SQLITE_INDEX_CONSTRAINT_EQ: + if (ret == 0) + ok = 1; +@@ -794,14 +787,11 @@ + static int + vXL_column (sqlite3_vtab_cursor * pCursor, sqlite3_context * pContext, + int column) + { + /* fetching value for the Nth column */ +- unsigned char type; +- int int_value; +- double dbl_value; +- const char *text_value; ++ FreeXL_CellValue cell; + VirtualXLCursorPtr cursor = (VirtualXLCursorPtr) pCursor; + if (column == 0) + { + /* the PRIMARY KEY column */ + if (cursor->pVtab->firstLineTitles == 'Y') +@@ -812,29 +802,28 @@ + } + if (cursor->pVtab->XL_handle != NULL + && cursor->current_row <= cursor->pVtab->rows + && column <= cursor->pVtab->columns) + freexl_get_cell_value (cursor->pVtab->XL_handle, +- cursor->current_row - 1, column - 1, &type, +- &int_value, &dbl_value, &text_value); ++ cursor->current_row - 1, column - 1, &cell); + else +- type = FREEXL_CELL_NULL; +- switch (type) ++ cell.type = FREEXL_CELL_NULL; ++ switch (cell.type) + { + case FREEXL_CELL_INT: +- sqlite3_result_int (pContext, int_value); ++ sqlite3_result_int (pContext, cell.value.int_value); + break; + case FREEXL_CELL_DOUBLE: +- sqlite3_result_double (pContext, dbl_value); ++ sqlite3_result_double (pContext, cell.value.double_value); + break; + case FREEXL_CELL_TEXT: + case FREEXL_CELL_SST_TEXT: + case FREEXL_CELL_DATE: + case FREEXL_CELL_DATETIME: + case FREEXL_CELL_TIME: +- sqlite3_result_text (pContext, text_value, strlen (text_value), +- SQLITE_STATIC); ++ sqlite3_result_text (pContext, cell.value.text_value, ++ strlen (cell.value.text_value), SQLITE_STATIC); + break; + default: + sqlite3_result_null (pContext); + break; + }; +--- a/spatialite-tools/shapefiles.c ++++ b/spatialite-tools/shapefiles.c +@@ -2600,10 +2600,7 @@ + unsigned int rows; + unsigned short columns; + unsigned short col; +- unsigned char type; +- int int_value; +- double dbl_value; +- const char *text_value; ++ FreeXL_CellValue cell; + int already_exists = 0; + /* checking if TABLE already exists */ + sprintf (sql, +@@ -2684,26 +2681,24 @@ + for (col = 0; col < columns; col++) + { + ret = +- freexl_get_cell_value (xl_handle, 0, col, &type, +- &int_value, &dbl_value, +- &text_value); ++ ret = freexl_get_cell_value (xl_handle, 0, col, &cell); + if (ret != FREEXL_OK) + sprintf (dummyName, "col_%d", col); + else + { +- if (type == FREEXL_CELL_INT) +- sprintf (dummyName, "%d", int_value); +- else if (type == FREEXL_CELL_DOUBLE) +- sprintf (dummyName, "%1.2f", dbl_value); +- else if (type == FREEXL_CELL_TEXT +- || type == FREEXL_CELL_SST_TEXT +- || type == FREEXL_CELL_DATE +- || type == FREEXL_CELL_DATETIME +- || type == FREEXL_CELL_TIME) ++ if (cell.type == FREEXL_CELL_INT) ++ sprintf (dummyName, "%d", cell.value.int_value); ++ else if (cell.type == FREEXL_CELL_DOUBLE) ++ sprintf (dummyName, "%1.2f", cell.value.double_value); ++ else if (cell.type == FREEXL_CELL_TEXT ++ || cell.type == FREEXL_CELL_SST_TEXT ++ || cell.type == FREEXL_CELL_DATE ++ || cell.type == FREEXL_CELL_DATETIME ++ || cell.type == FREEXL_CELL_TIME) + { +- int len = strlen (text_value); ++ int len = strlen (cell.value.text_value); + if (len < 256) +- strcpy (dummyName, text_value); ++ strcpy (dummyName, cell.value.text_value); + else + sprintf (dummyName, "col_%d", col); + } +@@ -2745,25 +2740,24 @@ + if (first_titles) + { + ret = +- freexl_get_cell_value (xl_handle, 0, col, &type, &int_value, +- &dbl_value, &text_value); ++ freexl_get_cell_value (xl_handle, 0, col, &cell); + if (ret != FREEXL_OK) + sprintf (dummyName, "col_%d", col); + else + { +- if (type == FREEXL_CELL_INT) +- sprintf (dummyName, "%d", int_value); +- else if (type == FREEXL_CELL_DOUBLE) +- sprintf (dummyName, "%1.2f", dbl_value); +- else if (type == FREEXL_CELL_TEXT +- || type == FREEXL_CELL_SST_TEXT +- || type == FREEXL_CELL_DATE +- || type == FREEXL_CELL_DATETIME +- || type == FREEXL_CELL_TIME) ++ if (cell.type == FREEXL_CELL_INT) ++ sprintf (dummyName, "%d", cell.value.int_value); ++ else if (cell.type == FREEXL_CELL_DOUBLE) ++ sprintf (dummyName, "%1.2f", cell.value.double_value); ++ else if (cell.type == FREEXL_CELL_TEXT ++ || cell.type == FREEXL_CELL_SST_TEXT ++ || cell.type == FREEXL_CELL_DATE ++ || cell.type == FREEXL_CELL_DATETIME ++ || cell.type == FREEXL_CELL_TIME) + { +- int len = strlen (text_value); ++ int len = strlen (cell.value.text_value); + if (len < 256) +- strcpy (dummyName, text_value); ++ strcpy (dummyName, cell.value.text_value); + else + sprintf (dummyName, "col_%d", col); + } +@@ -2810,27 +2804,26 @@ + { + /* column values */ + ret = +- freexl_get_cell_value (xl_handle, current_row, col, &type, +- &int_value, &dbl_value, &text_value); ++ freexl_get_cell_value (xl_handle, current_row, col, &cell); + if (ret != FREEXL_OK) + sqlite3_bind_null (stmt, col + 1); + else + { +- switch (type) ++ switch (cell.type) + { + case FREEXL_CELL_INT: +- sqlite3_bind_int (stmt, col + 1, int_value); ++ sqlite3_bind_int (stmt, col + 1, cell.value.int_value); + break; + case FREEXL_CELL_DOUBLE: +- sqlite3_bind_double (stmt, col + 1, dbl_value); ++ sqlite3_bind_double (stmt, col + 1, cell.value.double_value); + break; + case FREEXL_CELL_TEXT: + case FREEXL_CELL_SST_TEXT: + case FREEXL_CELL_DATE: + case FREEXL_CELL_DATETIME: + case FREEXL_CELL_TIME: +- sqlite3_bind_text (stmt, col + 1, text_value, +- strlen (text_value), ++ sqlite3_bind_text (stmt, col + 1, cell.value.text_value, ++ strlen (cell.value.text_value), + SQLITE_STATIC); + break; + default: diff -Nru spatialite-3.0.0~beta20110817/debian/patches/series spatialite-3.0.0~beta20110817/debian/patches/series --- spatialite-3.0.0~beta20110817/debian/patches/series 2011-11-21 12:12:12.000000000 +0100 +++ spatialite-3.0.0~beta20110817/debian/patches/series 2013-01-04 11:25:49.000000000 +0100 @@ -3,3 +3,5 @@ 02-fix_version-info.patch 03-fix_typos.patch 04-fix_missing_define.patch +05-fix_libgeos_search.patch +06-freexl_compat.patch