From brad@liquidneon.com  Mon Oct 22 16:23:21 2012
Return-Path: <brad@liquidneon.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id B59EF5A6
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Oct 2012 16:23:21 +0000 (UTC)
	(envelope-from brad@liquidneon.com)
Received: from valentine.liquidneon.com (cl-396.dal-01.us.sixxs.net [IPv6:2001:1938:80:18b::2])
	by mx1.freebsd.org (Postfix) with ESMTP id 7E0DC8FC12
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Oct 2012 16:23:21 +0000 (UTC)
Received: by valentine.liquidneon.com (Postfix, from userid 1001)
	id 854A48FF32; Mon, 22 Oct 2012 10:23:13 -0600 (MDT)
Message-Id: <20121022162313.854A48FF32@valentine.liquidneon.com>
Date: Mon, 22 Oct 2012 10:23:13 -0600 (MDT)
From: Brad Davis <brd@FreeBSD.org>
Reply-To: Brad Davis <brd@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] Clean up defaults to follow our installation layout and explain how to set things up
X-Send-Pr-Version: 3.113
X-GNATS-Notify: bsdports@wayfair.com

>Number:         172960
>Category:       ports
>Synopsis:       [patch] www/py-graphite-web: Clean up defaults to follow our installation layout and explain how to set things up
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    crees
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 22 16:30:02 UTC 2012
>Closed-Date:    Tue Nov 06 20:50:35 UTC 2012
>Last-Modified:  Tue Nov 06 20:50:35 UTC 2012
>Originator:     Brad Davis
>Release:        FreeBSD
>Organization:
>Environment:
	
>Description:
	- Clean up the defaults to match our installation layout
	- Add a pkg-message to explain more about how to set things up
>How-To-Repeat:
	
>Fix:

	

--- graphite.patch begins here ---
Index: Makefile
===================================================================
--- Makefile	(revision 305940)
+++ Makefile	(working copy)
@@ -28,5 +28,12 @@
 post-patch:
 	@${MKDIR} ${WRKSRC}/graphite/webapp/
 	@${CP} -LR ${WRKSRC}/webapp/content ${WRKSRC}/graphite/webapp
+	@${RM} ${WRKSRC}/bin/build-index.sh.orig
 
+post-install:
+	@${ECHO} ${PYTHON_SITELIBDIR}
+	${CHOWN} ${WWWOWN} ${PREFIX}/graphite/storage
+	${CHOWN} ${WWWOWN} ${PREFIX}/graphite/storage/log/webapp
+	@${CAT} pkg-message
+
 .include <bsd.port.mk>
Index: files/patch-bin-build-index.sh
===================================================================
--- files/patch-bin-build-index.sh	(revision 0)
+++ files/patch-bin-build-index.sh	(working copy)
@@ -0,0 +1,22 @@
+--- bin/build-index.sh.ori	2012-10-12 18:42:29.000000000 -0600
++++ bin/build-index.sh	2012-10-12 18:43:36.000000000 -0600
+@@ -1,8 +1,8 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ if [ "$GRAPHITE_ROOT" = "" ]
+ then
+-  GRAPHITE_ROOT="/opt/graphite"
++  GRAPHITE_ROOT="/usr/local/graphite"
+ fi
+ 
+ if [ "$GRAPHITE_STORAGE_DIR" = "" ]
+@@ -11,7 +11,7 @@
+ fi
+ 
+ 
+-WHISPER_DIR="${GRAPHITE_STORAGE_DIR}/whisper"
++WHISPER_DIR="/usr/local/storage/whisper"
+ 
+ if [ ! -d "$WHISPER_DIR" ]
+ then

Property changes on: files/patch-bin-build-index.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+FreeBSD=%H
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Index: files/patch-conf-graphite.wsgi.example
===================================================================
--- files/patch-conf-graphite.wsgi.example	(revision 0)
+++ files/patch-conf-graphite.wsgi.example	(working copy)
@@ -0,0 +1,9 @@
+--- conf/graphite.wsgi.example.ori	2012-10-12 19:34:56.000000000 -0600
++++ conf/graphite.wsgi.example	2012-10-12 19:35:07.000000000 -0600
+@@ -1,5 +1,5 @@
+ import os, sys
+-sys.path.append('/opt/graphite/webapp')
++sys.path.append('/usr/local/graphite/webapp')
+ os.environ['DJANGO_SETTINGS_MODULE'] = 'graphite.settings'
+ 
+ import django.core.handlers.wsgi

