]> gitweb.michael.orlitzky.com - dead/census-tools.git/commitdiff
Updated the makefile for PostGIS 1.4.0.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 22 Sep 2009 06:44:01 +0000 (02:44 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 22 Sep 2009 06:44:01 +0000 (02:44 -0400)
One of the SQL scripts was renamed, and the locations of the PostGIS files are now calculated using pg_config.

makefile

index 693b1c0b6d7af025f24ff0024d6d74e696e776b0..7b0c37511549e24794729402932d5356d624d3a3 100644 (file)
--- a/makefile
+++ b/makefile
@@ -3,6 +3,13 @@ DB_USER='postgres'
 TIGER_DATA_URL='http://www2.census.gov/cgi-bin/shapefiles/multi-file-download?files=24_MARYLAND%2Ftl_2008_24_tabblock00.zip'
 TIGER_SRID='4269'
 
+# Starting with PostGIS 1.4.0, these paths are calculated at install
+# time using the pg_config utility. Rather than try to guess where
+# PostGIS will wind up installed, we can just check the output of
+# pg_config ourselves.
+PG_BINDIR=`pg_config --bindir`
+PG_SHAREDIR=`pg_config --sharedir`
+
 # Necessary to run test/data without prerequisites.
 #
 .PHONY : test data
@@ -43,8 +50,8 @@ data:
 # the DB_NAME database (or schema, whatever). Then, it adds PL/pgSQL
 # support to the database.
 #
-# At that point, we import the two PostGIS files, lwpostgis.sql and
-# spatial_ref_sys.sql. The lwpostgis.sql file contains the geometry
+# At that point, we import the two PostGIS files, postgis.sql and
+# spatial_ref_sys.sql. The postgis.sql file contains the geometry
 # functions, while spatial_ref_sys.sql contains a table of SRIDs, and
 # their associated properties. PostGIS requires both.
 #
@@ -63,13 +70,13 @@ db: data
 
        psql -d $(DB_NAME) \
              -U $(DB_USER) \
-             -f /usr/share/postgresql/contrib/lwpostgis.sql
+             -f $(PG_SHAREDIR)/contrib/postgis.sql
 
        psql -d $(DB_NAME) \
              -U $(DB_USER) \
-             -f /usr/share/postgresql/contrib/spatial_ref_sys.sql
+             -f $(PG_SHAREDIR)/contrib/spatial_ref_sys.sql
 
-       shp2pgsql -I                                                        \
+       $(PG_BINDIR)/shp2pgsql -I                                           \
                  -s $(TIGER_SRID)                                          \
                  data/census-2000-block/maryland/tl_2008_24_tabblock00.shp \
                  tiger                                                     \