require 'formula' class ScmManagerCliClient < Formula homepage 'http://www.scm-manager.org' url 'http://maven.scm-manager.org/nexus/content/repositories/releases/sonia/scm/clients/scm-cli-client/1.27/scm-cli-client-1.27-jar-with-dependencies.jar' version '1.27' sha1 '5e9b78863368b04bd343c1bd582d133d78e66f25' end class ScmManager < Formula homepage 'http://www.scm-manager.org' url 'http://maven.scm-manager.org/nexus/content/repositories/releases/sonia/scm/scm-server/1.27/scm-server-1.27-app.tar.gz' version '1.27' sha1 'b2ef7302fa251b8da936c7085c590fd0978fe0dd' skip_clean 'libexec/var/log' def install rm_rf Dir['bin/*.bat'] libexec.install Dir['*'] (bin/'scm-server').write <<-EOS.undent #!/bin/bash BASEDIR="#{libexec}" REPO="#{libexec}/lib" "#{libexec}/bin/scm-server" "$@" EOS chmod 0755, bin/'scm-server' tools = libexec/'tools' ScmManagerCliClient.new.brew { tools.install Dir['*'] } scmCliClient = bin+'scm-cli-client' scmCliClient.write <<-EOS.undent #!/bin/bash java -jar "#{tools}/scm-cli-client-#{version}-jar-with-dependencies.jar" "$@" EOS chmod 0755, scmCliClient end plist_options :manual => 'scm-server start' def plist; <<-EOS.undent Label #{plist_name} ProgramArguments #{opt_prefix}/bin/scm-server start RunAtLoad EOS end end