Permalink
Browse files

Updated nginix formula.

* Keep empty logs folder.
* Comment what the patch does.
  • Loading branch information...
1 parent ca1c2aa commit b2d5e3625b964e70a934de51b98f4e57b656faf4 @adamv adamv committed Feb 1, 2010
Showing with 27 additions and 23 deletions.
  1. +27 −23 Library/Formula/nginx.rb
View
@@ -1,13 +1,17 @@
require 'formula'
class Nginx < Formula
- @url='http://sysoev.ru/nginx/nginx-0.7.64.tar.gz'
- @homepage='http://nginx.net/'
- @md5='cfa97c0f784532820110b5eee57fef6d'
+ url 'http://sysoev.ru/nginx/nginx-0.7.64.tar.gz'
+ md5 'cfa97c0f784532820110b5eee57fef6d'
+ homepage 'http://nginx.net/'
depends_on 'pcre'
+
+ skip_clean 'logs'
def patches
+ # Changes default port to 8080
+ # Adds code to detect PCRE installed in a non-standard HOMEBREW_PREFIX
DATA
end
@@ -16,40 +20,40 @@ def options
['--with-passenger', "Compile with support for Phusion Passenger module"]
]
end
+
+ def passenger_config_args
+ passenger_root = `passenger-config --root`.chomp
+
+ if File.directory?(passenger_root)
+ return "--add-module=#{passenger_root}/ext/nginx"
+ end
+
+ puts "Unable to install nginx with passenger support. The passenger"
+ puts "gem must be installed and passenger-config must be in your path"
+ puts "in order to continue."
+ exit
+ end
def install
configure_args = [
"--prefix=#{prefix}",
"--with-http_ssl_module"
]
- if ARGV.include? '--with-passenger'
- passenger_root = `passenger-config --root`.chomp
-
- if File.directory?(passenger_root)
- configure_args << "--add-module=#{passenger_root}/ext/nginx"
- else
- puts "Unable to install nginx with passenger support. The passenger"
- puts "gem must be installed and passenger-config must be in your path"
- puts "in order to continue."
- exit
- end
- end
+ configure_args << passenger_config_args if ARGV.include? '--with-passenger'
system "./configure", *configure_args
system "make install"
-
- # FIXME: This fails, for an unknown reason
- #(prefix+'logs').mkdir
end
def caveats
<<-CAVEATS
-You need to create a logs folder before you can run NginX. Also, in the
-interest of allowing you to run `nginx` without `sudo`, the default port is
-set to localhost:8080; if you want to host pages on your local machine to the
-public, you should probably change that to localhost:80, and run `nginx` with
-`sudo`.
+In the interest of allowing you to run `nginx` without `sudo`, the default
+port is set to localhost:8080.
+
+If you want to host pages on your local machine to the public, you should
+change that to localhost:80, and run `sudo nginx`. You'll need to turn off
+any other web servers running port 80, of course.
CAVEATS
end
end

0 comments on commit b2d5e36

Please sign in to comment.