postgis stable port information

Info2: <<
Package: postgis%type_pkg[postgresql]
Version: 1.3.2
Revision: 1
Distribution: (%type_pkg[postgresql] = 74) 10.4
Description: PostgreSQL geographic object support
Type: postgresql (7.4 8.0 8.1 8.2)
License: BSD
Maintainer: Benjamin Reed

Depends: <<
libgeos2-shlibs,
(%type_raw[postgresql] = 7.4) postgresql%type_pkg[postgresql]-unified-shlibs,
(%type_raw[postgresql] = 8.0) postgresql%type_pkg[postgresql]-unified-shlibs,
(%type_raw[postgresql] = 8.1) postgresql%type_pkg[postgresql]-shlibs,
(%type_raw[postgresql] = 8.2) postgresql%type_pkg[postgresql]-shlibs,
proj-shlibs
<<
BuildDepends: <<
jts,
libgeos2,
libiconv-dev,
(%type_raw[postgresql] = 7.4) postgresql%type_pkg[postgresql]-unified-dev,
(%type_raw[postgresql] = 8.0) postgresql%type_pkg[postgresql]-unified-dev,
(%type_raw[postgresql] = 8.1) postgresql%type_pkg[postgresql]-dev,
(%type_raw[postgresql] = 8.2) postgresql%type_pkg[postgresql]-dev,
postgresql-java (>= %type_raw[postgresql]-1),
proj,
system-openssl-dev,
system-java (>= 1.4-1)
<<
Replaces: postgresql%type_pkg[postgresql]
GCC: 4.0

Source: http://postgis.refractions.net/download/postgis-%v.tar.gz
Source-MD5: b0d52c2c23c316fc9884632a80b380a5
PatchScript: sed -e 's,@FINKPREFIX@,%p,g; s,@FINKPGRAWVERSION@,%type_raw[postgresql],g; s,@FINKPGVERSION@,%type_pkg[postgresql],g' %a/%{Ni}.patch | patch -p1

SetCPPFLAGS: -I%p/include/postgresql -I%p/include -fno-common
NoSetCPPFLAGS: true
NoSetLDFLAGS: true
ConfigureParams: --with-pgsql=%p/bin/pg_config-%type_raw[postgresql]
CompileScript: <<
#!/bin/sh -ev

export lt_cv_sys_max_cmd_len=65536 PGCONFIG=%p/bin/pg_config-%type_raw[postgresql]
export CPPFLAGS="-I%p/lib/system-openssl/include -I%p/include/postgresql -I%p/include -DHAVE_OPTRESET -fno-common"
export LDFLAGS="-L%p/lib/system-openssl/lib -L%p/lib"

./configure %c
make libdir=%p/lib/postgresql-%type_raw[postgresql] LPATH="%p/lib/postgresql-%type_raw[postgresql]"
pushd java/jdbc
make
popd
<<

InstallScript: <<
#!/bin/sh -ev

make -j1 install DESTDIR=%d libdir=%p/lib/postgresql-%type_raw[postgresql] LPATH="%p/lib/postgresql-%type_raw[postgresql]" datadir=%p/share/doc/%N
for file in pgsql2shp shp2pgsql; do
mv %i/bin/$file %i/bin/$file-%type_raw[postgresql]
done
<<
DocFiles: COPYING CREDITS ChangeLog NEWS README* TODO
SplitOff: <<
Package: %N-java
Depends: <<
jts,
postgresql-java (>= %type_raw[postgresql]-1)
<<
JarFiles: java/jdbc/postgis.jar java/pljava/postgis_pljava.jar
<<

PostInstScript: <<
for file in pgsql2shp shp2pgsql; do
%p/sbin/update-alternatives --install "%p/bin/$file" "$file" "%p/bin/$file-%type_raw[postgresql]" %type_pkg[postgresql]
done

# obsolete, from the old package
for file in createdb.postgis mktemplate_gis mktemplate_gis.sh postgis_env.sh postgres_lib.sh rmtemplate_gis rmtemplate_gis.sh; do
%p/sbin/update-alternatives --remove "$file" "%p/bin/$file-%type_raw[postgresql]"
done
for file in createdb.postgis.1 mktemplate_gis.1 rmtemplate_gis.1; do
%p/sbin/update-alternatives --remove "$file" "%p/bin/$file-%type_raw[postgresql]"
done
%p/sbin/update-alternatives --remove "postgis-default" "%p/etc/%N"
cat < Note: This package does not do anything until you add it's schema to
your database!

If this is the first time you're using PostGIS in a particular database,
you must install the schema like so:

sudo %p/bin/pgsql.sh-%type_raw[postgresql] start
sudo -u postgres %p/bin/psql-%type_raw[postgresql] -f %p/share/doc/%N/lwpostgis.sql -d

If you are upgrading your database from a previous PostGIS version, you
need to upgrade the schema like so:

sudo %p/bin/pgsql.sh-%type_raw[postgresql] start
sudo -u postgres %p/bin/psql-%type_raw[postgresql] -f %p/share/doc/%N/lwpostgis_upgrade.sql -d

EOF
<<
PreRmScript: <<
if [ "$1" != "upgrade" ]; then
for file in pgsql2shp shp2pgsql; do
%p/sbin/update-alternatives --remove "$file" "%p/bin/$file-%type_raw[postgresql]"
done
fi
<<

Homepage: http://postgis.refractions.net/
DescDetail: <<
PostGIS adds support for geographic objects to the PostgreSQL
object-relational database. In effect, PostGIS "spatially enables" the
PostgreSQL server, allowing it to be used as a backend spatial database for
geographic information systems (GIS), much like ESRI's SDE or Oracle's Spatial
extension. PostGIS follows the OpenGIS "Simple Features Specification for
SQL" and has been certified as compliant with the "Types and Functions"
profile.
<<
DescUsage: <<
Note: This package does not do anything until you add it's schema to
your database!

If this is the first time you're using PostGIS in a particular database,
you must install the schema like so:

sudo %p/bin/pgsql.sh-%type_raw[postgresql] start
sudo -u postgres %p/bin/psql-%type_raw[postgresql] \
-f %p/share/doc/%N/lwpostgis.sql -d

If you are upgrading your database from a previous PostGIS version, you
need to upgrade the schema like so:

sudo %p/bin/pgsql.sh-%type_raw[postgresql] start
sudo -u postgres %p/bin/psql-%type_raw[postgresql] \
-f %p/share/doc/%N/lwpostgis_upgrade.sql -d
<<
<<

postgis stable port .patch


--- postgis-1.3.2/README.postgis 2007-12-02 15:37:13.000000000 -0500
+++ postgis-1.3.2-new/README.postgis 2007-12-12 08:50:57.000000000 -0500
@@ -143,8 +143,8 @@

