debian/0000755000000000000000000000000012206615714007172 5ustar debian/copyright0000644000000000000000000002054112206615710011123 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: tdbc Source: http://sf.net/tcl/ Upstream-Contact: tcl-tdbc@lists.sourceforge.net Copyright: Copyright (c) 2008 by Kevin B. Kenny License: Tcl-license-terms Files: * Copyright: Copyright (c) 2008 by Kevin B. Kenny License: This software is copyrighted by Kevin B. Kenny, and by other parties. The following terms apply to all files associated with the software unless explicitly disclaimed in individual files. . The authors hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. Modifications to this software may be copyrighted by their authors and need not follow the licensing terms described here, provided that the new terms are clearly indicated on the first page of each file where they apply. . IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. . GOVERNMENT USE: If you are acquiring this software on behalf of the U.S. government, the Government shall have only "Restricted Rights" in the software and related documentation as defined in the Federal Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you are acquiring the software on behalf of the Department of Defense, the software shall be classified as "Commercial Computer Software" and the Government shall have only "Restricted Rights" as defined in Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the terms specified in this license. Files: tclconfig/tcl.m4 Copyright: Copyright (c) 1999-2000 Ajuba Solutions. Copyright (c) 2002-2005 ActiveState Corporation. License: Tcl-license-terms Files: tclconfig/depcomp Copyright: Copyright 1999, 2000 Free Software Foundation, Inc. Originally written by Alexandre Oliva . License: GPL-2+ Files: tclconfig/install-sh Copyright: Copyright (C) 1994 X Consortium License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. . Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other deal- ings in this Software without prior written authorization from the X Consor- tium. . FSF changes to this file are in the public domain. License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . . As a special exception, the respective Autoconf Macro's copyright owner gives unlimited permission to copy, distribute and modify the configure scripts that are the output of Autoconf when processing the Macro. You need not follow the terms of the GNU General Public License when using or distributing such scripts, even though portions of the text of the Macro appear in them. The GNU General Public License (GPL) does govern all other use of the material that constitutes the Autoconf Macro. . This special exception to the GPL applies to versions of the Autoconf Macro released by the Autoconf Macro Archive. When you make and distribute a modified version of the Autoconf Macro, you may extend this special exception to the GPL to apply to your modified version as well. . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. License: Tcl-license-terms This software is copyrighted by the Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState Corporation and other parties. The following terms apply to all files associated with the software unless explicitly disclaimed in individual files. . The authors hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. Modifications to this software may be copyrighted by their authors and need not follow the licensing terms described here, provided that the new terms are clearly indicated on the first page of each file where they apply. . IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. . GOVERNMENT USE: If you are acquiring this software on behalf of the U.S. government, the Government shall have only "Restricted Rights" in the software and related documentation as defined in the Federal Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you are acquiring the software on behalf of the Department of Defense, the software shall be classified as "Commercial Computer Software" and the Government shall have only "Restricted Rights" as defined in Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the authors grant the U.S. Government and others acting in its behalf permission to use and distribute the software in accordance with the terms specified in this license. debian/patches/0000755000000000000000000000000012206615710010615 5ustar debian/patches/libname.patch0000644000000000000000000000763712206615710013262 0ustar Description: Adding support also for libodbc.so.1 odbcStubInit.c attempts to load also libodbc.so.1 if libodbc.so is not present Author: Sergei Golovan Bug: http://core.tcl.tk/tdbcodbc/tktview/4c45c353f703bc7f0c814996fa96773c6f015ce3 Reviewed-by: Massimo Manghi Last-Update: 2013-08-26 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/generic/odbcStubInit.c +++ b/generic/odbcStubInit.c @@ -39,6 +39,16 @@ "libodbccp", "libodbccp32", "libodbcinst", NULL }; +/* ABI Version numbers of the ODBC API that we can cope with */ + +static const char *const odbcSuffixes[] = { + "", ".1", NULL +}; + +static const char *const odbcOptSuffixes[] = { + "", ".1", NULL +}; + /* * Names of the functions that we need from ODBC */ @@ -119,7 +129,7 @@ /* Pointer to a second load handle * that represents the ODBCINST library */ { - int i; + int i, j; int status; /* Status of Tcl library calls */ Tcl_Obj* path; /* Path name of a module to be loaded */ Tcl_Obj* shlibext; /* Extension to use for load modules */ @@ -144,17 +154,20 @@ */ status = TCL_ERROR; for (i = 0; status == TCL_ERROR && odbcStubLibNames[i] != NULL; ++i) { - path = Tcl_NewStringObj(odbcStubLibNames[i], -1); - Tcl_AppendObjToObj(path, shlibext); - Tcl_IncrRefCount(path); - Tcl_ResetResult(interp); - - /* - * Try to load a client library and resolve the ODBC API within it. - */ - status = Tcl_LoadFile(interp, path, odbcSymbolNames, 0, - (void*)odbcStubs, &handle); - Tcl_DecrRefCount(path); + for (j = 0; status == TCL_ERROR && odbcSuffixes[j] != NULL; ++j) { + path = Tcl_NewStringObj(odbcStubLibNames[i], -1); + Tcl_AppendObjToObj(path, shlibext); + Tcl_AppendToObj(path, odbcSuffixes[j], -1); + Tcl_IncrRefCount(path); + Tcl_ResetResult(interp); + + /* + * Try to load a client library and resolve the ODBC API within it. + */ + status = Tcl_LoadFile(interp, path, odbcSymbolNames, 0, + (void*)odbcStubs, &handle); + Tcl_DecrRefCount(path); + } } /* @@ -163,27 +176,30 @@ if (status == TCL_OK) { int status2 = TCL_ERROR; for (i = 0; status2 == TCL_ERROR && odbcOptLibNames[i] != NULL; ++i) { - path = Tcl_NewStringObj(odbcOptLibNames[i], -1); - Tcl_AppendObjToObj(path, shlibext); - Tcl_IncrRefCount(path); - status2 = Tcl_LoadFile(interp, path, NULL, 0, NULL, handle2Ptr); - if (status2 == TCL_OK) { - SQLConfigDataSourceW = - (BOOL (INSTAPI*)(HWND, WORD, LPCWSTR, LPCWSTR)) - Tcl_FindSymbol(NULL, *handle2Ptr, "SQLConfigDataSourceW"); - if (SQLConfigDataSourceW == NULL) { - SQLConfigDataSource = - (BOOL (INSTAPI*)(HWND, WORD, LPCSTR, LPCSTR)) - Tcl_FindSymbol(NULL, *handle2Ptr, - "SQLConfigDataSource"); + for (j = 0; status2 == TCL_ERROR && odbcOptSuffixes[j] != NULL; ++j) { + path = Tcl_NewStringObj(odbcOptLibNames[i], -1); + Tcl_AppendObjToObj(path, shlibext); + Tcl_AppendToObj(path, odbcOptSuffixes[j], -1); + Tcl_IncrRefCount(path); + status2 = Tcl_LoadFile(interp, path, NULL, 0, NULL, handle2Ptr); + if (status2 == TCL_OK) { + SQLConfigDataSourceW = + (BOOL (INSTAPI*)(HWND, WORD, LPCWSTR, LPCWSTR)) + Tcl_FindSymbol(NULL, *handle2Ptr, "SQLConfigDataSourceW"); + if (SQLConfigDataSourceW == NULL) { + SQLConfigDataSource = + (BOOL (INSTAPI*)(HWND, WORD, LPCSTR, LPCSTR)) + Tcl_FindSymbol(NULL, *handle2Ptr, + "SQLConfigDataSource"); + } + SQLInstallerError = + (BOOL (INSTAPI*)(WORD, DWORD*, LPSTR, WORD, WORD*)) + Tcl_FindSymbol(NULL, *handle2Ptr, "SQLInstallerError"); + } else { + Tcl_ResetResult(interp); } - SQLInstallerError = - (BOOL (INSTAPI*)(WORD, DWORD*, LPSTR, WORD, WORD*)) - Tcl_FindSymbol(NULL, *handle2Ptr, "SQLInstallerError"); - } else { - Tcl_ResetResult(interp); + Tcl_DecrRefCount(path); } - Tcl_DecrRefCount(path); } } debian/patches/series0000644000000000000000000000003512206615710012030 0ustar libname.patch tdbcodbc.patch debian/patches/tdbcodbc.patch0000644000000000000000000000540012206615710013401 0ustar Description: Pointer to int variable assignments Likewise to the Mysql and Postgresql drivers also the driver for ODBC suffers for the same problem patched introducing the tdbc_intptr_t data type based on the intptr_t data type defined in . If not existing the code reverts to int Author: Massimo Manghi Bug: http://core.tcl.tk/tdbcodbc/tktview/df3a7fd993cce16ec0e8d9042b27266e0f8614b6 Last-Update: 2013-08-25 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/generic/tdbcodbc.c +++ b/generic/tdbcodbc.c @@ -23,6 +23,12 @@ #include #include +#ifdef HAVE_STDINT_H +#include +typedef intptr_t tdbc_intptr_t; +#else +typedef int tdbc_intptr_t; +#endif #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN @@ -1229,7 +1235,7 @@ * uniqueness. */ Tcl_HashEntry* nameEntry; /* Hash table entry for the current name */ int new; /* Flag that column name is unique */ - int count; /* Count to append to the name */ + tdbc_intptr_t count; /* Count to append to the name */ char numbuf[16]; /* Buffer to hold the appended count */ SQLSMALLINT i; int retry; @@ -1324,10 +1330,10 @@ * we've seen it before. */ - count = (int) Tcl_GetHashValue(nameEntry); + count = (tdbc_intptr_t) Tcl_GetHashValue(nameEntry); ++count; Tcl_SetHashValue(nameEntry, (ClientData) count); - sprintf(numbuf, "#%d", count); + sprintf(numbuf, "#%ld", count); Tcl_AppendToObj(colNameObj, numbuf, -1); } @@ -1431,7 +1437,7 @@ SQLSMALLINT isol; /* Isolation level */ SQLINTEGER seconds; /* Timeout value in seconds */ SQLRETURN rc; /* Return code from SQL operations */ - int w; /* Window ID of the parent window */ + int w; /* Window ID of the parent window */ int status; /* Return call from Tcl */ if (connectFlagsPtr) { @@ -1687,7 +1693,7 @@ return status; } Tcl_ResetResult(interp); - *hParentWindowPtr = (HWND) w; + *hParentWindowPtr = (HWND) (tdbc_intptr_t) w; *connectFlagsPtr = SQL_DRIVER_COMPLETE_REQUIRED; break; @@ -2006,7 +2012,7 @@ int objc, /* Parameter count */ Tcl_Obj *const objv[] /* Parameter vector */ ) { - SQLSMALLINT completionType = (SQLSMALLINT) (int) (clientData); + SQLSMALLINT completionType = (SQLSMALLINT) (tdbc_intptr_t) (clientData); Tcl_Object thisObject = Tcl_ObjectContextObject(objectContext); /* The current connection object */ ConnectionData* cdata = (ConnectionData*) @@ -3959,7 +3965,7 @@ Tcl_Obj *const objv[] /* Parameter vector */ ) { - int lists = (int) clientData; + tdbc_intptr_t lists = (tdbc_intptr_t) clientData; /* Flag == 1 if lists are to be returned, * 0 if dicts are to be returned */ debian/source/0000755000000000000000000000000012206615710010466 5ustar debian/source/format0000644000000000000000000000001512206615710011675 0ustar 3.0 (quilt) debian/compat0000644000000000000000000000000212206615710010364 0ustar 8 debian/changelog0000644000000000000000000000023412206615710011037 0ustar tdbcodbc (1.0.0-1) unstable; urgency=low * Initial release. (Closes: #720772) -- Massimo Manghi Sun, 25 Aug 2013 00:17:56 +0200 debian/watch0000644000000000000000000000006612206615710010221 0ustar version=3 http://sf.net/tcl/tdbcodbc([\d.]+)\.tar\.gz debian/rules0000755000000000000000000000401412206615710010245 0ustar #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 #export DH_OPTIONS=-v DIR = $(shell pwd)/debian/tcl8.6-tdbc-odbc %: dh $@ override_dh_auto_configure: CFLAGS="-I/usr/include/tcl8.6" \ dh_auto_configure -- --with-tcl=/usr/lib/tcl8.6/ \ --prefix=/usr \ --includedir=/usr/include \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --sysconfdir=/etc \ --localstatedir=/var \ --libdir=/usr/lib/tcltk/ \ --libexecdir=/usr/lib/tcltk \ --with-tdbc=$(shell ls -d /usr/lib/tcltk/tdbc1.*) override_dh_auto_install: dh_auto_install mkdir $(DIR)/usr/share/man/man3 # Fix up the manpages. cd $(DIR)/usr/share/man/mann && \ for f in *.[3n] ; do \ f2=$$(echo $$f | sed -e 's/\.[3n]/.3tcl/') ; \ if [ -L $$f ]; then \ l=$$(readlink -n $$f | sed -e 's/\.[3n]/.3tcl/') ; \ rm $$f ; \ ln -sf $$l $$f2 ; \ else \ cat $$f | sed -e 's/^\.TH \([^ ]\+\|"[^"]\+"\) [3n]/.TH \1 3tcl/' \ -e 's/\(Tk_[0-9A-Za-z]*\)(3)/\1(3tk)/g' \ -e 's/\([A-Z][0-9A-Za-z_]*\)(3)/\1(3tcl)/g' \ -e 's/send(n)/send(3tk)/g' \ -e 's/text(n)/text(3tk)/g' \ -e 's/tk(n)/tk(3tk)/g' \ -e 's/winfo(n)/winfo(3tk)/g' \ -e 's/(n)/(3tcl)/g' \ -e "s/\\N'244'/\\[^o]/g" \ >$$f2 ; \ rm $$f ; \ mv -v $$f2 ../man3/ ; \ fi ; \ done ; \ find $(DIR) -empty -prune -exec rmdir \{\} \; ; \ debian/control0000644000000000000000000000127712206615710010600 0ustar Source: tdbcodbc Section: libs Priority: optional Maintainer: Massimo Manghi Build-Depends: debhelper (>=9), tcl8.6-dev, tcl8.6-tdbc (>=1.0.0), libodbc1, odbcinst1debian2 Standards-Version: 3.9.4 Homepage: http://tdbc.tcl.tk/ Package: tcl8.6-tdbc-odbc Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, tcl8.6, tcl8.6-tdbc (>=1.0.0), libodbc1, odbcinst1debian2 Description: ODBC driver for the Tcl Database Connectivity Tdbc is an interface standard for SQL databases and connectivity that aims to make it easy to write portable and secure Tcl scripts that access SQL databases. This package provides the driver for the ODBC, the Open DataBase Connectivity. debian/docs0000644000000000000000000000000712206615710010036 0ustar README