diff options
author | osa <osa@FreeBSD.org> | 2004-10-22 01:54:45 +0800 |
---|---|---|
committer | osa <osa@FreeBSD.org> | 2004-10-22 01:54:45 +0800 |
commit | 6e33b806543b6d16f4a7f529d89e22b279749353 (patch) | |
tree | 80eb4eee19f6bee8c09c82c816f445a4fcf58300 /www/nginx | |
parent | 85d228e19fa277cc58c4f9c5b7a598e8fd1c488a (diff) | |
download | freebsd-ports-gnome-6e33b806543b6d16f4a7f529d89e22b279749353.tar.gz freebsd-ports-gnome-6e33b806543b6d16f4a7f529d89e22b279749353.tar.zst freebsd-ports-gnome-6e33b806543b6d16f4a7f529d89e22b279749353.zip |
Add nginx (Engine X) - small and fast WWW-server.
Special thanks to: marck
Some ideas from PR: 72830
Diffstat (limited to 'www/nginx')
-rw-r--r-- | www/nginx/Makefile | 75 | ||||
-rw-r--r-- | www/nginx/distinfo | 2 | ||||
-rw-r--r-- | www/nginx/files/nginx.sh | 32 | ||||
-rw-r--r-- | www/nginx/files/patch-conf-nginx.conf | 32 | ||||
-rw-r--r-- | www/nginx/pkg-descr | 5 | ||||
-rw-r--r-- | www/nginx/pkg-plist | 16 |
6 files changed, 162 insertions, 0 deletions
diff --git a/www/nginx/Makefile b/www/nginx/Makefile new file mode 100644 index 000000000000..b20ae5c36c94 --- /dev/null +++ b/www/nginx/Makefile @@ -0,0 +1,75 @@ +# New ports collection makefile for: nginx +# Date created: 11 Oct 2004 +# Whom: osa +# +# $FreeBSD$ +# + +PORTNAME= nginx +PORTVERSION= 0.1.2 +CATEGORIES= www +MASTER_SITES= http://sysoev.ru/nginx/ + +MAINTAINER= osa@FreeBSD.org +COMMENT= Robust and small WWW server + +VARDIR?= ${DESTDIR}/var +LOGDIR?= ${VARDIR}/log +RUNDIR?= ${VARDIR}/run +HTTP_PORT?= 80 + +USE_REINPLACE= yes +USE_RC_SUBR= yes +HAS_CONFIGURE= yes +CONFIGURE_ENV+= LINK="${CC}" +CONFIGURE_ARGS= --prefix=${PREFIX}/etc/nginx \ + --with-cc-opt="-I ${PREFIX}/include" \ + --with-ld-opt="-L ${PREFIX}/lib" \ + --conf-path=${PREFIX}/etc/nginx/nginx.conf \ + --sbin-path=${PREFIX}/sbin/nginx \ + --pid-path=${RUNDIR}/nginx.pid \ + --http-log-path=${LOGDIR}/nginx-access.log \ + --error-log-path=${LOGDIR}/nginx-error.log \ + --user=${WWWOWN} --group=${WWWGRP} + +.if defined(WITHOUT_HTTP_REWRITE_MODULE) || defined(WITHOUT_PCRE) +PKGNAMESUFFIX= -nopcre +CONFIGURE_ARGS+=--without-http_rewrite_module \ + --without-pcre +.else +LIB_DEPENDS= pcre.0:${PORTSDIR}/devel/pcre +.endif + +PLIST_FILES+= etc/nginx/koi-win \ + etc/rc.d/nginx.sh \ + sbin/nginx + +RC_SCRIPTS_SUB=PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} + +post-extract: + @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ + ${FILESDIR}/nginx.sh > ${WRKSRC}/nginx.sh + +post-patch: + @${REINPLACE_CMD} 's!%%HTTP_PORT%%!${HTTP_PORT}!; \ + s!%%PREFIX%%!${PREFIX}!' \ + ${WRKSRC}/conf/nginx.conf + +do-build: + @cd ${WRKSRC} && ${MAKE} + +do-install: + ${MKDIR} ${PREFIX}/etc/nginx ${PREFIX}/www/nginx-dist + ${INSTALL_SCRIPT} ${WRKSRC}/nginx.sh ${PREFIX}/etc/rc.d + ${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${PREFIX}/sbin + ${INSTALL_DATA} ${WRKSRC}/conf/koi-win ${PREFIX}/etc/nginx +.for i in mime.types nginx.conf + [ -f ${PREFIX}/etc/nginx/${i} ] || \ + ${INSTALL_DATA} ${WRKSRC}/conf/${i} ${PREFIX}/etc/nginx + ${INSTALL_DATA} ${WRKSRC}/conf/${i} ${PREFIX}/etc/nginx/${i}-dist +.endfor + ${INSTALL_DATA} ${WRKSRC}/html/index.html ${PREFIX}/www/nginx-dist + ${ECHO_CMD} "" >>${PREFIX}/www/nginx-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING + ${LN} -sf ${PREFIX}/www/nginx-dist ${PREFIX}/www/nginx + +.include <bsd.port.mk> diff --git a/www/nginx/distinfo b/www/nginx/distinfo new file mode 100644 index 000000000000..a74e96a25483 --- /dev/null +++ b/www/nginx/distinfo @@ -0,0 +1,2 @@ +MD5 (nginx-0.1.2.tar.gz) = 520aa0e0cdb87d1dfb11963760feee9b +SIZE (nginx-0.1.2.tar.gz) = 229971 diff --git a/www/nginx/files/nginx.sh b/www/nginx/files/nginx.sh new file mode 100644 index 000000000000..dee8f0cad5be --- /dev/null +++ b/www/nginx/files/nginx.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# $FreeBSD$ + +# PROVIDE: nginx +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: FreeBSD shutdown + +# Define these apache_* variables in one of these files: +# /etc/rc.conf +# /etc/rc.conf.local +# /etc/rc.conf.d/apache +# +# DO NOT CHANGE THESE DEFAULT VALUES HERE +# +nginx_enable=${nginx_enable-"NO"} +nginx_flags=${nginx_flags-""} +nginx_pidfile=${nginx_pidfile-"/var/run/nginx.pid"} + +. %%RC_SUBR%% + +name="nginx" +rcvar=`set_rcvar` +command="%%PREFIX%%/sbin/nginx" + +load_rc_config $name + +pidfile="${nginx_pidfile}" + +start_cmd="echo \"Starting ${name}.\"; /usr/bin/limits -U www ${command} ${nginx_flags}" + +run_rc_command "$1" diff --git a/www/nginx/files/patch-conf-nginx.conf b/www/nginx/files/patch-conf-nginx.conf new file mode 100644 index 000000000000..734d51b9382a --- /dev/null +++ b/www/nginx/files/patch-conf-nginx.conf @@ -0,0 +1,32 @@ + +$FreeBSD$ + +--- conf/nginx.conf.orig Wed Oct 20 14:46:31 2004 ++++ conf/nginx.conf Thu Oct 21 19:47:18 2004 +@@ -12,7 +12,7 @@ + + + http { +- include conf/mime.types; ++ include mime.types; + default_type application/octet-stream; + + sendfile on; +@@ -20,7 +20,7 @@ + #gzip on; + + server { +- listen 80; ++ listen %%HTTP_PORT%%; + + charset on; + source_charset koi8-r; +@@ -28,7 +28,7 @@ + #access_log logs/access.log; + + location / { +- root html; ++ root %%PREFIX%%/www/nginx; + index index.html index.htm; + } + diff --git a/www/nginx/pkg-descr b/www/nginx/pkg-descr new file mode 100644 index 000000000000..c2bc5e717dab --- /dev/null +++ b/www/nginx/pkg-descr @@ -0,0 +1,5 @@ +Another one small and robust www server, supports +kqueue (EV_CLEAR, EV_DISABLE, NOTE_LOWAT, EV_EOF, etc.), +select, poll, sendfile. + +WWW: http://sysoev.ru/nginx/ diff --git a/www/nginx/pkg-plist b/www/nginx/pkg-plist new file mode 100644 index 000000000000..4e4b4e625352 --- /dev/null +++ b/www/nginx/pkg-plist @@ -0,0 +1,16 @@ +@comment $FreeBSD$ +@unexec if cmp -s %D/etc/nginx/mime.types %D/etc/nginx/mime.types-dist; then rm -f %D/etc/nginx/mime.types; fi +etc/nginx/mime.types-dist +@exec [ -f %B/mime.types ] || cp %B/%f %B/mime.types +@unexec if cmp -s %D/etc/nginx/nginx.conf %D/etc/nginx/nginx.conf-dist; then rm -f %D/etc/nginx/nginx.conf; fi +etc/nginx/nginx.conf-dist +@exec [ -f %B/nginx.conf ] || cp %B/%f %B/nginx.conf +@unexec rmdir $D/etc/nginx 2>/dev/null || true +@exec mkdir -p -m 755 www/nginx-dist +@comment @unexec chmod u+w www/nginx-dist +www/nginx-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING +@exec [ -d %D/www/nginx/ ] || ln -fs %B %D/www/nginx +www/nginx-dist/index.html +@exec chmod a-w www/nginx-dist +@unexec if [ -L %D/www/nginx ]; then rm -f %D/www/nginx; fi +@dirrm www/nginx-dist |