source: trunk/module/setup.py @ 236

Last change on this file since 236 was 236, checked in by D'Arcy J.M. Cain, 14 years ago

Get ready for version 3.8

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#!/usr/bin/env python
2# $Id: setup.py,v 1.15 2006-01-22 14:56:58 darcy Exp $
3
4# Setup script for the PyGreSQL version 3
5# created 2000/04 Mark Alexander <mwa@gate.net>
6# tweaked 2000/05 Jeremy Hylton <jeremy@cnri.reston.va.us>
7# win32 support 2001/01 Gerhard Haering <gerhard@bigfoot.de>
8
9# requires distutils; standard in Python 1.6, otherwise download from
10# http://www.python.org/sigs/distutils-sig/download.html
11
12# You may have to change the first 3 variables (include_dirs,
13# library_dirs, optional_libs) to match your postgres distribution.
14
15# Now, you can:
16#   python setup.py build   # to build the module
17#   python setup.py install # to install it
18
19# See http://www.python.org/sigs/distutils-sig/doc/ for more information
20# on using distutils to install Python programs.
21
22from distutils.core import setup
23from distutils.extension import Extension
24import sys, os
25
26def getconfig(s):
27        f = os.popen("pg_config --%s"% (s))
28        x = f.readline().strip()
29        f.close()
30        return x
31
32if sys.platform == "win32":
33        # If you want to build from source; you must have built a win32 native libpq    # before and copied libpq.dll into the PyGreSQL root directory.
34        win_pg_build_root = 'd:/dev/pg/postgresql-7.0.2/'
35        include_dirs=[ win_pg_build_root + 'src/include', win_pg_build_root + '/src/include/libpq', win_pg_build_root + 'src', win_pg_build_root + 'src/interfaces/libpq' ]
36        library_dirs=[ win_pg_build_root + 'src/interfaces/libpq/Release' ]
37        optional_libs=[ 'libpqdll', 'wsock32', 'advapi32' ]
38        data_files = [ 'libpq.dll' ]
39else:
40        include_dirs=[getconfig ('includedir'),getconfig('includedir-server')]
41        library_dirs=[getconfig('libdir')]
42        optional_libs=['pq']
43        data_files = []
44
45setup (name = "PyGreSQL",
46        version = "3.8",
47        description = "Python PostgreSQL Interfaces",
48        author = "D'Arcy J. M. Cain",
49        author_email = "darcy@PyGreSQL.org",
50        url = "http://www.pygresql.org/",
51        license = "Python",
52
53        py_modules = ['pg', 'pgdb'],
54        ext_modules = [ Extension(
55                name='_pg',
56                sources = ['pgmodule.c'],
57                include_dirs = include_dirs,
58                library_dirs = library_dirs,
59                libraries = optional_libs,
60        )],
61        data_files = data_files
62)
63
Note: See TracBrowser for help on using the repository browser.