From nobody@FreeBSD.org  Thu Dec  6 18:34:13 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 316C03F7
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  6 Dec 2012 18:34:13 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 0D7FC8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  6 Dec 2012 18:34:13 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qB6IYC1F038075
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 6 Dec 2012 18:34:12 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id qB6IYC9D038074;
	Thu, 6 Dec 2012 18:34:12 GMT
	(envelope-from nobody)
Message-Id: <201212061834.qB6IYC9D038074@red.freebsd.org>
Date: Thu, 6 Dec 2012 18:34:12 GMT
From: Robert Kruus <rob.rkuus@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Update to databases/py-odbc
X-Send-Pr-Version: www-3.1
X-GNATS-Notify: rob.kruus@gmail.com

>Number:         174242
>Category:       ports
>Synopsis:       Update to databases/py-odbc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-python
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 06 18:40:00 UTC 2012
>Closed-Date:    Sat Aug 17 08:29:34 UTC 2013
>Last-Modified:  Sat Aug 17 08:30:00 UTC 2013
>Originator:     Robert Kruus
>Release:        8.1
>Organization:
Government of Saskatchewan
>Environment:
FreeBSD wfm.gos.ca 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Wed Aug 11 16:42:44 CST 2010     root@thunder.gos.ca:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
Version update. It seems to build fine but I am not all that happy with some of the stuff in the Makefile to make it respect PREFIX.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -Nur py-odbc.orig/Makefile py-odbc/Makefile
--- py-odbc.orig/Makefile	2012-12-06 12:20:34.455665137 -0600
+++ py-odbc/Makefile	2012-12-06 12:16:59.753854589 -0600
@@ -18,8 +18,7 @@
 #
 
 PORTNAME=	pyodbc
-PORTVERSION=	2.1.5
-PORTREVISION=	2
+PORTVERSION=	3.0.6
 CATEGORIES=	databases python
 MASTER_SITES=	GOOGLE_CODE
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -50,18 +49,7 @@
 	@(cd ${WRKSRC}; ${PYTHON_CMD} setup.py build)
 
 do-install:
-	@(cd ${WRKSRC}; ${PYTHON_CMD} setup.py install)
-
-DOCSDIR=		${PREFIX}/share/doc/py-odbc
-
-DOCS=			docs.html index.html license.html styles.css tutorial.html
-
-post-install:
-.if !defined(NOPORTDOCS)
-	@${MKDIR} ${DOCSDIR}
-.for f in ${DOCS}
-	@${INSTALL_DATA} ${WRKSRC}/web/${f} ${DOCSDIR}
-.endfor
-.endif
+	${MKDIR} ${PYTHONPREFIX_SITELIBDIR}
+	@(cd ${WRKSRC}; ${SETENV} PYTHONPATH=${PYTHONPREFIX_SITELIBDIR} ${PYTHON_CMD} setup.py install --prefix=${PREFIX})
 
 .include <bsd.port.mk>
diff -Nur py-odbc.orig/distinfo py-odbc/distinfo
--- py-odbc.orig/distinfo	2012-12-06 12:20:34.455665137 -0600
+++ py-odbc/distinfo	2012-12-06 12:02:26.428323381 -0600
@@ -1,2 +1,2 @@
-SHA256 (pyodbc-2.1.5.zip) = 0e47fbe829e2295ea43c00ddcb268c274dc37a8a5a7963fb6f64080203278793
-SIZE (pyodbc-2.1.5.zip) = 147862
+SHA256 (pyodbc-3.0.6.zip) = e5a7f12deddf4b258bed904b5a071dd43c40c78de8e24c9228f8174e69f5366d
+SIZE (pyodbc-3.0.6.zip) = 85518
diff -Nur py-odbc.orig/files/patch-setup-libs py-odbc/files/patch-setup-libs
--- py-odbc.orig/files/patch-setup-libs	2012-12-06 12:20:34.455665137 -0600
+++ py-odbc/files/patch-setup-libs	2012-12-06 11:47:06.052870093 -0600
@@ -1,22 +1,18 @@
---- setup.py.orig	2009-04-15 14:10:36.000000000 -0600
-+++ setup.py	2009-06-24 09:15:04.203757061 -0600
-@@ -54,8 +54,16 @@
-     else:
-         # Other posix-like: Linux, Solaris, etc.
+--- setup.py.orig	2012-06-24 17:49:34.000000000 -0600
++++ setup.py	2012-12-06 11:47:02.121782861 -0600
+@@ -156,6 +156,15 @@
+         # What is the proper way to detect iODBC, MyODBC, unixODBC, etc.?
+         settings['libraries'].append('odbc')
  