So, as postgres run:

- createlang plpgsql yourdatabase
- psql -f lwpostgis.sql -d your_database
+ createlang-@FINKPGRAWVERSION@ plpgsql yourdatabase
+ psql-@FINKPGRAWVERSION@ -f lwpostgis.sql -d your_database

Your database should now be spatially enabled.

@@ -166,7 +166,7 @@
Soft upgrade consists of sourcing the lwpostgis_upgrade.sql
script in your spatial database:

- psql -f lwpostgis_upgrade.sql -d your_spatial_database
+ psql-@FINKPGRAWVERSION@ -f lwpostgis_upgrade.sql -d your_spatial_database

If a soft upgrade is not possible the script will abort and
you will be warned about HARD UPGRADE being required,
@@ -187,7 +187,7 @@

# Create a "custom-format" dump of the database you want
# to upgrade (let's call it "olddb")
- $ pg_dump -Fc olddb olddb.dump
+ $ pg_dump-@FINKPGRAWVERSION@ -Fc olddb olddb.dump

# Restore the dump while upgrading postgis into
# a new database.
@@ -204,9 +204,9 @@
# drop the attrelid, varattnum and stats columns in the geometry_columns
# table, which are no-more needed. Keeping them won't hurt.
# !!! DROPPING THEM WHEN REALLY NEEDED WILL DO HARM !!!!
- $ psql newdb -c "ALTER TABLE geometry_columns DROP attrelid"
- $ psql newdb -c "ALTER TABLE geometry_columns DROP varattnum"
- $ psql newdb -c "ALTER TABLE geometry_columns DROP stats"
+ $ psql-@FINKPGRAWVERSION@ newdb -c "ALTER TABLE geometry_columns DROP attrelid"
+ $ psql-@FINKPGRAWVERSION@ newdb -c "ALTER TABLE geometry_columns DROP varattnum"
+ $ psql-@FINKPGRAWVERSION@ newdb -c "ALTER TABLE geometry_columns DROP stats"

# The spatial_ref_sys table is restored from the dump, to
# ensure your custom additions are kept, but the distributed
@@ -214,7 +214,7 @@
# entries, drop the table and source the new one.
# If you did make additions we assume you know how to backup them before
# upgrading the table. Replace it with the new like this:
- $ psql newdb
+ $ psql-@FINKPGRAWVERSION@ newdb
newdb=> DELETE FROM spatial_ref_sys;
DROP
newdb=> \i spatial_ref_sys.sql
--- postgis-1.3.2/extras/template_gis/createdb.postgis.1 2006-05-31 02:43:12.000000000 -0400
+++ postgis-1.3.2-new/extras/template_gis/createdb.postgis.1 2007-12-12 08:46:50.000000000 -0500
@@ -43,7 +43,7 @@
.LP
The environment variables for template_gis creation, removal and usage may be stored in files, as follows:
.TP
-.B /etc/default/postgis
+.B @FINKPREFIX@/etc/default/postgis
will designate default values for the whole system.
.TP
.B $HOME/.postgis/profile
--- postgis-1.3.2/extras/template_gis/mktemplate_gis.1 2006-05-31 02:43:12.000000000 -0400
+++ postgis-1.3.2-new/extras/template_gis/mktemplate_gis.1 2007-12-12 08:46:43.000000000 -0500
@@ -89,7 +89,7 @@
.LP
The environment variables for template_gis creation, removal and usage may be stored in files, as follows:
.TP
-.B /etc/default/postgis
+.B @FINKPREFIX@/etc/default/postgis
will designate default values for the whole system.
.TP
.B $HOME/.postgis/profile
--- postgis-1.3.2/extras/template_gis/postgis_env.sh.in 2006-05-31 02:43:12.000000000 -0400
+++ postgis-1.3.2-new/extras/template_gis/postgis_env.sh.in 2007-12-12 08:46:32.000000000 -0500
@@ -3,7 +3,7 @@
# environment variables for postgis

#read optional configuration files. last prevails
-for file in "/etc/default/postgis" "$HOME/.postgis/profile" ; do
+for file in "@FINKPREFIX@/etc/default/postgis" "$HOME/.postgis/profile" ; do
if [ -f "$file" ]; then
tmpval=`grep "^TEMPLATEDB=" $file | cut -d= -f2`
if [ -n "$tmpval" ]; then
@@ -25,12 +25,12 @@
done

#cluster information should be set separately
-if [ -x @prefix@/bin/pg_lsclusters ]; then
+if [ -x @prefix@/bin/pg_lsclusters-@FINKPGRAWVERSION@ ]; then
# PGCLUSTER=`pg_lsclusters | awk '{if ($3 == ENVIRON["PGPORT"]) {print $1"/"$2;}}'`
# export PGCLUSTER
#
if [ -z $DBAUSER ]; then
- DBAUSER=`pg_lsclusters | awk '{if ($3 == ENVIRON["PGPORT"]) {print $5;}}'`
+ DBAUSER=`pg_lsclusters-@FINKPGRAWVERSION@ | awk '{if ($3 == ENVIRON["PGPORT"]) {print $5;}}'`
fi
fi

