ports/72830: new port: www/nginx

Dmitry Morozovsky marck at FreeBSD.org
Mon Oct 18 17:00:47 UTC 2004


>Number:         72830
>Category:       ports
>Synopsis:       new port: www/nginx
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 18 17:00:46 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Morozovsky
>Release:        FreeBSD 4-STABLE i386
>Organization:
Cronyx Plus LLC (RiNet ISP)
>Environment:
System: FreeBSD 4-STABLE 

>Description:

This is port of nginx, lightweight multi-threaded optimized http server

>How-To-Repeat:

N/A

>Fix:

Here is one-line patch for www category Makefile and shar archive of actual
port state.

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/www/Makefile,v
retrieving revision 1.992
diff -u -r1.992 Makefile
--- Makefile	17 Oct 2004 10:54:06 -0000	1.992
+++ Makefile	18 Oct 2004 16:50:35 -0000
@@ -350,6 +350,7 @@
     SUBDIR += netscape48-communicator
     SUBDIR += netscape48-navigator
     SUBDIR += netscape7
+    SUBDIR += nginx
     SUBDIR += notftp
     SUBDIR += npc
     SUBDIR += nscache

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	nginx
#	nginx/Makefile
#	nginx/pkg-descr~
#	nginx/distinfo
#	nginx/pkg-descr
#	nginx/files
#	nginx/files/patch-auto_init
#	nginx/files/patch-conf_nginx.conf
#	nginx/files/nginx.sh
#	nginx/pkg-plist
#
echo c - nginx
mkdir -p nginx > /dev/null 2>&1
echo x - nginx/Makefile
sed 's/^X//' >nginx/Makefile << 'END-of-nginx/Makefile'
X# New ports collection makefile for:	nginx
X# Date created:		17 October 2004
X# Whom:			marck at FreeBSD.org
X#
X# $FreeBSD$
X#
X
XPORTNAME=	nginx
XPORTVERSION=	0.1.1
XCATEGORIES=	www
XMASTER_SITES=	http://sysoev.ru/nginx/
X
XMAINTAINER=	marck at FreeBSD.org
XCOMMENT=	Small and fast multithreaded http server
X
XUSE_RC_SUBR=	yes
X
XLIB_DEPENDS+=	pcre.0:${PORTSDIR}/devel/pcre
X
XCONFDIR?=	etc/nginx
XHTTPDIR?=	www/nginx
X
XPLIST_FILES=	etc/rc.d/nginx.sh ${CONFDIR}/koi-win sbin/nginx \
X		${HTTPDIR}/index.html
XPLIST_DIRS+=	${CONFDIR} ${HTTPDIR}
XPLIST_SUB+=	CONFDIR=${CONFDIR}
XRC_SCRIPTS_SUB=	PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
X
Xdo-configure:
X	cd ${WRKSRC} && ./configure --prefix=${PREFIX} \
X	--conf-path=${CONFDIR}/nginx.conf \
X	--http-log-path=/var/log/nginx-access.log \
X	--error-log-path=/var/log/nginx-error.log \
X	--pid-path=/var/run/nginx.pid
X
Xpre-install:
X	${SED} -e 's,%%CONFDIR%%,'${CONFDIR}',g;s,%%HTTPDIR%%,'${HTTPDIR}',g' \
X		${WRKSRC}/conf/nginx.conf >${WRKDIR}/nginx.conf
X	${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
X		${FILESDIR}/nginx.sh > ${WRKDIR}/nginx.sh
X
Xdo-install:
X	${INSTALL_PROGRAM} ${WRKSRC}/nginx ${PREFIX}/sbin/
X	${MKDIR} ${PREFIX}/${CONFDIR}
X	${INSTALL_DATA} ${WRKSRC}/conf/koi-win ${PREFIX}/${CONFDIR}
X	${INSTALL_DATA} ${WRKSRC}/conf/mime.types \
X		${PREFIX}/${CONFDIR}/mime.types.default
X	[ -f ${PREFIX}/${CONFDIR}/mime.types ] || \
X		${INSTALL_DATA} ${WRKSRC}/conf/mime.types ${PREFIX}/${CONFDIR}
X	${INSTALL_DATA} ${WRKDIR}/nginx.conf \
X		${PREFIX}/${CONFDIR}/nginx.conf.default
X	[ -f ${PREFIX}/${CONFDIR}/nginx.conf ] || \
X		${INSTALL_DATA} ${WRKDIR}/nginx.conf ${PREFIX}/${CONFDIR}
X	${MKDIR} ${PREFIX}/${HTTPDIR}
X	${INSTALL_DATA} ${WRKSRC}/html/index.html ${PREFIX}/${HTTPDIR}
X	${INSTALL_SCRIPT} ${WRKDIR}/nginx.sh ${PREFIX}/etc/rc.d
X
X.include <bsd.port.mk>
END-of-nginx/Makefile
echo x - nginx/pkg-descr~
sed 's/^X//' >nginx/pkg-descr~ << 'END-of-nginx/pkg-descr~'
Xnginx (Engine X) is highly optimized multi-threaded multi-platform http server
X
X... (to be filled)
X
XWWW: http://sysoev.ru/nginx/
END-of-nginx/pkg-descr~
echo x - nginx/distinfo
sed 's/^X//' >nginx/distinfo << 'END-of-nginx/distinfo'
XMD5 (nginx-0.1.1.tar.gz) = 1e5c16e2cf6ca5d977c4f3d5dc8ff803
XSIZE (nginx-0.1.1.tar.gz) = 224533
END-of-nginx/distinfo
echo x - nginx/pkg-descr
sed 's/^X//' >nginx/pkg-descr << 'END-of-nginx/pkg-descr'
Xnginx (Engine X) is highly optimized multi-threaded multi-platform http server
X
Xnginx supports kqueue and NOTE_LOWAT under FreeBSD, so if could be used as
Xa very efficient reverse proxy frontend for huge dynamic site without
Xrequiring enormous resources from underlying site.
X
X
XWWW: http://sysoev.ru/nginx/
END-of-nginx/pkg-descr
echo c - nginx/files
mkdir -p nginx/files > /dev/null 2>&1
echo x - nginx/files/patch-auto_init
sed 's/^X//' >nginx/files/patch-auto_init << 'END-of-nginx/files/patch-auto_init'
X--- auto/init.orig	Tue Oct  5 16:54:00 2004
X+++ auto/init	Mon Oct 18 13:27:44 2004
X@@ -43,6 +43,8 @@
X 
X     cat << END > Makefile
X 
X+all:	build
X+
X build:
X 	\$(MAKE) -f $OBJS/Makefile
X 
END-of-nginx/files/patch-auto_init
echo x - nginx/files/patch-conf_nginx.conf
sed 's/^X//' >nginx/files/patch-conf_nginx.conf << 'END-of-nginx/files/patch-conf_nginx.conf'
X
X$FreeBSD$
X
X--- conf/nginx.conf.orig
X+++ conf/nginx.conf
X@@ -1,5 +1,5 @@
X 
X-user  nobody;
X+user  www;
X worker_processes  3;
X 
X #error_log  logs/error.log;
X@@ -12,7 +12,7 @@
X 
X 
X http {
X-    include       conf/mime.types;
X+    include       %%CONFDIR%%/mime.types;
X     default_type  application/octet-stream;
X 
X     sendfile  on;
X@@ -28,7 +28,7 @@
X         #access_log  logs/access.log;
X 
X         location / {
X-            root   html;
X+            root   %%HTTPDIR%%;
X             index  index.html index.htm;
X         }
X 
END-of-nginx/files/patch-conf_nginx.conf
echo x - nginx/files/nginx.sh
sed 's/^X//' >nginx/files/nginx.sh << 'END-of-nginx/files/nginx.sh'
X#!/bin/sh
X# $FreeBSD$
X
X# PROVIDE: nginx
X# REQUIRE: DAEMON
X# BEFORE: LOGIN
X# KEYWORD: FreeBSD shutdown
X
X# Define these nginx_* variables in one of these files:
X#       /etc/rc.conf
X#       /etc/rc.conf.local
X#       /etc/rc.conf.d/nginx
X#
X# DO NOT CHANGE THESE DEFAULT VALUES HERE
X#
Xnginx_enable=${nginx_enable-"NO"}
Xnginx_flags=${nginx_flags-""}
Xnginx_pidfile=${nginx_pidfile-"/var/run/nginx.pid"}
X
X. %%RC_SUBR%%
X
Xname="nginx"
Xrcvar=`set_rcvar`
Xcommand="%%PREFIX%%/sbin/nginx"
X
Xload_rc_config $name
X
Xpidfile="${nginx_pidfile}"
X
Xstart_cmd="echo \"Starting ${name}.\"; /usr/bin/limits -U www ${command} ${nginx_flags} ${command_args}"
X
Xrun_rc_command "$1"
END-of-nginx/files/nginx.sh
echo x - nginx/pkg-plist
sed 's/^X//' >nginx/pkg-plist << 'END-of-nginx/pkg-plist'
X at unexec if cmp -s %D/%%CONFDIR%%/mime.types %D/%%CONFDIR%%/mime.types.default; then rm -f %D/%%CONFDIR%%/mime.types; fi
X%%CONFDIR%%/mime.types.default
X at exec [ -f %B/mime.types ] || cp %B/%f %B/mime.types
X at unexec if cmp -s %D/%%CONFDIR%%/nginx.conf %D/%%CONFDIR%%/nginx.conf.default; then rm -f %D/%%CONFDIR%%/nginx.conf; fi
X%%CONFDIR%%/nginx.conf.default
X at exec [ -f %B/nginx.conf ] || cp %B/%f %B/nginx.conf
END-of-nginx/pkg-plist
exit

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list