2010-09-22 01:41:42 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Fits < Formula
|
2014-02-28 17:42:37 +00:00
|
|
|
homepage 'http://fitstool.org/'
|
2014-08-30 19:42:57 +00:00
|
|
|
url 'http://projects.iq.harvard.edu/files/fits/files/fits-0.8.2.zip'
|
|
|
|
sha1 'ea4a6020f9d64a4c9b85f37b488aa254c10e2703'
|
|
|
|
|
|
|
|
# provided jars may not be compatible with installed java,
|
|
|
|
# but works when built from source
|
|
|
|
depends_on "ant" => :build
|
2010-09-22 01:41:42 +00:00
|
|
|
|
|
|
|
def install
|
2014-08-30 19:42:57 +00:00
|
|
|
system "ant"
|
|
|
|
|
2014-02-28 17:42:37 +00:00
|
|
|
inreplace 'fits-env.sh' do |s|
|
2010-09-22 01:41:42 +00:00
|
|
|
s.gsub! "FITS_HOME=`echo \"$0\" | sed 's,/[^/]*$,,'`", "FITS_HOME=#{prefix}"
|
|
|
|
s.gsub! "${FITS_HOME}/lib", libexec
|
|
|
|
end
|
|
|
|
|
|
|
|
prefix.install %w{ COPYING COPYING.LESSER tools xml }
|
|
|
|
prefix.install Dir['*.txt']
|
|
|
|
libexec.install Dir['lib/*']
|
2014-02-28 17:47:07 +00:00
|
|
|
|
|
|
|
# fits-env.sh is a helper script that sets up environment
|
|
|
|
# variables, so we want to tuck this away in libexec
|
|
|
|
libexec.install 'fits-env.sh'
|
|
|
|
%w[fits.sh fits-ngserver.sh].each do |file|
|
|
|
|
inreplace file, '"$(dirname $BASH_SOURCE)/fits-env.sh"',
|
2014-04-05 03:02:48 +00:00
|
|
|
"'#{libexec}/fits-env.sh'"
|
2014-02-28 17:47:07 +00:00
|
|
|
end
|
|
|
|
|
2010-09-22 01:41:42 +00:00
|
|
|
bin.install 'fits.sh' => 'fits'
|
2014-02-28 17:42:37 +00:00
|
|
|
bin.install 'fits-ngserver.sh' => 'fits-ngserver'
|
2010-09-22 01:41:42 +00:00
|
|
|
end
|
|
|
|
end
|