aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/gdal-grass.rb
blob: 767b65ffd1335a75c63670c86575315387e625d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require 'formula'

class GdalGrass < Formula
  homepage 'http://www.gdal.org'
  url 'http://download.osgeo.org/gdal/gdal-grass-1.4.3.tar.gz'
  sha1 '63b87ad1688cc365dc6bd6c3ccc854d0e6aa637a'

  depends_on 'gdal'
  depends_on 'grass'

  def install
    grass = Formula.factory('grass')

    system "./configure", "--prefix=#{prefix}",
                          "--disable-debug",
                          "--disable-dependency-tracking",
                          "--with-gdal=#{HOMEBREW_PREFIX}/bin/gdal-config",
                          "--with-grass=#{grass.prefix}/grass-#{grass.version}",
                          "--with-autoload=#{lib}/gdalplugins"

    inreplace "Makefile", 'mkdir', 'mkdir -p'

    system "make install"
  end

  def caveats
    caveats = <<-EOS
This formula provides a plugin that allows GDAL and OGR to access geospatial
data stored using the GRASS vector and raster formats. In order to use the
plugin, you will need to add the following path to the GDAL_DRIVER_PATH
enviroment variable:
    #{HOMEBREW_PREFIX}/lib/gdalplugins
    EOS
  end
end