-+        try:
-+            include = '-I'+os.environ['PREFIX']+'/include'
-+            lib = '-L'+os.environ['PREFIX']+'/lib'
-+        except:
-+            include = '-I/usr/local/include'
-+            lib = '-L/usr/local/lib'
++        if sys.platform.startswith('freebsd'):
++            settings['library_dirs'] = ['/usr/local/lib/']
++            settings['include_dirs'] = ['/usr/local/include/']
++            freebsd_prefix = '/usr/local'
++            if 'PREFIX' in os.environ:
++                freebsd_prefix = os.environ['PREFIX']
++            if 'PYTHONPREFIX_SITELIBDIR' in os.environ:
++                sys.path.append('/'.join(freebsd_prefix, os.environ['PYTHONPREFIX_SITELIBDIR']))
 +
-         # Python functions take a lot of 'char *' that really should be const.  gcc complains about this *a lot*
--        extra_compile_args = ['-Wno-write-strings']
-+        extra_compile_args = ['-Wno-write-strings', include, lib]
-+        extra_link_args = [ lib ]
+     return settings
+ 
  
-         # What is the proper way to detect iODBC, MyODBC, unixODBC, etc.?
-         libraries.append('odbc')
-
-
diff -Nur py-odbc.orig/files/patch-src_pyodbc.h py-odbc/files/patch-src_pyodbc.h
--- py-odbc.orig/files/patch-src_pyodbc.h	1969-12-31 18:00:00.000000000 -0600
+++ py-odbc/files/patch-src_pyodbc.h	2012-12-06 10:22:06.238855478 -0600
@@ -0,0 +1,12 @@
+--- src/pyodbc.h.orig	2012-01-13 13:10:48.000000000 -0600
++++ src/pyodbc.h	2012-12-06 10:21:36.527165345 -0600
+@@ -76,7 +76,9 @@
+ #include <stdarg.h>
+ 
+ #if defined(__SUNPRO_CC) || defined(__SUNPRO_C) || (defined(__GNUC__) && !defined(__MINGW32__))
++#ifndef __FreeBSD__
+ #include <alloca.h>
++#endif
+ #define CDECL cdecl
+ #define min(X,Y) ((X) < (Y) ? (X) : (Y))
+ #define max(X,Y) ((X) > (Y) ? (X) : (Y))
diff -Nur py-odbc.orig/pkg-plist py-odbc/pkg-plist
--- py-odbc.orig/pkg-plist	2012-12-06 12:20:34.456665007 -0600
+++ py-odbc/pkg-plist	2012-12-06 12:00:28.146692957 -0600
@@ -1,7 +1,3 @@
-%%PYTHON_SITELIBDIR%%/pyodbc.so
-%%PORTDOCS%%%%DOCSDIR%%/docs.html
-%%PORTDOCS%%%%DOCSDIR%%/index.html
-%%PORTDOCS%%%%DOCSDIR%%/license.html
-%%PORTDOCS%%%%DOCSDIR%%/styles.css
-%%PORTDOCS%%%%DOCSDIR%%/tutorial.html
-%%PORTDOCS%%@dirrm %%DOCSDIR%%
+%%PYTHON_SITELIBDIR%%/pyodbc-3.0.6-py2.7-freebsd-8.1-RELEASE-amd64.egg
+@dirrm lib/python2.7/site-packages
+@dirrm lib/python2.7


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-python 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Dec 6 18:40:14 UTC 2012 
Responsible-Changed-Why:  
freebsd-python@ wants this port PRs (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174242 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Thu Dec 6 18:40:16 UTC 2012 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174242 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: rob.kruus@gmail.com
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/174242: Update to databases/py-odbc
Date: Thu, 6 Dec 2012 18:40:15 UT

 Maintainer of databases/py-odbc,
 
 Please note that PR ports/174242 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/174242
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

From: Robert Kruus <rob.kruus@gmail.com>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/174242: Update to databases/py-odbc
Date: Mon, 10 Dec 2012 08:23:18 -0600

 Go ahead on my part.
 
 Rob
 
 On Thu, Dec 6, 2012 at 12:40 PM, Edwin Groothuis <edwin@freebsd.org> wrote:
 > Maintainer of databases/py-odbc,
 >
 > Please note that PR ports/174242 has just been submitted.
 >
 > If it contains a patch for an upgrade, an enhancement or a bug fix
 > you agree on, reply to this email stating that you approve the patch
 > and a committer will take care of it.
 >
 > The full text of the PR can be found at:
 >     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/174242
 >
 > --
 > Edwin Groothuis via the GNATS Auto Assign Tool
 > edwin@FreeBSD.org
State-Changed-From-To: feedback->closed 
State-Changed-By: vanilla 
State-Changed-When: Sat Aug 17 08:29:33 UTC 2013 
State-Changed-Why:  
Committed, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174242 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/174242: commit references a PR
Date: Sat, 17 Aug 2013 08:29:23 +0000 (UTC)

 Author: vanilla
 Date: Sat Aug 17 08:29:14 2013
 New Revision: 324833
 URL: http://svnweb.freebsd.org/changeset/ports/324833
 
 Log:
   1: Upgrade to 3.0.6.
   2: trim Makefile header, fix pkg-plist.
   
   PR:		ports/174242
   Submitted by:	maintainer [1], me [2]
 
 Added:
   head/databases/py-odbc/files/patch-src_pyodbc.h   (contents, props changed)
 Modified:
   head/databases/py-odbc/Makefile
   head/databases/py-odbc/distinfo
   head/databases/py-odbc/files/patch-setup-libs
   head/databases/py-odbc/pkg-plist
 
 Modified: head/databases/py-odbc/Makefile
 ==============================================================================
 --- head/databases/py-odbc/Makefile	Sat Aug 17 08:28:01 2013	(r324832)
 +++ head/databases/py-odbc/Makefile	Sat Aug 17 08:29:14 2013	(r324833)
 @@ -1,9 +1,5 @@
 -# New ports collection makefile for:   pyodbc
 -# Date created:        April 15 2009
 -# Whom:                rkruus
 -#
 +# Created by: April 15 2009
  # $FreeBSD$
 -#
  
  # Like they say in the postgres-odbc Makefile (and I quote):
  #
 @@ -18,12 +14,11 @@
  #
  
  PORTNAME=	pyodbc
 -PORTVERSION=	2.1.5
 -PORTREVISION=	2
 +PORTVERSION=	3.0.6
  CATEGORIES=	databases python
  MASTER_SITES=	GOOGLE_CODE
  PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 -DISTNAME=		pyodbc-${PORTVERSION}
 +#DISTNAME=		pyodbc-${PORTVERSION}
  
  MAINTAINER=	rob.kruus@gmail.com
  COMMENT=	ODBC connections for python
 @@ -31,7 +26,8 @@ COMMENT=	ODBC connections for python
  USE_ZIP=	yes
  USE_GMAKE=	yes
  USE_PYTHON=	2.5+
 -USE_PYDISTUTILS=	yes
 +USE_PYDISTUTILS=	easy_install
 +PYEASYINSTALL_ARCHDEP=	yes
  
  # again, shamelessly copied from datebase/postgres-odbc
  .if !defined(WITH_IODBC)
 @@ -40,28 +36,17 @@ WITH_UNIXODBC=	yes
  
  .if defined(WITH_UNIXODBC)
  # I.e. even if WITH_IODBC is defined
 -LIB_DEPENDS+=	odbc.2:${PORTSDIR}/databases/unixODBC
 +LIB_DEPENDS+=	odbc:${PORTSDIR}/databases/unixODBC
  BUILD_DEPENDS+=	unixODBC>=2.2.14_1:${PORTSDIR}/databases/unixODBC
  .else
 -LIB_DEPENDS+=	iodbc.3:${PORTSDIR}/databases/libiodbc
 +LIB_DEPENDS+=	iodbc:${PORTSDIR}/databases/libiodbc
  .endif
  
  do-build:
  	@(cd ${WRKSRC}; ${PYTHON_CMD} setup.py build)
  
  do-install:
 -	@(cd ${WRKSRC}; ${PYTHON_CMD} setup.py install)
 -
 -DOCSDIR=		${PREFIX}/share/doc/py-odbc
 -
 -DOCS=			docs.html index.html license.html styles.css tutorial.html
 -
 -post-install:
 -.if !defined(NOPORTDOCS)
 -	@${MKDIR} ${DOCSDIR}
 -.for f in ${DOCS}
 -	@${INSTALL_DATA} ${WRKSRC}/web/${f} ${DOCSDIR}
 -.endfor
 -.endif
 +	${MKDIR} ${PYTHONPREFIX_SITELIBDIR}
 +	@(cd ${WRKSRC}; ${SETENV} PYTHONPATH=${PYTHONPREFIX_SITELIBDIR} ${PYTHON_CMD} setup.py install --prefix=${PREFIX})
  
  .include <bsd.port.mk>
 
 Modified: head/databases/py-odbc/distinfo
 ==============================================================================
 --- head/databases/py-odbc/distinfo	Sat Aug 17 08:28:01 2013	(r324832)
 +++ head/databases/py-odbc/distinfo	Sat Aug 17 08:29:14 2013	(r324833)
 @@ -1,2 +1,2 @@
 -SHA256 (pyodbc-2.1.5.zip) = 0e47fbe829e2295ea43c00ddcb268c274dc37a8a5a7963fb6f64080203278793
 -SIZE (pyodbc-2.1.5.zip) = 147862
 +SHA256 (pyodbc-3.0.6.zip) = e5a7f12deddf4b258bed904b5a071dd43c40c78de8e24c9228f8174e69f5366d
 +SIZE (pyodbc-3.0.6.zip) = 85518
 
 Modified: head/databases/py-odbc/files/patch-setup-libs
 ==============================================================================
 --- head/databases/py-odbc/files/patch-setup-libs	Sat Aug 17 08:28:01 2013	(r324832)
 +++ head/databases/py-odbc/files/patch-setup-libs	Sat Aug 17 08:29:14 2013	(r324833)
 @@ -1,22 +1,18 @@
 ---- setup.py.orig	2009-04-15 14:10:36.000000000 -0600
 -+++ setup.py	2009-06-24 09:15:04.203757061 -0600
 -@@ -54,8 +54,16 @@
 -     else:
 -         # Other posix-like: Linux, Solaris, etc.
 +--- setup.py.orig	2012-06-24 17:49:34.000000000 -0600
 ++++ setup.py	2012-12-06 11:47:02.121782861 -0600
 +@@ -156,6 +156,15 @@
 +         # What is the proper way to detect iODBC, MyODBC, unixODBC, etc.?
 +         settings['libraries'].append('odbc')
   
 -+        try:
 -+            include = '-I'+os.environ['PREFIX']+'/include'
 -+            lib = '-L'+os.environ['PREFIX']+'/lib'
 -+        except:
 -+            include = '-I/usr/local/include'
 -+            lib = '-L/usr/local/lib'
 ++        if sys.platform.startswith('freebsd'):
 ++            settings['library_dirs'] = ['/usr/local/lib/']
 ++            settings['include_dirs'] = ['/usr/local/include/']
 ++            freebsd_prefix = '/usr/local'
 ++            if 'PREFIX' in os.environ:
 ++                freebsd_prefix = os.environ['PREFIX']
 ++            if 'PYTHONPREFIX_SITELIBDIR' in os.environ:
 ++                sys.path.append('/'.join(freebsd_prefix, os.environ['PYTHONPREFIX_SITELIBDIR']))
  +
 -         # Python functions take a lot of 'char *' that really should be const.  gcc complains about this *a lot*
 --        extra_compile_args = ['-Wno-write-strings']
 -+        extra_compile_args = ['-Wno-write-strings', include, lib]
 -+        extra_link_args = [ lib ]
 +     return settings
 + 
   
 -         # What is the proper way to detect iODBC, MyODBC, unixODBC, etc.?
 -         libraries.append('odbc')
 -
 -
 
 Added: head/databases/py-odbc/files/patch-src_pyodbc.h
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/databases/py-odbc/files/patch-src_pyodbc.h	Sat Aug 17 08:29:14 2013	(r324833)
 @@ -0,0 +1,12 @@
 +--- src/pyodbc.h.orig	2012-01-13 13:10:48.000000000 -0600
 ++++ src/pyodbc.h	2012-12-06 10:21:36.527165345 -0600
 +@@ -76,7 +76,9 @@
 + #include <stdarg.h>
 + 
 + #if defined(__SUNPRO_CC) || defined(__SUNPRO_C) || (defined(__GNUC__) && !defined(__MINGW32__))
 ++#ifndef __FreeBSD__
 + #include <alloca.h>
 ++#endif
 + #define CDECL cdecl
 + #define min(X,Y) ((X) < (Y) ? (X) : (Y))
 + #define max(X,Y) ((X) > (Y) ? (X) : (Y))
 
 Modified: head/databases/py-odbc/pkg-plist
 ==============================================================================
 --- head/databases/py-odbc/pkg-plist	Sat Aug 17 08:28:01 2013	(r324832)
 +++ head/databases/py-odbc/pkg-plist	Sat Aug 17 08:29:14 2013	(r324833)
 @@ -1,7 +1 @@
 -%%PYTHON_SITELIBDIR%%/pyodbc.so
 -%%PORTDOCS%%%%DOCSDIR%%/docs.html
 -%%PORTDOCS%%%%DOCSDIR%%/index.html
 -%%PORTDOCS%%%%DOCSDIR%%/license.html
 -%%PORTDOCS%%%%DOCSDIR%%/styles.css
 -%%PORTDOCS%%%%DOCSDIR%%/tutorial.html
 -%%PORTDOCS%%@dirrm %%DOCSDIR%%
 +%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
