2009-11-11 20:40:29 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-06-09 05:01:36 +00:00
|
|
|
class Shapelib < Formula
|
2009-11-11 20:40:29 +00:00
|
|
|
homepage 'http://shapelib.maptools.org/'
|
2012-02-21 06:04:21 +00:00
|
|
|
url 'http://download.osgeo.org/shapelib/shapelib-1.2.10.tar.gz'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '436b09b6a90f403e4568460d67560d5730725651'
|
2009-11-11 20:40:29 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
dylib = lib+"libshp.#{version}.dylib"
|
|
|
|
|
2010-02-19 19:19:01 +00:00
|
|
|
inreplace 'Makefile' do |s|
|
2010-08-10 15:05:31 +00:00
|
|
|
s.change_make_var! "CFLAGS", ENV.cflags
|
2010-02-19 19:19:01 +00:00
|
|
|
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'
|
|
|
|
|
2012-02-21 06:04:21 +00:00
|
|
|
cd lib do
|
2012-07-10 21:01:02 +00:00
|
|
|
ln_s "libshp.#{version}.dylib", "libshp.#{version.to_s.split('.').first}.dylib"
|
2010-04-07 05:58:35 +00:00
|
|
|
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
|