Dear PostGIS maintainers,

(Please CC to me as I'm not subscribed the list.)

I just succeeded in producing working Debian packages
for PostGIS 2.0.0 on Debian/Wheezy. Those are currently
targeted at PostgreSQL 9.1, but I also plan to produce
some for PostgreSQL 9.2.

I'm not completely happy with my work, but it might
be a good starting point for someone who wants to
create "official" Debian packages for PostGIS.

Attached you'll find two patch files which are meant
to be applied to the current unstable Debian files
(postgis_1.5.3-2.debian.tar.gz).

The *-stable.patch contains changes I'm confident with.

The *-hacks.patch contains changes which were necessary
to make the build working, but for which I think there
must be a better way.

Note that the build currently requires root privileges,
i.e. it doesn't work with fakeroot. The reason is that
Maven needs to download various packages into /root/.m2/
which of course isn't accessible by fakeroot. Also, I
don't think that build scripts which download packages
are acceptable for Debian. So this issue has to be solved,
but I don't have a clue how to do that.

I confirmed that my patches produce working Debian
packages on a Debian/Wheezy amd64 system using the
following steps:

------------------------------------------------
# Download packages
wget 
http://ftp.de.debian.org/debian/pool/main/p/postgis/postgis_1.5.3-2.debian.tar.gz
wget http://postgis.org/download/postgis-2.0.0.tar.gz

# Rename source tarball
mv postgis-2.0.0.tar.gz postgis_2.0.0.orig.tar.gz

# Unpack sources
tar xf postgis_2.0.0.orig.tar.gz
cd postgis-2.0.0
tar xf ../postgis_1.5.3-2.debian.tar.gz

# Apply patches
patch -p1 < ../debian-postgis-2.0.0-stable.patch
patch -p1 < ../debian-postgis-2.0.0-hacks.patch

# Run build as root, because fakeroot doesn't work yet :-(
sudo dpkg-buildpackage
------------------------------------------------


Regards,
Volker

-- 
Volker Grabsch
---<<(())>>---
diff --git a/debian/changelog b/debian/changelog
index 7b7f8b6..1649294 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+postgis (2.0.0-1~mclick) UNRELEASED; urgency=low
+
+  * Upgrade to postgis 2.0.0
+
+ --  <v...@m-click.de>  Thu, 31 May 2012 19:20:31 +0200
+
 postgis (1.5.3-2) unstable; urgency=low
 
   * Moved pgsql2shp/shp2pgsql under conventional /usr/bin path.
diff --git a/debian/control b/debian/control
index f18a869..36a06a5 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,8 @@ Uploaders: Stephen Frost <sfr...@debian.org>, Francesco Paolo Lovergine <frankie
 Build-Depends: debhelper (>= 8), autotools-dev, flex, bison, libgeos-dev (>= 3.1.1),
  libproj-dev (>= 4.5.0), libssl-dev, xsltproc, docbook, docbook-xsl,
  default-jdk, libpg-java, fastjar, libjts-java (>= 1.7), imagemagick,
- libcunit1-dev, dblatex, libxml2-dev, libgtk2.0-dev, postgresql-server-dev-9.1
+ libcunit1-dev, dblatex, libxml2-dev, libgtk2.0-dev, postgresql-server-dev-9.1,
+ libmaven-ant-tasks-java
 Standards-Version: 3.9.2
 Homepage: http://postgis.refractions.net/
 Vcs-Browser: http://git.debian.org/?p=pkg-grass/postgis.git
diff --git a/debian/patches/disable-download-maven-ant-tasks b/debian/patches/disable-download-maven-ant-tasks
new file mode 100644
index 0000000..27f5cf7
--- /dev/null
+++ b/debian/patches/disable-download-maven-ant-tasks
@@ -0,0 +1,39 @@
+Description: Disable download of maven-ant-tasks
+ TODO: Put a short summary on the line above and replace this paragraph
+ with a longer explanation of this change. Complete the meta-information
+ with other relevant fields (see below for details). To make it easier, the
+ information below has been extracted from the changelog. Adjust it or drop
+ it.
+ .
+ postgis (2.0.0-1~mclick) UNRELEASED; urgency=low
+ .
+   * Upgrade to postgis 2.0.0
+Author: <v...@m-click.de>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: http://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: <YYYY-MM-DD>
+
+--- postgis-2.0.0.orig/java/jdbc/build.xml
++++ postgis-2.0.0/java/jdbc/build.xml
+@@ -55,10 +55,7 @@
+ 
+ 
+      <!-- Loading Maven dependencies -->
+-     <mkdir dir="lib"/>
+-     <get src="http://www.apache.org/dist/maven/binaries/maven-ant-tasks-2.1.3.jar"; dest="lib/maven-ant-tasks-2.1.3.jar"/>
+-
+-     <path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.3.jar" />
++     <path id="maven-ant-tasks.classpath" path="/usr/share/maven-repo/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar" />
+      <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
+            uri="antlib:org.apache.maven.artifact.ant"
+            classpathref="maven-ant-tasks.classpath" />
diff --git a/debian/patches/generator b/debian/patches/generator
deleted file mode 100644
index 11d19c0..0000000
--- a/debian/patches/generator
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: postgis/doc/html/image_src/generator.c
-===================================================================
---- postgis.orig/doc/html/image_src/generator.c	2011-03-24 17:12:30.000000000 +0100
-+++ postgis/doc/html/image_src/generator.c	2011-03-24 17:36:08.000000000 +0100
-@@ -363,7 +363,7 @@
- 	while ( fgets ( line, sizeof line, pfile ) != NULL && !isspace(*line) )
- 	{
- 
--		char output[2048];
-+		char output[4096];
- 		char *ptr = output;
- 		char *styleName;
- 		int useDefaultStyle;
diff --git a/debian/patches/html_doc_resources b/debian/patches/html_doc_resources
deleted file mode 100644
index 981f462..0000000
--- a/debian/patches/html_doc_resources
+++ /dev/null
@@ -1,21 +0,0 @@
-Index: postgis/doc/Makefile
-===================================================================
---- postgis.orig/doc/Makefile	2011-09-15 15:14:47.000000000 +0200
-+++ postgis/doc/Makefile	2011-11-21 16:06:03.000000000 +0100
-@@ -134,12 +134,16 @@
- 	@mkdir -p $(PGSQL_DOCDIR)/postgis
- 	@mkdir -p $(PGSQL_MANDIR)/man1
- 	cp html/postgis.html $(PGSQL_DOCDIR)/postgis/postgis.html
-+	cp html/style.css $(PGSQL_DOCDIR)/postgis/style.css
-+	cp -r html/images $(PGSQL_DOCDIR)/postgis/
- 	cp ../README.postgis $(PGSQL_DOCDIR)/postgis/README.postgis
- 	cp man/pgsql2shp.1 $(PGSQL_MANDIR)/man1/pgsql2shp.1
- 	cp man/shp2pgsql.1 $(PGSQL_MANDIR)/man1/shp2pgsql.1
- 
- uninstall:
- 	rm -f $(PGSQL_DOCDIR)/postgis/postgis.html
-+	rm -f $(PGSQL_DOCDIR)/postgis/style.css
-+	rm -rf $(PGSQL_DOCDIR)/postgis/images
- 	rm -f $(PGSQL_DOCDIR)/postgis/README.postgis
- 	rm -f $(PGSQL_MANDIR)/man1/shp2pgsql.1
- 	rm -f $(PGSQL_MANDIR)/man1/pgsql2shp.1
diff --git a/debian/patches/install b/debian/patches/install
deleted file mode 100644
index 243e1ab..0000000
--- a/debian/patches/install
+++ /dev/null
@@ -1,15 +0,0 @@
-Index: postgis/java/jdbc/Makefile
-===================================================================
---- postgis.orig/java/jdbc/Makefile	2011-03-24 17:12:30.000000000 +0100
-+++ postgis/java/jdbc/Makefile	2011-03-24 17:35:23.000000000 +0100
-@@ -251,8 +251,8 @@
- install: jar installdirs
- 	@echo Testing for successful inclusion of ../Makefile.config
- 	test ../Makefile.config
--	$(INSTALL_DATA) postgis.jar $(DESTDIR)
--	$(INSTALL_DATA) postgis_debug.jar $(DESTDIR)
-+	install -m 644 postgis.jar $(DESTDIR)
-+	install -m 644 postgis_debug.jar $(DESTDIR)
- 
- installdirs:
- 	@mkdir -p $(DESTDIR)
diff --git a/debian/patches/series b/debian/patches/series
index 5deccea..8aae289 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1 @@
-install
-generator
-html_doc_resources
+disable-download-maven-ant-tasks
diff --git a/debian/rules b/debian/rules
index b133eb2..eedd62e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -69,7 +69,7 @@ install-indep: build-indep
 		--with-pgconfig=/usr/lib/postgresql/9.1/bin/pg_config
 	# PostGIS JDBC (with debug support)
 	$(MAKE) -C java/jdbc clean
-	DEBUGJAR=postgis_debug.fastjar JAR=fastjar JAVAC=javac $(MAKE) -C java/jdbc jar
+	DEBUGJAR=postgis_debug.fastjar JAR=fastjar JAVAC=javac $(MAKE) -C java/jdbc build
 	DEBUGJAR=postgis_debug.fastjar JAR=fastjar JAVAC=javac $(MAKE) -C java/jdbc install DESTDIR=$(CURDIR)/debian/libpostgis-java/usr/share/java/$(JAVA_PATH)
 	# regress target uses pushd/popd
 	$(MAKE) SHELL=/bin/bash distclean
diff --git a/debian/rules b/debian/rules
index eedd62e..2af387c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -63,6 +63,7 @@ install-indep: build-indep
 	dh_installdirs -i
 #	CFLAGS="$(CFLAGS) -Wl,-z,defs" ./configure 
 	./configure \
+		--without-topology \
 		--docdir=\$${prefix}/share/doc/postgis \
 		--mandir=\$${prefix}/share/man \
 		--infodir=\$${prefix}/share/info \
@@ -85,6 +86,7 @@ install-arch: build-arch
 	
 	# PostGIS for PostgreSQL 9.1
 	./configure \
+		--without-topology \
 		--host=$(DEB_HOST_GNU_TYPE) \
 		--build=$(DEB_BUILD_GNU_TYPE) \
 		--prefix=/usr \
@@ -144,7 +146,7 @@ binary-common:
 	dh_compress 
 	dh_fixperms
 	dh_installdeb
-	dh_shlibdeps
+#	dh_shlibdeps
 	dh_gencontrol
 	dh_md5sums
 	dh_builddeb
_______________________________________________
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