--- postgis-1.3.2/extras/template_gis/postgres_lib.sh.in 2006-05-31 02:43:12.000000000 -0400
+++ postgis-1.3.2-new/extras/template_gis/postgres_lib.sh.in 2007-12-12 08:51:30.000000000 -0500
@@ -39,9 +39,9 @@
echo "you may be not allowed to do so (maybe wrong password)."
exit 1
fi
- ISDBAPGUSER=`psql -At -d template1 -c "select usename from pg_user where usesuper = true and usename = '$DBAUSER';" 2>&1`
+ ISDBAPGUSER=`psql-@FINKPGRAWVERSION@ -At -d template1 -c "select usename from pg_user where usesuper = true and usename = '$DBAUSER';" 2>&1`
if [ ! "$ISDBAPGUSER" = "$DBAUSER" ]; then
- MAYPOSTGRES=`psql -l`
+ MAYPOSTGRES=`psql-@FINKPGRAWVERSION@ -l`
if [ -z "$MAYPOSTGRES" ]; then
echo "either postgresql $PGCLUSTER is not running,"
echo "or $DBAUSER doesn't have privileges on cluster $PGCLUSTER."
@@ -59,9 +59,9 @@
function template_rm()
{
TDB=$1
- db_update=`psql -d template1 -c "UPDATE pg_database SET datistemplate = FALSE WHERE datname = '$TDB';" 2>&1`
+ db_update=`psql-@FINKPGRAWVERSION@ -d template1 -c "UPDATE pg_database SET datistemplate = FALSE WHERE datname = '$TDB';" 2>&1`
if [ "$db_update" = "UPDATE 1" ]; then
- dropdb $TDB 2>&1 | cat > /dev/null
+ dropdb-@FINKPGRAWVERSION@ $TDB 2>&1 | cat > /dev/null
else
echo "$TDB could not be accessed. it may not exist"
fi
@@ -75,50 +75,50 @@
TDB=$1
GRUSER=$2
#of course it could be better to create as the $GRUSER where system user
- db_create=`createdb $TDB 2>&1`
+ db_create=`createdb-@FINKPGRAWVERSION@ $TDB 2>&1`
if [ "$db_create" = "CREATE DATABASE" ]; then
- GRID=`psql -d template1 -At -c "select usesysid from pg_user where usename='$GRUSER';"`
+ GRID=`psql-@FINKPGRAWVERSION@ -d template1 -At -c "select usesysid from pg_user where usename='$GRUSER';"`
if [ -n "$GRID" ]; then
- psql -d $TDB -c "UPDATE pg_database SET datdba = $GRID WHERE datname = '$TDB';" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "UPDATE pg_database SET datdba = $GRID WHERE datname = '$TDB';" 2>&1 | cat > /dev/null
fi
- if [ -x @bindir@/createlang ]; then
- @bindir@/createlang plpgsql $TDB 2>&1 | cat > /dev/null
+ if [ -x @bindir@/createlang-@FINKPGRAWVERSION@ ]; then
+ @bindir@/createlang-@FINKPGRAWVERSION@ plpgsql $TDB 2>&1 | cat > /dev/null
fi
for script in $SCRIPTS ; do
- psql -d $TDB -f $script 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -f $script 2>&1 | cat > /dev/null
done
#pseudo tables for postgresql 7.2 and 7.4. feel free to add more, for other postgresql versions
PSEUDO_TABLES="'pg_xactlock', 'sql_features', 'sql_implementation_info', 'sql_languages',
'sql_packages', 'sql_sizing', 'sql_sizing_profiles'"
- TABLES=`psql -d $TDB -At -c "select tablename from pg_tables where tablename not in ($PSEUDO_TABLES);"`
+ TABLES=`psql-@FINKPGRAWVERSION@ -d $TDB -At -c "select tablename from pg_tables where tablename not in ($PSEUDO_TABLES);"`
if [ -n "$GRID" ]; then
for table in $TABLES ; do
- psql -d $TDB -c "alter table $table owner to $GRUSER;" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "alter table $table owner to $GRUSER;" 2>&1 | cat > /dev/null
done
- psql -d $TDB -c "update pg_class set relowner=$GRID where relkind = 'S';" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "update pg_class set relowner=$GRID where relkind = 'S';" 2>&1 | cat > /dev/null
else #maybe public, or group
for grtable in $GRTABLES ; do
- psql -d $TDB -c "grant all privileges on table $grtable to $GRUSER;" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "grant all privileges on table $grtable to $GRUSER;" 2>&1 | cat > /dev/null
done
fi
for grschema in $GRSCHEMAS ; do
- psql -d $TDB -c "alter schema $grschema owner to $GRUSER;" 2>&1 | cat > /dev/null
- psql -d $TDB -c "grant all privileges on schema $grschema to $GRUSER;" 2>&1 | cat > /dev/null
- STABLES=`psql -d $TDB -At -c "select tablename from pg_tables where schemaname = '$grschema';"`
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "alter schema $grschema owner to $GRUSER;" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "grant all privileges on schema $grschema to $GRUSER;" 2>&1 | cat > /dev/null
+ STABLES=`psql-@FINKPGRAWVERSION@ -d $TDB -At -c "select tablename from pg_tables where schemaname = '$grschema';"`
if [ -n "$GRID" ]; then
for table in $STABLES ; do
- psql -d $TDB -c "alter table $grschema.$table owner to $GRUSER;" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "alter table $grschema.$table owner to $GRUSER;" 2>&1 | cat > /dev/null
done
else #maybe public, or group
for grtable in $GRTABLES ; do #contain specific schema
- psql -d $TDB -c "grant all privileges on table $grtable to $GRUSER;" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "grant all privileges on table $grtable to $GRUSER;" 2>&1 | cat > /dev/null
done
fi
done
- psql -d $TDB -c "VACUUM FULL;" 2>&1 | cat > /dev/null
- psql -d $TDB -c "VACUUM FREEZE;" 2>&1 | cat > /dev/null
- psql -d $TDB -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = '$TDB';" 2>&1 | cat > /dev/null
- psql -d $TDB -c "UPDATE pg_database SET datallowconn = FALSE WHERE datname = '$TDB';" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "VACUUM FULL;" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "VACUUM FREEZE;" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = '$TDB';" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "UPDATE pg_database SET datallowconn = FALSE WHERE datname = '$TDB';" 2>&1 | cat > /dev/null
else
echo "$db_create"
fi
--- postgis-1.3.2/extras/template_gis/profile 2006-06-09 02:03:59.000000000 -0400
+++ postgis-1.3.2-new/extras/template_gis/profile 2007-12-12 08:43:29.000000000 -0500
@@ -1,6 +1,6 @@

#those are the default variables for postgresql-postgis.
-#this file will be scanned from /etc/default/postgis,
+#this file will be scanned from @FINKPREFIX@/etc/default/postgis,
#and then from $HOME/postgis/profile

#values should NOT be in quotes
--- postgis-1.3.2/extras/template_gis/rmtemplate_gis.1 2006-05-31 02:43:12.000000000 -0400
+++ postgis-1.3.2-new/extras/template_gis/rmtemplate_gis.1 2007-12-12 08:43:15.000000000 -0500
@@ -45,7 +45,7 @@
.LP
The environment variables for template_gis creation, removal and usage may be stored in files, as follows:
.TP
-.B /etc/default/postgis
+.B @FINKPREFIX@/etc/default/postgis
will designate default values for the whole system.
.TP
.B $HOME/.postgis/profile
--- postgis-1.3.2/lwgeom/lwgeom_gml.c 2007-10-10 17:27:51.000000000 -0400
+++ postgis-1.3.2-new/lwgeom/lwgeom_gml.c 2007-12-12 09:15:30.000000000 -0500
@@ -51,10 +51,10 @@
static char *getSRSbySRID(int SRID);

/* Add dot, sign, exponent sign, 'e', exponent digits */
-#define SHOW_DIGS (precision + 8)
+#define SHOW_DIGS (gml_precision + 8)

/* Globals */
-int precision;
+int gml_precision;


/**
@@ -85,8 +85,8 @@
geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(1));

/* Get precision */
- precision = PG_GETARG_INT32(2);
- if ( precision < 1 || precision > 15 )
+ gml_precision = PG_GETARG_INT32(2);
+ if ( gml_precision < 1 || gml_precision > 15 )
{
elog(ERROR, "Precision out of range 1..15");
PG_RETURN_NULL();
@@ -440,8 +440,8 @@
getPoint2d_p(pa, i, &pt);
if ( i ) ptr += sprintf(ptr, " ");
ptr += sprintf(ptr, "%.*g,%.*g",
- precision, pt.x,
- precision, pt.y);
+ gml_precision, pt.x,
+ gml_precision, pt.y);
}
}
else
@@ -452,9 +452,9 @@
getPoint4d_p(pa, i, &pt);
if ( i ) ptr += sprintf(ptr, " ");
ptr += sprintf(ptr, "%.*g,%.*g,%.*g",
- precision, pt.x,
- precision, pt.y,
- precision, pt.z);
+ gml_precision, pt.x,
+ gml_precision, pt.y,
+ gml_precision, pt.z);
}
}

