homebrew-core/Formula/scm-manager.rb
BrewTestBot 4bd890cbff scm-manager: add 1.42 bottle.
Closes Homebrew/homebrew#33373.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-10-20 10:18:44 +01:00

65 lines
1.9 KiB
Ruby

require 'formula'
class ScmManager < Formula
homepage 'http://www.scm-manager.org'
url 'http://maven.scm-manager.org/nexus/content/repositories/releases/sonia/scm/scm-server/1.42/scm-server-1.42-app.tar.gz'
version '1.42'
sha1 '937e37f617f0953a6ae2eb86a53a833d18d72abf'
bottle do
sha1 "e7005d66f236a1ed483771e0990e122e0901c49c" => :yosemite
sha1 "e2b340b6059e14dfda83fb7a733792cd21b4a58a" => :mavericks
sha1 "0c0b1e47a35333b6320534c2d22c3433a60a6eaf" => :mountain_lion
end
resource 'client' do
url 'http://maven.scm-manager.org/nexus/content/repositories/releases/sonia/scm/clients/scm-cli-client/1.42/scm-cli-client-1.42-jar-with-dependencies.jar'
sha1 '5625aa747a6c675a9b5daad85bf9139852098010'
end
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'
tools.install resource('client')
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_bin}/scm-server</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
end