ports/172960: [patch] Clean up defaults to follow our installation layout and explain how to set things up
Brad Davis
brd at FreeBSD.org
Mon Oct 22 16:30:02 UTC 2012
>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 <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:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list