@@ -798,8 +798,8 @@
getPoint2d_p(pa, i, &pt);
if ( i ) ptr += sprintf(ptr, " ");
ptr += sprintf(ptr, "%.*g %.*g",
- precision, pt.x,
- precision, pt.y);
+ gml_precision, pt.x,
+ gml_precision, pt.y);
}
}
else
@@ -810,9 +810,9 @@
getPoint4d_p(pa, i, &pt);
if ( i ) ptr += sprintf(ptr, " ");
ptr += sprintf(ptr, "%.*g %.*g,%.*g",
- precision, pt.x,
- precision, pt.y,
- precision, pt.z);
+ gml_precision, pt.x,
+ gml_precision, pt.y,
+ gml_precision, pt.z);
}
}

--- postgis-1.3.2/lwgeom/lwgeom_kml.c 2007-10-22 20:19:54.000000000 -0400
+++ postgis-1.3.2-new/lwgeom/lwgeom_kml.c 2007-12-12 09:14:49.000000000 -0500
@@ -40,10 +40,10 @@

#define DEF_PRECISION 15
/* Add dot, sign, exponent sign, 'e', exponent digits */
-#define SHOW_DIGS (precision + 8)
+#define SHOW_DIGS (kml_precision + 8)

/* Globals */
-int precision;
+int kml_precision;


/**
@@ -60,7 +60,7 @@
char *srs;
int SRID;

- precision = DEF_PRECISION;
+ kml_precision = DEF_PRECISION;

if ( PG_ARGISNULL(0) ) PG_RETURN_NULL();

@@ -68,9 +68,9 @@

/* Get precision (if provided) */
if ( PG_NARGS() > 1 && ! PG_ARGISNULL(1) )
- precision = PG_GETARG_INT32(1);
+ kml_precision = PG_GETARG_INT32(1);

- if ( precision < 1 || precision > 15 )
+ if ( kml_precision < 1 || kml_precision > 15 )
{
elog(ERROR, "Precision out of range 1..15");
PG_RETURN_NULL();
@@ -411,8 +411,8 @@
getPoint2d_p(pa, i, &pt);
if ( i ) ptr += sprintf(ptr, " ");
ptr += sprintf(ptr, "%.*g,%.*g,0",
- precision, pt.x,
- precision, pt.y);
+ kml_precision, pt.x,
+ kml_precision, pt.y);
}
}
else
@@ -423,9 +423,9 @@
getPoint4d_p(pa, i, &pt);
if ( i ) ptr += sprintf(ptr, " ");
ptr += sprintf(ptr, "%.*g,%.*g,%.*g",
- precision, pt.x,
- precision, pt.y,
- precision, pt.z);
+ kml_precision, pt.x,
+ kml_precision, pt.y,
+ kml_precision, pt.z);
}
}

