2010-04-08 10:04:37 +00:00
require 'formula'
2011-08-29 15:36:01 +00:00
class CfitsioExamples < Formula
url 'http://heasarc.gsfc.nasa.gov/docs/software/fitsio/cexamples/cexamples.zip'
md5 '31a5f5622a111f25bee5a3fda2fdac28'
version '2010.08.19'
end
2011-03-10 05:11:03 +00:00
class Cfitsio < Formula
2011-07-17 20:52:56 +00:00
url 'ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3280.tar.gz'
2010-04-08 10:04:37 +00:00
homepage 'http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html'
2011-07-17 20:52:56 +00:00
md5 'fdb9c0f51678b47e78592c70fb5dc793'
version '3.28'
2010-04-08 10:04:37 +00:00
2011-08-29 15:36:01 +00:00
def options
[
[ '--with-examples' , " Compile and install example programs from http://heasarc.gsfc.nasa.gov/docs/software/fitsio/cexamples.html as well as fpack and funpack " ]
]
end
2010-04-08 10:04:37 +00:00
def install
# --disable-debug and --disable-dependency-tracking are not recognized by configure
system " ./configure " , " --prefix= #{ prefix } "
system " make shared "
system " make install "
2011-08-29 15:36:01 +00:00
if ARGV . include? '--with-examples'
system " make fpack funpack "
bin . install [ 'fpack' , 'funpack' ]
# fetch, compile and install examples programs
CfitsioExamples . new . brew do
mkdir 'bin'
Dir . glob ( '*.c' ) . each do | f |
# compressed_fits.c does not work (obsolete function call)
if f != 'compress_fits.c'
system " #{ ENV . compiler } #{ f } -I #{ include } -L #{ lib } -lcfitsio -lm -o bin/ #{ f . sub ( '.c' , '' ) } "
end
end
bin . install Dir [ 'bin/*' ]
end
end
2010-04-08 10:04:37 +00:00
end
end