2009-12-01 08:52:29 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Uwsgi <Formula
|
|
|
|
url 'http://projects.unbit.it/downloads/uwsgi-0.9.3.tar.gz'
|
|
|
|
homepage 'http://projects.unbit.it/uwsgi/'
|
|
|
|
md5 'dd72040daea5a9ee982f3b3b98946ed9'
|
|
|
|
|
2010-01-13 11:06:52 +00:00
|
|
|
def python_archs
|
|
|
|
archs_for_command("python").collect{ |arch| "-arch #{arch}" }.join(' ')
|
|
|
|
end
|
|
|
|
|
|
|
|
def python_version
|
|
|
|
`python -c "import sys; print '%s.%s' % sys.version_info[:2]"`.chomp
|
|
|
|
end
|
|
|
|
|
2009-12-01 08:52:29 +00:00
|
|
|
def install
|
2010-01-13 11:06:52 +00:00
|
|
|
mv 'Makefile.OSX.ub.Py25', 'Makefile'
|
|
|
|
|
|
|
|
inreplace "Makefile" do |s|
|
|
|
|
s.gsub! "python2.5-config", "python#{ python_version }-config"
|
|
|
|
# The arch flags should match your Python's arch flags
|
|
|
|
s.gsub! "-arch ppc -arch i386", python_archs
|
2009-12-01 08:52:29 +00:00
|
|
|
end
|
2010-01-13 11:06:52 +00:00
|
|
|
|
|
|
|
system "make all"
|
2009-12-01 08:52:29 +00:00
|
|
|
bin.install "uwsgi"
|
|
|
|
end
|
|
|
|
end
|