homebrew-core/Formula/mod_wsgi.rb

44 lines
1.4 KiB
Ruby
Raw Normal View History

require 'formula'
2011-03-10 05:11:03 +00:00
class ModWsgi < Formula
homepage 'http://code.google.com/p/modwsgi/'
2010-08-02 21:05:34 +00:00
url 'http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz'
sha1 'f32d38e5d3ed5de1efd5abefb52678f833dc9166'
head 'http://modwsgi.googlecode.com/svn/trunk/mod_wsgi'
def install
# Remove a flag added when homebrew isn't in /usr/local
# causes apxs to fail with "unknown flags" error
ENV.remove 'CPPFLAGS', "-isystem #{HOMEBREW_PREFIX}/include"
2010-01-13 11:06:52 +00:00
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
2010-01-13 11:06:52 +00:00
inreplace 'Makefile' do |s|
# Remove 'ppc' support, so we can pass Intel-optimized CFLAGS.
cflags = s.get_make_var("CFLAGS")
cflags.gsub! "-Wc,'-arch ppc7400'", ""
cflags.gsub! "-Wc,'-arch ppc64'", ""
cflags.gsub! "-Wc,'-arch x86_64'", "" if Hardware.is_32_bit?
s.change_make_var! "CFLAGS", cflags
2010-04-12 17:18:28 +00:00
2010-01-13 11:06:52 +00:00
# --libexecdir parameter to ./configure isn't changing this, so cram it in
2010-04-12 17:18:28 +00:00
# This will be where the Apache module ends up, and we don't want to touch
# the system libexec.
2010-01-13 11:06:52 +00:00
s.change_make_var! "LIBEXECDIR", libexec
end
system "make install"
end
def caveats
<<-EOS.undent
You must manually edit /etc/apache2/httpd.conf to load
#{libexec}/mod_wsgi.so
On 10.5, you must run Apache in 32-bit mode:
http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX
EOS
end
end