class Kettle < Formula desc "Pentaho Data Integration software" homepage "https://community.hds.com/docs/DOC-1009855" url "https://downloads.sourceforge.net/project/pentaho/Data%20Integration/6.1/pdi-ce-6.1.0.1-196.zip" sha256 "ef5076c09e8481d1ab4cfc5f7d4701437f80f2b97a3bf19dfa74821de9524495" 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 plist_options :manual => "pdicarte #{HOMEBREW_PREFIX}/etc/kettle/carte-config.xml" def plist; <<~EOS Label #{plist_name} ProgramArguments #{opt_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 system "#{bin}/pdipan", "-file=#{libexec}/samples/transformations/Encrypt\ Password.ktr", "-level=RowLevel" end end