aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/googlecl.rb
diff options
context:
space:
mode:
authorMike McQuaid2013-12-14 19:25:25 +0000
committerMike McQuaid2013-12-14 19:26:15 +0000
commitca1b7bf77125f5472f2062d64ff7303dc768199d (patch)
tree44d63ac37382efe7dd5eef5559157e264444eebc /Library/Formula/googlecl.rb
parent59847c8e885951903dcaa74bccee1ee1dbec1b52 (diff)
downloadhomebrew-ca1b7bf77125f5472f2062d64ff7303dc768199d.tar.bz2
googlecl 0.9.14 (new formula)
Closes #24643. Closes #25166.
Diffstat (limited to 'Library/Formula/googlecl.rb')
-rw-r--r--Library/Formula/googlecl.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/Library/Formula/googlecl.rb b/Library/Formula/googlecl.rb
new file mode 100644
index 000000000..73589f43a
--- /dev/null
+++ b/Library/Formula/googlecl.rb
@@ -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