Skip to content

Commit

Permalink
httpd22 2.2.32
Browse files Browse the repository at this point in the history
Closes #166.

Signed-off-by: Jan Viljanen <[email protected]>
  • Loading branch information
capripot authored and Jan Viljanen committed Jul 1, 2017
1 parent 10097e9 commit a175fb9
Showing 1 changed file with 37 additions and 24 deletions.
61 changes: 37 additions & 24 deletions httpd22.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
class Httpd22 < Formula
desc "HTTP server"
homepage "https://httpd.apache.org/"
url "https://archive.apache.org/dist/httpd/httpd-2.2.31.tar.bz2"
sha256 "f32f9d19f535dac63b06cb55dfc023b40dcd28196b785f79f9346779e22f26ac"
url "https://archive.apache.org/dist/httpd/httpd-2.2.32.tar.bz2"
sha256 "527bc9d8092d784daf08910dd6c9d2681d6a2325055b2cc69806a0a7df7ed650"

bottle do
sha256 "b467425b4c729c842953d4974725cf043006c05cdcb2b973daeb9b4ea12f61bc" => :yosemite
sha256 "e5fa95c5b6e9e05a50f165ef6292d59681f1a9ab32b14433c192501d67999cd6" => :mavericks
sha256 "cce58a9a01559018d6aafeae50c88ef183774ffcde0f1b621353f3e0302c41b9" => :mountain_lion
end

conflicts_with "homebrew/apache/httpd24", :because => "different versions of the same software"

skip_clean :la

option "with-mpm-worker", "Use the Worker Multi-Processing Module instead of Prefork"
Expand All @@ -23,6 +21,8 @@ class Httpd22 < Formula
depends_on "pcre" => :optional
depends_on "zlib"

conflicts_with "homebrew/apache/httpd24", :because => "different versions of the same software"

if build.with?("mpm-worker") && build.with?("mpm-event")
raise "Cannot build with both worker and event MPMs, choose one"
end
Expand All @@ -31,6 +31,11 @@ def install
# point config files to opt_prefix instead of the version-specific prefix
inreplace "Makefile.in",
'#@@ServerRoot@@#$(prefix)#', '#@@ServerRoot@@'"##{opt_prefix}#"
# fix non-executable files in sbin dir (for brew audit)
inreplace "support/Makefile.in",
"cp -p envvars-std $(DESTDIR)$(sbindir);", "mkdir -p $(DESTDIR)$(sysconfdir); cp -p envvars-std $(DESTDIR)$(sysconfdir);"
inreplace "support/Makefile.in",
"$(DESTDIR)$(sbindir)/envvars", "$(DESTDIR)$(sysconfdir)/envvars"

# install custom layout
File.open("config.layout", "w") { |f| f.write(httpd_layout) }
Expand Down Expand Up @@ -85,6 +90,32 @@ def install
touch("#{var}/log/apache2/error_log") unless File.exist?("#{var}/log/apache2/error_log")
end

def caveats
if build.with? "privileged-ports"
<<-EOS.undent
To load #{name} when --with-privileged-ports is used:
sudo cp -v #{plist_path} /Library/LaunchDaemons
sudo chown -v root:wheel /Library/LaunchDaemons/#{plist_path.basename}
sudo chmod -v 644 /Library/LaunchDaemons/#{plist_path.basename}
sudo launchctl load /Library/LaunchDaemons/#{plist_path.basename}
To reload #{name} after an upgrade when --with-privileged-ports is used:
sudo launchctl unload /Library/LaunchDaemons/#{plist_path.basename}
sudo launchctl load /Library/LaunchDaemons/#{plist_path.basename}
If not using --with-privileged-ports, use the instructions below.
EOS
end
end

manual_startup = "apachectl start"

plist_options :manual => manual_startup

if build.with? "privileged-ports"
plist_options :startup => true, :manual => manual_startup
end

def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
Expand Down Expand Up @@ -123,7 +154,7 @@ def httpd_layout
htdocsdir: ${datadir}/htdocs
manualdir: ${datadir}/manual
cgidir: #{var}/apache2/cgi-bin
includedir: ${prefix}/include/apache2
includedir: ${prefix}/include/httpd
localstatedir: #{var}/apache2
runtimedir: #{var}/run/apache2
logfiledir: #{var}/log/apache2
Expand All @@ -132,25 +163,7 @@ def httpd_layout
EOS
end

def caveats
if build.with? "privileged-ports"
<<-EOS.undent
To load #{name} when --with-privileged-ports is used:
sudo cp -v #{plist_path} /Library/LaunchDaemons
sudo chown -v root:wheel /Library/LaunchDaemons/#{plist_path.basename}
sudo chmod -v 644 /Library/LaunchDaemons/#{plist_path.basename}
sudo launchctl load /Library/LaunchDaemons/#{plist_path.basename}
To reload #{name} after an upgrade when --with-privileged-ports is used:
sudo launchctl unload /Library/LaunchDaemons/#{plist_path.basename}
sudo launchctl load /Library/LaunchDaemons/#{plist_path.basename}
If not using --with-privileged-ports, use the instructions below.
EOS
end
end

test do
system sbin/"httpd", "-v"
system bin/"httpd", "-v"
end
end

0 comments on commit a175fb9

Please sign in to comment.