aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorMike McQuaid2013-09-02 12:43:49 +0100
committerSamuel John2013-09-03 14:26:15 +0200
commit0c847bbf7c4eef9901f55d8b3ab6836a5c3d65b4 (patch)
treeb784d25a51d5f1f87f89ed04f2cab7091e626d17 /Library/Formula
parentc71dc7c149885317881c95760f9edda653afb85b (diff)
downloadhomebrew-0c847bbf7c4eef9901f55d8b3ab6836a5c3d65b4.tar.bz2
ansible: 1.2.2 (new formula)
Closes #22236. Signed-off-by: Samuel John <github@SamuelJohn.de>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/ansible.rb66
1 files changed, 66 insertions, 0 deletions
diff --git a/Library/Formula/ansible.rb b/Library/Formula/ansible.rb
new file mode 100644
index 000000000..455dc90e8
--- /dev/null
+++ b/Library/Formula/ansible.rb
@@ -0,0 +1,66 @@
+require 'formula'
+
+class PyCrypto < Formula
+ url 'https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.tar.gz'
+ sha1 'c17e41a80b3fbf2ee4e8f2d8bb9e28c5d08bbb84'
+end
+
+class PyYAML < Formula
+ url 'https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.10.tar.gz'
+ sha1 '476dcfbcc6f4ebf3c06186229e8e2bd7d7b20e73'
+end
+
+class Paramiko < Formula
+ url 'https://pypi.python.org/packages/source/p/paramiko/paramiko-1.11.0.tar.gz'
+ sha1 'fd925569b9f0b1bd32ce6575235d152616e64e46'
+end
+
+class Jinja2 < Formula
+ url 'https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.1.tar.gz'
+ sha1 'a9b24d887f2be772921b3ee30a0b9d435cffadda'
+end
+
+class Ansible < Formula
+ homepage 'http://ansible.github.com/'
+ url 'https://github.com/ansible/ansible/archive/v1.2.2.tar.gz'
+ sha1 'cd64c200edec22b9eb0581a79491a7aa551cc864'
+
+ head 'https://github.com/ansible/ansible.git', :branch => :devel
+
+ depends_on :python
+ depends_on 'libyaml'
+
+ def bin_wrapper bin_file; <<-EOS.undent
+ #!/bin/sh
+ PYTHONPATH="#{libexec}/lib/#{python.xy}/site-packages:$PYTHONPATH" "#{libexec}/bin/#{bin_file}" "$@"
+ EOS
+ end
+
+ def install
+ ENV['PYTHONPATH'] = "#{libexec}/lib/#{python.xy}/site-packages"
+ install_args = [ "setup.py", "install", "--prefix=#{libexec}" ]
+
+ PyCrypto.new.brew { system python, *install_args }
+ PyYAML.new.brew { system python, *install_args }
+ Paramiko.new.brew { system python, *install_args }
+ Jinja2.new.brew { system python, *install_args }
+
+ inreplace 'lib/ansible/constants.py' do |s|
+ s.gsub! '/usr/share/ansible', share+'ansible'
+ s.gsub! '/etc/ansible', etc+'ansible'
+ end
+
+ system python, "setup.py", "install", "--prefix=#{prefix}"
+
+ man1.install Dir['docs/man/man1/*.1']
+
+ (libexec/'bin').mkpath
+
+ Dir["#{bin}/*"].each do |bin_path|
+ bin_path = Pathname.new(bin_path)
+ bin_file = bin_path.basename
+ mv bin_path, libexec/"bin/#{bin_file}"
+ bin_path.write(bin_wrapper(bin_file))
+ end
+ end
+end