ports/154211: Update port: www/cherokee

Diego Schulz dschulz at gmail.com
Fri Jan 21 20:10:09 UTC 2011


>Number:         154211
>Category:       ports
>Synopsis:       Update port: www/cherokee
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 21 20:10:08 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Diego Schulz
>Release:        
>Organization:
>Environment:
>Description:
The attached patch updates the www/cherokee port from upstream version 1.0.15 to 1.0.18.

The port now takes care of the creating a directory for RRD databases needed if Cherokee is installed with RRDtool support.
It also contains a patch to allow the cherokee-admin program to correctly gather memory usage on 8.x systems. The patch alters the admin/SystemStats.py file, and hopefully will be accepted for next upstream release. 

To apply the patch:

cd $PORTSDIR/www/cherokee && patch -p0 < /path/to/the/attached/patch.txt

Thanks!

diego
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN cherokee/Makefile cherokee-new/Makefile
--- cherokee/Makefile	2011-01-12 11:29:43.000000000 -0300
+++ cherokee-new/Makefile	2011-01-19 22:06:31.000000000 -0300
@@ -2,11 +2,11 @@
 # Date created:			01 Jun 2002
 # Whom:				silence <oksala at videotron.ca>
 #
-# $FreeBSD: ports/www/cherokee/Makefile,v 1.92 2011/01/06 00:54:06 wen Exp $
+# $FreeBSD: ports/www/cherokee/Makefile,v 1.91 2010/12/09 06:24:40 wen Exp $
 #
 
 PORTNAME=	cherokee
-PORTVERSION=	1.0.15
+PORTVERSION=	1.0.18
 CATEGORIES=	www
 MASTER_SITES=	http://www.cherokee-project.com/download/1.0/${PORTVERSION}/ \
 		http://cherokee.osuosl.org/1.0/${PORTVERSION}/ \
@@ -73,6 +73,9 @@
 CHEROKEE_LOGFILE_USER=	root
 CHEROKEE_LOGFILE_GROUP=	wheel
 
+# Directory where to put RRD files, by default
+CHEROKEE_RRDDIR=/var/lib/cherokee/graphs
+
 CONFIGURE_ARGS=	--with-wwwroot=${PREFIX}/www/cherokee \
 		--localstatedir=${CHEROKEE_VARDIR} \
 		--disable-static
@@ -237,8 +240,13 @@
 	     CHEROKEE_LOGFILE_GROUP=${CHEROKEE_LOGFILE_GROUP} \
 	     CHEROKEE_ERRORLOG=${CHEROKEE_ERRORLOG} \
 	     CHEROKEE_ACCESSLOG=${CHEROKEE_ACCESSLOG} \
+	     CHEROKEE_WITH_RRDTOOL=${WITH_RRDTOOL} \
+	     CHEROKEE_RRDDIR=${CHEROKEE_RRDDIR} \
+	     CHEROKEE_RRDDIR_USER=${CHEROKEE_USER} \
+	     CHEROKEE_RRDDIR_GROUP=${CHEROKEE_GROUP} \
 	     ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
 
+
 	@${ECHO_MSG} "==============================================================="
 	@${CAT} ${PKGMESSAGE}
 	@${ECHO_MSG} "==============================================================="
diff -ruN cherokee/distinfo cherokee-new/distinfo
--- cherokee/distinfo	2011-01-12 11:29:43.000000000 -0300
+++ cherokee-new/distinfo	2011-01-19 22:08:22.000000000 -0300
@@ -1,2 +1,2 @@
-SHA256 (cherokee-1.0.15.tar.gz) = 014ff6ddf5491c2289cab135c28a8c69955ef2c0cd8a60531cd6bc4f4918c3eb
-SIZE (cherokee-1.0.15.tar.gz) = 5827351
+SHA256 (cherokee-1.0.18.tar.gz) = 8bedf485ffbfa0a915a5714532186d8bd2b7b4a7cc5a2197bc9f026c68fd1a2c
+SIZE (cherokee-1.0.18.tar.gz) = 5841896
diff -ruN cherokee/files/patch-admin-systemstats.py.diff cherokee-new/files/patch-admin-systemstats.py.diff
--- cherokee/files/patch-admin-systemstats.py.diff	1969-12-31 20:00:00.000000000 -0400
+++ cherokee-new/files/patch-admin-systemstats.py.diff	2011-01-21 16:46:52.000000000 -0300
@@ -0,0 +1,34 @@
+--- admin/SystemStats.py	2011-01-14 12:07:33.000000000 -0300
++++ admin/SystemStats.py-new	2011-01-21 16:44:01.000000000 -0300
+@@ -5,7 +5,7 @@
+ # Authors:
+ #      Alvaro Lopez Ortega <alvaro at alobbs.com>
+ #
+-# Copyright (C) 2001-2011 Alvaro Lopez Ortega
++# Copyright (C) 2001-2010 Alvaro Lopez Ortega
+ #
+ # This program is free software; you can redistribute it and/or
+ # modify it under the terms of version 2 of the GNU General Public
+@@ -331,7 +331,7 @@
+ 
+     def _read_cpu_and_mem_info (self):
+         # Execute sysctl
+-        ret = popen.popen_sync ("/sbin/sysctl hw.ncpu hw.clockrate kern.threads.virtual_cpu hw.pagesize vm.stats.vm.v_page_count")
++        ret = popen.popen_sync ("/sbin/sysctl -i hw.ncpu hw.clockrate kern.smp.cpus hw.pagesize vm.stats.vm.v_page_count")
+         lines = filter (lambda x: x, ret['stdout'].split('\n'))
+ 
+         # Parse output
+@@ -349,10 +349,11 @@
+ 	    parts = line.split()
+ 	    if parts[0] == 'hw.ncpu:':
+ 		ncpus = int(parts[1])
++		vcpus = int(parts[1])
+             elif parts[0] == 'hw.clockrate:':
+ 		clock = parts[1]
+-            elif parts[0] == 'kern.threads.virtual_cpu:':
+-		vcpus = parts[1]
++            elif parts[0] == 'kern.smp.cpus:':
++	  	vcpus = parts[1]
+             elif parts[0] == 'vm.stats.vm.v_page_count:':
+ 		pcount = int(parts[1])
+             elif parts[0] == 'hw.pagesize:':
diff -ruN cherokee/files/pkg-install.in cherokee-new/files/pkg-install.in
--- cherokee/files/pkg-install.in	2010-11-25 11:00:15.000000000 -0300
+++ cherokee-new/files/pkg-install.in	2011-01-12 15:54:22.000000000 -0300
@@ -3,31 +3,51 @@
 PATH=/bin:/usr/bin:/usr/sbin
 
 
