Index: GNUmakefile =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/python/GNUmakefile,v retrieving revision 1.7 diff -u -p -r1.7 GNUmakefile --- GNUmakefile 2001/05/12 17:49:32 1.7 +++ GNUmakefile 2001/05/24 21:05:41 @@ -12,30 +12,16 @@ subdir = src/interfaces/python top_builddir = ../../.. include $(top_builddir)/src/Makefile.global -all: Makefile pgmodule.c libpq-all - $(MAKE) -f Makefile +all: pgmodule.c libpq-all + $(PYTHON) $(srcdir)/setup.py build .PHONY: libpq-all libpq-all: $(MAKE) -C $(libpq_builddir) all -Makefile: Setup.in Makefile.pre.in - $(MAKE) -f Makefile.pre.in boot srcdir=$(srcdir) VPATH=$(srcdir) - -Makefile.pre.in: $(python_makefile_pre_in) - cp $< $@ - -Setup.in: Setup.in.raw - sed -e 's,@libpq_srcdir@,$(libpq_srcdir),g' \ - -e 's,@libpq_builddir@,$(libpq_builddir),g' \ - -e 's%@EXTRA_LIBS@%$(filter -L%, $(LDFLAGS)) $(LIBS)%g' \ - -e 's%@INCLUDES@%$(filter -I%, $(CPPFLAGS))%g' \ - $< > $@ - -install: all +install: all installdirs @echo "Installing Python module" - @if ( $(INSTALL_DATA) pg.py $(python_moduledir) && \ - $(MAKE) -f Makefile install ); then : ; else \ + @if ( $(PYTHON) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix) ); then : ; else \ echo "*****" ;\ echo "* Skipping the installation of the Python interface module for lack"; \ echo "* of permissions. To install it, change to the directory"; \ @@ -44,6 +30,9 @@ install: all echo "*****"; \ fi +installdirs: + $(mkinstalldirs) $(DESTDIR)$(python_moduledir) + uninstall: @echo "*****"; \ echo "* Unfortunately, the Python interface module cannot be uninstalled"; \ @@ -51,8 +40,5 @@ uninstall: echo "* \`$(python_moduledir)' for files \`pg.py' and \`_pgmodule$(DLSUFFIX)'."; \ echo "*****" -# Python sometimes has a different idea what exactly "clean" is. - clean distclean maintainer-clean: - -[ -f Makefile ] && $(MAKE) -f Makefile clobber - rm -f Makefile.pre.in Makefile Setup Setup.in + $(PYTHON) $(srcdir)/setup.py clean --all Index: setup.py =================================================================== RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/python/setup.py,v retrieving revision 1.4 diff -u -p -r1.4 setup.py --- setup.py 2001/03/27 10:53:21 1.4 +++ setup.py 2001/05/24 21:05:41 @@ -1,56 +1,27 @@ #!/usr/bin/env python -# Setup script for the PyGreSQL version 3 -# created 2000/04 Mark Alexander -# tweaked 2000/05 Jeremy Hylton -# win32 support 2001/01 Gerhard Haering - -# requires distutils; standard in Python 1.6, otherwise download from -# http://www.python.org/sigs/distutils-sig/download.html - -# You may have to change the first 3 variables (include_dirs, -# library_dirs, optional_libs) to match your postgres distribution. - -# Now, you can: -# python setup.py build # to build the module -# python setup.py install # to install it - -# See http://www.python.org/sigs/distutils-sig/doc/ for more information -# on using distutils to install Python programs. - -from distutils.core import setup -from distutils.extension import Extension -import sys - -if sys.platform == "win32": - # 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. - win_pg_build_root = 'd:/dev/pg/postgresql-7.0.2/' - 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' ] - library_dirs=[ win_pg_build_root + 'src/interfaces/libpq/Release' ] - optional_libs=[ 'libpqdll', 'wsock32', 'advapi32' ] - data_files = [ 'libpq.dll' ] -else: - include_dirs=['/usr/include/pgsql'] - library_dirs=['usr/lib/pgsql'] - optional_libs=['pq'] - data_files = [] - -setup (name = "PyGreSQL", - version = "3.1", - description = "Python PostgreSQL Interfaces", - author = "D'Arcy J. M. Cain", - author_email = "darcy@druid.net", - url = "http://www.druid.net/pygresql/", - licence = "Python", - +# +# setup.py for src/interfaces/python, a.k.a. "PyGreSQL" +# +# Rewritten by Jason Tishler to conform with the +# current Distutils style +# +# $Header$ +# +# vim: tabstop=4 +# + +from distutils.core import setup, Extension + +setup( + name = 'PyGreSQL', + version = '3.2', py_modules = ['pg', 'pgdb'], - ext_modules = [ Extension( - name='_pg', - sources = ['pgmodule.c'], - include_dirs = include_dirs, - library_dirs = library_dirs, - libraries = optional_libs - )] - data_files = data_files -) - + ext_modules = [ + Extension( + name = '_pg', + sources = ['pgmodule.c'], + include_dirs = ['../../../src/interfaces/libpq', + '../../../src/include'], + library_dirs = ['../../../src/interfaces/libpq'], + libraries = ['pq'])])