2009-12-14 17:15:00 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class RubyOdbc < Formula
|
|
|
|
url 'http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9997.tar.gz'
|
|
|
|
homepage 'http://www.ch-werner.de/rubyodbc/'
|
|
|
|
md5 '36d21519795c3edc8bc63b1ec6682b99'
|
|
|
|
|
|
|
|
depends_on 'unixodbc'
|
|
|
|
depends_on 'freetds'
|
|
|
|
|
|
|
|
def install
|
2009-12-19 15:36:20 +00:00
|
|
|
system "ruby", "extconf.rb", "--enable-dlopen", "--with-odbc-dir=#{HOMEBREW_PREFIX}/lib"
|
2009-12-14 17:15:00 +00:00
|
|
|
|
|
|
|
# extconf.rb assumes it will install ruby-odbc within a folder in your
|
|
|
|
# current ruby installation.
|
|
|
|
#
|
|
|
|
# The following modifications to the Makefile ensure that it is installed
|
|
|
|
# within your homebrew directories.
|
|
|
|
inreplace 'Makefile', /^prefix = .*$/, "prefix = #{prefix}"
|
|
|
|
inreplace 'Makefile', /^sitearchdir = .*$/, "sitearchdir = #{prefix}/lib"
|
|
|
|
|
|
|
|
system 'make'
|
|
|
|
system 'make install'
|
|
|
|
end
|
|
|
|
|
2009-12-19 15:36:20 +00:00
|
|
|
def caveats; <<-EOS
|
|
|
|
Installed #{lib}/odbc.bundle
|
2009-12-14 17:15:00 +00:00
|
|
|
|
|
|
|
You will need to add this to your RUBYLIB by adding the following line to
|
2009-12-19 15:36:20 +00:00
|
|
|
.profile or .bashrc or equivalent:
|
2009-12-14 17:15:00 +00:00
|
|
|
|
2009-12-19 15:36:20 +00:00
|
|
|
export RUBYLIB="#{HOMEBREW_PREFIX}/lib:$RUBYLIB"
|
|
|
|
|
|
|
|
You will need to edit freetds.conf, odbcinst.ini and odbc.ini files to set up
|
2009-12-14 17:15:00 +00:00
|
|
|
access to your odbc databases.
|
2009-12-19 15:36:20 +00:00
|
|
|
EOS
|
2009-12-14 17:15:00 +00:00
|
|
|
end
|
|
|
|
end
|