diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2006-10-09 14:18:23 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2006-10-09 14:18:23 +0000 |
commit | ef2d8478470317ca9b9e667e5b1c29dec025b1f1 (patch) | |
tree | 6503a6b5d6b348d0170c882a4e6555189106288e /databases/mysqltcl | |
parent | - Register CONFLICTS with sysutils/tct; both install "bin/file". (diff) |
- Update to 3.0.2
PR: ports/103763
Submitted by: Martin Matuska <martin@matuska.org>
Approved by: Bjorn Konig <bkoenig@cs.tu-berlin.de> (maintainer)
Notes
Notes:
svn path=/head/; revision=175089
Diffstat (limited to 'databases/mysqltcl')
-rw-r--r-- | databases/mysqltcl/Makefile | 44 | ||||
-rw-r--r-- | databases/mysqltcl/distinfo | 6 | ||||
-rw-r--r-- | databases/mysqltcl/files/Makefile.bsd | 16 | ||||
-rw-r--r-- | databases/mysqltcl/files/patch-generic-mysqltcl.c | 264 | ||||
-rw-r--r-- | databases/mysqltcl/pkg-message-legacy | 1 | ||||
-rw-r--r-- | databases/mysqltcl/pkg-plist | 6 |
6 files changed, 169 insertions, 168 deletions
diff --git a/databases/mysqltcl/Makefile b/databases/mysqltcl/Makefile index af931cd8b329..da1782eea18c 100644 --- a/databases/mysqltcl/Makefile +++ b/databases/mysqltcl/Makefile @@ -1,50 +1,44 @@ # New ports collection makefile for: mysqltcl -# Date created: August 31, 1999 -# Whom: Mikhail Teterin <mi@aldan.algebra.com> +# Date created: Thu Sep 28 16:07:00 CET 2006 +# Whom: Martin Matuska <martin@matuska.org> # # $FreeBSD$ # PORTNAME= mysqltcl -PORTVERSION= 3.01 +PORTVERSION= 3.02 CATEGORIES= databases tcl83 tcl84 MASTER_SITES= http://www.xdobry.de/mysqltcl/ MAINTAINER= bkoenig@cs.tu-berlin.de COMMENT= TCL module for accessing MySQL databases based on msqltcl -LIB_DEPENDS= ${TCL_NODOT}:${PORTSDIR}/lang/${TCL_NODOT} - +USE_LDCONFIG= yes USE_MYSQL= yes -TCL_VERSION?= tcl8.4 -TCL_NODOT= ${TCL_VERSION:S/.//} -SQL_DIR= ${PREFIX}/lib/${TCL_VERSION}/mysqltcl -PLIST_SUB+= TCL_VERSION=${TCL_VERSION} LIB_NAME=${LIB_NAME} +USE_TCL= yes +USE_TCL_BUILD= yes + MANN= mysqltcl.n -MAKE_ENV+= PORTVERSION="${PORTVERSION}" \ - TCL_VERSION="${TCL_VERSION}" \ - TCL_NODOT="${TCL_NODOT}" -MAKEFILE= ${FILESDIR}/Makefile.bsd -ALL_TARGET= shlib -REINPLACE_ARGS= -i '' + +GNU_CONFIGURE= yes + +.include <bsd.port.pre.mk> + +CONFIGURE_ARGS+= --with-tcl=${TCL_LIBDIR} \ + --with-mysql-include=${LOCALBASE}/include/mysql \ + --with-mysql-lib=${LOCALBASE}/lib/mysql + +PLIST_SUB+= LIB_DIR=${PORTNAME}-${PORTVERSION} \ + LIB_NAME=libmysqltcl${PORTVERSION}.so pre-patch: @${REINPLACE_CMD} -e 's, *
,,' ${WRKSRC}/generic/*.[ch] -do-install: - @${MKDIR} ${SQL_DIR} - @${INSTALL_DATA} ${WRKSRC}/${LIB_NAME} ${SQL_DIR} - @${ECHO} "package ifneeded mysqltcl ${PORTVERSION} {load ${SQL_DIR}/${LIB_NAME}}" \ - > ${SQL_DIR}/pkgIndex.tcl - @${INSTALL_MAN} ${WRKSRC}/doc/${MANN} ${PREFIX}/man/mann - post-install: @${TEST} ! -f ${PKGMESSAGE} || ${CAT} ${PKGMESSAGE} -.include <bsd.port.mk> +.include <bsd.port.post.mk> .if ${MYSQL_VER} == 323 || ${MYSQL_VER} == 40 PKGMESSAGE= ${PKGDIR}/pkg-message-legacy .endif - -LIB_NAME!= ${MAKE_ENV} ${MAKE} -f ${FILESDIR}/Makefile.bsd -V SHLIB_NAME diff --git a/databases/mysqltcl/distinfo b/databases/mysqltcl/distinfo index 1d745297ac47..a8f1dfda73a5 100644 --- a/databases/mysqltcl/distinfo +++ b/databases/mysqltcl/distinfo @@ -1,3 +1,3 @@ -MD5 (mysqltcl-3.01.tar.gz) = 8e3df0d77b78e14680288dce72d79304 -SHA256 (mysqltcl-3.01.tar.gz) = d831411e1bde99fdfdedb241e00b616e5ce8c0532ebb517d4468e5276bdb38cc -SIZE (mysqltcl-3.01.tar.gz) = 168408 +MD5 (mysqltcl-3.02.tar.gz) = bf408a7d1f10aec28102fd27cba1f6eb +SHA256 (mysqltcl-3.02.tar.gz) = b07d19a41da0b55912cc05150cde04340ecc673354f4a00edcede832e095c206 +SIZE (mysqltcl-3.02.tar.gz) = 193912 diff --git a/databases/mysqltcl/files/Makefile.bsd b/databases/mysqltcl/files/Makefile.bsd deleted file mode 100644 index 1eef8065a549..000000000000 --- a/databases/mysqltcl/files/Makefile.bsd +++ /dev/null @@ -1,16 +0,0 @@ -.PATH: ${.CURDIR}/generic - -LIB = mysqltcl -SHLIB_MAJOR= ${PORTVERSION:R} -SHLIB_MINOR= ${PORTVERSION:E} - -SRCS = mysqltcl.c -CFLAGS += -I${PREFIX}/include/${TCL_VERSION}/ -CFLAGS += -I${PREFIX}/include/mysql/ -Wall -LDADD += -L${PREFIX}/lib -l${TCL_NODOT} -LDADD += -L${PREFIX}/lib/mysql -lmysqlclient -CFLAGS += -DVERSION='"${SHLIB_MAJOR}.${SHLIB_MINOR}"' - -.include <bsd.lib.mk> - -shlib: ${SHLIB_NAME} diff --git a/databases/mysqltcl/files/patch-generic-mysqltcl.c b/databases/mysqltcl/files/patch-generic-mysqltcl.c index c913f8c94257..8ee1d34c5bc3 100644 --- a/databases/mysqltcl/files/patch-generic-mysqltcl.c +++ b/databases/mysqltcl/files/patch-generic-mysqltcl.c @@ -1,23 +1,78 @@ ---- generic/mysqltcl.c.orig Wed Jan 11 21:08:48 2006 -+++ generic/mysqltcl.c Wed Jan 11 21:17:10 2006 -@@ -95,6 +95,8 @@ - /* C variable corresponding to mysqlstatus(nullvalue) */ - #define MYSQL_NULLV_INIT "" +--- generic/mysqltcl.c.orig Mon Oct 9 14:46:31 2006 ++++ generic/mysqltcl.c Mon Oct 9 14:48:39 2006 +@@ -41,12 +41,6 @@ + + #include <tcl.h> + #include <mysql.h> +- +-#if (MYSQL_VERSION_ID<40100) +- #error You need Mysql version 4.1 or higher to compile mysqltcl +-#endif +- +- + #include <errno.h> + #include <string.h> + #include <ctype.h> +@@ -97,6 +91,8 @@ + #define MYSQL_STATUS_MSG "message" + #define MYSQL_STATUS_NULLV "nullvalue" +#define FUNCTION_NOT_AVAILABLE "function not available" + - /* Check Level for mysql_prologue */ - enum CONNLEVEL {CL_PLAIN,CL_CONN,CL_DB,CL_RES}; + /* C variable corresponding to mysqlstatus(nullvalue) */ + #define MYSQL_NULLV_INIT "" -@@ -183,7 +185,6 @@ - static int MysqlNullSet(Tcl_Interp *interp, Tcl_Obj *objPtr) - { - Tcl_ObjType *oldTypePtr = objPtr->typePtr; -- Tcl_HashEntry *entryPtr; +@@ -713,7 +709,11 @@ + static CONST char* MysqlConnectOpt[] = + { + "-host", "-user", "-password", "-db", "-port", "-socket","-encoding", ++#if (MYSQL_VERSION_ID >= 40107) + "-ssl", "-compress", "-noschema","-odbc","-multistatement","-multiresult", ++#else ++ "-ssl", "-compress", "-noschema","-odbc", ++#endif + "-localfiles","-ignorespace","-foundrows","-interactive","-sslkey","-sslcert", + "-sslca","-sslcapath","-sslciphers",NULL + }; +@@ -730,7 +730,9 @@ + char *socket = NULL; + char *encodingname = NULL; - if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { - oldTypePtr->freeIntRepProc(objPtr); -@@ -803,6 +804,7 @@ ++#if (MYSQL_VERSION_ID >= 40107) + int isSSL = 0; ++#endif + char *sslkey = NULL; + char *sslcert = NULL; + char *sslca = NULL; +@@ -745,7 +747,11 @@ + MYSQL_CONNHOST_OPT, MYSQL_CONNUSER_OPT, MYSQL_CONNPASSWORD_OPT, + MYSQL_CONNDB_OPT, MYSQL_CONNPORT_OPT, MYSQL_CONNSOCKET_OPT, MYSQL_CONNENCODING_OPT, + MYSQL_CONNSSL_OPT, MYSQL_CONNCOMPRESS_OPT, MYSQL_CONNNOSCHEMA_OPT, MYSQL_CONNODBC_OPT, ++#if (MYSQL_VERSION_ID >= 40107) + MYSQL_MULTISTATEMENT_OPT,MYSQL_MULTIRESULT_OPT,MYSQL_LOCALFILES_OPT,MYSQL_IGNORESPACE_OPT, ++#else ++ MYSQL_LOCALFILES_OPT,MYSQL_IGNORESPACE_OPT, ++#endif + MYSQL_FOUNDROWS_OPT,MYSQL_INTERACTIVE_OPT,MYSQL_SSLKEY_OPT,MYSQL_SSLCERT_OPT, + MYSQL_SSLCA_OPT,MYSQL_SSLCAPATH_OPT,MYSQL_SSLCIPHERS_OPT + }; +@@ -786,8 +792,15 @@ + encodingname = Tcl_GetStringFromObj(objv[++i],NULL); + break; + case MYSQL_CONNSSL_OPT: ++#if (MYSQL_VERSION_ID >= 40107) + if (Tcl_GetBooleanFromObj(interp,objv[++i],&isSSL) != TCL_OK ) + return TCL_ERROR; ++#else ++ if (Tcl_GetBooleanFromObj(interp,objv[++i],&booleanflag) != TCL_OK ) ++ return TCL_ERROR; ++ if (booleanflag) ++ flags |= CLIENT_SSL; ++#endif + break; + case MYSQL_CONNCOMPRESS_OPT: + if (Tcl_GetBooleanFromObj(interp,objv[++i],&booleanflag) != TCL_OK ) +@@ -807,13 +820,12 @@ if (booleanflag) flags |= CLIENT_ODBC; break; @@ -25,18 +80,29 @@ case MYSQL_MULTISTATEMENT_OPT: if (Tcl_GetBooleanFromObj(interp,objv[++i],&booleanflag) != TCL_OK ) return TCL_ERROR; -@@ -817,6 +819,7 @@ + if (booleanflag) + flags |= CLIENT_MULTI_STATEMENTS; +- +- + break; + case MYSQL_MULTIRESULT_OPT: + if (Tcl_GetBooleanFromObj(interp,objv[++i],&booleanflag) != TCL_OK ) +@@ -821,7 +833,7 @@ if (booleanflag) flags |= CLIENT_MULTI_RESULTS; break; +- +#endif - case MYSQL_LOCALFILES_OPT: if (Tcl_GetBooleanFromObj(interp,objv[++i],&booleanflag) != TCL_OK ) -@@ -876,9 +879,11 @@ - #if (MYSQL_VERSION_ID>=32350) + return TCL_ERROR; +@@ -877,12 +889,12 @@ + handle->connection = mysql_init(NULL); + + /* the function below caused in version pre 3.23.50 segmentation fault */ +-#if (MYSQL_VERSION_ID>=32350) mysql_options(handle->connection,MYSQL_READ_DEFAULT_GROUP,groupname); - #endif +-#endif +#if (MYSQL_VERSION_ID >= 40107) if (isSSL) { mysql_ssl_set(handle->connection,sslkey,sslcert, sslca, sslcapath, sslcipher); @@ -45,84 +111,57 @@ if (!mysql_real_connect(handle->connection, hostname, user, password, db, port, socket, flags)) { -@@ -1388,8 +1393,8 @@ - static int Mysqltcl_Receive(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) - { - MysqltclState *statePtr = (MysqltclState *)clientData; -- int code ; -- int count ; -+ int code = TCL_ERROR; -+ int count = 0; - - MysqlTclHandle *handle; - int idx ; -@@ -1397,7 +1402,6 @@ - Tcl_Obj** listObjv ; - MYSQL_ROW row ; - int *val = NULL; -- int breakLoop = 0; - unsigned long *lengths; - - -@@ -1455,15 +1459,9 @@ - switch(code=Tcl_EvalObjEx(interp, objv[4],0)) { - case TCL_CONTINUE: - case TCL_OK: -- break ; -- case TCL_BREAK: -- breakLoop=1; -- break; -- default: -- breakLoop=1; -- break; -+ continue; - } -- if (breakLoop==1) break; -+ break; - } - } - if (val!=NULL) { -@@ -1592,6 +1590,7 @@ - Tcl_SetObjResult(interp, Tcl_NewStringObj(val,-1)); - } +@@ -1513,7 +1525,11 @@ + static CONST char* MysqlDbOpt[] = + { + "dbname", "dbname?", "tables", "host", "host?", "databases", ++#if (MYSQL_VERSION_ID >= 40107) + "info","serverversion","serverversionid","sqlstate","state",NULL ++#else ++ "info","serverversion","state",NULL ++#endif + }; + enum dboption { + MYSQL_INFNAME_OPT, MYSQL_INFNAMEQ_OPT, MYSQL_INFTABLES_OPT, +@@ -1547,8 +1563,10 @@ break; + case MYSQL_INFO: + case MYSQL_INF_SERVERVERSION: +#if (MYSQL_VERSION_ID >= 40107) + case MYSQL_INFO_SERVERVERSION_ID: + case MYSQL_INFO_SQLSTATE: ++#endif + case MYSQL_INFO_STATE: + break; + +@@ -1605,12 +1623,14 @@ case MYSQL_INF_SERVERVERSION: Tcl_SetObjResult(interp, Tcl_NewStringObj(mysql_get_server_info(handle->connection),-1)); break; -@@ -1604,6 +1603,7 @@ ++#if (MYSQL_VERSION_ID >= 40107) + case MYSQL_INFO_SERVERVERSION_ID: + Tcl_SetObjResult(interp, Tcl_NewIntObj(mysql_get_server_version(handle->connection))); + break; + case MYSQL_INFO_SQLSTATE: + Tcl_SetObjResult(interp, Tcl_NewStringObj(mysql_sqlstate(handle->connection),-1)); + break; ++#endif case MYSQL_INFO_STATE: Tcl_SetObjResult(interp, Tcl_NewStringObj(mysql_stat(handle->connection),-1)); break; -+#endif - default: /* should never happen */ - return mysql_prim_confl(interp,objc,objv,"weirdness in Mysqltcl_Info") ; - } -@@ -1625,6 +1625,7 @@ - int idx ; - Tcl_Obj *resList; +@@ -1637,7 +1657,11 @@ char **option; -+#if (MYSQL_VERSION_ID >= 40107) static CONST char* MysqlInfoOpt[] = { ++#if (MYSQL_VERSION_ID >= 40107) "connectparameters", "clientversion","clientversionid", NULL -@@ -1632,6 +1633,15 @@ - enum baseoption { - MYSQL_BINFO_CONNECT, MYSQL_BINFO_CLIENTVERSION,MYSQL_BINFO_CLIENTVERSIONID - }; +#else -+ static CONST char* MysqlInfoOpt[] = -+ { + "connectparameters", "clientversion", NULL -+ }; -+ enum baseoption { -+ MYSQL_BINFO_CONNECT, MYSQL_BINFO_CLIENTVERSION -+ }; +#endif - - if (objc <2) { - Tcl_WrongNumArgs(interp, 1, objv, "connectparameters | clientversion"); -@@ -1657,9 +1667,11 @@ + }; + enum baseoption { + MYSQL_BINFO_CONNECT, MYSQL_BINFO_CLIENTVERSION,MYSQL_BINFO_CLIENTVERSIONID +@@ -1667,9 +1691,11 @@ case MYSQL_BINFO_CLIENTVERSION: Tcl_SetObjResult(interp, Tcl_NewStringObj(mysql_get_client_info(),-1)); break; @@ -134,7 +173,7 @@ } return TCL_OK ; } -@@ -1974,6 +1986,10 @@ +@@ -1984,6 +2010,10 @@ static int Mysqltcl_AutoCommit(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { @@ -145,7 +184,7 @@ MysqlTclHandle *handle; int isAutocommit = 0; -@@ -1986,6 +2002,7 @@ +@@ -1996,6 +2026,7 @@ mysql_server_confl(interp,objc,objv,handle->connection); } return TCL_OK; @@ -153,7 +192,7 @@ } /* *---------------------------------------------------------------------- -@@ -1997,6 +2014,10 @@ +@@ -2007,6 +2038,10 @@ static int Mysqltcl_Commit(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { @@ -164,7 +203,7 @@ MysqlTclHandle *handle; if ((handle = mysql_prologue(interp, objc, objv, 2, 2, CL_CONN, -@@ -2006,6 +2027,7 @@ +@@ -2016,6 +2051,7 @@ mysql_server_confl(interp,objc,objv,handle->connection); } return TCL_OK; @@ -172,7 +211,7 @@ } /* *---------------------------------------------------------------------- -@@ -2017,6 +2039,10 @@ +@@ -2027,6 +2063,10 @@ static int Mysqltcl_Rollback(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { @@ -183,7 +222,7 @@ MysqlTclHandle *handle; if ((handle = mysql_prologue(interp, objc, objv, 2, 2, CL_CONN, -@@ -2026,6 +2052,7 @@ +@@ -2036,6 +2076,7 @@ mysql_server_confl(interp,objc,objv,handle->connection); } return TCL_OK; @@ -191,7 +230,7 @@ } /* *---------------------------------------------------------------------- -@@ -2037,6 +2064,10 @@ +@@ -2047,6 +2088,10 @@ static int Mysqltcl_MoreResult(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { @@ -202,7 +241,7 @@ MysqlTclHandle *handle; int boolResult = 0; -@@ -2046,6 +2077,7 @@ +@@ -2056,6 +2101,7 @@ boolResult = mysql_more_results(handle->connection); Tcl_SetObjResult(interp,Tcl_NewBooleanObj(boolResult)); return TCL_OK; @@ -210,7 +249,7 @@ } /* -@@ -2059,6 +2091,10 @@ +@@ -2069,6 +2115,10 @@ static int Mysqltcl_NextResult(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { @@ -221,7 +260,7 @@ MysqlTclHandle *handle; int result = 0; -@@ -2085,6 +2121,7 @@ +@@ -2095,6 +2145,7 @@ Tcl_SetObjResult(interp, Tcl_NewIntObj(handle->res_count)); } return TCL_OK; @@ -229,7 +268,7 @@ } /* *---------------------------------------------------------------------- -@@ -2096,6 +2133,10 @@ +@@ -2106,6 +2157,10 @@ static int Mysqltcl_WarningCount(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { @@ -240,7 +279,7 @@ MysqlTclHandle *handle; int count = 0; -@@ -2105,6 +2146,7 @@ +@@ -2115,6 +2170,7 @@ count = mysql_warning_count(handle->connection); Tcl_SetObjResult(interp,Tcl_NewIntObj(count)); return TCL_OK; @@ -248,15 +287,7 @@ } /* *---------------------------------------------------------------------- -@@ -2149,7 +2191,6 @@ - - static int Mysqltcl_NewNull(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) - { -- Tcl_Obj *objPtr; - if (objc != 1) { - Tcl_WrongNumArgs(interp, 1, objv, ""); - return TCL_ERROR; -@@ -2164,13 +2205,19 @@ +@@ -2173,13 +2229,19 @@ * usage: mysql::setserveroption (- * */ @@ -276,7 +307,7 @@ MysqlTclHandle *handle; int idx; enum enum_mysql_set_option mysqlServerOption; -@@ -2201,6 +2248,7 @@ +@@ -2210,6 +2272,7 @@ mysql_server_confl(interp,objc,objv,handle->connection); } return TCL_OK; @@ -284,22 +315,15 @@ } /* *---------------------------------------------------------------------- -@@ -2211,6 +2259,10 @@ - */ - static int Mysqltcl_ShutDown(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) - { -+#if (MYSQL_VERSION_ID < 40107) -+ Tcl_AddErrorInfo(interp, FUNCTION_NOT_AVAILABLE); -+ return TCL_ERROR; -+#else - MysqlTclHandle *handle; - +@@ -2225,7 +2288,11 @@ if ((handle = mysql_prologue(interp, objc, objv, 2, 2, CL_CONN, -@@ -2220,6 +2272,7 @@ + "handle")) == 0) + return TCL_ERROR; ++#if (MYSQL_VERSION_ID >= 40107) + if (mysql_shutdown(handle->connection,SHUTDOWN_DEFAULT)!=0) { ++#else ++ if (mysql_shutdown(handle->connection)!=0) { ++#endif mysql_server_confl(interp,objc,objv,handle->connection); } return TCL_OK; -+#endif - } - /* - *---------------------------------------------------------------------- diff --git a/databases/mysqltcl/pkg-message-legacy b/databases/mysqltcl/pkg-message-legacy index 9b93a1bd9b00..0bddc206e96c 100644 --- a/databases/mysqltcl/pkg-message-legacy +++ b/databases/mysqltcl/pkg-message-legacy @@ -14,7 +14,6 @@ - nextresult - warningcount - setserverversion - - shutdown This is not supported by the author of mysqltcl. Please send comments and questions solely to me. diff --git a/databases/mysqltcl/pkg-plist b/databases/mysqltcl/pkg-plist index caa203b4ee43..c3accd05d75f 100644 --- a/databases/mysqltcl/pkg-plist +++ b/databases/mysqltcl/pkg-plist @@ -1,3 +1,3 @@ -lib/%%TCL_VERSION%%/mysqltcl/%%LIB_NAME%% -lib/%%TCL_VERSION%%/mysqltcl/pkgIndex.tcl -@dirrm lib/%%TCL_VERSION%%/mysqltcl +lib/%%LIB_DIR%%/%%LIB_NAME%% +lib/%%LIB_DIR%%/pkgIndex.tcl +@dirrm lib/%%LIB_DIR%% |