aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorperky <perky@FreeBSD.org>2006-06-23 11:54:01 +0800
committerperky <perky@FreeBSD.org>2006-06-23 11:54:01 +0800
commit0ef273f23e2297df3ea882fca62705527c8d47a3 (patch)
tree00d5b39293d43a9c4cb4e510fde848412eb4fe02
parent0cf97ffd47b90c872c24c5af41efc91d7dd63d19 (diff)
downloadfreebsd-ports-gnome-0ef273f23e2297df3ea882fca62705527c8d47a3.tar.gz
freebsd-ports-gnome-0ef273f23e2297df3ea882fca62705527c8d47a3.tar.zst
freebsd-ports-gnome-0ef273f23e2297df3ea882fca62705527c8d47a3.zip
Add new port for python sqlite3 module.
This port installs a Python "standard" library version of pysqlite which is provided by databases/py-pysqlite22 already. Because sqlite3 module was introduced in Python 2.5, this port plays only for 2.5 or laters. See Also: http://docs.python.org/dev/lib/module-sqlite3.html
-rw-r--r--databases/Makefile1
-rw-r--r--databases/py-sqlite3/Makefile34
-rw-r--r--databases/py-sqlite3/files/setup.py41
-rw-r--r--databases/py-sqlite3/pkg-descr8
-rw-r--r--databases/py-sqlite3/pkg-message7
5 files changed, 91 insertions, 0 deletions
diff --git a/databases/Makefile b/databases/Makefile
index 066de23b3527..38447520ac12 100644
--- a/databases/Makefile
+++ b/databases/Makefile
@@ -387,6 +387,7 @@
SUBDIR += py-oops
SUBDIR += py-psycopg
SUBDIR += py-pyPgSQL
+ SUBDIR += py-sqlite3
SUBDIR += py-sqlobject
SUBDIR += py-sqlrelay
SUBDIR += py-sybase
diff --git a/databases/py-sqlite3/Makefile b/databases/py-sqlite3/Makefile
new file mode 100644
index 000000000000..d742e1b47ef9
--- /dev/null
+++ b/databases/py-sqlite3/Makefile
@@ -0,0 +1,34 @@
+# New ports collection makefile for: py-sqlite3
+# Date created: 23 June 2006
+# Whom: Hye-Shik Chang
+#
+# $FreeBSD$
+#
+
+PORTNAME= sqlite3
+PORTVERSION= ${PYTHON_PORTVERSION}
+CATEGORIES= databases python
+MASTER_SITES= ${PYTHON_MASTER_SITES}
+MASTER_SITE_SUBDIR= ${PYTHON_MASTER_SITE_SUBDIR}
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+DISTFILES= ${PYTHON_DISTFILE}
+
+MAINTAINER= perky@FreeBSD.org
+COMMENT= Standard Python binding to the SQLite3 library
+
+LIB_DEPENDS= sqlite3.8:${PORTSDIR}/databases/sqlite3
+
+PLIST_FILES= lib/%%PYTHON_VERSION%%/site-packages/_sqlite3.so
+DIST_SUBDIR= python
+USE_PYTHON= 2.5+
+USE_PYDISTUTILS=yes
+WRKSRC= ${PYTHON_WRKSRC}/Modules
+MD5_FILE= ${PORTSDIR}/lang/python/distinfo
+
+pre-extract:
+ @${CAT} ${PKGMESSAGE}
+
+post-extract:
+ @${CP} ${FILESDIR}/setup.py ${WRKSRC}
+
+.include <bsd.port.mk>
diff --git a/databases/py-sqlite3/files/setup.py b/databases/py-sqlite3/files/setup.py
new file mode 100644
index 000000000000..ec0fd9ccc197
--- /dev/null
+++ b/databases/py-sqlite3/files/setup.py
@@ -0,0 +1,41 @@
+#!/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"
+
+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)]
+ )
diff --git a/databases/py-sqlite3/pkg-descr b/databases/py-sqlite3/pkg-descr
new file mode 100644
index 000000000000..8d91da89239a
--- /dev/null
+++ b/databases/py-sqlite3/pkg-descr
@@ -0,0 +1,8 @@
+SQLite is a library that provides a SQL-language database that
+stores data in disk files without requiring a separate server
+process. pysqlite provides a SQL interface compliant with the DB-API
+2.0 specification described by PEP 249. This means that it should
+be possible to write the first version of your applications using
+SQLite for data storage. If switching to a larger database such as
+PostgreSQL or Oracle is later necessary, the switch should be
+relatively easy.
diff --git a/databases/py-sqlite3/pkg-message b/databases/py-sqlite3/pkg-message
new file mode 100644
index 000000000000..fa94cdeeb335
--- /dev/null
+++ b/databases/py-sqlite3/pkg-message
@@ -0,0 +1,7 @@
+====
+**CAUTION**
+This port installs the sqlite3 module which is distributed as a
+part of standard library collection of Python 2.5 and laters. If
+you're using Python 2.4 or former, you must install databases/py-pysqlite22
+instead.
+====