From 49e94b0d0741fae4781b4b7af5517df994207ff2 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sun, 26 Aug 2012 19:29:46 -0700 Subject: sigar: use new dsl --- Library/Formula/sigar.rb | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/sigar.rb b/Library/Formula/sigar.rb index c27d017ae..300ef6d7e 100644 --- a/Library/Formula/sigar.rb +++ b/Library/Formula/sigar.rb @@ -5,18 +5,13 @@ class Sigar < Formula head 'https://github.com/hyperic/sigar.git' homepage 'http://sigar.hyperic.com/' - def options - [ - ["--perl", "Build Perl bindings."], - ["--python", "Build Python bindings."], - ["--ruby", "Build Ruby bindings."], - ] - end + option "perl", "Build Perl bindings" + option "python", "Build Python bindings" + option "ruby", "Build Ruby bindings" def java_script; <<-EOS.undent #!/bin/sh # Runs SIGAR's REPL. - java -jar #{prefix}/sigar.jar EOS end @@ -33,13 +28,13 @@ class Sigar < Formula include.install Dir['sigar-bin/include/*'] - (bin+'sigar').write java_script + (bin/'sigar').write java_script end # Install Python bindings cd "bindings/python" do system "python", "setup.py", "install", "--prefix=#{prefix}" - end if ARGV.include? "--python" + end if build.include? "python" # Install Perl bindings cd "bindings/perl" do @@ -62,12 +57,12 @@ class Sigar < Formula end system "make install" - end if ARGV.include? "--perl" + end if build.include? "perl" # Install Ruby bindings cd "bindings/ruby" do system "ruby", "extconf.rb", "--prefix=#{prefix}" system "make install" - end if ARGV.include? "--ruby" + end if build.include? "ruby" end end -- cgit v1.2.3