SF.net SVN: gar:[25120] csw/mgar/pkg/lang-python/graphite-web/trunk

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Thu Jun 25 13:20:59 CEST 2015


Revision: 25120
          http://sourceforge.net/p/gar/code/25120
Author:   dmichelsen
Date:     2015-06-25 11:20:59 +0000 (Thu, 25 Jun 2015)
Log Message:
-----------
lang-python/graphite-web/trunk: Build only for Python 2.7, link useful stuff to bin/

Modified Paths:
--------------
    csw/mgar/pkg/lang-python/graphite-web/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/lang-python/graphite-web/trunk/files/httpd-graphite-vhost.conf

Modified: csw/mgar/pkg/lang-python/graphite-web/trunk/Makefile
===================================================================
--- csw/mgar/pkg/lang-python/graphite-web/trunk/Makefile	2015-06-25 10:03:09 UTC (rev 25119)
+++ csw/mgar/pkg/lang-python/graphite-web/trunk/Makefile	2015-06-25 11:20:59 UTC (rev 25120)
@@ -8,8 +8,12 @@
 DESCRIPTION = Enterprise scalable realtime graphing
 
 MASTER_SITES = $(PYPI_MIRROR)
-DISTFILES  = $(DISTNAME).tar.gz
+DISTFILES += $(DISTNAME).tar.gz
+DISTFILES += httpd-graphite-vhost.conf
 
+# This is a new package, don't bother building for 2.6
+MODULATIONS_PYTHON_VERSION = 2_7
+
 PACKAGES += CSWgraphite-web
 SPKG_DESC_CSWgraphite-web = Enterprise scalable realtime graphing
 # PKGFILES is catchall
@@ -34,8 +38,10 @@
 CHECKPKG_OVERRIDES_CSWgraphite-web += surplus-dependency|CSWpy-cairo
 CHECKPKG_OVERRIDES_CSWgraphite-web += surplus-dependency|CSWpy-simplejson
 
+# This is a new package, don't bother building for 2.6
+CHECKPKG_OVERRIDES_CSWgraphite-web += python-package-missing-py26-files
+
 # This is /usr/share/lib/zoneinfo
-CHECKPKG_OVERRIDES_CSWgraphite-web += file-with-bad-content|/usr/share|root/opt/csw/lib/python2.6/site-packages/graphite/thirdparty/pytz/__init__.py
 CHECKPKG_OVERRIDES_CSWgraphite-web += file-with-bad-content|/usr/share|root/opt/csw/lib/python2.7/site-packages/graphite/thirdparty/pytz/__init__.py
 
 # Use upstream naming for main package
@@ -60,37 +66,6 @@
 STORAGEDIR = $(localstatedir)/graphite
 WEBAPPDIR = $(sharedstatedir)/graphite
 
-REINPLACEMENTS += conf
-REINPLACE_MATCH_conf = /opt/graphite/conf
-REINPLACE_WITH_conf = $(CONFDIR)
-REINPLACE_FILES_conf += examples/example-graphite-vhost.conf
-
-REINPLACEMENTS += storage
-REINPLACE_MATCH_storage = /opt/graphite/storage
-REINPLACE_WITH_storage = $(STORAGEDIR)
-REINPLACE_FILES_storage += examples/example-graphite-vhost.conf
-        
-REINPLACEMENTS += webapp
-REINPLACE_MATCH_webapp = /opt/graphite/webapp
-REINPLACE_WITH_webapp = $(WEBAPPDIR)/webapp
-REINPLACE_FILES_webapp += conf/graphite.wsgi.example
-REINPLACE_FILES_webapp += examples/example-graphite-vhost.conf
-
-REINPLACEMENTS += webperms
-REINPLACE_MATCH_webperms = </Directory>
-REINPLACE_WITH_webperms = </Directory>\n        <Directory /opt/csw/share/graphite/webapp>\n                Order deny,allow\n                Allow from all\n        </Directory>
-REINPLACE_FILES_webperms += examples/example-graphite-vhost.conf
-
-REINPLACEMENTS += wsgi
-REINPLACE_MATCH_wsgi = modules/mod_wsgi.so
-REINPLACE_WITH_wsgi = libexec/mod_wsgi-2.7.so
-REINPLACE_FILES_wsgi += examples/example-graphite-vhost.conf
-
-REINPLACEMENTS += noprefix
-REINPLACE_MATCH_noprefix = ^WSGISocketPrefix
-REINPLACE_WITH_noprefix = \#WSGISocketPrefix
-REINPLACE_FILES_noprefix += examples/example-graphite-vhost.conf
-
 # Taken from local_settings.py.example
 # 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
@@ -126,7 +101,6 @@
 PRESERVECONF += $(prefix)/apache2/etc/extra/httpd-graphite-vhost.conf
 
 # TBD: This needs customization of pathes
