aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorCharlie Sharpsteen2012-04-19 15:31:21 -0700
committerCharlie Sharpsteen2012-04-19 15:33:06 -0700
commit5336ad4db8ea5c1adab5da6b620207cbfeac7fac (patch)
tree76a05e0294d8aceb3cad60bc28ee5e595b4b8c90 /Library
parent4570a0629ae3c6ac7feb01a672933a35d1f34f0f (diff)
downloadhomebrew-5336ad4db8ea5c1adab5da6b620207cbfeac7fac.tar.bz2
PostGIS: Simplify installation and add man pages
Instead of manually listing and installing every component in PostGIS, the whole mess is now installed to a staging directory and copied to the prefix using globbing operations. Man pages are now installed as well.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/postgis.rb68
1 files changed, 13 insertions, 55 deletions
diff --git a/Library/Formula/postgis.rb b/Library/Formula/postgis.rb
index 5b1ddec35..a5da0e726 100644
--- a/Library/Formula/postgis.rb
+++ b/Library/Formula/postgis.rb
@@ -64,68 +64,31 @@ class Postgis < Formula
system './configure', *args
system 'make'
- # __DON'T RUN MAKE INSTALL!__
- #
# PostGIS includes the PGXS makefiles and so will install __everything__
# into the Postgres keg instead of the PostGIS keg. Unfortunately, some
# things have to be inside the Postgres keg in order to be function. So, we
- # install the bare minimum of stuff and then manually move everything else
- # to the prefix.
+ # install everything to a staging directory and manually move the pieces
+ # into the appropriate prefixes.
+ mkdir 'stage'
+ system 'make', 'install', "DESTDIR=#{Dir.getwd}/stage"
# Install PostGIS plugin libraries into the Postgres keg so that they can
# be loaded and so PostGIS databases will continue to function even if
# PostGIS is removed.
- postgresql.lib.install Dir['postgis/postgis*.so']
-
- # Stand-alone SQL files will be installed the share folder
- postgis_sql = share + 'postgis'
-
- # Install version-specific SQL scripts and tools first. Some of the
- # installation routines require command line tools to still be present
- # inside the build prefix.
-
- # Install the liblwgeom library
- lib.install Dir['liblwgeom/.libs/*.dylib', 'liblwgeom/.libs/*.a']
- include.install 'liblwgeom/liblwgeom.h'
-
- # Install raster plugin to Postgres keg
- postgresql.lib.install Dir['raster/rt_pg/rtpostgis*.so']
+ postgresql.lib.install Dir['stage/**/*.so']
# Install extension scripts to the Postgres keg.
# `CREATE EXTENSION postgis;` won't work if these are located elsewhere.
- system 'make install -C extensions'
+ (postgresql.share + 'postgresql' + 'extension').install Dir['stage/**/extension/*']
- bin.install %w[
- loader/.libs/pgsql2shp
- loader/.libs/shp2pgsql
- raster/loader/.libs/raster2pgsql
- ]
- bin.install 'loader/.libs/shp2pgsql-gui' if build_gui?
-
- # Install PostGIS 2.0 SQL scripts
- postgis_sql.install %w[
- postgis/legacy.sql
- postgis/legacy_minimal.sql
- postgis/uninstall_legacy.sql
- postgis/postgis_upgrade_20_minor.sql
- ]
-
- postgis_sql.install %w[
- raster/rt_pg/rtpostgis.sql
- raster/rt_pg/rtpostgis_drop.sql
- raster/rt_pg/rtpostgis_upgrade_20_minor.sql
- raster/rt_pg/rtpostgis_upgrade.sql
- raster/rt_pg/rtpostgis_upgrade_cleanup.sql
- raster/rt_pg/uninstall_rtpostgis.sql
- ]
+ bin.install Dir['stage/**/bin/*']
+ lib.install Dir['stage/**/lib/*']
+ include.install Dir['stage/**/include/*']
- postgis_sql.install %w[
- topology/topology.sql
- topology/topology_upgrade_20_minor.sql
- topology/uninstall_topology.sql
- ]
+ # Stand-alone SQL files will be installed the share folder
+ (share + 'postgis').install Dir['stage/**/contrib/postgis-2.0/*']
- # Common tools
+ # Extension scripts
bin.install %w[
utils/create_undef.pl
utils/postgis_proc_upgrade.pl
@@ -137,12 +100,7 @@ class Postgis < Formula
utils/test_joinestimation.pl
]
- # Common SQL scripts
- postgis_sql.install %w[
- spatial_ref_sys.sql
- postgis/postgis.sql
- postgis/uninstall_postgis.sql
- ]
+ man1.install Dir['doc/**/*.1']
end
def caveats;