require 'formula' class Mcabber :optional if ARGV.include? '--enable-aspell' depends_on 'enchant' => :optional if ARGV.include? '--enable-enchant' depends_on 'libotr' => :optional if ARGV.include? '--enable-otr' depends_on 'libidn' => :optional def options [ ["--enable-enchant", "Enable spell checking support via enchant"], ["--enable-aspell", "Enable spell checking support via aspell"], ["--enable-otr", "Enable support for off-the-record messages"] ] end def install args = ["--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}"] args << "--enable-aspell" if ARGV.include? "--enable-aspell" args << "--enable-enchant" if ARGV.include? "--enable-enchant" args << "--enable-otr" if ARGV.include? "--enable-otr" system "./configure", *args system "make install" (share+'mcabber').install %w[mcabberrc.example contrib] end end