This patch file should be better.
diff -ruN ./mapserver_orig/mapserver-4.6.1/debian/changelog ./mapserver/mapserver-4.6.1/debian/changelog
--- ./mapserver_orig/mapserver-4.6.1/debian/changelog	2005-11-05 13:18:48.000000000 -0500
+++ ./mapserver/mapserver-4.6.1/debian/changelog	2005-11-05 12:42:04.000000000 -0500
@@ -1,3 +1,9 @@
+mapserver (4.6.1-5) unstable; urgency=low
+
+  * add support for php5 mapscript
+
+ -- Jon Saints <[EMAIL PROTECTED]>  Sat,  5 Nov 2005 12:41:37 -0500
+
 mapserver (4.6.1-4) unstable; urgency=low
 
   * Add Swedish translation by Daniel Nylander. (Closes: #333097)
diff -ruN ./mapserver_orig/mapserver-4.6.1/debian/control ./mapserver/mapserver-4.6.1/debian/control
--- ./mapserver_orig/mapserver-4.6.1/debian/control	2005-11-05 13:18:48.000000000 -0500
+++ ./mapserver/mapserver-4.6.1/debian/control	2005-11-05 12:47:38.000000000 -0500
@@ -4,7 +4,7 @@
 Maintainer: Debian GIS Project <pkg-grass-devel@lists.alioth.debian.org>
 Uploaders: Thomas Sondag <[EMAIL PROTECTED]>, Schuyler Erle <[EMAIL PROTECTED]>, Petter Reinholdtsen <[EMAIL PROTECTED]>
 Standards-Version: 3.6.2.1
-Build-Depends: debhelper (>= 4), dpatch, libcurl3-gnutls-dev | libcurl3-dev, libpng12-dev, zlib1g-dev (>= 1.1.4), libgd2-xpm-dev (>= 2.0.1-10), libfreetype6-dev (>=2.0.9), libjpeg62-dev, libgdal1-dev, proj, libwww-dev, postgresql-dev (>= 7.3.3-1), php4-dev, swig, python-dev
+Build-Depends: debhelper (>= 4), dpatch, libcurl3-gnutls-dev | libcurl3-dev, libpng12-dev, zlib1g-dev (>= 1.1.4), libgd2-xpm-dev (>= 2.0.1-10), libfreetype6-dev (>=2.0.9), libjpeg62-dev, libgdal1-dev, proj, libwww-dev, postgresql-dev (>= 7.3.3-1), php4-dev, php5-dev, swig, python-dev
 Build-conflicts: libcurl3-openssl-dev
 
 Package: php4-mapscript
@@ -21,6 +21,17 @@
  .
  Curently work only with php as an Apache DSO.
 
+Package: php5-mapscript
+Section: web
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, libapache-mod-php5 | phpapi-20041030
+Suggests: mapserver-bin, mapserver-doc
+Description: module for php5-cgi to use mapserver
+ php mapscript allows you to use the mapserver functionalities with php web
+ scripting language.
+ .
+ Curently work only with php as an Apache DSO.
+
 Package: perl-mapscript
 Section: perl
 Architecture: any
diff -ruN ./mapserver_orig/mapserver-4.6.1/debian/dirs ./mapserver/mapserver-4.6.1/debian/dirs
--- ./mapserver_orig/mapserver-4.6.1/debian/dirs	2005-11-05 13:18:48.000000000 -0500
+++ ./mapserver/mapserver-4.6.1/debian/dirs	2005-11-05 12:48:18.000000000 -0500
@@ -1,5 +1,6 @@
 usr/bin
 usr/lib
 usr/lib/php4/20020429/
+usr/lib/php5/20041030/
 usr/lib/perl/5.6.1/auto/mapscript
 usr/include
diff -ruN ./mapserver_orig/mapserver-4.6.1/debian/php5-mapscript.config ./mapserver/mapserver-4.6.1/debian/php5-mapscript.config
--- ./mapserver_orig/mapserver-4.6.1/debian/php5-mapscript.config	1969-12-31 19:00:00.000000000 -0500
+++ ./mapserver/mapserver-4.6.1/debian/php5-mapscript.config	2005-10-08 16:54:06.000000000 -0400
@@ -0,0 +1,32 @@
+#/bin/sh -e
+
+# Source debconf library.
+. /usr/share/debconf/confmodule
+
+db_title "PHP"
+
+for SAPI in apache
+do
+	# Skip this loop if the config file isn't there (yet).
+	if [ -f "/etc/php5/$SAPI/php.ini" ]; then
+		db_register php5/add_extension php5/extension_mapscript_$SAPI
+
+		# FIXME: this is the wrong answer if the SAPI package was
+		# installed after the module was.
+		if [ -n "$2" ] && dpkg --compare-versions "$2" ge 4:4.3.2+rc3-2
+		then
+			if grep -q "^[[:space:]]*extension[[:space:]]*=[[:space:]]*php_mapscript.so" "/etc/php5/$SAPI/php.ini"
+			then
+				db_set php5/extension_mapscript_$SAPI true
+			else
+				db_set php5/extension_mapscript_$SAPI false
+			fi
+		fi
+
+		db_subst php5/extension_mapscript_$SAPI extname Mapscript 
+		db_subst php5/extension_mapscript_$SAPI sapiconfig $SAPI
+		db_input low php5/extension_mapscript_$SAPI || true
+	fi
+done
+
+db_go
diff -ruN ./mapserver_orig/mapserver-4.6.1/debian/php5-mapscript.dirs ./mapserver/mapserver-4.6.1/debian/php5-mapscript.dirs
--- ./mapserver_orig/mapserver-4.6.1/debian/php5-mapscript.dirs	1969-12-31 19:00:00.000000000 -0500
+++ ./mapserver/mapserver-4.6.1/debian/php5-mapscript.dirs	2005-10-08 16:00:34.000000000 -0400
@@ -0,0 +1 @@
+usr/lib/php5/20041030/
diff -ruN ./mapserver_orig/mapserver-4.6.1/debian/php5-mapscript.files ./mapserver/mapserver-4.6.1/debian/php5-mapscript.files
--- ./mapserver_orig/mapserver-4.6.1/debian/php5-mapscript.files	1969-12-31 19:00:00.000000000 -0500
+++ ./mapserver/mapserver-4.6.1/debian/php5-mapscript.files	2005-10-08 16:00:51.000000000 -0400
@@ -0,0 +1 @@
+usr/lib/php5/20041030/
diff -ruN ./mapserver_orig/mapserver-4.6.1/debian/php5-mapscript.postinst ./mapserver/mapserver-4.6.1/debian/php5-mapscript.postinst
--- ./mapserver_orig/mapserver-4.6.1/debian/php5-mapscript.postinst	1969-12-31 19:00:00.000000000 -0500
+++ ./mapserver/mapserver-4.6.1/debian/php5-mapscript.postinst	2005-10-08 16:01:58.000000000 -0400
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -e
+
+# Source debconf library.
+. /usr/share/debconf/confmodule
+
+#DEBHELPER#
+
+if [ "$1" != "configure" ]; then
+	exit 0
+fi
+
+for SAPI in apache
+do
+	if [ -f /etc/php5/$SAPI/php.ini ]; then
+		db_get php5/extension_mapscript_$SAPI
+		if [ "$RET" = "true" ] \
+		   && ! grep -q "^[[:space:]]*extension[[:space:]]*=[[:space:]]*php_mapscript.so" /etc/php5/$SAPI/php.ini
+		then
+			echo "extension=php_mapscript.so" >> /etc/php5/$SAPI/php.ini
+		fi
+	fi
+done
+
+exit 0
diff -ruN ./mapserver_orig/mapserver-4.6.1/debian/php5-mapscript.prerm ./mapserver/mapserver-4.6.1/debian/php5-mapscript.prerm
--- ./mapserver_orig/mapserver-4.6.1/debian/php5-mapscript.prerm	1969-12-31 19:00:00.000000000 -0500
+++ ./mapserver/mapserver-4.6.1/debian/php5-mapscript.prerm	2005-10-08 16:03:02.000000000 -0400
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+if [ "$1" != "remove" ] && [ "$1" != "purge" ]; then
+	exit 0
+fi
+
+EXTENSIONRE="^[[:space:]]*extension[[:space:]]*=[[:space:]]*php_mapscript.so"
+
+. /usr/share/debconf/confmodule
+
+for SAPI in `find /etc/php5/ -type d -maxdepth 1 -mindepth 1 | sed -e's#.*/##'`
+do
+	# Use the same question for all extensions, because it's only
+	# used once per package: right here.
+	if [ -f "/etc/php5/$SAPI/php.ini" ] \
+	   && grep -q "$EXTENSIONRE" /etc/php5/$SAPI/php.ini
+	then
+		db_set php5/remove_extension true
+		db_title "PHP"
+		db_subst php5/remove_extension extname Mapscript
+		db_subst php5/remove_extension sapiconfig $SAPI
+		db_input low php5/remove_extension || true
+		db_go
+
+		db_get php5/remove_extension
+		if [ "$RET" = "true" ]; then
+			grep -v "$EXTENSIONRE" < /etc/php5/$SAPI/php.ini \
+				> /etc/php5/$SAPI/php.ini.mapscriptremove
+			chmod --reference=/etc/php5/$SAPI/php.ini \
+				/etc/php5/$SAPI/php.ini.mapscriptremove
+			mv /etc/php5/$SAPI/php.ini.mapscriptremove \
+				/etc/php5/$SAPI/php.ini
+		fi
+		db_fset php5/remove_extension seen false
+	fi
+done
+
+exit 0
diff -ruN ./mapserver_orig/mapserver-4.6.1/debian/php5-mapscript.templates ./mapserver/mapserver-4.6.1/debian/php5-mapscript.templates
--- ./mapserver_orig/mapserver-4.6.1/debian/php5-mapscript.templates	1969-12-31 19:00:00.000000000 -0500
+++ ./mapserver/mapserver-4.6.1/debian/php5-mapscript.templates	2005-10-08 16:03:35.000000000 -0400
@@ -0,0 +1,15 @@
+Template: php5/add_extension
+Type: boolean
+Default: true
+_Description: Should ${extname} be added to /etc/php5/${sapiconfig}/php.ini?
+ You are installing ${extname} support for php5, and it is not yet
+ enabled in the configuration for the ${sapiconfig} SAPI.  Do you want
+ this extension to be enabled now?
+
+Template: php5/remove_extension
+Type: boolean
+Default: true
+_Description: Should ${extname} be removed from /etc/php5/${sapiconfig}/php.ini?
+ You are removing ${extname} support for php5, but it is still enabled
+ in the configuration for the ${sapiconfig} SAPI.  Leaving this in place
+ will probably cause problems when trying to use PHP.
diff -ruN ./mapserver_orig/mapserver-4.6.1/debian/rules ./mapserver/mapserver-4.6.1/debian/rules
--- ./mapserver_orig/mapserver-4.6.1/debian/rules	2005-11-05 13:18:48.000000000 -0500
+++ ./mapserver/mapserver-4.6.1/debian/rules	2005-11-05 12:55:34.000000000 -0500
@@ -60,6 +60,13 @@
 
 	touch configure-php-stamp
 
+configure-php5-stamp: patch clean-first-build
+	dh_testdir
+	./configure $(COMMON_CONFIG) \
+		--with-php=/usr/include/php5 
+
+	touch configure-php5-stamp
+
 build-stamp: configure-stamp mapscriptvars
 	dh_testdir
 
@@ -83,6 +90,13 @@
 	# Build php_mapscript
 	$(MAKE)
 
+build-php5-stamp: configure-php5-stamp
+	dh_testdir
+	-cd mapscript/php3 && \
+		$(MAKE) clean
+	# Build php_mapscript
+	$(MAKE)
+
 # This is needed to do 'make clean', but will be removed by the clean
 # targets.  The end result is that 'debuild clean' only can execute
 # once.  Hack around this problem by faking the creation when make fail.
@@ -117,11 +131,11 @@
 clean: unpatch clean-first-build
 	dh_testdir
 	dh_clean
-	-$(RM) configure-phpstamp build-php-stamp install-stamp install-php-stamp
+	-$(RM) configure-phpstamp configure-php5-stamp build-php-stamp build-php5-stamp install-stamp install-php-stamp install-php5-stamp
 	-$(MAKE) distclean
 
 
-install: install-stamp install-php-stamp
+install: install-stamp install-php-stamp install-php5-stamp
 install-stamp: build-stamp
 	dh_testdir
 	dh_testroot
@@ -163,6 +177,18 @@
                       
 	touch install-php-stamp
 
+install-php5-stamp: build-php5-stamp
+	dh_testdir
+	dh_testroot
+
+	-mkdir -p debian/tmp/usr/lib/php5/20041030
+
+	# php5-mapscript
+	install -m644 mapscript/php3/php_mapscript.so \
+		debian/tmp/usr/lib/php5/20041030
+                      
+	touch install-php5-stamp
+
 binary-indep: install 
 
 binary-arch: install 
_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-grass-devel

Reply via email to