~ubuntu-branches/ubuntu/lucid/python-apsw/lucid

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Bazaar Package Importer
  • Author(s): Joel Rosdahl
  • Date: 2008-07-07 20:24:11 UTC
  • mfrom: (1.1.5 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080707202411-612ylo5p89y9ilvi
Tags: 3.5.9-r2-1
* New upstream release.
* Build dependency on libsqlite3-dev 3.5.9.
* Updated Standards-Version to 3.8.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import os
 
2
import sys
2
3
 
3
4
from distutils.core import setup, Extension
4
5
 
5
6
define_macros=[]
6
7
 
7
 
# Excludes the assertions
8
 
define_macros.append( ('NDEBUG', '1') )
 
8
# We always want threadsafe
 
9
define_macros.append( ('SQLITE_THREADSAFE', '1') )
 
10
 
 
11
# We don't want assertions
 
12
if "--debug" not in sys.argv:
 
13
    define_macros.append( ('NDEBUG', '1') )
9
14
 
10
15
# This includes the functionality marked as experimental in SQLite 3.
11
16
# Comment out the line to exclude them
12
17
define_macros.append( ('EXPERIMENTAL', '1') )
13
18
 
14
 
# SQLite 3.3.9 disables extension loading by default.  If you have
15
 
# re-enabled it then comment out the following line:
16
 
define_macros.append( ('SQLITE_OMIT_LOAD_EXTENSION', 1) )
 
19
# If you compiled SQLite omitting functionality then specify the same
 
20
# defines here.  For example this exlcudes loadable extensions.
 
21
#
 
22
# define_macros.append( ('SQLITE_OMIT_LOAD_EXTENSION', '1') )
17
23
 
18
24
include_dirs=[]
19
25
library_dirs=[]
20
26
 
21
 
# if there is a sqlite3 subdirectory then use that
22
 
if os.path.exists("sqlite3"):
23
 
    include_dirs=["sqlite3"]
24
 
    library_dirs=["sqlite3"]
25
 
 
26
 
libraries=['sqlite3']
 
27
# Look for amalgamation in our directory or in sqlite3 subdirectory
 
28
amalgamation=(
 
29
    os.path.join(os.path.dirname(os.path.abspath(__file__)), "sqlite3.c"),
 
30
    os.path.join(os.path.dirname(os.path.abspath(__file__)), "sqlite3", "sqlite3.c")
 
31
    )
 
32
 
 
33
usingamalgamation=False
 
34
for path in amalgamation:
 
35
    if os.path.exists(path):
 
36
        if sys.platform=="win32":
 
37
            # double quotes get consumed by windows arg processing
 
38
            define_macros.append( ('APSW_USE_SQLITE_AMALGAMATION', '\\"'+path+'\\"') )
 
39
        else:
 
40
            define_macros.append( ('APSW_USE_SQLITE_AMALGAMATION', '"'+path+'"') )
 
41
        libraries=[]
 
42
        usingamalgamation=True
 
43
        break
 
44
    
 
45
if not usingamalgamation:
 
46
    # if there is a sqlite3 subdirectory then use that, otherwise
 
47
    # the system sqlite will be used
 
48
    if os.path.exists("sqlite3"):
 
49
        include_dirs=["sqlite3"]
 
50
        library_dirs=["sqlite3"]
 
51
 
 
52
    libraries=['sqlite3']
 
53
 
 
54
# setuptools likes to define NDEBUG even when we want debug stuff
 
55
if "--debug" in sys.argv:
 
56
    define_macros.append( ('APSW_NO_NDEBUG', 1) ) # double negatives are bad
 
57
    define_macros.append( ('SQLITE_DEBUG', 1) ) # also does NDEBUG mangling
 
58
 
27
59
 
28
60
# work out version number
29
61
version=open("apswversion.h", "rtU").read().split()[2].strip('"')
30
62
 
31
 
 
32
63
setup(name="apsw",
33
64
      version=version,
 
65
      description="Another Python SQLite Wrapper",
 
66
      long_description=\
 
67
"""A Python wrapper for the SQLite embedded relational database engine.
 
68
In contrast to other wrappers such as pysqlite it focuses on being
 
69
a minimal layer over SQLite attempting just to translate the
 
70
complete SQLite API into Python.""",
34
71
      author="Roger Binns",
35
72
      author_email="rogerb@rogerbinns.com",
36
 
      description="Another Python SQLite Wrapper",
 
73
      url="http://code.google.com/p/apsw/",
 
74
      download_url="http://code.google.com/p/apsw/downloads/list",
 
75
      classifiers=[
 
76
    "Development Status :: 5 - Production/Stable",
 
77
    "Intended Audience :: Developers",
 
78
    "License :: OSI Approved :: zlib/libpng License",
 
79
    "Operating System :: OS Independent",
 
80
    "Programming Language :: C",
 
81
    "Topic :: Database :: Front-Ends",
 
82
    ],
 
83
      keywords=["database", "sqlite"],
 
84
      license="OSI Approved :: zlib/libpng License",
37
85
 
38
86
      ext_modules=[Extension("apsw",
39
87
                             ["apsw.c"],