homebrew-core/Formula/cfitsio.rb

37 lines
1.1 KiB
Ruby
Raw Normal View History

require 'formula'
class CfitsioExamples < Formula
url 'http://heasarc.gsfc.nasa.gov/docs/software/fitsio/cexamples/cexamples.zip'
version '2012.09.24'
sha1 '668ffa9a65a66c9f1d7f4241867e1e8adf653231'
end
2011-03-10 05:11:03 +00:00
class Cfitsio < Formula
homepage 'http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html'
url 'ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio3350.tar.gz'
sha1 '4870380013d089e1e9b8994d74f15482decffc1c'
version '3.350'
2012-08-23 04:37:04 +00:00
option 'with-examples', "Compile and install example programs"
def install
system "./configure", "--prefix=#{prefix}"
system "make shared"
system "make install"
2012-08-23 04:37:04 +00:00
if build.include? 'with-examples'
system "make fpack funpack"
2012-02-22 04:48:36 +00:00
bin.install 'fpack', 'funpack'
# fetch, compile and install examples programs
CfitsioExamples.new.brew do
Dir['*.c'].each do |f|
# compressed_fits.c does not work (obsolete function call)
2012-01-02 22:42:29 +00:00
next if f == 'compress_fits.c'
system ENV.cc, f, "-I#{include}", "-L#{lib}", "-lcfitsio", "-lm", "-o", "#{bin}/#{f.sub('.c', '')}"
end
end
end
end
end