forked from Homebrew/legacy-homebrew
/
ansible.rb
43 lines (36 loc) · 1.33 KB
/
ansible.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
require 'formula'
# Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class Ansible < Formula
homepage 'http://ansible.cc/'
url 'https://github.com/ansible/ansible/archive/v0.9.tar.gz'
version '0.9'
sha1 '23c3b807dcf296002663c10b10c42c3885f1340f'
def install
# In order to install into the Cellar, the dir must exist and be in the PYTHONPATH.
temp_site_packages = lib/which_python/'site-packages'
mkdir_p temp_site_packages
ENV['PYTHONPATH'] = temp_site_packages
args = [
"--verbose",
"install",
"--force",
"--install-scripts=#{bin}",
"--install-lib=#{temp_site_packages}",
"--install-data=#{share}",
"--install-headers=#{include}",
"--record=installed-files.txt"
]
system "python", "-s", "setup.py", *args
end
def which_python
# Update this once we have something like [this](https://github.com/mxcl/homebrew/issues/11204)
"python" + `python -c 'import sys;print(sys.version[:3])'`.strip
end
def test
# This test will fail and we won't accept that! It's enough to just replace
# "false" with the main program this formula installs, but it'd be nice if you
# were more thorough. Run the test with `brew test v`.
system "false"
end
end