--- postgis-1.3.2/utils/postgis_restore.pl 2006-11-20 07:59:55.000000000 -0500
+++ postgis-1.3.2-new/utils/postgis_restore.pl 2007-12-12 08:48:53.000000000 -0500
@@ -375,7 +375,7 @@
#
print "Scanning $dump list\n";
open( OUTPUT, ">$dumplist") || die "Can't write to ".$dump.".list\n";
-open( INPUT, "pg_restore -l $dump |") || die "Couldn't run pg_restore -l $dump\n";
+open( INPUT, "pg_restore-@FINKPGRAWVERSION@ -l $dump |") || die "Couldn't run pg_restore-@FINKPGRAWVERSION@ -l $dump\n";
while( my $line = )
{
next if $line =~ /^;/;
@@ -613,7 +613,7 @@
close(OUTPUT);

print "Producing ascii dump $dumpascii\n";
-open( INPUT, "pg_restore -L $dumplist $dump |") || die "Can't run pg_restore\n";
+open( INPUT, "pg_restore-@FINKPGRAWVERSION@ -L $dumplist $dump |") || die "Can't run pg_restore\n";
open( OUTPUT, ">$dumpascii") || die "Can't write to $dumpascii\n";
while( my $line = )
{
@@ -673,7 +673,7 @@
# when implemented operators skip must be disabled
# in the first scan of ToC
}
-close(INPUT) || die "pg_restore call failed\n";
+close(INPUT) || die "pg_restore-@FINKPGRAWVERSION@ call failed\n";
close(OUTPUT);

#exit(1);
@@ -682,15 +682,15 @@
# Create the new db and install plpgsql language
#
print "Creating db ($dbname)\n";
-`createdb $createdb_opt $dbname`;
+`createdb-@FINKPGRAWVERSION@ $createdb_opt $dbname`;
die "Database creation failed\n" if ($?);
print "Adding plpgsql\n";
-`createlang plpgsql $dbname`;
+`createlang-@FINKPGRAWVERSION@ plpgsql $dbname`;

#
# Open a pipe to the SQL monitor
#
-open( PSQL, "| psql -a $dbname") || die "Can't run psql\n";
+open( PSQL, "| psql-@FINKPGRAWVERSION@ -a $dbname") || die "Can't run psql\n";

#
# Source new postgis.sql
@@ -717,4 +717,4 @@
open(INPUT, "<$dumpascii") || die "Can't read $postgissql\n";
while() { print PSQL; }
close(INPUT);
-close(PSQL) || die "psql run failed\n"
+close(PSQL) || die "psql-@FINKPGRAWVERSION@ run failed\n"

postgis _unstable_ port information

Info2: <<
Package: postgis%type_pkg[postgresql]
Version: 1.3.3
Revision: 1
Description: PostgreSQL geographic object support
Type: postgresql (7.4 8.0 8.1 8.2 8.3)
License: BSD
Maintainer: Benjamin Reed

Depends: <<
libgeos2-shlibs,
(%type_raw[postgresql] <= 7.4) postgresql%type_pkg[postgresql]-unified-shlibs,
(%type_raw[postgresql] >= 8.1) postgresql%type_pkg[postgresql]-shlibs,
proj-shlibs
<<
BuildDepends: <<
jts,
libgeos2,
libiconv-dev,
(%type_raw[postgresql] <= 8.0) postgresql%type_pkg[postgresql]-unified-dev,
(%type_raw[postgresql] >= 8.1) postgresql%type_pkg[postgresql]-dev,
postgresql-java (>= %type_raw[postgresql]-1),
proj,
system-openssl-dev,
system-java (>= 1.4-1)
<<
Replaces: postgresql%type_pkg[postgresql]
GCC: 4.0

Source: http://postgis.refractions.net/download/postgis-%v.tar.gz
Source-MD5: 0a1df813ca9450e874663f16a35ec34a
PatchScript: sed -e 's,@FINKPREFIX@,%p,g; s,@FINKPGRAWVERSION@,%type_raw[postgresql],g; s,@FINKPGVERSION@,%type_pkg[postgresql],g' %a/%{Ni}.patch | patch -p1

SetCPPFLAGS: -I%p/include/postgresql -I%p/include -fno-common
NoSetCPPFLAGS: true
NoSetLDFLAGS: true
ConfigureParams: --with-pgsql=%p/bin/pg_config-%type_raw[postgresql]
CompileScript: <<
#!/bin/sh -ev

export lt_cv_sys_max_cmd_len=65536 PGCONFIG=%p/bin/pg_config-%type_raw[postgresql]
export CPPFLAGS="-I%p/lib/system-openssl/include -I%p/include/postgresql -I%p/include -DHAVE_OPTRESET -fno-common"
export LDFLAGS="-L%p/lib/system-openssl/lib -L%p/lib"

./configure %c
make libdir=%p/lib/postgresql-%type_raw[postgresql] LPATH="%p/lib/postgresql-%type_raw[postgresql]"
pushd java/jdbc
make
popd
<<

InstallScript: <<
#!/bin/sh -ev

make -j1 install DESTDIR=%d libdir=%p/lib/postgresql-%type_raw[postgresql] LPATH="%p/lib/postgresql-%type_raw[postgresql]" datadir=%p/share/doc/%N
for file in pgsql2shp shp2pgsql; do
mv %i/bin/$file %i/bin/$file-%type_raw[postgresql]
done
<<
DocFiles: COPYING CREDITS ChangeLog NEWS README* TODO
SplitOff: <<
Package: %N-java
Depends: <<
jts,
postgresql-java (>= %type_raw[postgresql]-1)
<<
JarFiles: java/jdbc/postgis.jar java/pljava/postgis_pljava.jar
<<

PostInstScript: <<
for file in pgsql2shp shp2pgsql; do
%p/sbin/update-alternatives --install "%p/bin/$file" "$file" "%p/bin/$file-%type_raw[postgresql]" %type_pkg[postgresql]
done

# obsolete, from the old package
for file in createdb.postgis mktemplate_gis mktemplate_gis.sh postgis_env.sh postgres_lib.sh rmtemplate_gis rmtemplate_gis.sh; do
%p/sbin/update-alternatives --remove "$file" "%p/bin/$file-%type_raw[postgresql]"
done
for file in createdb.postgis.1 mktemplate_gis.1 rmtemplate_gis.1; do
%p/sbin/update-alternatives --remove "$file" "%p/bin/$file-%type_raw[postgresql]"
done
%p/sbin/update-alternatives --remove "postgis-default" "%p/etc/%N"
cat < Note: This package does not do anything until you add it's schema to
your database!

If this is the first time you're using PostGIS in a particular database,
you must install the schema like so:

sudo %p/bin/pgsql.sh-%type_raw[postgresql] start
sudo -u postgres %p/bin/psql-%type_raw[postgresql] -f %p/share/doc/%N/lwpostgis.sql -d

If you are upgrading your database from a previous PostGIS version, you
need to upgrade the schema like so:

sudo %p/bin/pgsql.sh-%type_raw[postgresql] start
sudo -u postgres %p/bin/psql-%type_raw[postgresql] -f %p/share/doc/%N/lwpostgis_upgrade.sql -d

EOF
<<
PreRmScript: <<
if [ "$1" != "upgrade" ]; then
for file in pgsql2shp shp2pgsql; do
%p/sbin/update-alternatives --remove "$file" "%p/bin/$file-%type_raw[postgresql]"
done
fi
<<

Homepage: http://postgis.refractions.net/
DescDetail: <<
PostGIS adds support for geographic objects to the PostgreSQL
object-relational database. In effect, PostGIS "spatially enables" the
PostgreSQL server, allowing it to be used as a backend spatial database for
geographic information systems (GIS), much like ESRI's SDE or Oracle's Spatial
extension. PostGIS follows the OpenGIS "Simple Features Specification for
SQL" and has been certified as compliant with the "Types and Functions"
profile.
<<
DescUsage: <<
Note: This package does not do anything until you add it's schema to
your database!

If this is the first time you're using PostGIS in a particular database,
you must install the schema like so:

sudo %p/bin/pgsql.sh-%type_raw[postgresql] start
sudo -u postgres %p/bin/psql-%type_raw[postgresql] \
-f %p/share/doc/%N/lwpostgis.sql -d

If you are upgrading your database from a previous PostGIS version, you
need to upgrade the schema like so:

sudo %p/bin/pgsql.sh-%type_raw[postgresql] start
sudo -u postgres %p/bin/psql-%type_raw[postgresql] \
-f %p/share/doc/%N/lwpostgis_upgrade.sql -d
<<
<<

postgis _unstable_ port .patch

diff -Nurd postgis-1.3.3/README.postgis postgis-1.3.3-new/README.postgis
--- postgis-1.3.3/README.postgis 2008-04-12 14:32:14.000000000 -0400
+++ postgis-1.3.3-new/README.postgis 2008-06-11 16:46:54.000000000 -0400
@@ -143,8 +143,8 @@

So, as postgres run:

- createlang plpgsql yourdatabase
- psql -f lwpostgis.sql -d your_database
+ createlang-@FINKPGRAWVERSION@ plpgsql yourdatabase
+ psql-@FINKPGRAWVERSION@ -f lwpostgis.sql -d your_database

Your database should now be spatially enabled.

@@ -166,7 +166,7 @@
Soft upgrade consists of sourcing the lwpostgis_upgrade.sql
script in your spatial database:

- psql -f lwpostgis_upgrade.sql -d your_spatial_database
+ psql-@FINKPGRAWVERSION@ -f lwpostgis_upgrade.sql -d your_spatial_database

If a soft upgrade is not possible the script will abort and
you will be warned about HARD UPGRADE being required,
@@ -187,7 +187,7 @@

# Create a "custom-format" dump of the database you want
# to upgrade (let's call it "olddb")
- $ pg_dump -Fc olddb olddb.dump
+ $ pg_dump-@FINKPGRAWVERSION@ -Fc olddb olddb.dump

# Restore the dump while upgrading postgis into
# a new database.
@@ -204,9 +204,9 @@
# drop the attrelid, varattnum and stats columns in the geometry_columns
# table, which are no-more needed. Keeping them won't hurt.
# !!! DROPPING THEM WHEN REALLY NEEDED WILL DO HARM !!!!
- $ psql newdb -c "ALTER TABLE geometry_columns DROP attrelid"
- $ psql newdb -c "ALTER TABLE geometry_columns DROP varattnum"
- $ psql newdb -c "ALTER TABLE geometry_columns DROP stats"
+ $ psql-@FINKPGRAWVERSION@ newdb -c "ALTER TABLE geometry_columns DROP attrelid"
+ $ psql-@FINKPGRAWVERSION@ newdb -c "ALTER TABLE geometry_columns DROP varattnum"
+ $ psql-@FINKPGRAWVERSION@ newdb -c "ALTER TABLE geometry_columns DROP stats"

# The spatial_ref_sys table is restored from the dump, to
# ensure your custom additions are kept, but the distributed
@@ -214,7 +214,7 @@
# entries, drop the table and source the new one.
# If you did make additions we assume you know how to backup them before
# upgrading the table. Replace it with the new like this:
- $ psql newdb
+ $ psql-@FINKPGRAWVERSION@ newdb
newdb=> DELETE FROM spatial_ref_sys;
DROP
newdb=> \i spatial_ref_sys.sql
diff -Nurd postgis-1.3.3/extras/template_gis/createdb.postgis.1 postgis-1.3.3-new/extras/template_gis/createdb.postgis.1
--- postgis-1.3.3/extras/template_gis/createdb.postgis.1 2006-05-31 02:43:12.000000000 -0400
+++ postgis-1.3.3-new/extras/template_gis/createdb.postgis.1 2008-06-11 16:46:54.000000000 -0400
@@ -43,7 +43,7 @@
.LP
The environment variables for template_gis creation, removal and usage may be stored in files, as follows:
.TP
-.B /etc/default/postgis
+.B @FINKPREFIX@/etc/default/postgis
will designate default values for the whole system.
.TP
.B $HOME/.postgis/profile
diff -Nurd postgis-1.3.3/extras/template_gis/mktemplate_gis.1 postgis-1.3.3-new/extras/template_gis/mktemplate_gis.1
--- postgis-1.3.3/extras/template_gis/mktemplate_gis.1 2006-05-31 02:43:12.000000000 -0400
+++ postgis-1.3.3-new/extras/template_gis/mktemplate_gis.1 2008-06-11 16:46:54.000000000 -0400
@@ -89,7 +89,7 @@
.LP
The environment variables for template_gis creation, removal and usage may be stored in files, as follows:
.TP
-.B /etc/default/postgis
+.B @FINKPREFIX@/etc/default/postgis
will designate default values for the whole system.
.TP
.B $HOME/.postgis/profile
diff -Nurd postgis-1.3.3/extras/template_gis/postgis_env.sh.in postgis-1.3.3-new/extras/template_gis/postgis_env.sh.in
--- postgis-1.3.3/extras/template_gis/postgis_env.sh.in 2006-05-31 02:43:12.000000000 -0400
+++ postgis-1.3.3-new/extras/template_gis/postgis_env.sh.in 2008-06-11 16:46:54.000000000 -0400
@@ -3,7 +3,7 @@
# environment variables for postgis

#read optional configuration files. last prevails
-for file in "/etc/default/postgis" "$HOME/.postgis/profile" ; do
+for file in "@FINKPREFIX@/etc/default/postgis" "$HOME/.postgis/profile" ; do
if [ -f "$file" ]; then
tmpval=`grep "^TEMPLATEDB=" $file | cut -d= -f2`
if [ -n "$tmpval" ]; then
@@ -25,12 +25,12 @@
done

#cluster information should be set separately
-if [ -x @prefix@/bin/pg_lsclusters ]; then
+if [ -x @prefix@/bin/pg_lsclusters-@FINKPGRAWVERSION@ ]; then
# PGCLUSTER=`pg_lsclusters | awk '{if ($3 == ENVIRON["PGPORT"]) {print $1"/"$2;}}'`
# export PGCLUSTER
#
if [ -z $DBAUSER ]; then
- DBAUSER=`pg_lsclusters | awk '{if ($3 == ENVIRON["PGPORT"]) {print $5;}}'`
+ DBAUSER=`pg_lsclusters-@FINKPGRAWVERSION@ | awk '{if ($3 == ENVIRON["PGPORT"]) {print $5;}}'`
fi
fi

diff -Nurd postgis-1.3.3/extras/template_gis/postgres_lib.sh.in postgis-1.3.3-new/extras/template_gis/postgres_lib.sh.in
--- postgis-1.3.3/extras/template_gis/postgres_lib.sh.in 2006-05-31 02:43:12.000000000 -0400
+++ postgis-1.3.3-new/extras/template_gis/postgres_lib.sh.in 2008-06-11 16:46:54.000000000 -0400
@@ -39,9 +39,9 @@
echo "you may be not allowed to do so (maybe wrong password)."
exit 1
fi
- ISDBAPGUSER=`psql -At -d template1 -c "select usename from pg_user where usesuper = true and usename = '$DBAUSER';" 2>&1`
+ ISDBAPGUSER=`psql-@FINKPGRAWVERSION@ -At -d template1 -c "select usename from pg_user where usesuper = true and usename = '$DBAUSER';" 2>&1`
if [ ! "$ISDBAPGUSER" = "$DBAUSER" ]; then
- MAYPOSTGRES=`psql -l`
+ MAYPOSTGRES=`psql-@FINKPGRAWVERSION@ -l`
if [ -z "$MAYPOSTGRES" ]; then
echo "either postgresql $PGCLUSTER is not running,"
echo "or $DBAUSER doesn't have privileges on cluster $PGCLUSTER."
@@ -59,9 +59,9 @@
function template_rm()
{
TDB=$1
- db_update=`psql -d template1 -c "UPDATE pg_database SET datistemplate = FALSE WHERE datname = '$TDB';" 2>&1`
+ db_update=`psql-@FINKPGRAWVERSION@ -d template1 -c "UPDATE pg_database SET datistemplate = FALSE WHERE datname = '$TDB';" 2>&1`
if [ "$db_update" = "UPDATE 1" ]; then
- dropdb $TDB 2>&1 | cat > /dev/null
+ dropdb-@FINKPGRAWVERSION@ $TDB 2>&1 | cat > /dev/null
else
echo "$TDB could not be accessed. it may not exist"
fi
@@ -75,50 +75,50 @@
TDB=$1
GRUSER=$2
#of course it could be better to create as the $GRUSER where system user
- db_create=`createdb $TDB 2>&1`
+ db_create=`createdb-@FINKPGRAWVERSION@ $TDB 2>&1`
if [ "$db_create" = "CREATE DATABASE" ]; then
- GRID=`psql -d template1 -At -c "select usesysid from pg_user where usename='$GRUSER';"`
+ GRID=`psql-@FINKPGRAWVERSION@ -d template1 -At -c "select usesysid from pg_user where usename='$GRUSER';"`
if [ -n "$GRID" ]; then
- psql -d $TDB -c "UPDATE pg_database SET datdba = $GRID WHERE datname = '$TDB';" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "UPDATE pg_database SET datdba = $GRID WHERE datname = '$TDB';" 2>&1 | cat > /dev/null
fi
- if [ -x @bindir@/createlang ]; then
- @bindir@/createlang plpgsql $TDB 2>&1 | cat > /dev/null
+ if [ -x @bindir@/createlang-@FINKPGRAWVERSION@ ]; then
+ @bindir@/createlang-@FINKPGRAWVERSION@ plpgsql $TDB 2>&1 | cat > /dev/null
fi
for script in $SCRIPTS ; do
- psql -d $TDB -f $script 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -f $script 2>&1 | cat > /dev/null
done
#pseudo tables for postgresql 7.2 and 7.4. feel free to add more, for other postgresql versions
PSEUDO_TABLES="'pg_xactlock', 'sql_features', 'sql_implementation_info', 'sql_languages',
'sql_packages', 'sql_sizing', 'sql_sizing_profiles'"
- TABLES=`psql -d $TDB -At -c "select tablename from pg_tables where tablename not in ($PSEUDO_TABLES);"`
+ TABLES=`psql-@FINKPGRAWVERSION@ -d $TDB -At -c "select tablename from pg_tables where tablename not in ($PSEUDO_TABLES);"`
if [ -n "$GRID" ]; then
for table in $TABLES ; do
- psql -d $TDB -c "alter table $table owner to $GRUSER;" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "alter table $table owner to $GRUSER;" 2>&1 | cat > /dev/null
done
- psql -d $TDB -c "update pg_class set relowner=$GRID where relkind = 'S';" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "update pg_class set relowner=$GRID where relkind = 'S';" 2>&1 | cat > /dev/null
else #maybe public, or group
for grtable in $GRTABLES ; do
- psql -d $TDB -c "grant all privileges on table $grtable to $GRUSER;" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "grant all privileges on table $grtable to $GRUSER;" 2>&1 | cat > /dev/null
done
fi
for grschema in $GRSCHEMAS ; do
- psql -d $TDB -c "alter schema $grschema owner to $GRUSER;" 2>&1 | cat > /dev/null
- psql -d $TDB -c "grant all privileges on schema $grschema to $GRUSER;" 2>&1 | cat > /dev/null
- STABLES=`psql -d $TDB -At -c "select tablename from pg_tables where schemaname = '$grschema';"`
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "alter schema $grschema owner to $GRUSER;" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "grant all privileges on schema $grschema to $GRUSER;" 2>&1 | cat > /dev/null
+ STABLES=`psql-@FINKPGRAWVERSION@ -d $TDB -At -c "select tablename from pg_tables where schemaname = '$grschema';"`
if [ -n "$GRID" ]; then
for table in $STABLES ; do
- psql -d $TDB -c "alter table $grschema.$table owner to $GRUSER;" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "alter table $grschema.$table owner to $GRUSER;" 2>&1 | cat > /dev/null
done
else #maybe public, or group
for grtable in $GRTABLES ; do #contain specific schema
- psql -d $TDB -c "grant all privileges on table $grtable to $GRUSER;" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "grant all privileges on table $grtable to $GRUSER;" 2>&1 | cat > /dev/null
done
fi
done
- psql -d $TDB -c "VACUUM FULL;" 2>&1 | cat > /dev/null
- psql -d $TDB -c "VACUUM FREEZE;" 2>&1 | cat > /dev/null
- psql -d $TDB -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = '$TDB';" 2>&1 | cat > /dev/null
- psql -d $TDB -c "UPDATE pg_database SET datallowconn = FALSE WHERE datname = '$TDB';" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "VACUUM FULL;" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "VACUUM FREEZE;" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = '$TDB';" 2>&1 | cat > /dev/null
+ psql-@FINKPGRAWVERSION@ -d $TDB -c "UPDATE pg_database SET datallowconn = FALSE WHERE datname = '$TDB';" 2>&1 | cat > /dev/null
else
echo "$db_create"
fi
diff -Nurd postgis-1.3.3/extras/template_gis/profile postgis-1.3.3-new/extras/template_gis/profile
--- postgis-1.3.3/extras/template_gis/profile 2006-06-09 02:03:59.000000000 -0400
+++ postgis-1.3.3-new/extras/template_gis/profile 2008-06-11 16:46:54.000000000 -0400
@@ -1,6 +1,6 @@

#those are the default variables for postgresql-postgis.
-#this file will be scanned from /etc/default/postgis,
+#this file will be scanned from @FINKPREFIX@/etc/default/postgis,
#and then from $HOME/postgis/profile

#values should NOT be in quotes
diff -Nurd postgis-1.3.3/extras/template_gis/rmtemplate_gis.1 postgis-1.3.3-new/extras/template_gis/rmtemplate_gis.1
--- postgis-1.3.3/extras/template_gis/rmtemplate_gis.1 2006-05-31 02:43:12.000000000 -0400
+++ postgis-1.3.3-new/extras/template_gis/rmtemplate_gis.1 2008-06-11 16:46:54.000000000 -0400
@@ -45,7 +45,7 @@
.LP
The environment variables for template_gis creation, removal and usage may be stored in files, as follows:
.TP
-.B /etc/default/postgis
+.B @FINKPREFIX@/etc/default/postgis
will designate default values for the whole system.
.TP
.B $HOME/.postgis/profile
diff -Nurd postgis-1.3.3/lwgeom/lwgeom_gml.c postgis-1.3.3-new/lwgeom/lwgeom_gml.c
--- postgis-1.3.3/lwgeom/lwgeom_gml.c 2007-10-10 17:27:51.000000000 -0400
+++ postgis-1.3.3-new/lwgeom/lwgeom_gml.c 2008-06-11 16:46:54.000000000 -0400
@@ -51,10 +51,10 @@
static char *getSRSbySRID(int SRID);

/* Add dot, sign, exponent sign, 'e', exponent digits */
-#define SHOW_DIGS (precision + 8)
+#define SHOW_DIGS (gml_precision + 8)

/* Globals */
-int precision;
+int gml_precision;


/**
@@ -85,8 +85,8 @@
geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(1));

/* Get precision */
- precision = PG_GETARG_INT32(2);
- if ( precision < 1 || precision > 15 )
+ gml_precision = PG_GETARG_INT32(2);
+ if ( gml_precision < 1 || gml_precision > 15 )
{
elog(ERROR, "Precision out of range 1..15");
PG_RETURN_NULL();
@@ -440,8 +440,8 @@
getPoint2d_p(pa, i, &pt);
if ( i ) ptr += sprintf(ptr, " ");
ptr += sprintf(ptr, "%.*g,%.*g",
- precision, pt.x,
- precision, pt.y);
+ gml_precision, pt.x,
+ gml_precision, pt.y);
}
}
else
@@ -452,9 +452,9 @@
getPoint4d_p(pa, i, &pt);
if ( i ) ptr += sprintf(ptr, " ");
ptr += sprintf(ptr, "%.*g,%.*g,%.*g",
- precision, pt.x,
- precision, pt.y,
- precision, pt.z);
+ gml_precision, pt.x,
+ gml_precision, pt.y,
+ gml_precision, pt.z);
}
}

