409b1f4f4d
Closes Homebrew/homebrew#20195. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
63 lines
1.8 KiB
Ruby
63 lines
1.8 KiB
Ruby
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.31/scm-cli-client-1.31-jar-with-dependencies.jar'
|
|
version '1.31'
|
|
sha1 '97b0c2e2e552912cacf228c6e70163e15f4280ed'
|
|
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.31/scm-server-1.31-app.tar.gz'
|
|
version '1.31'
|
|
sha1 '9b26431a6fcd4d5f8e922535914ef0df396a3c19'
|
|
|
|
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"
|
|
export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)
|
|
"#{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
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>Label</key>
|
|
<string>#{plist_name}</string>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{opt_prefix}/bin/scm-server</string>
|
|
<string>start</string>
|
|
</array>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
end
|