2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-08-24 17:14:06 +00:00
|
|
|
|
|
|
|
class ModWsgi <Formula
|
2010-08-02 21:05:34 +00:00
|
|
|
url 'http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz'
|
|
|
|
sha1 'f32d38e5d3ed5de1efd5abefb52678f833dc9166'
|
2010-04-12 17:18:28 +00:00
|
|
|
homepage 'http://code.google.com/p/modwsgi/'
|
2010-06-16 23:17:59 +00:00
|
|
|
head "http://modwsgi.googlecode.com/svn/trunk/mod_wsgi"
|
2009-08-24 17:14:06 +00:00
|
|
|
|
|
|
|
def caveats
|
2010-04-12 17:18:28 +00:00
|
|
|
<<-EOS.undent
|
2010-06-16 19:32:39 +00:00
|
|
|
NOTE: "brew install -v mod_wsgi" will fail! You must install
|
|
|
|
in non-verbose mode for this to succeed. Patches to fix this
|
2010-08-02 21:05:34 +00:00
|
|
|
are welcome.
|
2010-06-16 19:32:39 +00:00
|
|
|
|
2010-04-12 17:18:28 +00:00
|
|
|
* 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
|
2009-08-24 17:14:06 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2010-06-16 19:19:06 +00:00
|
|
|
# Remove a flag added when homebrew isn't in /usr/local
|
|
|
|
# causes apxs to fail with unknown flags s,y,s,t,m
|
|
|
|
ENV.remove 'CPPFLAGS', "-isystem #{HOMEBREW_PREFIX}/include"
|
|
|
|
|
2010-01-13 11:06:52 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
|
2009-08-24 17:14:06 +00:00
|
|
|
|
2010-04-12 17:18:28 +00:00
|
|
|
# Find the archs of the Python we are building against.
|
|
|
|
# We remove 'ppc' support, so we can pass Intel-optimized CFLAGS.
|
2010-04-12 18:19:13 +00:00
|
|
|
archs = archs_for_command("python")
|
2010-04-12 17:18:28 +00:00
|
|
|
archs.delete :ppc7400
|
|
|
|
archs.delete :ppc64
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2010-01-13 11:06:52 +00:00
|
|
|
inreplace 'Makefile' do |s|
|
2010-04-12 17:18:28 +00:00
|
|
|
s.gsub! "-Wc,'-arch x86_64' -Wc,'-arch i386' -Wc,'-arch ppc7400'",
|
2010-04-12 18:19:13 +00:00
|
|
|
archs.collect{ |a| "-Wc,'-arch #{a}'" }.join(' ')
|
2010-04-12 17:18:28 +00:00
|
|
|
|
2010-04-12 18:19:13 +00:00
|
|
|
s.gsub! "-arch x86_64 -arch i386 -arch ppc7400",
|
|
|
|
archs.collect{ |a| "-arch #{a}" }.join(' ')
|
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
|
2009-09-21 19:20:05 +00:00
|
|
|
end
|
2009-08-24 17:14:06 +00:00
|
|
|
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|