@@ -798,8 +798,8 @@
getPoint2d_p(pa, i, &pt);
if ( i ) ptr += sprintf(ptr, " ");
ptr += sprintf(ptr, "%.*g %.*g",
- precision, pt.x,
- precision, pt.y);
+ gml_precision, pt.x,
+ gml_precision, pt.y);
}
}
else
@@ -810,9 +810,9 @@
getPoint4d_p(pa, i, &pt);
if ( i ) ptr += sprintf(ptr, " ");
ptr += sprintf(ptr, "%.*g %.*g,%.*g",
- precision, pt.x,
- precision, pt.y,
- precision, pt.z);
+ gml_precision, pt.x,
+ gml_precision, pt.y,
+ gml_precision, pt.z);
}
}

diff -Nurd postgis-1.3.3/lwgeom/lwgeom_kml.c postgis-1.3.3-new/lwgeom/lwgeom_kml.c
--- postgis-1.3.3/lwgeom/lwgeom_kml.c 2008-03-28 17:31:57.000000000 -0400
+++ postgis-1.3.3-new/lwgeom/lwgeom_kml.c 2008-06-11 16:47:38.000000000 -0400
@@ -40,10 +40,10 @@
static size_t pointArray_KMLsize(POINTARRAY *pa);

/* Add dot, sign, exponent sign, 'e', exponent digits */
-#define SHOW_DIGS (precision + 8)
+#define SHOW_DIGS (kml_precision + 8)

