2013-08-01 17:50:08 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Juju < Formula
|
|
|
|
homepage 'https://juju.ubuntu.com'
|
2013-12-11 20:46:40 +00:00
|
|
|
url 'https://launchpad.net/juju-core/1.16/1.16.5/+download/juju-core_1.16.5.tar.gz'
|
|
|
|
sha1 '2202805d09dffe64d1e07988b9d1b16e02c7bd52'
|
2013-08-15 04:30:32 +00:00
|
|
|
|
2013-08-01 17:50:08 +00:00
|
|
|
depends_on 'go' => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV['GOPATH'] = buildpath
|
|
|
|
args = %w(install launchpad.net/juju-core/cmd/juju)
|
|
|
|
args.insert(1, "-v") if ARGV.verbose?
|
|
|
|
system "go", *args
|
|
|
|
bin.install 'bin/juju'
|
2013-11-23 15:59:01 +00:00
|
|
|
(bash_completion/'juju-completion.bash').write <<-EOS.undent
|
|
|
|
_juju()
|
|
|
|
{
|
|
|
|
local cur prev options files targets
|
|
|
|
COMPREPLY=()
|
|
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
|
|
actions=$(juju help commands 2>/dev/null | awk '{print $1}')
|
|
|
|
COMPREPLY=( $( compgen -W "${actions}" -- ${cur} ) )
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
complete -F _juju juju
|
|
|
|
EOS
|
2013-08-01 17:50:08 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def test
|
|
|
|
system "#{bin}/juju", "version"
|
|
|
|
end
|
|
|
|
end
|