diff options
author | Li-Wen Hsu <lwhsu@FreeBSD.org> | 2009-06-30 21:51:53 +0000 |
---|---|---|
committer | Li-Wen Hsu <lwhsu@FreeBSD.org> | 2009-06-30 21:51:53 +0000 |
commit | 43f259ee0cb4da1f818e04dc6003c986145b09af (patch) | |
tree | 7541d241e971c3de7e27b4a43f2cf82cce9610f0 | |
parent | 5f405da980311449dd5b19a0d778eae39accb401 (diff) | |
download | ports-43f259ee0cb4da1f818e04dc6003c986145b09af.tar.gz ports-43f259ee0cb4da1f818e04dc6003c986145b09af.zip |
Notes
-rw-r--r-- | databases/py-sqlite3/Makefile | 10 | ||||
-rw-r--r-- | databases/py-sqlite3/files/setup3.py | 43 |
2 files changed, 51 insertions, 2 deletions
diff --git a/databases/py-sqlite3/Makefile b/databases/py-sqlite3/Makefile index d33ff720d869..bfbc9972c2f9 100644 --- a/databases/py-sqlite3/Makefile +++ b/databases/py-sqlite3/Makefile @@ -24,14 +24,20 @@ DIST_SUBDIR= python USE_PYTHON= 2.5+ USE_PYDISTUTILS=yes WRKSRC= ${PYTHON_WRKSRC}/Modules -MD5_FILE= ${PORTSDIR}/lang/python/distinfo +MD5_FILE= ${PORTSDIR}/lang/python${PYTHON_SUFFIX}/distinfo PYDISTUTILS_NOEGGINFO= yes +.include <bsd.port.pre.mk> + pre-extract: @${CAT} ${PKGMESSAGE} post-extract: +.if ${PYTHON_REL} < 300 @${CP} ${FILESDIR}/setup.py ${WRKSRC} +.else + @${CP} ${FILESDIR}/setup3.py ${WRKSRC}/setup.py +.endif -.include <bsd.port.mk> +.include <bsd.port.post.mk> diff --git a/databases/py-sqlite3/files/setup3.py b/databases/py-sqlite3/files/setup3.py new file mode 100644 index 000000000000..8bd5cce3771b --- /dev/null +++ b/databases/py-sqlite3/files/setup3.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python +# To use: +# python setup.py install +# + +__version__ = "$FreeBSD$" + +try: + import distutils + from distutils import sysconfig + from distutils.command.install import install + from distutils.core import setup, Extension +except: + raise SystemExit("Distutils problem") + +install.sub_commands = [x for x in install.sub_commands if 'egg' not in x[0]] + +prefix = sysconfig.PREFIX +inc_dirs = [prefix + "/include", "Modules/_sqlite"] +lib_dirs = [prefix + "/lib"] +libs = ["sqlite3"] +macros = [('MODULE_NAME', '"sqlite3"')] +sqlite_srcs = [ +'_sqlite/cache.c', +'_sqlite/connection.c', +'_sqlite/cursor.c', +'_sqlite/microprotocols.c', +'_sqlite/module.c', +'_sqlite/prepare_protocol.c', +'_sqlite/row.c', +'_sqlite/statement.c', +'_sqlite/util.c'] + +setup(name = "_sqlite3", + description = "SQLite 3 extension to Python", + + ext_modules = [Extension('_sqlite3', sqlite_srcs, + include_dirs = inc_dirs, + libraries = libs, + library_dirs = lib_dirs, + runtime_library_dirs = lib_dirs, + define_macros = macros)] + ) |