aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--databases/Makefile1
-rw-r--r--databases/py-odbc/Makefile66
-rw-r--r--databases/py-odbc/distinfo3
-rw-r--r--databases/py-odbc/files/patch-setup-libs12
-rw-r--r--databases/py-odbc/pkg-descr8
-rw-r--r--databases/py-odbc/pkg-plist7
6 files changed, 97 insertions, 0 deletions
diff --git a/databases/Makefile b/databases/Makefile
index 9366b4dd121d..9c1eabac616f 100644
--- a/databases/Makefile
+++ b/databases/Makefile
@@ -530,6 +530,7 @@
SUBDIR += py-memcached
SUBDIR += py-migrate
SUBDIR += py-mssql
+ SUBDIR += py-odbc
SUBDIR += py-oops
SUBDIR += py-pg8000
SUBDIR += py-pg_pqueue
diff --git a/databases/py-odbc/Makefile b/databases/py-odbc/Makefile
new file mode 100644
index 000000000000..73f9a4fe16ad
--- /dev/null
+++ b/databases/py-odbc/Makefile
@@ -0,0 +1,66 @@
+# New ports collection makefile for: pyodbc
+# Date created: April 15 2009
+# Whom: rkruus
+#
+# $FreeBSD$
+#
+
+# Like they say in the postgres-odbc Makefile (and I quote):
+#
+# This ODBC driver should work under either unixODBC or iODBC
+# driver manager, when compliled against one. (Important: Do not try
+# to have both installed -- they have overlapping files).
+
+# It looks like most people are using unixODBC these days, rather than
+# iODBC, so let's make unixODBC the default choice: to select iODBC,
+# set WITH_IODBC, without setting WITH_UNIXODBC. When the latter is
+# set or when neither is set, we go with WITH_UNIXODBC.
+#
+
+PORTNAME= pyodbc
+PORTVERSION= 2.1.5
+CATEGORIES= databases python
+MASTER_SITES= GOOGLE_CODE
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+DISTNAME= pyodbc-${PORTVERSION}
+
+MAINTAINER= rob.kruus@gmail.com
+COMMENT= ODBC connections for python
+
+USE_ZIP= yes
+USE_GMAKE= yes
+USE_PYTHON= 2.4+
+USE_PYDISTUTILS= yes
+
+# again, shamelessly copied from datebase/postgres-odbc
+.if !defined(WITH_IODBC)
+WITH_UNIXODBC= yes
+.endif
+
+.if defined(WITH_UNIXODBC)
+# I.e. even if WITH_IODBC is defined
+LIB_DEPENDS+= odbc.1:${PORTSDIR}/databases/unixODBC
+BUILD_DEPENDS+= unixODBC>=2.2.14_1:${PORTSDIR}/databases/unixODBC
+.else
+LIB_DEPENDS+= iodbc.3:${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
+
+.include <bsd.port.mk>
diff --git a/databases/py-odbc/distinfo b/databases/py-odbc/distinfo
new file mode 100644
index 000000000000..c5c13c701cde
--- /dev/null
+++ b/databases/py-odbc/distinfo
@@ -0,0 +1,3 @@
+MD5 (pyodbc-2.1.5.zip) = eccee612807e22a2aa3cc5033aee0fcc
+SHA256 (pyodbc-2.1.5.zip) = 0e47fbe829e2295ea43c00ddcb268c274dc37a8a5a7963fb6f64080203278793
+SIZE (pyodbc-2.1.5.zip) = 147862
diff --git a/databases/py-odbc/files/patch-setup-libs b/databases/py-odbc/files/patch-setup-libs
new file mode 100644
index 000000000000..b4915ec86fab
--- /dev/null
+++ b/databases/py-odbc/files/patch-setup-libs
@@ -0,0 +1,12 @@
+--- setup.py.orig 2008-12-06 10:34:24.000000000 -0600
++++ setup.py 2009-01-15 14:56:00.648997526 -0600
+@@ -40,7 +40,8 @@
+ # Other posix-like: Linux, Solaris, etc.
+
+ # 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', '-I/usr/local/include', '-L/usr/local/lib']
++ extra_link_args = ['-L/usr/local/lib']
+
+ # What is the proper way to detect iODBC, MyODBC, unixODBC, etc.?
+ libraries.append('odbc')
diff --git a/databases/py-odbc/pkg-descr b/databases/py-odbc/pkg-descr
new file mode 100644
index 000000000000..4f5d9f62e1a0
--- /dev/null
+++ b/databases/py-odbc/pkg-descr
@@ -0,0 +1,8 @@
+pyodbc is a Python module that allows you to use ODBC to connect to
+almost any database from Windows, Linux, OS/X, and more.
+
+It implements the Python Database API Specification v2.0, but
+additional features have been added to simplify database
+programming even more.
+
+WWW: http://code.google.com/p/pyodbc/
diff --git a/databases/py-odbc/pkg-plist b/databases/py-odbc/pkg-plist
new file mode 100644
index 000000000000..45900da5f50d
--- /dev/null
+++ b/databases/py-odbc/pkg-plist
@@ -0,0 +1,7 @@
+%%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%%