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

mod_security: audit fixes

  • Loading branch information...
bfontaine committed Nov 2, 2015
1 parent 8b2bce2 commit 07683ff9416d459edd381ad7dbffd8e290bc9279
Showing with 8 additions and 12 deletions.
  1. +8 −12 mod_security.rb
View
@@ -1,5 +1,3 @@
require "formula"
class ModSecurity < Formula
class CLTRequirement < Requirement
fatal true
@@ -15,7 +13,6 @@ def message; <<-EOS.undent
homepage "http://www.modsecurity.org/"
url "https://www.modsecurity.org/tarball/2.9.0/modsecurity-2.9.0.tar.gz"
sha1 "837c4615d91963ed1343b50e80d35582a78ab23b"
sha256 "e2bbf789966c1f80094d88d9085a81bde082b2054f8e38e0db571ca49208f434"
option "with-homebrew-apr", "Use Homebrew apr"
@@ -33,27 +30,27 @@ def message; <<-EOS.undent
depends_on "httpd24" if build.with? "homebrew-httpd24"
depends_on "libtool" => :build
depends_on "pcre"
depends_on CLTRequirement if build.without? "homebrew-httpd22" and build.without? "homebrew-httpd24"
depends_on CLTRequirement if build.without?("homebrew-httpd22") && build.without?("homebrew-httpd24")
if build.with? "homebrew-apr" and (build.with? "homebrew-httpd22" or build.with? "homebrew-httpd24")
if build.with?("homebrew-apr") && (build.with?("homebrew-httpd22") || build.with?("homebrew-httpd24"))
opoo "Ignoring --with-homebrew-apr: homebrew apr included in httpd22 and httpd24"
end
if build.with? "homebrew-httpd22" and build.with? "homebrew-httpd24"
if build.with?("homebrew-httpd22") && build.with?("homebrew-httpd24")
onoe "Cannot build for http22 and httpd24 at the same time"
exit 1
end
def apache_apxs
if build.with? "homebrew-httpd22"
%W[sbin bin].each do |dir|
if File.exist?(location = "#{Formula['httpd22'].opt_prefix}/#{dir}/apxs")
if File.exist?(location = "#{Formula["httpd22"].opt_prefix}/#{dir}/apxs")
return location
end
end
elsif build.with? "homebrew-httpd24"
%W[sbin bin].each do |dir|
if File.exist?(location = "#{Formula['httpd24'].opt_prefix}/#{dir}/apxs")
if File.exist?(location = "#{Formula["httpd24"].opt_prefix}/#{dir}/apxs")
return location
end
end
@@ -74,12 +71,12 @@ def apache_configdir
def install
args = "--prefix=#{prefix}", "--disable-dependency-tracking"
args << "--with-pcre=#{Formula['pcre'].opt_prefix}"
args << "--with-pcre=#{Formula["pcre"].opt_prefix}"
args << "--with-apxs=#{apache_apxs}"
if (build.with? "homebrew-httpd22") || (build.with? "homebrew-httpd24") || (build.with? "homebrew-apr")
args << "--with-apr=#{Formula['apr'].opt_prefix}"
args << "--with-apu=#{Formula['apr-util'].prefix}/bin"
args << "--with-apr=#{Formula["apr"].opt_prefix}"
args << "--with-apu=#{Formula["apr-util"].prefix}/bin"
else
args << "--with-apr=/usr/bin"
args << "--with-apu=/usr/bin"
@@ -115,5 +112,4 @@ def caveats; <<-EOS.undent
read the "Troubleshooting" section of https://github.com/Homebrew/homebrew-apache
EOS
end
end

0 comments on commit 07683ff

Please sign in to comment.