aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorMike McQuaid2013-10-30 11:59:06 -0700
committerMike McQuaid2013-10-30 11:59:06 -0700
commit752bcf2553e6b3f661cc5172330f2e268044e92b (patch)
tree8ac7d28f89130cfa8d89b4fe237ac9b891305c9b /Library/Formula
parent8d0881375b41a6de04567ade787381e06ad2fcf3 (diff)
downloadhomebrew-752bcf2553e6b3f661cc5172330f2e268044e92b.tar.bz2
ansible: use resources.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/ansible.rb74
1 files changed, 38 insertions, 36 deletions
diff --git a/Library/Formula/ansible.rb b/Library/Formula/ansible.rb
index 8d9ade761..b721ddd3e 100644
--- a/Library/Formula/ansible.rb
+++ b/Library/Formula/ansible.rb
@@ -1,35 +1,5 @@
require 'formula'
-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 MarkupSafe < Formula
- url 'https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.18.tar.gz'
- sha1 '9fe11891773f922a8b92e83c8f48edeb2f68631e'
-end
-
-class Jinja2 < Formula
- url 'https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.1.tar.gz'
- sha1 'a9b24d887f2be772921b3ee30a0b9d435cffadda'
-end
-
-class PyCrypto < Formula
- url 'https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.tar.gz'
- sha1 'c17e41a80b3fbf2ee4e8f2d8bb9e28c5d08bbb84'
-end
-
-class PythonKeyczar < Formula
- url 'https://pypi.python.org/packages/source/p/python-keyczar/python-keyczar-0.71b.tar.gz'
- sha1 '20c7c5d54c0ce79262092b4cc691aa309fb277fa'
-end
-
class Ansible < Formula
homepage 'http://www.ansibleworks.com/'
url 'https://github.com/ansible/ansible/archive/v1.3.3.tar.gz'
@@ -42,6 +12,38 @@ class Ansible < Formula
option 'with-accelerate', "Enable accelerated mode"
+ resource 'pycrypto' do
+ url 'https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.tar.gz'
+ sha1 'c17e41a80b3fbf2ee4e8f2d8bb9e28c5d08bbb84'
+ end
+
+ resource 'pyyaml' do
+ url 'https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.10.tar.gz'
+ sha1 '476dcfbcc6f4ebf3c06186229e8e2bd7d7b20e73'
+ end
+
+ resource 'paramiko' do
+ url 'https://pypi.python.org/packages/source/p/paramiko/paramiko-1.11.0.tar.gz'
+ sha1 'fd925569b9f0b1bd32ce6575235d152616e64e46'
+ end
+
+ resource 'markupsafe' do
+ url 'https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.18.tar.gz'
+ sha1 '9fe11891773f922a8b92e83c8f48edeb2f68631e'
+ end
+
+ resource 'jinja2' do
+ url 'https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.1.tar.gz'
+ sha1 'a9b24d887f2be772921b3ee30a0b9d435cffadda'
+ end
+
+ if build.with? 'accelerate'
+ resource 'python-keyczar' do
+ url 'https://pypi.python.org/packages/source/p/python-keyczar/python-keyczar-0.71b.tar.gz'
+ sha1 '20c7c5d54c0ce79262092b4cc691aa309fb277fa'
+ end
+ end
+
# TODO: Move this into Library/Homebrew somewhere (see also mitmproxy.rb).
def wrap bin_file, pythonpath
bin_file = Pathname.new bin_file
@@ -58,13 +60,13 @@ class Ansible < Formula
install_args = [ "setup.py", "install", "--prefix=#{libexec}" ]
python do
- PyCrypto.new.brew { system python, *install_args }
- PyYAML.new.brew { system python, *install_args }
- Paramiko.new.brew { system python, *install_args }
- MarkupSafe.new.brew { system python, *install_args }
- Jinja2.new.brew { system python, *install_args }
+ resource('pycrypto').stage { system python, *install_args }
+ resource('pyyaml').stage { system python, *install_args }
+ resource('paramiko').stage { system python, *install_args }
+ resource('markupsafe').stage { system python, *install_args }
+ resource('jinja2').stage { system python, *install_args }
if build.with? 'accelerate'
- PythonKeyczar.new.brew { system python, *install_args }
+ resource('python-keyczar').stage { system python, *install_args }
end
inreplace 'lib/ansible/constants.py' do |s|