/* Globals */
-int precision;
+int kml_precision;


/**
@@ -72,8 +72,8 @@
geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(1));

/* Get precision */
- precision = PG_GETARG_INT32(2);
- if ( precision < 1 || precision > 15 )
+ kml_precision = PG_GETARG_INT32(2);
+ if ( kml_precision < 1 || kml_precision > 15 )
{
elog(ERROR, "Precision out of range 1..15");
PG_RETURN_NULL();
@@ -392,8 +392,8 @@
getPoint2d_p(pa, i, &pt);
if ( i ) ptr += sprintf(ptr, " ");
ptr += sprintf(ptr, "%.*g,%.*g",
- precision, pt.x,
- precision, pt.y);
+ kml_precision, pt.x,
+ kml_precision, pt.y);
}
}
else
@@ -404,9 +404,9 @@
getPoint4d_p(pa, i, &pt);
if ( i ) ptr += sprintf(ptr, " ");
ptr += sprintf(ptr, "%.*g,%.*g,%.*g",
- precision, pt.x,
- precision, pt.y,
- precision, pt.z);
+ kml_precision, pt.x,
+ kml_precision, pt.y,
+ kml_precision, pt.z);
}
}

diff -Nurd postgis-1.3.3/utils/postgis_restore.pl postgis-1.3.3-new/utils/postgis_restore.pl
--- postgis-1.3.3/utils/postgis_restore.pl 2006-11-20 07:59:55.000000000 -0500
+++ postgis-1.3.3-new/utils/postgis_restore.pl 2008-06-11 16:46:54.000000000 -0400
@@ -375,7 +375,7 @@
#
print "Scanning $dump list\n";
open( OUTPUT, ">$dumplist") || die "Can't write to ".$dump.".list\n";
-open( INPUT, "pg_restore -l $dump |") || die "Couldn't run pg_restore -l $dump\n";
+open( INPUT, "pg_restore-@FINKPGRAWVERSION@ -l $dump |") || die "Couldn't run pg_restore-@FINKPGRAWVERSION@ -l $dump\n";
while( my $line = )
{
next if $line =~ /^;/;
@@ -613,7 +613,7 @@
close(OUTPUT);

print "Producing ascii dump $dumpascii\n";
-open( INPUT, "pg_restore -L $dumplist $dump |") || die "Can't run pg_restore\n";
+open( INPUT, "pg_restore-@FINKPGRAWVERSION@ -L $dumplist $dump |") || die "Can't run pg_restore\n";
open( OUTPUT, ">$dumpascii") || die "Can't write to $dumpascii\n";
while( my $line = )
{
@@ -673,7 +673,7 @@
# when implemented operators skip must be disabled
# in the first scan of ToC
}
-close(INPUT) || die "pg_restore call failed\n";
+close(INPUT) || die "pg_restore-@FINKPGRAWVERSION@ call failed\n";
close(OUTPUT);

#exit(1);
@@ -682,15 +682,15 @@
# Create the new db and install plpgsql language
#
print "Creating db ($dbname)\n";
-`createdb $createdb_opt $dbname`;
+`createdb-@FINKPGRAWVERSION@ $createdb_opt $dbname`;
die "Database creation failed\n" if ($?);
print "Adding plpgsql\n";
-`createlang plpgsql $dbname`;
+`createlang-@FINKPGRAWVERSION@ plpgsql $dbname`;

#
# Open a pipe to the SQL monitor
#
-open( PSQL, "| psql -a $dbname") || die "Can't run psql\n";
+open( PSQL, "| psql-@FINKPGRAWVERSION@ -a $dbname") || die "Can't run psql\n";

#
# Source new postgis.sql
@@ -717,4 +717,4 @@
open(INPUT, "<$dumpascii") || die "Can't read $postgissql\n";
while() { print PSQL; }
close(INPUT);
-close(PSQL) || die "psql run failed\n"
+close(PSQL) || die "psql-@FINKPGRAWVERSION@ run failed\n"