1
1
class Httpd24 < Formula
2
+ desc "HTTP server"
2
3
homepage "https://httpd.apache.org/"
3
- url "https://archive.apache.org/dist/httpd/httpd-2.4.17.tar.bz2"
4
- sha256 "331e035dec81d3db95b048f036f4d7b1a97ec8daa5b377bde42d4ccf1f2eb798"
5
- revision 1
4
+ url "https://archive.apache.org/dist/httpd/httpd-2.4.18.tar.bz2"
5
+ sha256 "0644b050de41f5c9f67c825285049b144690421acb709b06fe53eddfa8a9fd4c"
6
6
7
7
bottle do
8
- sha256 "a7744efed0e6bd8dc4eb6926a0f678593b6f18587dde83dc4a902036601f7eb2" => :yosemite
9
- sha256 "db2b2d4763fcd96080556ae2cbdf2cfb70f0d86b42d0ea61f763b5a136357a59" => :mavericks
10
- sha256 "ef80df482e837e5cae17a1f388fc4e60ae57f9a354eb1403843cf9dbcb9ecf17" => :mountain_lion
8
+ revision 1
9
+ sha256 "e42f84b204594b68e19a7881cf298db5a48d3246b611c5b1657754e2b1fbb97e" => :el_capitan
10
+ sha256 "7cf68e02a013b9779eb7b5f4391881f74d803c6cccd90895806ddcf108338624" => :yosemite
11
+ sha256 "6ac23f6e09c8ac706e952a8a0aa88ef4649cf8aafd91927723168a61c680e985" => :mavericks
11
12
end
12
13
13
14
conflicts_with "homebrew/apache/httpd22" , :because => "different versions of the same software"
@@ -34,9 +35,8 @@ class Httpd24 < Formula
34
35
depends_on "nghttp2"
35
36
end
36
37
37
- if build . with? "mpm-worker" and build . with? "mpm-event"
38
- onoe "Cannot build with both worker and event MPMs, choose one"
39
- exit 1
38
+ if build . with? ( "mpm-worker" ) && build . with? ( "mpm-event" )
39
+ raise "Cannot build with both worker and event MPMs, choose one"
40
40
end
41
41
42
42
def install
@@ -68,14 +68,13 @@ def install
68
68
--enable-cgid
69
69
--enable-suexec
70
70
--enable-rewrite
71
+ --with-apr=#{ Formula [ "apr" ] . opt_prefix }
72
+ --with-apr-util=#{ Formula [ "apr-util" ] . opt_prefix }
73
+ --with-pcre=#{ Formula [ "pcre" ] . opt_prefix }
74
+ --with-ssl=#{ Formula [ "openssl" ] . opt_prefix }
75
+ --with-z=#{ Formula [ "zlib" ] . opt_prefix }
71
76
]
72
77
73
- args << "--with-apr=#{ Formula [ "apr" ] . opt_prefix } "
74
- args << "--with-apr-util=#{ Formula [ "apr-util" ] . opt_prefix } "
75
- args << "--with-pcre=#{ Formula [ 'pcre' ] . opt_prefix } "
76
- args << "--with-ssl=#{ Formula [ 'openssl' ] . opt_prefix } "
77
- args << "--with-z=#{ Formula [ 'zlib' ] . opt_prefix } "
78
-
79
78
if build . with? "mpm-worker"
80
79
args << "--with-mpm=worker"
81
80
elsif build . with? "mpm-event"
@@ -85,34 +84,29 @@ def install
85
84
end
86
85
87
86
if build . with? "privileged-ports"
88
- args << "--with-port=80"
89
- args << "--with-sslport=443"
87
+ args << "--with-port=80" << "--with-sslport=443"
90
88
else
91
- args << "--with-port=8080"
92
- args << "--with-sslport=8443"
89
+ args << "--with-port=8080" << "--with-sslport=8443"
93
90
end
94
91
95
92
if build . with? "http2"
96
- args << "--enable-http2"
97
- args << "--with-nghttp2=#{ Formula [ "nghttp2" ] . opt_prefix } "
93
+ args << "--enable-http2" << "--with-nghttp2=#{ Formula [ "nghttp2" ] . opt_prefix } "
98
94
end
99
95
100
96
if build . with? "ldap"
101
- args << "--with-ldap"
102
- args << "--enable-ldap"
103
- args << "--enable-authnz-ldap"
97
+ args << "--with-ldap" << "--enable-ldap" << "--enable-authnz-ldap"
104
98
end
105
99
106
100
( etc /"apache2/2.4" ) . mkpath
107
101
108
102
system "./configure" , *args
109
103
110
104
system "make"
111
- system "make install"
105
+ system "make" , " install"
112
106
( var /"apache2/log" ) . mkpath
113
107
( var /"apache2/run" ) . mkpath
114
- touch ( "#{ var } /log/apache2/access_log" ) unless File . exists ?( "#{ var } /log/apache2/access_log" )
115
- touch ( "#{ var } /log/apache2/error_log" ) unless File . exists ?( "#{ var } /log/apache2/error_log" )
108
+ touch ( "#{ var } /log/apache2/access_log" ) unless File . exist ?( "#{ var } /log/apache2/access_log" )
109
+ touch ( "#{ var } /log/apache2/error_log" ) unless File . exist ?( "#{ var } /log/apache2/error_log" )
116
110
end
117
111
118
112
def plist ; <<-EOS . undent
@@ -124,7 +118,7 @@ def plist; <<-EOS.undent
124
118
<string>#{ plist_name } </string>
125
119
<key>ProgramArguments</key>
126
120
<array>
127
- <string>#{ opt_sbin } /httpd</string>
121
+ <string>#{ opt_bin } /httpd</string>
128
122
<string>-D</string>
129
123
<string>FOREGROUND</string>
130
124
</array>
@@ -136,12 +130,12 @@ def plist; <<-EOS.undent
136
130
end
137
131
138
132
def httpd_layout
139
- return <<-EOS . undent
133
+ <<-EOS . undent
140
134
<Layout Homebrew>
141
135
prefix: #{ prefix }
142
136
exec_prefix: ${prefix}
143
137
bindir: ${exec_prefix}/bin
144
- sbindir: ${exec_prefix}/sbin
138
+ sbindir: ${exec_prefix}/bin
145
139
libdir: ${exec_prefix}/lib
146
140
libexecdir: ${exec_prefix}/libexec
147
141
mandir: #{ man }
@@ -159,11 +153,7 @@ def httpd_layout
159
153
logfiledir: #{ var } /log/apache2
160
154
proxycachedir: ${localstatedir}/proxy
161
155
</Layout>
162
- EOS
163
- end
164
-
165
- test do
166
- system sbin /"httpd" , "-v"
156
+ EOS
167
157
end
168
158
169
159
def caveats
@@ -183,4 +173,8 @@ def caveats
183
173
EOS
184
174
end
185
175
end
176
+
177
+ test do
178
+ system bin /"httpd" , "-v"
179
+ end
186
180
end
0 commit comments