homebrew-core/Formula/shapelib.rb

33 lines
857 B
Ruby
Raw Normal View History

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