Property changes on: files/patch-conf-graphite.wsgi.example
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: files/patch-webapp-graphite-local__settings.py.example
===================================================================
--- files/patch-webapp-graphite-local__settings.py.example	(revision 0)
+++ files/patch-webapp-graphite-local__settings.py.example	(working copy)
@@ -0,0 +1,54 @@
+--- webapp/graphite/local_settings.py.example.orig	2012-05-31 00:28:54.000000000 -0600
++++ webapp/graphite/local_settings.py.example	2012-10-12 19:39:54.000000000 -0600
+@@ -44,6 +44,7 @@
+ # Change only GRAPHITE_ROOT if your install is merely shifted from /opt/graphite
+ # to somewhere else
+ #GRAPHITE_ROOT = '/opt/graphite'
++GRAPHITE_ROOT = '/usr/local/graphite'
+ 
+ # Most installs done outside of a separate tree such as /opt/graphite will only
+ # need to change these three settings. Note that the default settings for each
+@@ -51,6 +52,9 @@
+ #CONF_DIR = '/opt/graphite/conf'
+ #STORAGE_DIR = '/opt/graphite/storage'
+ #CONTENT_DIR = '/opt/graphite/webapp/content'
++CONF_DIR = '/usr/local/etc/graphite'
++STORAGE_DIR = '/usr/local/storage'
++CONTENT_DIR = '/usr/local/graphite/webapp/content'
+ 
+ # To further or fully customize the paths, modify the following. Note that the
+ # default settings for each of these are relative to CONF_DIR and STORAGE_DIR
+@@ -58,6 +62,8 @@
+ ## Webapp config files
+ #DASHBOARD_CONF = '/opt/graphite/conf/dashboard.conf'
+ #GRAPHTEMPLATES_CONF = '/opt/graphite/conf/graphTemplates.conf'
++DASHBOARD_CONF = '/usr/local/etc/graphite/dashboard.conf'
++GRAPHTEMPLATES_CONF = '/usr/local/etc/graphite/graphTemplates.conf'
+ 
+ ## Data directories
+ # NOTE: If any directory is unreadable in DATA_DIRS it will break metric browsing
+@@ -66,6 +72,11 @@
+ #DATA_DIRS = [WHISPER_DIR, RRD_DIR] # Default: set from the above variables
+ #LOG_DIR = '/opt/graphite/storage/log/webapp'
+ #INDEX_FILE = '/opt/graphite/storage/index'  # Search index file
++WHISPER_DIR = '/usr/local/storage/whisper'
++RRD_DIR = '/usr/local/graphite/storage/rrd'
++DATA_DIRS = [WHISPER_DIR, RRD_DIR] # Default: set from the above variables
++LOG_DIR = '/usr/local/graphite/storage/log/webapp'
++INDEX_FILE = '/usr/local/graphite/storage/index'  # Search index file
+ 
+ 
+ #####################################
+@@ -156,6 +167,12 @@
+ #DATABASE_PASSWORD = 'graphite-is-awesome'
+ #DATABASE_HOST = 'mysql.mycompany.com'
+ #DATABASE_PORT = '3306'
++DATABASES = {
++	'default': {
++		'NAME': '/usr/local/graphite/storage/graphite.db',
++		'ENGINE': 'django.db.backends.sqlite3',
++	}
++}
+ 
+ 
+ #########################

Property changes on: files/patch-webapp-graphite-local__settings.py.example
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: pkg-message
===================================================================
--- pkg-message	(revision 0)
+++ pkg-message	(working copy)
@@ -0,0 +1,58 @@
+==============================================================================
+
+In /usr/local/etc/graphite/ copy the graphite.wsgi.example to graphite.wsgi
+
+To run graphite, you will need to setup Apache by creating a vhost similar to
+the following:
+
+WSGIImportScript /usr/local/etc/graphite/graphite.wsgi process-group=graphite application-group=%{GLOBAL}
+<VirtualHost *:80>
+	ServerName graphite
+	DocumentRoot "/usr/local/graphite/webapp"
+
+	# I've found that an equal number of processes & threads tends
+	# to show the best performance for Graphite (ymmv).
+	WSGIDaemonProcess graphite processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120
+	WSGIProcessGroup graphite
+	WSGIApplicationGroup %{GLOBAL}
+
+	# XXX You will need to create this file! There is a graphite.wsgi.example
+	# file in this directory that you can safely use, just copy it to graphite.wgsi
+	WSGIScriptAlias / /usr/local/etc/graphite/graphite.wsgi
+
+	Alias /content/ /usr/local/graphite/webapp/content/
+	<Location "/content/">
+		SetHandler None
+	</Location>
+
+	# XXX In order for the django admin site media to work you
+	# must change @DJANGO_ROOT@ to be the path to your django
+	# installation, which is probably something like:
+	# /usr/lib/python2.6/site-packages/django
+	#Alias /media/ "@DJANGO_ROOT@/contrib/admin/media/"
+	Alias /media/ ${${PYTHON_SITELIBDIR}}/django
+	<Location "/media/">
+		SetHandler None
+	</Location>
+
+	# The graphite.wsgi file has to be accessible by apache. It won't
+	# be visible to clients because of the DocumentRoot though.
+	<Directory /usr/local/etc/graphite/>
+		Order deny,allow
+		Allow from all
+	</Directory>
+</VirtualHost>
+
+
+Then initialize the sqllite user database and create the admin user:
+
+	python ${PYTHON_SITELIBDIR}/graphite/manage.py syncdb
+
+Change the ownership of the user database so the webapp can write to it:
+
+	chown ${WWWOWN} ${PREFIX}/graphite/storage/graphite.db
+
+Now you should be able to access the graphite virtual host you created in the
+first step.
+
+==============================================================================

Property changes on: pkg-message
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
--- graphite.patch ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-python 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Oct 25 14:46:50 UTC 2012 
Responsible-Changed-Why:  
freebsd-python@ wants this port PRs (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172960 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Thu Oct 25 14:46:52 UTC 2012 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172960 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: bsdports@wayfair.com
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/172960: [patch] www/py-graphite-web: Clean up defaults to follow our installation layout and explain how to set things up
Date: Thu, 25 Oct 2012 14:46:51 UT

 Maintainer of www/py-graphite-web,
 
 Please note that PR ports/172960 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/172960
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org
Responsible-Changed-From-To: freebsd-python->crees 
Responsible-Changed-By: crees 
Responsible-Changed-When: Mon Oct 29 14:17:37 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172960 
State-Changed-From-To: feedback->closed 
State-Changed-By: crees 
State-Changed-When: Tue Nov 6 20:50:35 UTC 2012 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172960 
>Unformatted:
