From 942e107c95006278fb26476af7412bd82e52f5d5 Mon Sep 17 00:00:00 2001 From: "Tim D. Smith" Date: Thu, 6 Nov 2014 22:25:23 -0800 Subject: [PATCH] ansible: refurbish with new setup_install method --- Formula/ansible.rb | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/Formula/ansible.rb b/Formula/ansible.rb index 1d1bcc7647..d4612808fb 100644 --- a/Formula/ansible.rb +++ b/Formula/ansible.rb @@ -70,35 +70,26 @@ class Ansible < Formula end def install - ENV["PYTHONPATH"] = lib+"python2.7/site-packages" - ENV.prepend_create_path "PYTHONPATH", libexec+"lib/python2.7/site-packages" - # 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" - install_args = [ "setup.py", "install", "--prefix=#{libexec}" ] + ENV["PYTHONPATH"] = libexec/"vendor/lib/python2.7/site-packages" + ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages" res = %w[pycrypto boto pyyaml paramiko markupsafe jinja2] res << "python-keyczar" if build.with? "accelerate" res += %w[pywinrm isodate xmltodict] if build.with? "windows" res.each do |r| - resource(r).stage { system "python", *install_args } + resource(r).stage { Language::Python.setup_install "python", libexec/"vendor" } end inreplace "lib/ansible/constants.py" do |s| - s.gsub! "/usr/share/ansible", share+"ansible" - s.gsub! "/etc/ansible", etc+"ansible" + s.gsub! "/usr/share/ansible", share/"ansible" + s.gsub! "/etc/ansible", etc/"ansible" end - system "python", "setup.py", "install", "--prefix=#{prefix}" - - # 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"] + Language::Python.setup_install "python", libexec man1.install Dir["docs/man/man1/*.1"] - - bin.env_script_all_files(libexec+"bin", :PYTHONPATH => ENV["PYTHONPATH"]) + bin.install Dir["#{libexec}/bin/*"] + bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"]) end test do