[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Python3 bindings for GDAL



Hi developers,
I prepared a patch (attached) to generate the python3-gdal package: python3 bindings for GDAL 1.9.0.

I would like to push it in the git repo in order to have the new package with the next upload.

I know that there is an ongoing transition for GDAL so please let me know if the patch is OK and what is the bast way to proceed.


best regards

--
Antonio Valentino
>From 13e48c7b4f0195465490e16ff49eea18f2aa7af5 Mon Sep 17 00:00:00 2001
From: Antonio Valentino <antonio.valentino@tiscali.it>
Date: Tue, 22 May 2012 19:05:30 +0000
Subject: [PATCH] New package for Python 3 bindings

---
 debian/changelog            |    6 ++++++
 debian/control              |   35 +++++++++++++++++++++++++++++---
 debian/python-gdal.install  |    2 +-
 debian/python3-gdal.install |    1 +
 debian/rules                |   47 ++++++++++++++++++++++---------------------
 5 files changed, 64 insertions(+), 27 deletions(-)
 create mode 100644 debian/python3-gdal.install

diff --git a/debian/changelog b/debian/changelog
index 09125e8..c21918d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+gdal (1.9.0-2) UNRELEASED; urgency=low
+
+  * New package for Python 3 bindings
+
+ -- Antonio Valentino <antonio.valentino@tiscali.it>  Tue, 22 May 2012 19:04:23 +0000
+
 gdal (1.9.0-1) unstable; urgency=low
 
   * Ready for sid, starting transition.
diff --git a/debian/control b/debian/control
index 94e861a..ed233d8 100644
--- a/debian/control
+++ b/debian/control
@@ -6,15 +6,17 @@ Uploaders: Francesco Paolo Lovergine <frankie@debian.org>
 Build-Depends: debhelper (>= 8), zlib1g-dev, libnetcdf-dev (>= 1:4.0.0),
  libjasper-dev, libpng-dev, libjpeg-dev, libgif-dev,
  libhdf4-alt-dev, libhdf5-serial-dev (>= 1.6.6), libpq-dev, libxerces-c2-dev, unixodbc-dev (>= 2.2.11),
- python-numpy, doxygen, d-shlibs, libgeos-dev, libmysqlclient-dev, python-all-dev (>= 2.6.6-3~), 
+ python-numpy, doxygen, d-shlibs, libgeos-dev, libmysqlclient-dev, python-all-dev (>= 2.6.6-3~),
  libcurl4-gnutls-dev, libsqlite3-dev, libogdi3.2-dev,
  ruby, ruby1.8-dev, chrpath, swig, patch, libexpat1-dev, libproj-dev,
  libdap-dev, libxml2-dev, libspatialite-dev (>= 2.4.0~rc2-4), libepsilon-dev (>= 0.9.1),
  libpoppler-dev, liblzma-dev, libopenjpeg-dev, libarmadillo-dev, libfreexl-dev (>= 1.0.0),
- libkml-dev, liburiparser-dev
+ libkml-dev, liburiparser-dev,
+ python3-all-dev, python3-numpy
 Build-Conflicts: python-setuptools
 Standards-Version: 3.9.3
 XS-Python-Version: all
+X-Python3-Version: >= 3.2
 Homepage: http://www.gdal.org/
 Vcs-Browser: http://git.debian.org/?p=pkg-grass/gdal.git
 Vcs-Git: git://git.debian.org/git/pkg-grass/gdal.git
@@ -79,7 +81,7 @@ Package: libgdal-doc
 Section: doc
 Architecture: all
 Suggests: libgdal1
-Depends: ${misc:Depends} 
+Depends: ${misc:Depends}
 Homepage: http://www.gdal.org/#index_userdocs
 Description: Documentation for the Geospatial Data Abstraction Library
  GDAL is a translator library for raster geospatial data formats.
@@ -154,6 +156,33 @@ Description: Python bindings to the Geospatial Data Abstraction Library
  This package contains Python bindings for GDAL/OGR library and
  a set of additional command line tools.
 
+Package: python3-gdal
+Section: python
+Architecture: any
+Depends: ${shlibs:Depends}, ${python3:Depends}, python3-numpy, ${misc:Depends}
+Provides: ${python3:Provides}
+Homepage: http://trac.osgeo.org/gdal/wiki/GdalOgrInPython
+XB-Python-Version: ${python3:Versions}
+Description: Python 3 bindings to the Geospatial Data Abstraction Library
+ GDAL is a translator library for raster geospatial data formats.
+ As a library, it presents a single abstract data model to the
+ calling application for all supported formats. The related OGR
+ library (which lives within the GDAL source tree) provides
+ a similar capability for simple features vector data.
+ .
+ GDAL supports 40+ popular data formats, including commonly used
+ ones (GeoTIFF, JPEG, PNG and more) as well as the ones used in
+ GIS and remote sensing software packages (ERDAS Imagine,
+ ESRI Arc/Info, ENVI, PCI Geomatics). Also supported many remote
+ sensing and scientific data distribution formats such as HDF,
+ EOS FAST, NOAA L1B, NetCDF, FITS.
+ .
+ OGR library supports popular vector formats like ESRI Shapefile,
+ TIGER data, S57, MapInfo File, DGN, GML and more.
+ .
+ This package contains Python 3 bindings for GDAL/OGR library and
+ a set of additional command line tools.
+
 Package: libgdal-perl
 Section: perl
 Architecture: any
diff --git a/debian/python-gdal.install b/debian/python-gdal.install
index 77e8b17..8d1d3c9 100644
--- a/debian/python-gdal.install
+++ b/debian/python-gdal.install
@@ -1,4 +1,4 @@
-usr/lib/python*
+usr/lib/python2*
 usr/bin/*.py
 usr/share/man/man1/gdal_merge.1
 usr/share/man/man1/pct2rgb.1
diff --git a/debian/python3-gdal.install b/debian/python3-gdal.install
new file mode 100644
index 0000000..4606faa
--- /dev/null
+++ b/debian/python3-gdal.install
@@ -0,0 +1 @@
+usr/lib/python3*
diff --git a/debian/rules b/debian/rules
index 1e416cd..2a6b048 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,7 +8,7 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-PYVERS=$(shell pyversions -v -r debian/control)
+PYVERS=$(shell pyversions -v -r debian/control) $(shell py3versions -v -r)
 PYDEF=$(shell pyversions -dv)
 RUBYDEF=$(shell ruby --version|cut -d' ' -f2|cut -d. -f1,2)
 PERLDEF=$(shell perl -V:version|cut -d\' -f2)
@@ -48,7 +48,7 @@ gdal-ecw-dist:
 	rm -f $(CURDIR)/GDALmake.opt
 
 gdal-mrsid: configure gdal-mrsid-dist clean
-gdal-mrsid-dist: 
+gdal-mrsid-dist:
 	ln -fs $(CURDIR)/GDALmake.opt-$(PYDEF) $(CURDIR)/GDALmake.opt
 	[ -e $(CURDIR)/GDALmake.opt ] && $(MAKE) -C $(CURDIR)/frmts/mrsid dist
 	mv $(CURDIR)/frmts/mrsid/libgdal-mrsid-*.tar.gz $(CURDIR)/..
@@ -57,9 +57,9 @@ gdal-mrsid-dist:
 
 
 configure: configure-stamp
-configure-stamp: 
+configure-stamp:
 	dh_testdir
-	
+
 	for V in $(PYVERS); do \
 		PYTHON=/usr/bin/python$$V ./configure --prefix=/usr \
 			--mandir=\$$\{prefix\}/share/man \
@@ -96,19 +96,19 @@ configure-stamp:
 			--with-epsilon=/usr; \
 		mv GDALmake.opt GDALmake.opt-$$V; \
 	done
-	
+
 	touch $@
 
 build: configure-stamp build-stamp
-build-stamp: 
+build-stamp:
 	dh_testdir
-	
+
 	cp `ls GDALmake.opt-*|tail -1` GDALmake.opt
-	$(MAKE) lib-target apps-target 
+	$(MAKE) lib-target apps-target
 	rm -rf $(CURDIR)/swig/perl/*.c  $(CURDIR)/swig/perl/*.cpp
 	$(MAKE) -C $(CURDIR)/swig/perl generate build
 	$(MAKE) -C $(CURDIR)/swig/ruby generate build
-	
+
 	# It needs pre-installing just after the building due to intermediate cleaning.
 	# Apply conditionally an on-fly patch for pre 1.3.38 swig versions.
 	for V in $(PYVERS); do \
@@ -121,15 +121,15 @@ build-stamp:
 	mkdir $(CURDIR)/html || true
 	$(MAKE) docs
 	$(MAKE) man
-	# a temporary workaround for doxygen problem #564243 
+	# a temporary workaround for doxygen problem #564243
 	cd man/man1 && \
 			for i in `find . -name "*__*"`; do basename=`basename $$i`; mv $$basename `echo $$basename|sed -e 's/__/_/'`; done
 	touch $@
 
-clean: 
+clean:
 	dh_testdir
 	dh_testroot
-	
+
 	[ ! -f GDALmake.opt ] || $(MAKE) distclean
 	rm -rf $(CURDIR)/swig/ruby/.libs $(CURDIR)/swig/perl/*.bs
 	rm -rf $(CURDIR)/.libs
@@ -141,38 +141,38 @@ clean:
 	rm -f  $(CURDIR)/islibdappost310.*
 	# Removes per arch symbols for compatible archs
 	rm -f $(CURDIR)/debian/libgdal*.symbols.kfreebsd-i386 $(CURDIR)/debian/libgdal*.symbols.kfreebsd-amd64
-	dh_clean 
+	dh_clean
 
 install: build
 	dh_testdir
 	dh_testroot
 	dh_prep
 	dh_installdirs
-	
+
 	cp `ls GDALmake.opt-*|tail -1` GDALmake.opt
 	$(MAKE) install BINDINGS="perl ruby" DESTDIR=$(CURDIR)/debian/tmp \
-			INST_DATA="\$$(prefix)/share/gdal/$(GDAL_MAJOR).$(GDAL_MINOR)" 
+			INST_DATA="\$$(prefix)/share/gdal/$(GDAL_MAJOR).$(GDAL_MINOR)"
 	$(MAKE) install-docs DESTDIR=$(CURDIR)/debian/tmp \
 		"INST_DOCS=\$$(prefix)/share/doc/libgdal-doc"\
-		"INST_MAN=\$$(prefix)/share/man" 
+		"INST_MAN=\$$(prefix)/share/man"
 	$(MAKE) install-man DESTDIR=$(CURDIR)/debian/tmp \
 		"INST_DOCS=\$$(prefix)/share/doc/libgdal-doc"\
-		"INST_MAN=\$$(prefix)/share/man" 
-		
+		"INST_MAN=\$$(prefix)/share/man"
+
 	# install python stuff previuosly built and pre-installed
 	cp -a $(CURDIR)/debian/python-tmp/usr/lib/* $(CURDIR)/debian/tmp/usr/lib/.
 	install -o root -g root -d $(CURDIR)/debian/tmp/usr/bin
-	install -o root -g root -m 755 $(CURDIR)/swig/python/scripts/*.py $(CURDIR)/debian/tmp/usr/bin/.                                        
-	
+	install -o root -g root -m 755 $(CURDIR)/swig/python/scripts/*.py $(CURDIR)/debian/tmp/usr/bin/.
+
 	# removing license file
 	rm -f $(CURDIR)/debian/tmp/usr/share/gdal/$(GDAL_MAJOR).$(GDAL_MINOR)/LICENSE.TXT
-	# removing empty packlist MakeMaker files 
+	# removing empty packlist MakeMaker files
 	-find $(CURDIR)/debian/tmp$(PERL_PATH) -type f -name .packlist -exec rm -f {} \;
 	# removing embedded rpath in perl shlibs
 	-find $(CURDIR)/debian/tmp/$(PERL_PATH) -type f -name "*.so" -exec chrpath --delete {} \;
 	# removing embedded rpath in main lib
 	-find $(CURDIR)/debian/tmp/usr/lib -type f -name "*.so*" -exec chrpath --delete {} \;
-	
+
 	# moves ruby/perl stuff the right dirs
 	install -o root -g root -d $(CURDIR)/debian/tmp/usr/lib/perl5/auto
 	install -o root -g root -d $(CURDIR)/debian/tmp/usr/lib/ruby/$(RUBYDEF)
@@ -186,7 +186,7 @@ install: build
 	echo "libgdal1: embedded-library usr/lib/libgdal.so.$$(basename debian/tmp/usr/lib/libgdal.so.*.*.*|cut -d. -f3,4,5): tiff" \
 		>$(CURDIR)/debian/libgdal1.lintian-overrides
 
-binary-common: 
+binary-common:
 	dh_testdir
 	dh_testroot
 	dh_install --autodest --list-missing
@@ -199,6 +199,7 @@ binary-common:
 	dh_fixperms
 	dh_lintian
 	dh_python2 -X.info
+	dh_python3 -X.info
 	dh_numpy
 	dh_perl
 	# Adds per arch symbols for compatible archs
-- 
1.7.10


Reply to: