This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository python-pyproj.

commit 9aed8107eddbe70e5b04bc1cc85cec993d31d984
Author: Bas Couwenberg <sebas...@xs4all.nl>
Date:   Sun Apr 6 19:38:59 2014 +0200

    Use setup-proj.py for system installed Proj.4 library.
---
 debian/changelog                            |  1 +
 debian/patches/02-dont_compile_datums.patch | 17 -------
 debian/patches/02-use_setup-proj.patch      | 77 +++++++++++++++++++++++++++++
 debian/patches/series                       |  2 +-
 debian/rules                                |  3 ++
 5 files changed, 82 insertions(+), 18 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 55d542c..b9c9115 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,7 @@ python-pyproj (1.9.3-1) UNRELEASED; urgency=medium
   * Remove pyversion file and add X-Python*-Version to control file.
   * Drop doc-base registration for README.html, no longer included.
   * Update copyright file using copyright-format 1.0.
+  * Use setup-proj.py for system installed Proj.4 library.
 
  -- Bas Couwenberg <sebas...@xs4all.nl>  Sun, 06 Apr 2014 14:23:45 +0200
 
diff --git a/debian/patches/02-dont_compile_datums.patch 
b/debian/patches/02-dont_compile_datums.patch
deleted file mode 100644
index f1fc002..0000000
--- a/debian/patches/02-dont_compile_datums.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-From: David Paleino <da...@debian.org>
-Subject: don't compile datum files, as we're using the ones provided by
- proj-data
-Origin: vendor
-Forwarded: not-needed
-
---- a/setup.py
-+++ b/setup.py
-@@ -7,7 +7,7 @@ extensions = [Extension("pyproj._proj",d
- 
- # create binary datum shift grid files.
- pathout = os.path.join('lib',os.path.join('pyproj','data'))
--if sys.argv[1] != 'sdist':
-+if False:
-     cc = ccompiler.new_compiler()
-     #sysconfig.customize_compiler(cc) # doesn't work in python 3.3
-     cc.set_include_dirs(['src'])
diff --git a/debian/patches/02-use_setup-proj.patch 
b/debian/patches/02-use_setup-proj.patch
new file mode 100644
index 0000000..2c88d99
--- /dev/null
+++ b/debian/patches/02-use_setup-proj.patch
@@ -0,0 +1,77 @@
+Description: Use setup-proj.py for system installed Proj.4.
+ Don't overwrite datadir.py with setup.py, but use quilt patch.
+Author: Bas Couwenberg <sebas...@xs4all.nl>
+--- a/setup.py
++++ b/setup.py
+@@ -1,35 +1,28 @@
+-import sys, os, glob, subprocess
+-from distutils import ccompiler, sysconfig
++# build pyproj using installed proj library and data files
++# (instead of bundled source and data)
+ from distutils.core import setup, Extension
++import os, glob, numpy, sys, subprocess
+ 
+-deps = glob.glob('src/*.c')
+-extensions = [Extension("pyproj._proj",deps+['_proj.c'],include_dirs = 
['src'])]
++proj_dir = os.environ.get('PROJ_DIR')
++if proj_dir is None: proj_dir='/usr/local'
++proj_libdir = os.environ.get('PROJ_LIBDIR')
++proj_incdir = os.environ.get('PROJ_INCDIR')
++libdirs=[]
++incdirs=[numpy.get_include()]
++libraries=['proj']
+ 
+-# create binary datum shift grid files.
+-pathout = os.path.join('lib',os.path.join('pyproj','data'))
+-if sys.argv[1] != 'sdist':
+-    cc = ccompiler.new_compiler()
+-    #sysconfig.customize_compiler(cc) # doesn't work in python 3.3
+-    cc.set_include_dirs(['src'])
+-    objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
+-    execname = 'nad2bin'
+-    cc.link_executable(objects, execname)
+-    llafiles = glob.glob('datumgrid/*.lla')
+-    cmd = os.path.join(os.getcwd(),execname)
+-    for f in llafiles:
+-        fout = os.path.basename(f.split('.lla')[0])
+-        fout = os.path.join(pathout,fout)
+-        strg = '%s %s < %s' % (cmd, fout, f)
+-        sys.stdout.write('executing %s'%strg)
+-        subprocess.call(strg,shell=True)
++if proj_libdir is None and proj_dir is not None:
++    libdirs.append(os.path.join(proj_dir,'lib'))
++    libdirs.append(os.path.join(proj_dir,'lib64'))
++if proj_incdir is None and proj_dir is not None:
++    incdirs.append(os.path.join(proj_dir,'include'))
++
++pyprojext =\
++Extension("pyproj._proj",["_proj.c"],include_dirs=incdirs,library_dirs=libdirs,libraries=libraries)
+ 
+ packages          = ['pyproj']
+ package_dirs       = {'':'lib'}
+ 
+-datafiles = glob.glob(os.path.join(pathout,'*'))
+-datafiles = [os.path.join('data',os.path.basename(f)) for f in datafiles]
+-package_data = {'pyproj':datafiles}
+-
+ setup(name = "pyproj",
+   version = "1.9.3",
+   description = "Python interface to PROJ.4 library",
+@@ -47,14 +40,13 @@ Optimized for numpy arrays.""",
+   license           = "OSI Approved",
+   keywords          = ["python","map projections","GIS","mapping","maps"],
+   classifiers       = ["Development Status :: 4 - Beta",
+-                       "Intended Audience :: Science/Research", 
+-                       "License :: OSI Approved", 
++                       "Intended Audience :: Science/Research",
++                       "License :: OSI Approved",
+                        "Topic :: Software Development :: Libraries :: Python 
Modules",
+                        "Topic :: Scientific/Engineering :: GIS",
+                        "Topic :: Scientific/Engineering :: Mathematics",
+                        "Operating System :: OS Independent"],
+   packages          = packages,
+   package_dir       = package_dirs,
+-  ext_modules = extensions,
+-  package_data = package_data
++  ext_modules = [pyprojext]
+   )
diff --git a/debian/patches/series b/debian/patches/series
index cbd9482..ff139e5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,2 @@
 01-use_proj-data_instead_of_embedded.patch
-02-dont_compile_datums.patch
+02-use_setup-proj.patch
diff --git a/debian/rules b/debian/rules
index fae4413..be4749d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,6 +6,9 @@
 
 export PYBUILD_NAME=pyproj
 
+# Path to system installed Proj.4 data.
+export PROJ_DIR=/usr/
+
 override_dh_clean:
        dh_clean lib/pyproj/data/FL lib/pyproj/data/MD \
                 lib/pyproj/data/TN lib/pyproj/data/WI \

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-grass/python-pyproj.git

_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel

Reply via email to