2013-09-02 11:43:49 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Ansible < Formula
|
2014-03-07 23:01:07 +00:00
|
|
|
homepage 'http://www.ansible.com/home'
|
2014-08-15 01:51:49 +00:00
|
|
|
url 'http://releases.ansible.com/ansible/ansible-1.7.1.tar.gz'
|
|
|
|
sha1 '4f4be4d45f28f52e4ab0c063efb66c7b9f482a51'
|
2013-09-02 11:43:49 +00:00
|
|
|
|
2014-02-06 19:27:43 +00:00
|
|
|
head 'https://github.com/ansible/ansible.git', :branch => 'devel'
|
2013-09-02 11:43:49 +00:00
|
|
|
|
2014-06-27 17:31:11 +00:00
|
|
|
bottle do
|
2014-09-04 01:37:40 +00:00
|
|
|
revision 2
|
|
|
|
sha1 "d24b092def576f66ef87ad4ac08e82379f857569" => :mavericks
|
|
|
|
sha1 "91272b6bcdd4ccae55ebe1bb0dc318f7adcc5bb5" => :mountain_lion
|
|
|
|
sha1 "1a27c03864b32c8696e9fd203bc1fc5fe8cecdbf" => :lion
|
2014-06-27 17:31:11 +00:00
|
|
|
end
|
|
|
|
|
2014-04-30 22:35:13 +00:00
|
|
|
depends_on :python if MacOS.version <= :snow_leopard
|
2013-09-02 11:43:49 +00:00
|
|
|
depends_on 'libyaml'
|
|
|
|
|
2013-10-20 13:44:20 +00:00
|
|
|
option 'with-accelerate', "Enable accelerated mode"
|
|
|
|
|
2013-10-30 18:59:06 +00:00
|
|
|
resource 'pycrypto' do
|
|
|
|
url 'https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.tar.gz'
|
|
|
|
sha1 'c17e41a80b3fbf2ee4e8f2d8bb9e28c5d08bbb84'
|
|
|
|
end
|
|
|
|
|
2014-09-04 01:29:10 +00:00
|
|
|
resource 'boto' do
|
|
|
|
url 'https://pypi.python.org/packages/source/b/boto/boto-2.32.1.tar.gz'
|
|
|
|
sha1 '4fdecde66245b7fc0295e22d2c2d3c9b08c2b1fa'
|
|
|
|
end
|
|
|
|
|
2013-10-30 18:59:06 +00:00
|
|
|
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
|
|
|
|
|
2014-08-25 01:20:49 +00:00
|
|
|
resource 'python-keyczar' do
|
|
|
|
url 'https://pypi.python.org/packages/source/p/python-keyczar/python-keyczar-0.71b.tar.gz'
|
|
|
|
sha1 '20c7c5d54c0ce79262092b4cc691aa309fb277fa'
|
2013-10-30 18:59:06 +00:00
|
|
|
end
|
|
|
|
|
2013-09-02 11:43:49 +00:00
|
|
|
def install
|
2014-04-30 22:35:13 +00:00
|
|
|
ENV["PYTHONPATH"] = lib+"python2.7/site-packages"
|
2014-01-04 13:01:30 +00:00
|
|
|
ENV.prepend_create_path 'PYTHONPATH', libexec+'lib/python2.7/site-packages'
|
2014-05-01 16:08:37 +00:00
|
|
|
# HEAD additionally requires this to be present in PYTHONPATH, or else
|
|
|
|
# ansible's own setup.py will fail.
|
|
|
|
ENV.prepend_create_path 'PYTHONPATH', prefix+'lib/python2.7/site-packages'
|
2013-09-02 11:43:49 +00:00
|
|
|
install_args = [ "setup.py", "install", "--prefix=#{libexec}" ]
|
|
|
|
|
2014-09-04 01:29:10 +00:00
|
|
|
res = %w[pycrypto boto pyyaml paramiko markupsafe jinja2]
|
2014-05-20 00:18:12 +00:00
|
|
|
res << "python-keyczar" if build.with? "accelerate"
|
|
|
|
res.each do |r|
|
|
|
|
resource(r).stage { system "python", *install_args }
|
2014-01-04 13:01:30 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
inreplace 'lib/ansible/constants.py' do |s|
|
|
|
|
s.gsub! '/usr/share/ansible', share+'ansible'
|
|
|
|
s.gsub! '/etc/ansible', etc+'ansible'
|
2013-09-03 09:13:20 +00:00
|
|
|
end
|
2013-09-02 11:43:49 +00:00
|
|
|
|
2014-01-04 13:01:30 +00:00
|
|
|
system "python", "setup.py", "install", "--prefix=#{prefix}"
|
|
|
|
|
2014-05-06 16:41:49 +00:00
|
|
|
# These are now rolled into 1.6 and cause linking conflicts
|
|
|
|
rm Dir["#{bin}/easy_install*"]
|
|
|
|
rm "#{lib}/python2.7/site-packages/site.py"
|
|
|
|
rm Dir["#{lib}/python2.7/site-packages/*.pth"]
|
2014-05-01 16:08:37 +00:00
|
|
|
|
2013-09-03 09:13:20 +00:00
|
|
|
man1.install Dir['docs/man/man1/*.1']
|
2013-09-02 11:43:49 +00:00
|
|
|
|
2014-01-04 13:01:30 +00:00
|
|
|
bin.env_script_all_files(libexec+'bin', :PYTHONPATH => ENV['PYTHONPATH'])
|
2013-09-02 11:43:49 +00:00
|
|
|
end
|
2013-10-18 23:51:59 +00:00
|
|
|
|
2014-01-04 13:01:30 +00:00
|
|
|
test do
|
2013-10-18 23:51:59 +00:00
|
|
|
system "#{bin}/ansible", "--version"
|
|
|
|
end
|
2013-09-02 11:43:49 +00:00
|
|
|
end
|