googlecl 0.9.14 (new formula)

Closes Homebrew/homebrew#24643.
Closes Homebrew/homebrew#25166.
This commit is contained in:
Mike McQuaid 2013-12-14 19:25:25 +00:00
parent f6f381249c
commit 849e0c77f1

36
Formula/googlecl.rb Normal file
View file

@ -0,0 +1,36 @@
require 'formula'
class Googlecl < Formula
homepage 'https://code.google.com/p/googlecl/'
url 'https://googlecl.googlecode.com/files/googlecl-0.9.14.tar.gz'
sha1 '810b2426e2c5e5292e507837ea425e66f4949a1d'
depends_on :python
# TODO: Move this into Library/Homebrew somewhere (see also ansible.rb).
def wrap bin_file, pythonpath
bin_file = Pathname.new bin_file
libexec_bin = Pathname.new libexec/'bin'
libexec_bin.mkpath
mv bin_file, libexec_bin
bin_file.write <<-EOS.undent
#!/bin/sh
PYTHONPATH="#{pythonpath}:$PYTHONPATH" "#{libexec_bin}/#{bin_file.basename}" "$@"
EOS
end
def install
inreplace 'src/googlecl/__init__.py',
"__author__ = 'tom.h.miller@gmail.com (Tom Miller)'",
"__author__ = 'tom.h.miller@gmail.com (Tom Miller)'; import site; site.addsitedir('#{python.private_site_packages}')"
system python, "setup.py", "install",
"--prefix=#{prefix}",
"--single-version-externally-managed",
"--record=installed.txt"
Dir["#{bin}/*"].each do |bin_file|
wrap bin_file, python.site_packages
end
end
end