From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Oct 22 16:30:02 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BB8CB905 for ; Mon, 22 Oct 2012 16:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.FreeBSD.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id 9336C8FC12 for ; Mon, 22 Oct 2012 16:30:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9MGU2af073268 for ; Mon, 22 Oct 2012 16:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9MGU2dO073265; Mon, 22 Oct 2012 16:30:02 GMT (envelope-from gnats) Resent-Date: Mon, 22 Oct 2012 16:30:02 GMT Resent-Message-Id: <201210221630.q9MGU2dO073265@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Brad Davis Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B59EF5A6 for ; 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 ; 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 To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/172960: [patch] Clean up defaults to follow our installation layout and explain how to set things up X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Brad Davis List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2012 16:30:02 -0000 >Number: 172960 >Category: ports >Synopsis: [patch] Clean up defaults to follow our installation layout and explain how to set things up >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Mon Oct 22 16:30:02 UTC 2012 >Closed-Date: >Last-Modified: >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 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} + + 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/ + + SetHandler None + + + # 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 + + SetHandler None + + + # The graphite.wsgi file has to be accessible by apache. It won't + # be visible to clients because of the DocumentRoot though. + + Order deny,allow + Allow from all + + + + +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: >Unformatted: