79 lines
2.5 KiB
Ruby
79 lines
2.5 KiB
Ruby
class SpoofMac < Formula
|
|
homepage "https://github.com/feross/SpoofMAC"
|
|
url "https://pypi.python.org/packages/source/S/SpoofMAC/SpoofMAC-2.0.4.tar.gz"
|
|
sha256 "eb623ead027c804d9e01e4418462c6da3319b05b09ce9b641080179ea2c9971d"
|
|
|
|
head "https://github.com/feross/SpoofMAC.git"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "8771adbc4f74098dbc6470cde08f808cec0e21b2efe61f7ebe5cfb84aafc9fd6" => :yosemite
|
|
sha256 "eb496422b56e593cfe96fd8d1596d2e3db1740d2f5edbd067567c9b5ed05969d" => :mavericks
|
|
sha256 "fcfa251ff925d5d325ed6edf25180a8e90d25de71ef5ed8c9a66d7a229b9724b" => :mountain_lion
|
|
end
|
|
|
|
depends_on :python if MacOS.version <= :snow_leopard
|
|
|
|
resource "docopt" do
|
|
url "https://pypi.python.org/packages/source/d/docopt/docopt-0.6.2.tar.gz"
|
|
sha256 "49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"
|
|
end
|
|
|
|
def install
|
|
ENV["PYTHONPATH"] = libexec/"lib/python2.7/site-packages"
|
|
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
|
|
|
|
resources.each do |r|
|
|
r.stage { system "python", *Language::Python.setup_install_args(libexec/"vendor") }
|
|
end
|
|
|
|
system "python", *Language::Python.setup_install_args(libexec)
|
|
|
|
bin.install_symlink "spoof-mac.py" => "spoof-mac"
|
|
bin.env_script_all_files(libexec+"bin", :PYTHONPATH => ENV["PYTHONPATH"])
|
|
end
|
|
|
|
plist_options :startup => true, :manual => "spoof-mac"
|
|
|
|
def plist; <<-EOS.undent
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>Label</key>
|
|
<string>#{plist_name}</string>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{bin}/spoof-mac</string>
|
|
<string>randomize</string>
|
|
<string>en0</string>
|
|
</array>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
<key>StandardErrorPath</key>
|
|
<string>/dev/null</string>
|
|
<key>StandardOutPath</key>
|
|
<string>/dev/null</string>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
|
|
def caveats; <<-EOS.undent
|
|
Although spoof-mac can run without root, you must be root to change the MAC.
|
|
|
|
The launchdaemon is set to randomize en0.
|
|
You can find the interfaces available by running:
|
|
"spoof-mac list"
|
|
|
|
If you wish to change interface randomized at startup change the plist line:
|
|
<string>en0</string>
|
|
to e.g.:
|
|
<string>en1</string>
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/spoof-mac", "list", "--wifi"
|
|
end
|
|
end
|