2009-11-11 20:40:29 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Shapefile <Formula
|
|
|
|
url 'http://download.osgeo.org/shapelib/shapelib-1.2.10.tar.gz'
|
|
|
|
homepage 'http://shapelib.maptools.org/'
|
|
|
|
md5 '4d96bd926167193d27bf14d56e2d484e'
|
|
|
|
|
|
|
|
def install
|
|
|
|
dylib = lib+"libshp.#{version}.dylib"
|
|
|
|
|
2010-02-19 19:19:01 +00:00
|
|
|
inreplace 'Makefile' do |s|
|
|
|
|
s.change_make_var! "CFLAGS", ENV['CFLAGS']
|
|
|
|
end
|
2009-11-11 20:40:29 +00:00
|
|
|
|
|
|
|
system "make all"
|
|
|
|
system "make shptree.o"
|
|
|
|
|
|
|
|
lib.mkpath
|
|
|
|
system ENV.cc, *%W(-dynamiclib -all_load
|
|
|
|
-install_name #{dylib}
|
|
|
|
-compatibility_version #{version}
|
|
|
|
-o #{dylib}
|
|
|
|
shpopen.o shptree.o dbfopen.o)
|
|
|
|
|
|
|
|
include.install 'shapefil.h'
|
|
|
|
|
2010-02-19 19:19:01 +00:00
|
|
|
Dir.chdir lib do
|
2010-04-07 05:58:35 +00:00
|
|
|
ln_s "libshp.#{version}.dylib", "libshp.#{version.split('.').first}.dylib"
|
|
|
|
ln_s "libshp.#{version}.dylib", "libshp.dylib"
|
2010-02-19 19:19:01 +00:00
|
|
|
end
|
2009-11-11 20:40:29 +00:00
|
|
|
end
|
|
|
|
end
|