Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 May 2008 11:24:19 +0400 (MSD)
From:      Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        osa@FreeBSD.org
Subject:   ports/124123: [patch] update www/nginx to 0.6.31 and enable custom server string
Message-ID:  <20080530072419.E33651AF41F@void.codelabs.ru>
Resent-Message-ID: <200805300730.m4U7U1fn021960@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         124123
>Category:       ports
>Synopsis:       [patch] update www/nginx to 0.6.31 and enable custom server string
>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:   Fri May 30 07:30:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Eygene Ryabinkin
>Release:        FreeBSD 7.0-STABLE i386
>Organization:
Code Labs
>Environment:

System: FreeBSD XXX 7.0-STABLE FreeBSD 7.0-STABLE #16: Tue Mar 18 11:49:55 MSK 2008 root@XXX:/usr/obj/usr/src/sys/XXX i386

>Description:

Igor Sysoev announced at 05.05.2008 that 0.6 branch becomes stable.
So, www/nginx can be upgraded to 0.6.31.  Basically, the first of
provided patches is the www/nginx -> www/nginx-devel and changes
from 0.6.30 to 0.6.31.

Additionally, I had parametrized my old patch that changes server
string to something neutral -- I hate when people know the name
and precise version of software I am running.  Second patch adds
variable NGINX_SERVER_STRING, that will carry new server string.

>How-To-Repeat:

Look at http://sysoev.ru/ and/or http://sysoev.ru/en/

>Fix:

Patch that updates the port:
--- nginx-0.5-to-0.6.31.patch begins here ---
diff -urN ./Makefile ../nginx/Makefile
--- ./Makefile	2008-05-06 12:22:28.000000000 +0400
+++ ../nginx/Makefile	2008-05-30 10:25:46.000000000 +0400
@@ -2,20 +2,22 @@
 # Date created:				11 Oct 2004
 # Whom:					osa
 #
-# $FreeBSD: ports/www/nginx/Makefile,v 1.134 2008/05/04 14:26:12 osa Exp $
+# $FreeBSD: ports/www/nginx-devel/Makefile,v 1.145 2008/04/30 09:10:46 osa Exp $
 #
 
 PORTNAME=	nginx
-PORTVERSION=	0.5.36
+PORTVERSION=	0.6.31
 CATEGORIES=	www
 MASTER_SITES=	http://sysoev.ru/nginx/
 MASTER_SITES+=	${MASTER_SITE_LOCAL}
 MASTER_SITE_SUBDIR=	osa
+PKGNAMESUFFIX=	-devel
 
 MAINTAINER=	osa@FreeBSD.org
 COMMENT=	Robust and small WWW server
 
 OPTIONS=	DEBUG "Enable nginx debugging" off \
+		GOOGLE_PERFTOOLS "Enable google perftools module" off \
 		HTTP_MODULE "Enable HTTP module" on \
 		HTTP_ADDITION_MODULE "Enable http_addition module" off \
 		HTTP_DAV_MODULE "Enable http_webdav module" off \
@@ -64,6 +66,11 @@
 STRIP=		#do not strip if nginx with debug information
 .endif
 
+.if defined(WITH_GOOGLE_PERFTOOLS)
+LIB_DEPENDS+=	profiler.0:${PORTSDIR}/devel/google-perftools
+CONFIGURE_ARGS+=--with-google_perftools_module
+.endif
+
 .if defined(WITH_HTTP_MODULE)
 CONFIGURE_ARGS+=--http-client-body-temp-path=${NGINX_TMPDIR}/client_body_temp \
 		--http-proxy-temp-path=${NGINX_TMPDIR}/proxy_temp \
@@ -105,11 +112,11 @@
 .endif
 
 .if defined(WITHOUT_HTTP_REWRITE_MODULE) || defined(WITHOUT_PCRE)
-PKGNAMESUFFIX+=	-nopcre
+PKGNAMESUFFIX:=	${PKGNAMESUFFIX}-nopcre
 CONFIGURE_ARGS+=--without-http_rewrite_module \
 		--without-pcre
 .else
-LIB_DEPENDS=	pcre.0:${PORTSDIR}/devel/pcre
+LIB_DEPENDS+=	pcre.0:${PORTSDIR}/devel/pcre
 .endif
 
 .if defined(WITH_WWW)
diff -urN ./distinfo ../nginx/distinfo
--- ./distinfo	2008-05-06 12:22:28.000000000 +0400
+++ ../nginx/distinfo	2008-05-30 10:22:30.000000000 +0400
@@ -1,3 +1,3 @@
-MD5 (nginx-0.5.36.tar.gz) = 1b5b6fca369843ac74cf6123a50d4cb1
-SHA256 (nginx-0.5.36.tar.gz) = e14cce500eb341b67a25201d5f92e7b241ba449fd6dca7023d5459ec03db8ad2
-SIZE (nginx-0.5.36.tar.gz) = 489443
+MD5 (nginx-0.6.31.tar.gz) = 824bcc25bbd5b636f182237b69227bd2
+SHA256 (nginx-0.6.31.tar.gz) = e68908705dfc1fb166506ec441291c7bad3b6ddcddb760b166931bfdb5b582a7
+SIZE (nginx-0.6.30.tar.gz) = 520344
diff -urN ./files/nginx.sh.in ../nginx/files/nginx.sh.in
--- ./files/nginx.sh.in	2007-06-19 10:29:22.000000000 +0400
+++ ../nginx/files/nginx.sh.in	2008-05-30 10:20:48.000000000 +0400
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $FreeBSD: ports/www/nginx/files/nginx.sh.in,v 1.3 2007/06/18 07:08:46 osa Exp $
+# $FreeBSD: ports/www/nginx-devel/files/nginx.sh.in,v 1.3 2007/06/18 07:13:27 osa Exp $
 
 # PROVIDE: nginx
 # REQUIRE: DAEMON
