class Imapfilter < Formula homepage "https://github.com/lefcha/imapfilter/" url "https://github.com/lefcha/imapfilter/archive/v2.5.7.tar.gz" sha1 "216ec7b8563729cf446e9b2839bdcdf3eae351ed" bottle do sha1 "55091d5ccf77951f94489c712c092f7d9b3c8c9a" => :yosemite sha1 "76bb5a5670eae9fbbdbfdc7903107724507abcbb" => :mavericks sha1 "92993d2acab4990578eccd43dc8cfed4ed37f6f5" => :mountain_lion end depends_on "lua" depends_on "pcre" depends_on "openssl" def install inreplace "src/Makefile" do |s| s.change_make_var! "CFLAGS", "#{s.get_make_var "CFLAGS"} #{ENV.cflags}" end # find Homebrew's libpcre and lua ENV.append "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib" ENV.append "LDFLAGS", "-liconv" system "make", "PREFIX=#{prefix}", "MANDIR=#{man}", "LDFLAGS=#{ENV.ldflags}" system "make", "PREFIX=#{prefix}", "MANDIR=#{man}", "install" prefix.install "samples" end def caveats; <<-EOS.undent You will need to create a ~/.imapfilter/config.lua file. Samples can be found in: #{prefix}/samples EOS end test do system "#{bin}/imapfilter", "-V" end end