This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Several changes: - httpd2x to always use apr, apr-util, and zlib from…

… homebrew. Prevents errors from when Xcode is installed but com.apple.pkg.CLTools_Executables (Command Line Tools package) is not installed. Also prevents logic problems if installing modules like mod_security where you would have needed the same "--with-brewed-*" options as httpd2x - Simplify dependencies - Refuse to build modules if both "--with-brewed-httpd22" and "--with-brewed-httpd24" are present - If not using "--with-brewed-httpd2x" with modules, on 10.9, and using Xcode without com.apple.pkg.CLTools_Executables, show an error and explain why it will fail, rather than allowing a failed build with no instructions to fix - Formatting changes
  • Loading branch information...
alanthing committed Oct 10, 2014
1 parent 256bdab commit d6c14ddd44d534f883a9afb7996e69f9e550e16e
Showing with 248 additions and 225 deletions.
  1. +1 −0 ab.rb
  2. +13 −30 httpd22.rb
  3. +14 −48 httpd24.rb
  4. +31 −18 mod_bonjour.rb
  5. +32 −19 mod_fastcgi.rb
  6. +32 −19 mod_fcgid.rb
  7. +35 −22 mod_python.rb
  8. +53 −45 mod_security.rb
  9. +37 −24 mod_wsgi.rb
View
1 ab.rb
@@ -6,6 +6,7 @@ class Ab < Formula
sha1 "00f5c3f8274139bd6160eda2cf514fa9b74549e5"
keg_only :provided_by_osx
conflicts_with "httpd22", "httpd24", :because => "both install `ab`"
depends_on "apr-util"
View
@@ -2,35 +2,28 @@
class Httpd22 < Formula
homepage "https://httpd.apache.org/"
url "https://archive.apache.org/dist/httpd/httpd-2.2.27.tar.bz2"
sha1 "fd4bf18dd1b3e0d9be9e85ff7e033b2eb8aa4976"
url "https://archive.apache.org/dist/httpd/httpd-2.2.29.tar.bz2"
sha1 "1d6a8fbc1391d358cc6fe430edc16222b97258d5"
conflicts_with "httpd24", :because => "different versions of the same software"
skip_clean :la
option "with-brewed-apr", "Use Homebrew's apr and apr-util instead of the bundled versions"
option "with-brewed-openssl", "Use Homebrew's SSL instead of the system version"
option "with-brewed-zlib", "Use Homebrew's zlib instead of the system version"
option "with-ldap", "Include support for LDAP"
option "with-privileged-ports", "Use the default ports 80 and 443 (which require root privileges), instead of 8080 and 8443"
if build.with? "brewed-apr"
depends_on "apr"
depends_on "apr-util"
end
depends_on "pcre" => :optional
depends_on "apr-util"
depends_on "openssl" if build.with? "brewed-openssl"
depends_on "homebrew/dupes/zlib" if build.with? "brewed-zlib"
depends_on "pcre" => :optional
depends_on "homebrew/dupes/zlib"
def install
# point config files to opt_prefix instead of the version-specific prefix
inreplace "Makefile.in",
'#@@ServerRoot@@#$(prefix)#', '#@@ServerRoot@@'"##{opt_prefix}#"
# install custom layout
File.open('config.layout', 'w') { |f| f.write(httpd_layout) };
File.open("config.layout", "w") { |f| f.write(httpd_layout) }
args = %W[
--enable-layout=Homebrew
@@ -49,9 +42,12 @@ def install
--enable-rewrite
]
args << "--with-apr=#{Formula["apr"].opt_prefix}"
args << "--with-apr-util=#{Formula["apr-util"].opt_prefix}"
args << "--with-z=#{Formula['zlib'].opt_prefix}"
if build.with? "brewed-openssl"
openssl = Formula["openssl"].opt_prefix
args << "--with-ssl=#{openssl}"
args << "--with-ssl=#{Formula['openssl'].opt_prefix}"
else
args << "--with-ssl=/usr"
end
@@ -64,27 +60,14 @@ def install
args << "--with-sslport=8443"
end
if build.with? "brewed-apr"
args << "--with-apr=#{Formula["apr"].opt_prefix}"
args << "--with-apr-util=#{Formula["apr-util"].opt_prefix}"
else
args << "--with-included-apr"
end
args << "--with-pcre=#{Formula['pcre'].opt_prefix}" if build.with? "pcre"
if build.with? "brewed-zlib"
args << "--with-z=#{Formula['zlib'].opt_prefix}"
else
args << "--with-z=#{MacOS.sdk_path}/usr"
end
if build.with? "ldap"
args << "--with-ldap"
args << "--enable-ldap"
args << "--enable-authnz-ldap"
end
args << "--with-pcre=#{Formula['pcre'].opt_prefix}" if build.with? "pcre"
system "./configure", *args
system "make"
View
@@ -9,38 +9,21 @@ class Httpd24 < Formula
skip_clean :la
option "with-brewed-apr", "Use Homebrew's apr and apr-util instead of the bundled versions"
option "with-brewed-openssl", "Use Homebrew's SSL instead of the system version"
option "with-brewed-zlib", "Use Homebrew's zlib instead of the system version"
option "with-ldap", "Include support for LDAP"
option "with-privileged-ports", "Use the default ports 80 and 443 (which require root privileges), instead of 8080 and 8443"
if build.with? "brewed-apr"
depends_on "apr"
depends_on "apr-util"
else
resource "apr" do
url "https://archive.apache.org/dist/apr/apr-1.5.1.tar.bz2"
sha1 "f94e4e0b678282e0704e573b5b2fe6d48bd1c309"
end
resource "apr-util" do
url "https://archive.apache.org/dist/apr/apr-util-1.5.4.tar.bz2"
sha1 "b00038b5081472ed094ced28bcbf2b5bb56c589d"
end
end
depends_on "pcre"
depends_on "apr-util"
depends_on "openssl" if build.with? "brewed-openssl"
depends_on "homebrew/dupes/zlib" if build.with? "brewed-zlib"
depends_on "pcre"
depends_on "homebrew/dupes/zlib"
def install
# point config files to opt_prefix instead of the version-specific prefix
inreplace "makefile.in",
'#@@ServerRoot@@#$(prefix)#', '#@@ServerRoot@@'"##{opt_prefix}#"
# install custom layout
File.open('config.layout', 'w') { |f| f.write(httpd_layout) };
File.open("config.layout", "w") { |f| f.write(httpd_layout) }
args = %W[
--enable-layout=Homebrew
@@ -58,19 +41,17 @@ def install
--enable-rewrite
]
args << "--with-apr=#{Formula["apr"].opt_prefix}"
args << "--with-apr-util=#{Formula["apr-util"].opt_prefix}"
args << "--with-pcre=#{Formula['pcre'].opt_prefix}"
args << "--with-z=#{Formula['zlib'].opt_prefix}"
if build.with? "brewed-openssl"
openssl = Formula["openssl"].opt_prefix
args << "--with-ssl=#{openssl}"
args << "--with-ssl=#{Formula['openssl'].opt_prefix}"
else
args << "--with-ssl=/usr"
end
if build.with? "ldap"
args << "--with-ldap"
args << "--enable-ldap"
args << "--enable-authnz-ldap"
end
if build.with? "privileged-ports"
args << "--with-port=80"
args << "--with-sslport=443"
@@ -79,25 +60,10 @@ def install
args << "--with-sslport=8443"
end
if build.with? "brewed-apr"
args << "--with-apr=#{Formula["apr"].opt_prefix}"
args << "--with-apr-util=#{Formula["apr-util"].opt_prefix}"
else
mkdir_p "#{buildpath}/srclib/apr"
mkdir_p "#{buildpath}/srclib/apr-util"
resource("apr").stage { mv Dir.glob("*"), "#{buildpath}/srclib/apr" }
resource("apr-util").stage { mv Dir.glob("*"), "#{buildpath}/srclib/apr-util" }
args << "--with-included-apr"
end
args << "--with-pcre=#{Formula['pcre'].opt_prefix}" if build.with? "pcre"
if build.with? "brewed-zlib"
args << "--with-z=#{Formula['zlib'].opt_prefix}"
else
args << "--with-z=#{MacOS.sdk_path}/usr"
if build.with? "ldap"
args << "--with-ldap"
args << "--enable-ldap"
args << "--enable-authnz-ldap"
end
system "./configure", *args
View
@@ -1,48 +1,61 @@
require 'formula'
require "formula"
class ModBonjour < Formula
homepage 'http://www.opensource.apple.com/source/apache_mod_bonjour/apache_mod_bonjour-23/'
url 'http://www.opensource.apple.com/tarballs/apache_mod_bonjour/apache_mod_bonjour-23.tar.gz'
sha1 '597ad957a6524ba05e03e2679fe622abdb2662f8'
version '2.3'
homepage "http://www.opensource.apple.com/source/apache_mod_bonjour/apache_mod_bonjour-23/"
url "http://www.opensource.apple.com/tarballs/apache_mod_bonjour/apache_mod_bonjour-23.tar.gz"
sha1 "597ad957a6524ba05e03e2679fe622abdb2662f8"
version "2.3"
option 'with-brewed-httpd22', 'Use Homebrew Apache httpd 2.2'
option 'with-brewed-httpd24', 'Use Homebrew Apache httpd 2.4'
option "with-brewed-httpd22", "Use Homebrew Apache httpd 2.2"
option "with-brewed-httpd24", "Use Homebrew Apache httpd 2.4"
depends_on 'httpd22' if build.with? 'brewed-httpd22'
depends_on 'httpd24' if build.with? 'brewed-httpd24'
depends_on "httpd22" if build.with? "brewed-httpd22"
depends_on "httpd24" if build.with? "brewed-httpd24"
if build.with? "brewed-httpd22" and build.with? "brewed-httpd24"
onoe "Cannot build for http22 and httpd24 at the same time"
exit 1
end
if (! (build.with? "brewed-httpd22" or build.with? "brewed-httpd24")) and MacOS.version == :mavericks
unless system("pkgutil --pkgs | grep -qx com.apple.pkg.CLTools_Executables")
onoe "Command Line Tools required, even if Xcode is installed, on 10.9 Mavericks and not
using Homebrew httpd22 or httpd24. Resolve by running `xcode-select --install`."
exit 1
end
end
def apache_apxs
if build.with? 'brewed-httpd22'
['sbin', 'bin'].each do |dir|
if build.with? "brewed-httpd22"
%W[sbin, bin].each do |dir|
if File.exist?(location = "#{Formula['httpd22'].opt_prefix}/#{dir}/apxs")
return location
end
end
elsif build.with? 'brewed-httpd24'
['sbin', 'bin'].each do |dir|
elsif build.with? "brewed-httpd24"
%W[sbin, bin].each do |dir|
if File.exist?(location = "#{Formula['httpd24'].opt_prefix}/#{dir}/apxs")
return location
end
end
else
'/usr/sbin/apxs'
"/usr/sbin/apxs"
end
end
def apache_configdir
if build.with? 'brewed-httpd22'
if build.with? "brewed-httpd22"
"#{etc}/apache2/2.2"
elsif build.with? 'brewed-httpd24'
elsif build.with? "brewed-httpd24"
"#{etc}/apache2/2.4"
else
'/etc/apache2'
"/etc/apache2"
end
end
def install
system "#{apache_apxs} -o mod_bonjour.so -c *.c"
libexec.install '.libs/mod_bonjour.so'
libexec.install ".libs/mod_bonjour.so"
end
def caveats
View
@@ -1,53 +1,66 @@
require 'formula'
require "formula"
class ModFastcgi < Formula
url 'http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz'
homepage 'http://www.fastcgi.com/'
sha1 '69c56548bf97040a61903b32679fe3e3b7d3c2d4'
url "http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz"
homepage "http://www.fastcgi.com/"
sha1 "69c56548bf97040a61903b32679fe3e3b7d3c2d4"
option 'with-brewed-httpd22', 'Use Homebrew Apache httpd 2.2'
option 'with-brewed-httpd24', 'Use Homebrew Apache httpd 2.4'
option "with-brewed-httpd22", "Use Homebrew Apache httpd 2.2"
option "with-brewed-httpd24", "Use Homebrew Apache httpd 2.4"
depends_on 'httpd22' if build.with? 'brewed-httpd22'
depends_on 'httpd24' if build.with? 'brewed-httpd24'
depends_on "httpd22" if build.with? "brewed-httpd22"
depends_on "httpd24" if build.with? "brewed-httpd24"
if build.with? "brewed-httpd22" and build.with? "brewed-httpd24"
onoe "Cannot build for http22 and httpd24 at the same time"
exit 1
end
if (! (build.with? "brewed-httpd22" or build.with? "brewed-httpd24")) and MacOS.version == :mavericks
unless system("pkgutil --pkgs | grep -qx com.apple.pkg.CLTools_Executables")
onoe "Command Line Tools required, even if Xcode is installed, on 10.9 Mavericks and not
using Homebrew httpd22 or httpd24. Resolve by running `xcode-select --install`."
exit 1
end
end
def apache_apxs
if build.with? 'brewed-httpd22'
['sbin', 'bin'].each do |dir|
if build.with? "brewed-httpd22"
%W[sbin, bin].each do |dir|
if File.exist?(location = "#{Formula['httpd22'].opt_prefix}/#{dir}/apxs")
return location
end
end
elsif build.with? 'brewed-httpd24'
['sbin', 'bin'].each do |dir|
elsif build.with? "brewed-httpd24"
%W[sbin, bin].each do |dir|
if File.exist?(location = "#{Formula['httpd24'].opt_prefix}/#{dir}/apxs")
return location
end
end
else
'/usr/sbin/apxs'
"/usr/sbin/apxs"
end
end
def apache_configdir
if build.with? 'brewed-httpd22'
if build.with? "brewed-httpd22"
"#{etc}/apache2/2.2"
elsif build.with? 'brewed-httpd24'
elsif build.with? "brewed-httpd24"
"#{etc}/apache2/2.4"
else
'/etc/apache2'
"/etc/apache2"
end
end
def patches
if build.with? 'brewed-httpd24'
'https://raw.githubusercontent.com/ByteInternet/libapache-mod-fastcgi/byte/debian/patches/byte-compile-against-apache24.diff'
if build.with? "brewed-httpd24"
"https://raw.githubusercontent.com/ByteInternet/libapache-mod-fastcgi/byte/debian/patches/byte-compile-against-apache24.diff"
end
end
def install
system "#{apache_apxs} -o mod_fastcgi.so -c *.c"
libexec.install '.libs/mod_fastcgi.so'
libexec.install ".libs/mod_fastcgi.so"
end
def caveats; <<-EOS.undent
Oops, something went wrong.

0 comments on commit d6c14dd

Please sign in to comment.