-PRESERVECONF += /opt/csw/lib/python2.6/site-packages/graphite/local_settings.py
 PRESERVECONF += /opt/csw/lib/python2.7/site-packages/graphite/local_settings.py
 PRESERVECONF += $(foreach C,$(CONFIG_FILES),$(CONFDIR)/$C)
 
@@ -136,14 +110,11 @@
 	-cd $(WORKSRC) && mv setup.cfg setup.cfg.orig
 	@$(MAKECOOKIE)
 
-V2_6 = 2.6
-V2_7 = 2.7
-
 post-install:
-	ginstall -D -m 0644 $(DESTDIR)$(CONFDIR)/examples/example-graphite-vhost.conf $(DESTDIR)$(prefix)/apache2/etc/extra/httpd-graphite-vhost.conf.CSW
+	ginstall -D -m 0644 $(WORKDIR)/httpd-graphite-vhost.conf $(DESTDIR)$(prefix)/apache2/etc/extra/httpd-graphite-vhost.conf.CSW
 	rm -f $(DESTDIR)$(CONFDIR)/examples/example-graphite-vhost.conf	
-	mv $(DESTDIR)/opt/csw/lib/python$(V$(PYTHON_VERSION))/site-packages/graphite/local_settings.py.example \
-	   $(DESTDIR)/opt/csw/lib/python$(V$(PYTHON_VERSION))/site-packages/graphite/local_settings.py.CSW
+	mv $(DESTDIR)/opt/csw/lib/python2.7/site-packages/graphite/local_settings.py.example \
+	   $(DESTDIR)/opt/csw/lib/python2.7/site-packages/graphite/local_settings.py.CSW
 	cd $(DESTDIR)$(CONFDIR)/conf; $(foreach F,$(CONFIG_FILES),mv $F.example $(DESTDIR)$(CONFDIR)/$F.CSW;)
 	rmdir $(DESTDIR)$(CONFDIR)/conf
 	ginstall -d -m 0755 $(DESTDIR)$(WEBAPPDIR)
@@ -152,4 +123,7 @@
 	ginstall -d -m 0755 $(DESTDIR)$(STORAGEDIR)
 	mv $(DESTDIR)$(CONFDIR)/storage/* $(DESTDIR)$(STORAGEDIR)
 	rmdir $(DESTDIR)$(CONFDIR)/storage
+	ln -s ../lib/python2.7/site-packages/graphite/manage.py $(DESTDIR)$(bindir)/graphite-manage
+	cd $(DESTDIR)$(bindir) && mv build-index.sh graphite-build-index
+	cd $(DESTDIR)$(bindir) && mv run-graphite-devel-server.py graphite-run-devel-server
 	@$(MAKECOOKIE)

Added: csw/mgar/pkg/lang-python/graphite-web/trunk/files/httpd-graphite-vhost.conf
===================================================================
--- csw/mgar/pkg/lang-python/graphite-web/trunk/files/httpd-graphite-vhost.conf	                        (rev 0)
+++ csw/mgar/pkg/lang-python/graphite-web/trunk/files/httpd-graphite-vhost.conf	2015-06-25 11:20:59 UTC (rev 25120)
@@ -0,0 +1,64 @@
+# This needs to be in your server's config somewhere, probably
+# the main httpd.conf
+# NameVirtualHost *:80
+
+# This line also needs to be in your server's config.
+# LoadModule wsgi_module modules/mod_wsgi.so
+
+# You need to manually edit this file to fit your needs.
+# This configuration assumes the default installation prefix
+# of /opt/graphite/, if you installed graphite somewhere else
+# you will need to change all the occurances of /opt/graphite/
+# in this file to your chosen install location.
+
+<IfModule !wsgi_module.c>
+    LoadModule wsgi_module libexec/mod_wsgi-2.7.so
+</IfModule>
+
+# XXX You need to set this up!
+# Read http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGISocketPrefix
+#WSGISocketPrefix run/wsgi
+
+<VirtualHost *:80>
+        ServerName graphite
+        DocumentRoot "/opt/csw/share/graphite/webapp"
+        ErrorLog /var/opt/csw/graphite/log/webapp/error.log
+        CustomLog /var/opt/csw/graphite/log/webapp/access.log common
+
+        # 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}
+        WSGIImportScript /etc/opt/csw/graphite/graphite.wsgi process-group=graphite application-group=%{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 / /etc/opt/csw/graphite/graphite.wsgi 
+
+        Alias /content/ /opt/csw/share/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/"
+        <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 /etc/opt/csw/graphite/>
+                Order deny,allow
+                Allow from all
+        </Directory>
+        <Directory /opt/csw/share/graphite/webapp>
+                Order deny,allow
+                Allow from all
+        </Directory>
+
+</VirtualHost>

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list