forked from denji/homebrew-nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenresty.rb
38 lines (30 loc) · 901 Bytes
/
openresty.rb
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
require 'formula'
class Openresty < Formula
homepage 'http://openresty.org'
url 'http://openresty.org/download/ngx_openresty-1.2.8.6.tar.gz'
sha1 '4b47862a77577d06447d17c935e94dc935c279e5'
version '1.2.8.6'
depends_on "luajit"
depends_on "pcre"
def install
# Configure
cc_opt = "-I#{HOMEBREW_PREFIX}/include"
ld_opt = "-L#{HOMEBREW_PREFIX}/lib"
args = [
"--prefix=#{prefix}",
"--pid-path=#{var}/run/openresty.pid",
"--lock-path=#{var}/run/openresty.lock",
"--sbin-path=#{bin}/openresty",
"--conf-path=#{etc}/openresty/nginx.conf",
"--http-log-path=#{var}/log/nginx/access.log",
"--error-log-path=#{var}/log/nginx/error.log",
"--with-luajit",
"--with-cc-opt=#{cc_opt}",
"--with-ld-opt=#{ld_opt}"
]
system "./configure", *args
# Install
system 'make'
system 'make install'
end
end