diff -urN ./files/patch-conf-nginx.conf ../nginx/files/patch-conf-nginx.conf
--- ./files/patch-conf-nginx.conf	2007-06-14 22:34:02.000000000 +0400
+++ ../nginx/files/patch-conf-nginx.conf	2008-05-30 10:20:48.000000000 +0400
@@ -1,17 +1,8 @@
 
-$FreeBSD: ports/www/nginx/files/patch-conf-nginx.conf,v 1.3 2007/06/14 10:32:32 osa Exp $
+$FreeBSD: ports/www/nginx-devel/files/patch-conf-nginx.conf,v 1.4 2007/08/16 08:56:36 osa Exp $
 
 --- conf/nginx.conf.orig	Thu Jan 18 10:08:18 2007
 +++ conf/nginx.conf	Thu Jun 14 12:57:52 2007
-@@ -15,7 +15,7 @@
- 
- 
- http {
--    include       conf/mime.types;
-+    include       mime.types;
-     default_type  application/octet-stream;
- 
-     #log_format  main  '$remote_addr - $remote_user [$time_gmt] $status '
 @@ -33,7 +33,7 @@
      #gzip  on;
  
diff -urN ./pkg-plist ../nginx/pkg-plist
--- ./pkg-plist	2007-10-11 08:23:40.000000000 +0400
+++ ../nginx/pkg-plist	2008-05-30 10:20:48.000000000 +0400
@@ -1,4 +1,4 @@
-@comment $FreeBSD: ports/www/nginx/pkg-plist,v 1.11 2007/09/19 08:48:24 osa Exp $
+@comment $FreeBSD: ports/www/nginx-devel/pkg-plist,v 1.11 2007/09/03 12:19:26 osa Exp $
 %%ETCDIR%%/fastcgi_params
 %%ETCDIR%%/koi-utf
 %%ETCDIR%%/koi-win
--- nginx-0.5-to-0.6.31.patch ends here ---

Patch that adds custom server string:
--- nginx-add_custom_server_string begins here ---
diff -urN ./Makefile ../nginx/Makefile
--- ./Makefile	2008-05-30 10:28:43.000000000 +0400
+++ ../nginx/Makefile	2008-05-30 11:19:30.000000000 +0400
@@ -55,6 +55,10 @@
 		--error-log-path=${NGINX_LOGDIR}/nginx-error.log \
 		--user=${WWWOWN} --group=${WWWGRP}
 
+.if defined(NGINX_SERVER_STRING)
+EXTRA_PATCHES+=	${WRKSRC}/nginx_server_string.patch
+.endif
+
 .if defined(WITHOUT_HTTP_MODULE) && defined(WITHOUT_MAIL_MODULE)
 IGNORE=		requires at least HTTP_MODULE or MAIL_MODULE to \
 		be defined.  Please 'make config' again
@@ -151,6 +155,18 @@
 .include "${PORTSDIR}/Mk/bsd.openssl.mk"
 .endif
 
+.if defined(NGINX_SERVER_STRING)
+pre-patch:
+	@${CP} "${PATCHDIR}/nginx_server_string.patch.in" \
+	    "${WRKSRC}/nginx_server_string.patch"
+	@${REINPLACE_CMD} 's|%%NGINX_SERVER_STRING%%|${NGINX_SERVER_STRING}|' \
+	    "${WRKSRC}/nginx_server_string.patch"
+.else
+pre-patch:
+	@${ECHO_CMD} "    If you want to override the default server string,"
+	@${ECHO_CMD} "    set NGINX_SERVER_STRING to the desired value and rebuild the port."
+.endif
+
 PLIST_SUB+=	NGINX_TMPDIR=${NGINX_TMPDIR} WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
 
 post-patch:
diff -urN ./files/nginx_server_string.patch.in ../nginx/files/nginx_server_string.patch.in
--- ./files/nginx_server_string.patch.in	1970-01-01 03:00:00.000000000 +0300
+++ ../nginx/files/nginx_server_string.patch.in	2008-05-30 10:44:40.000000000 +0400
@@ -0,0 +1,13 @@
+--- src/http/ngx_http_header_filter_module.c.orig	2008-01-05 18:27:51.000000000 +0300
++++ src/http/ngx_http_header_filter_module.c	2008-01-05 18:28:26.000000000 +0300
+@@ -45,8 +45,8 @@
+ };
+ 
+ 
+-static char ngx_http_server_string[] = "Server: nginx" CRLF;
+-static char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF;
++static char ngx_http_server_string[] = "Server: %%NGINX_SERVER_STRING%%" CRLF;
++static char ngx_http_server_full_string[] = "Server: %%NGINX_SERVER_STRING%%" CRLF;
+ 
+ 
+ static ngx_str_t ngx_http_status_lines[] = {
--- nginx-add_custom_server_string ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080530072419.E33651AF41F>