aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/mod_python.rb
blob: 9576489ef58f399d21ba76df2518d2a5073240e2 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require 'formula'

class ModPython < Formula
  homepage 'http://www.modpython.org/'
  url 'http://archive.apache.org/dist/httpd/modpython/mod_python-3.3.1.tgz'
  sha1 'e538170fd78e09408b6d8593da980b126a0fef93'

  # patch-src-connobject.c.diff from MacPorts
  def patches; DATA; end

  def install
    system "./configure", "--disable-debug", "--disable-dependency-tracking",
                          "--prefix=#{prefix}"

    # Explicitly set the arch in CFLAGS so the PSPModule will build against system Python
    # We remove 'ppc' support, so we can pass Intel-optimized CFLAGS.
    archs = archs_for_command("python")
    archs.remove_ppc!
    ENV.append_to_cflags archs.as_arch_flags

    # Don't install to the system Apache libexec folder
    inreplace 'Makefile' do |s|
      s.change_make_var! "LIBEXECDIR", libexec
    end

    system "make"
    system "make install"
  end

  def caveats; <<-EOS.undent
    To use mod_python, you must manually edit /etc/apache2/httpd.conf to load:
      #{libexec}/mod_python.so

    NOTE: mod_python is deprecated. See:
      http://blog.dscpl.com.au/2010/05/modpython-project-soon-to-be-officially.html

    mod_wsgi is the suggested replacement.
    EOS
  end
end

__END__
--- a/src/connobject.c	2006-12-03 05:36:37.000000000 +0100
+++ b/src/connobject.c	2008-07-30 12:30:10.000000000 +0200
@@ -139,7 +139,7 @@
     bytes_read = 0;
 
     while ((bytes_read < len || len == 0) &&
-           !(b == APR_BRIGADE_SENTINEL(b) ||
+           !(b == APR_BRIGADE_SENTINEL(bb) ||
              APR_BUCKET_IS_EOS(b) || APR_BUCKET_IS_FLUSH(b))) {
 
         const char *data;