Formula for the Shapefile C library

This doesn't have a configure script, and the Makefile is basic. Installation
steps are based on the macports portfile.

Signed-off-by: Max Howell <max@methylblue.com>

Replaced most system calls with Ruby equivalents.
This commit is contained in:
Gavin Heavyside 2009-11-11 20:40:29 +00:00 committed by Max Howell
parent 17b742601c
commit 0ad887ad98

29
Formula/shapefile.rb Normal file
View file

@ -0,0 +1,29 @@
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"
inreplace 'Makefile', /CFLAGS\s+=\s+-g/, "CFLAGS = #{ENV['CFLAGS']}"
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'
Dir.chdir lib
FileUtils.ln_s "libshp.#{version}.dylib", "libshp.#{version.split('.').first}.dylib"
FileUtils.ln_s "libshp.#{version}.dylib", "libshp.dylib"
end
end