homebrew-core/Formula/uwsgi.rb

39 lines
1020 B
Ruby
Raw Normal View History

require 'formula'
class Uwsgi <Formula
2010-04-18 23:07:55 +00:00
url 'http://projects.unbit.it/downloads/uwsgi-0.9.4.3.tar.gz'
homepage 'http://projects.unbit.it/uwsgi/'
2010-04-18 23:07:55 +00:00
md5 '5f6a7385138deccfd5f8a80f2e0dea04'
2010-01-13 11:06:52 +00:00
def python_version
`python -c "import sys; print '%s.%s' % sys.version_info[:2]"`.chomp
end
def install
2010-02-01 20:18:30 +00:00
case python_version
when '2.5'
makefile = "Makefile"
program = "uwsgi"
when '2.6'
makefile = "Makefile.Py26"
program = "uwsgi26"
end
2010-02-01 20:18:30 +00:00
2010-04-18 23:07:55 +00:00
# Find the archs of the Python we are building against.
# We remove 'ppc' support, so we can pass Intel-optimized CFLAGS.
archs = archs_for_command("python")
archs.delete :ppc7400
archs.delete :ppc64
flags = archs.collect{ |a| "-arch #{a}" }.join(' ')
inreplace makefile do |s|
s.change_make_var! "CFLAGS", "$(PYTHON_CFLAGS) $(XML_CFLAGS) #{flags}"
s.change_make_var! "LD_FLAGS", "$(PYTHON_LIBS) $(XML_LIBS) #{flags}"
end
2010-02-01 20:18:30 +00:00
system "make -f #{makefile}"
bin.install program
end
end