-C_ACCESSLOG=${CHEROKEE_ACCESSLOG:-/var/log/cherokee.access}
-C_ERRORLOG=${CHEROKEE_ERRORLOG:-/var/log/cherokee.error}
-C_USER=${CHEROKEE_LOGFILE_USER:-root}
-C_GROUP=${CHEROKEE_LOGFILE_GROUP:-wheel}
-C_FILEMODE=${CHEROKEE_LOGFILE_FILEMODE:-0640}
+ACCESSLOG=${CHEROKEE_ACCESSLOG:-/var/log/cherokee.access}
+ERRORLOG=${CHEROKEE_ERRORLOG:-/var/log/cherokee.error}
+LOGS_USER=${CHEROKEE_LOGFILE_USER:-root}
+LOGS_GROUP=${CHEROKEE_LOGFILE_GROUP:-wheel}
+LOGS_FILEMODE=${CHEROKEE_LOGFILE_FILEMODE:-0640}
+
+WITH_RRDTOOL=${CHEROKEE_WITH_RRDTOOL:-n}
+RRDDIR=${CHEROKEE_RRDDIR:-/var/lib/cherokee/graphs}
+RRDDIR_USER=${CHEROKEE_RRDDIR_USER:-www}
+RRDDIR_GROUP=${CHEROKEE_RRDDIR_GROUP:-www}
+
 
 case $2 in
 
 POST-INSTALL)
-        echo "$2 for $1" 
-	echo "Adjusting ownership (${C_USER}:${C_GROUP}) and permissions (${C_FILEMODE}) on log files:"
-        echo "${C_ACCESSLOG}"
-        echo "${C_ERRORLOG}"
+        
+	echo "$2 for $1" 
+	echo "Adjusting ownership (${LOGS_USER}:${LOGS_GROUP}) and permissions (${LOGS_FILEMODE}) on log files:"
+        echo "${ACCESSLOG}"
+        echo "${ERRORLOG}"
 
-	if [ ! -f  ${C_ACCESSLOG} ]; then
-		touch ${C_ACCESSLOG}
+	if [ ! -f  ${ACCESSLOG} ]; then
+		touch ${ACCESSLOG}
         fi
 
-	if [ ! -f  ${C_ERRORLOG} ]; then
-		touch ${C_ERRORLOG}
+	if [ ! -f  ${ERRORLOG} ]; then
+		touch ${ERRORLOG}
         fi
 
-	chown ${C_USER}:${C_GROUP} ${C_ACCESSLOG} ${C_ERRORLOG}
-	chmod ${C_FILEMODE} ${C_ACCESSLOG} ${C_ERRORLOG}
-	
+	chown -v ${LOGS_USER}:${LOGS_GROUP} ${ACCESSLOG} ${ERRORLOG}
+	chmod -v ${LOGS_FILEMODE} ${ACCESSLOG} ${ERRORLOG}
+
+        if [ "$WITH_RRDTOOL" = "true" ]; then	
+	        if [ -d ${RRDDIR} ]; then
+	            echo "RRD directory already exists."
+		else
+	            echo "Creating directory for RRD databases..."
+		    mkdir -v -p ${RRDDIR} 
+		fi
+
+	        echo "Adjusting ownership..."
+	        chown -v ${RRDDIR_USER}:${RRDDIR_GROUP} ${RRDDIR} 
+	fi
+
+	echo "$2 done."
 	;;
 
 
diff -ruN cherokee/pkg-plist cherokee-new/pkg-plist
--- cherokee/pkg-plist	2011-01-12 11:29:43.000000000 -0300
+++ cherokee-new/pkg-plist	2011-01-12 15:45:44.000000000 -0300
@@ -910,6 +910,7 @@
 %%ADMIN%%%%DATADIR%%/admin/static/images/wizards/wordpress.png
 %%ADMIN%%%%DATADIR%%/admin/static/images/wizards/zend.png
 %%ADMIN%%%%DATADIR%%/admin/static/js/SelectionPanel.js
+%%ADMIN%%%%DATADIR%%/admin/static/help_404.html
 %%ADMIN%%%%DATADIR%%/admin/theme.html
 %%ADMIN%%%%DATADIR%%/admin/upgrade_config.py
 %%ADMIN%%%%DATADIR%%/admin/upgrade_config.pyc


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



More information about the freebsd-ports-bugs mailing list