aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/setuptools.rb
blob: 0cb91342fc6341ea8558761aa47c57825501a742 (plain)
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
require 'formula'

class Setuptools <Formula
  url 'http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz'
  homepage 'http://pypi.python.org/pypi/setuptools'
  md5 '7df2a529a074f613b509fb44feefe74e'
  version '0.6c11'

  def install
    dest=prefix+'lib/setuptools'
    FileUtils.mkdir_p dest
    ENV.append 'PYTHONPATH', dest, ":"
    system "python", "setup.py", "install", "--prefix=#{prefix}", "--install-lib=#{dest}"

    site_packages = `python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"`.chomp
    pth = Pathname.new site_packages+'/homebrew.pth'
    ohai "Writing #{pth} to enable setuptools"
    data = DATA.read
    data.sub! "HOMEBREW_SETUPTOOLS_PATH", dest
    pth.unlink if pth.exist?
    pth.write data
  end
end

__END__
# Please dont't modify this file, Homebrew will overwrite it.
import site; site.addsitedir('HOMEBREW_SETUPTOOLS_PATH')