class Kettle < Formula desc "Pentaho Data Integration software" homepage "http://community.pentaho.com/projects/data-integration/" url "https://downloads.sourceforge.net/project/pentaho/Data%20Integration/5.0.1-stable/pdi-ce-5.0.1-stable.zip" sha256 "f669f1aaaf0ef0e453ea64df91e016dac8a8b20e3ba90ede758d2f80dc262855" bottle :unneeded def install rm_rf Dir["*.{bat}"] libexec.install Dir["*"] (etc+"kettle").install libexec+"pwd/carte-config-master-8080.xml" => "carte-config.xml" (etc+"kettle/.kettle").install libexec+"pwd/kettle.pwd" (etc+"kettle/simple-jndi").mkpath (var+"log/kettle").mkpath # We don't assume that carte, kitchen or pan are in anyway unique command names so we'll prepend "pdi" %w[carte kitchen pan].each do |command| (bin+"pdi#{command}").write_env_script libexec+"#{command}.sh", :BASEDIR => libexec end end def plist; <<-EOS.undent Label #{plist_name} ProgramArguments #{bin}/pdicarte #{etc}/kettle/carte-config.xml EnvironmentVariables KETTLE_HOME #{etc}/kettle WorkingDirectory #{etc}/kettle StandardOutPath #{var}/log/kettle/carte.log StandardErrorPath #{var}/log/kettle/carte.log RunAtLoad EOS end test do ENV["_JAVA_OPTIONS"] = "-Duser.home=#{testpath}" system "#{bin}/pdikitchen", "-file=#{libexec}/samples/jobs/Slowly\ Changing\ Dimension/create\ -\ populate\ -\ update\ slowly\ changing\ dimension.kjb", "-level=RowLevel" system "#{bin}/pdipan", "-file=#{libexec}/samples/transformations/Encrypt\ Password.ktr", "-level=RowLevel" end end