ansible: refurbish with new setup_install method

This commit is contained in:
Tim D. Smith 2014-11-06 22:25:23 -08:00
parent 4aca8c444c
commit 942e107c95

View file

@ -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