diff options
-rw-r--r-- | databases/py-sqlite3/DESCR | 2 | ||||
-rw-r--r-- | databases/py-sqlite3/Makefile | 34 | ||||
-rw-r--r-- | databases/py-sqlite3/PLIST | 2 | ||||
-rw-r--r-- | databases/py-sqlite3/files/setup.py | 33 |
4 files changed, 71 insertions, 0 deletions
diff --git a/databases/py-sqlite3/DESCR b/databases/py-sqlite3/DESCR new file mode 100644 index 00000000000..33b432568b5 --- /dev/null +++ b/databases/py-sqlite3/DESCR @@ -0,0 +1,2 @@ +This is the interface to the SQLite library built into Python starting +with version 2.5. It allows Python programs to access SQLite databases. diff --git a/databases/py-sqlite3/Makefile b/databases/py-sqlite3/Makefile new file mode 100644 index 00000000000..d8e5732951b --- /dev/null +++ b/databases/py-sqlite3/Makefile @@ -0,0 +1,34 @@ +# $NetBSD: Makefile,v 1.1.1.1 2008/08/27 00:28:57 epg Exp $ + +PKGNAME= ${PYPKGPREFIX}-sqlite3-0 +CATEGORIES= databases python + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= http://www.python.org/ +COMMENT= Built-in sqlite support for Python 2.5 and up + +PKG_DESTDIR_SUPPORT= user-destdir + +USE_TOOLS+= patch + +EXTRACT_ELEMENTS= ${PYSUBDIR}/Modules/_sqlite + +PYBINMODULE= yes +PYDISTUTILSPKG= yes +PYTHON_VERSIONS_ACCEPTED=25 +PY_SETUP_SUBST+= SQLITE_PREFIX=${BUILDLINK_PREFIX.sqlite3} + +# ignore errors due to missing files (EXTRACT_ELEMENTS!) +do-patch: + set -e; \ + cd ${WRKSRC}; \ + for f in ${PATCHDIR}/patch-*; do \ + ${PATCH} --batch < "$$f" || ${TRUE}; \ + done + +BUILDLINK_API_DEPENDS.python25+= python25>=2.5.2nb2 + +.include "../../databases/sqlite3/buildlink3.mk" +.include "../../lang/python/extension.mk" +.include "../../lang/python/srcdist.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/databases/py-sqlite3/PLIST b/databases/py-sqlite3/PLIST new file mode 100644 index 00000000000..9ea4fd6f981 --- /dev/null +++ b/databases/py-sqlite3/PLIST @@ -0,0 +1,2 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2008/08/27 00:28:57 epg Exp $ +${PYSITELIB}/_sqlite3.so diff --git a/databases/py-sqlite3/files/setup.py b/databases/py-sqlite3/files/setup.py new file mode 100644 index 00000000000..7eac27acba8 --- /dev/null +++ b/databases/py-sqlite3/files/setup.py @@ -0,0 +1,33 @@ +# $NetBSD + +from distutils.core import setup, Extension + +sqlite_prefix = '@SQLITE_PREFIX@' +sqlite_incdir = sqlite_prefix + '/include' +sqlite_libdir = sqlite_prefix + '/lib' + +sqlite_defines = [('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', ] +sqlite_srcs = ['Modules/' + x for x in sqlite_srcs] + +setup( + ext_modules = [ + Extension('_sqlite3', + sqlite_srcs, + define_macros=sqlite_defines, + include_dirs=["Modules/_sqlite", + sqlite_incdir], + library_dirs=[sqlite_libdir], + runtime_library_dirs=[sqlite_libdir], + libraries=["sqlite3"]), + ] +) |