summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www/nginx/DESCR10
-rw-r--r--www/nginx/Makefile60
-rw-r--r--www/nginx/PLIST14
-rw-r--r--www/nginx/distinfo6
-rw-r--r--www/nginx/files/nginx.sh17
-rw-r--r--www/nginx/options.mk19
-rw-r--r--www/nginx/patches/patch-aa86
7 files changed, 212 insertions, 0 deletions
diff --git a/www/nginx/DESCR b/www/nginx/DESCR
new file mode 100644
index 00000000000..8c79764c22c
--- /dev/null
+++ b/www/nginx/DESCR
@@ -0,0 +1,10 @@
+nginx (pronounced "engine X") is a lightweight web (HTTP) server/reverse proxy
+and mail (IMAP/POP3) proxy written by Igor Sysoev.
+
+nginx has been running for more than three years on many heavily loaded Russian
+sites including Rambler (RamblerMedia.com). In March 2007 about 20% of all
+Russian virtual hosts were served or proxied by nginx. According to Google
+Online Security Blog nginx serves or proxies about 4% of all Internet virtual
+hosts, although Netcraft shows much less percent.
+
+The sources are licensed under a BSD-like license.
diff --git a/www/nginx/Makefile b/www/nginx/Makefile
new file mode 100644
index 00000000000..80231282b60
--- /dev/null
+++ b/www/nginx/Makefile
@@ -0,0 +1,60 @@
+# $NetBSD: Makefile,v 1.1.1.1 2007/12/11 09:12:26 ghen Exp $
+
+DISTNAME= nginx-0.5.33
+CATEGORIES= www
+MASTER_SITES= http://sysoev.ru/nginx/
+
+MAINTAINER= ghen@NetBSD.org
+HOMEPAGE= http://nginx.net/
+COMMENT= Lightweight HTTP server and mail proxy server
+
+USE_PKGLOCALEDIR= yes
+HAS_CONFIGURE= yes
+CONFIGURE_ARGS+= --with-ld-opt=-L${PREFIX}/lib\ -Wl,-R${PREFIX}/lib
+CONFIGURE_ARGS+= --prefix=${PREFIX}
+CONFIGURE_ARGS+= --sbin-path=${PREFIX}/sbin
+CONFIGURE_ARGS+= --conf-path=${PKG_SYSCONFDIR}/nginx.conf
+CONFIGURE_ARGS+= --pid-path=${VARBASE}/run/nginx.pid
+CONFIGURE_ARGS+= --error-log-path=${NGINX_LOGDIR}/error.log
+CONFIGURE_ARGS+= --http-log-path=${NGINX_LOGDIR}/access.log
+CONFIGURE_ARGS+= --with-mail
+
+.include "../../mk/bsd.prefs.mk"
+
+PKG_SYSCONFSUBDIR= nginx
+NGINX_LOGDIR?= ${VARBASE}/log/nginx
+
+EGDIR= ${PREFIX}/share/examples/nginx
+EGFILES= fastcgi_params koi-utf koi-win mime.types nginx.conf win-utf
+
+.for file in ${EGFILES}
+CONF_FILES+= ${EGDIR:Q}/conf/${file} ${PKG_SYSCONFDIR}/${file}
+.endfor
+
+RCD_SCRIPTS= nginx
+
+INSTALLATION_DIRS= sbin share/examples/nginx/conf share/examples/nginx/html
+OWN_DIRS= ${NGINX_LOGDIR}
+
+BUILD_DEFS+= PKG_SYSCONFBASE NGINX_LOGDIR VARBASE
+
+BUILD_TARGET= build
+
+SUBST_CLASSES+= paths
+SUBST_STAGE.paths= pre-configure
+SUBST_FILES.paths= conf/nginx.conf
+SUBST_SED.paths= -e 's,%%PKG_SYSCONFDIR%%,${PKG_SYSCONFDIR},g'
+SUBST_SED.paths+= -e 's,%%NGINX_LOGDIR%%,${NGINX_LOGDIR},g'
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${PREFIX}/sbin/nginx
+.for file in ${EGFILES}
+ ${INSTALL_DATA} ${WRKSRC}/conf/${file} ${EGDIR}/conf/${file}
+.endfor
+ ${INSTALL_DATA} ${WRKSRC}/html/50x.html ${EGDIR}/html/50x.html
+ ${INSTALL_DATA} ${WRKSRC}/html/index.html ${EGDIR}/html/index.html
+
+.include "options.mk"
+
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/www/nginx/PLIST b/www/nginx/PLIST
new file mode 100644
index 00000000000..6f4b22f8a45
--- /dev/null
+++ b/www/nginx/PLIST
@@ -0,0 +1,14 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2007/12/11 09:12:26 ghen Exp $
+sbin/nginx
+share/examples/nginx/conf/fastcgi_params
+share/examples/nginx/conf/koi-utf
+share/examples/nginx/conf/koi-win
+share/examples/nginx/conf/mime.types
+share/examples/nginx/conf/nginx.conf
+share/examples/nginx/conf/win-utf
+share/examples/nginx/html/50x.html
+share/examples/nginx/html/index.html
+share/examples/rc.d/nginx
+@dirrm share/examples/nginx/html
+@dirrm share/examples/nginx/conf
+@dirrm share/examples/nginx
diff --git a/www/nginx/distinfo b/www/nginx/distinfo
new file mode 100644
index 00000000000..4fd81ecd6da
--- /dev/null
+++ b/www/nginx/distinfo
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1.1.1 2007/12/11 09:12:26 ghen Exp $
+
+SHA1 (nginx-0.5.33.tar.gz) = d8c321126c57d3a5cf06914541465bf44a6f3904
+RMD160 (nginx-0.5.33.tar.gz) = 1836b4019f450b562bbffade6ea2046f6b640062
+Size (nginx-0.5.33.tar.gz) = 485441 bytes
+SHA1 (patch-aa) = ffc4de0134bd3d1808bdd1462e4602a11159d996
diff --git a/www/nginx/files/nginx.sh b/www/nginx/files/nginx.sh
new file mode 100644
index 00000000000..dbdd4c31674
--- /dev/null
+++ b/www/nginx/files/nginx.sh
@@ -0,0 +1,17 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: nginx.sh,v 1.1.1.1 2007/12/11 09:12:26 ghen Exp $
+#
+# PROVIDE: nginx
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name="nginx"
+rcvar=${name}
+command="@PREFIX@/sbin/${name}"
+required_files="@PKG_SYSCONFDIR@/${name}.conf"
+pidfile="@VARBASE@/run/${name}.pid"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/www/nginx/options.mk b/www/nginx/options.mk
new file mode 100644
index 00000000000..f4ebbbfc8df
--- /dev/null
+++ b/www/nginx/options.mk
@@ -0,0 +1,19 @@
+# $NetBSD: options.mk,v 1.1.1.1 2007/12/11 09:12:26 ghen Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.nginx
+PKG_SUPPORTED_OPTIONS= ssl pcre
+PKG_SUGGESTED_OPTIONS= ssl pcre
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mssl)
+.include "../../security/openssl/buildlink3.mk"
+CONFIGURE_ARGS+= --with-mail_ssl_module
+.endif
+
+.if !empty(PKG_OPTIONS:Mpcre)
+.include "../../devel/pcre/buildlink3.mk"
+.else
+CONFIGURE_ARGS+= --without-pcre
+CONFIGURE_ARGS+= --without-http_rewrite_module
+.endif
diff --git a/www/nginx/patches/patch-aa b/www/nginx/patches/patch-aa
new file mode 100644
index 00000000000..5c1922897ce
--- /dev/null
+++ b/www/nginx/patches/patch-aa
@@ -0,0 +1,86 @@
+$NetBSD: patch-aa,v 1.1.1.1 2007/12/11 09:12:26 ghen Exp $
+
+--- conf/nginx.conf.orig 2007-01-18 08:08:18.000000000 +0100
++++ conf/nginx.conf
+@@ -2,11 +2,11 @@
+ #user nobody;
+ worker_processes 1;
+
+-#error_log logs/error.log;
+-#error_log logs/error.log notice;
+-#error_log logs/error.log info;
++#error_log %%NGINX_LOGDIR%%/error.log;
++#error_log %%NGINX_LOGDIR%%/error.log notice;
++#error_log %%NGINX_LOGDIR%%/error.log info;
+
+-#pid logs/nginx.pid;
++#pid %%NGINX_LOGDIR%%/nginx.pid;
+
+
+ events {
+@@ -15,14 +15,14 @@ events {
+
+
+ http {
+- include conf/mime.types;
++ include %%PKG_SYSCONFDIR%%/mime.types;
+ default_type application/octet-stream;
+
+ #log_format main '$remote_addr - $remote_user [$time_local] $request '
+ # '"$status" $body_bytes_sent "$http_referer" '
+ # '"$http_user_agent" "$http_x_forwarded_for"';
+
+- #access_log logs/access.log main;
++ #access_log %%NGINX_LOGDIR%%/access.log main;
+
+ sendfile on;
+ #tcp_nopush on;
+@@ -38,10 +38,10 @@ http {
+
+ #charset koi8-r;
+
+- #access_log logs/host.access.log main;
++ #access_log %%NGINX_LOGDIR%%/host.access.log main;
+
+ location / {
+- root html;
++ root share/examples/nginx/html;
+ index index.html index.htm;
+ }
+
+@@ -51,7 +51,7 @@ http {
+ #
+ error_page 500 502 503 504 /50x.html;
+ location = /50x.html {
+- root html;
++ root share/examples/nginx/html;
+ }
+
+ # proxy the PHP scripts to Apache listening on 127.0.0.1:80
+@@ -66,7 +66,7 @@ http {
+ # fastcgi_pass 127.0.0.1:9000;
+ # fastcgi_index index.php;
+ # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
+- # include conf/fastcgi_params;
++ # include %%PKG_SYSCONFDIR%%/fastcgi_params;
+ #}
+
+ # deny access to .htaccess files, if Apache's document root
+@@ -86,7 +86,7 @@ http {
+ # server_name somename alias another.alias;
+
+ # location / {
+- # root html;
++ # root share/examples/nginx/html;
+ # index index.html index.htm;
+ # }
+ #}
+@@ -109,7 +109,7 @@ http {
+ # ssl_prefer_server_ciphers on;
+
+ # location / {
+- # root html;
++ # root share/examples/nginx/html;
+ # index index.html index.htm;
+ # }
+ #}