Index: build_tools/get_version.py
===================================================================
--- build_tools/get_version.py	(revision bd0a2115827ff1b9f19bba38d5691cbb86987dae)
+++ build_tools/get_version.py	(revision 5709051a16febce00b286288e9681dc40db38534)
@@ -3,28 +3,15 @@
 __version__ = "0.0.0"
     
-def get_svn_revision(path=None):
-    rev = None
-    if path is None:
-        path = os.path.dirname(__file__)
-    entries_path = '%s/.svn/entries' % path
+import subprocess
 
-    if os.path.exists(entries_path):
-        entries = open(entries_path, 'r').read()
-        # Versions >= 7 of the entries file are flat text.  The first line is
-        # the version number. The next set of digits after 'dir' is the revision.
-        if re.match('(\d+)', entries):
-            rev_match = re.search('\d+\s+dir\s+(\d+)', entries)
-            if rev_match:
-                rev = rev_match.groups()[0]
-        # Older XML versions of the file specify revision as an attribute of
-        # the first entries node.
-        else:
-            from xml.dom import minidom
-            dom = minidom.parse(entries_path)
-            rev = dom.getElementsByTagName('entry')[0].getAttribute('revision')
-
-    if rev:
-        return u'%s' % rev
-    return None
+def get_svn_revision():
+    p = subprocess.Popen("svnversion", shell=True, \
+       stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    (stdout, stderr) = p.communicate()
+    try:
+        rev = int(stdout.strip())
+        return str(rev)
+    except:
+        return __revision__
 
 # Get the version number from the sansview module
@@ -46,3 +33,3 @@
 
 
-print "SasView v ", __version__, __revision__
+print "SasView v", __version__, __revision__
Index: build_tools/jenkins_rhel6_build.sh
===================================================================
--- build_tools/jenkins_rhel6_build.sh	(revision 5709051a16febce00b286288e9681dc40db38534)
+++ build_tools/jenkins_rhel6_build.sh	(revision 5709051a16febce00b286288e9681dc40db38534)
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+# Check envorionment variables set by Jenkins #############################
+if [ -z "$WORKSPACE" ]; then
+	WORKSPACE=`pwd`
+fi
+
+if [ -z "$SVN_REVISION" ]; then
+	SVN_REVISION=''
+fi
+
+export SASVIEW_INSTALL=sasview-install
+
+
+# Set up build environmentRun tests #######################################
+cd $WORKSPACE
+
+#  Check dependencies
+if [ ! -d "utils" ]; then
+    mkdir utils
+fi
+export PYTHONPATH=$PYTHONPATH:$WORKSPACE/utils
+easy_install -d $WORKSPACE/utils unittest-xml-reporting
+easy_install -d $WORKSPACE/utils lxml
+easy_install -d $WORKSPACE/utils pyparsing==1.5.5
+python deps.py
+
+#  Set up working directories
+rm -rf $SASVIEW_INSTALL
+mkdir $SASVIEW_INSTALL
+
+rm -rf $WORKSPACE/dist
+mkdir $WORKSPACE/dist
+
+rm -rf build
+
+
+# Build SasView ###########################################################
+export PYTHONPATH=$PYTHONPATH:$WORKSPACE/$SASVIEW_INSTALL:$WORKSPACE/utils
+python setup.py bdist_egg 
+
+
+# Run tests ###############################################################
+#  Install it locally so we can test it
+cd $WORKSPACE/dist
+easy_install -d ../$SASVIEW_INSTALL sasview*.egg
+
+#  Run tests
+cd $WORKSPACE/test
+python utest_sansview.py
+
+
+# Build RPM ###############################################################
+cd ${HOME}/rpmbuild/SOURCES
+rm -rf *.egg
+cp $WORKSPACE/dist/*.egg .
+
+rm -rf $WORKSPACE/dist/*.rpm
+
+cd ${WORKSPACE}/build_tools/rpm
+python create_rpm_spec.py ${SVN_REVISION}
+cp sansview.spec ${HOME}/rpmbuild/SPECS
+
+cd ${HOME}/rpmbuild/SPECS
+rpmbuild -bb sansview.spec --clean
+cp ${HOME}/rpmbuild/RPMS/x86_64/* ${WORKSPACE}/dist
+
Index: sansview/__init__.py
===================================================================
--- sansview/__init__.py	(revision 5d9b2c0325d9f07213cb07a1dd1b72d65534ed91)
+++ sansview/__init__.py	(revision 5709051a16febce00b286288e9681dc40db38534)
@@ -3,12 +3,13 @@
 try:
     import pkg_resources
-    d = pkg_resources.get_distribution("sansview")
-    rev = int(d.parsed_version[5])
-    __build__ = str(rev)
+    d = pkg_resources.get_distribution("sasview")
+    __build__ = str(d.version)
 except:
     try:
         import os
-        if os.path.isfile("BUILD_NUMBER"):
-            f=open("BUILD_NUMBER",'r')
+        dir = os.path.dirname(__file__)
+        filepath = os.path.join(dir, "BUILD_NUMBER")
+        if os.path.isfile(filepath):
+            f=open(filepath, 'r')
             buff = f.read().strip()
             if len(buff)<50:
Index: setup.py
===================================================================
--- setup.py	(revision cf9b1595d3431643a298f076fa72c6451e9db73c)
+++ setup.py	(revision 5709051a16febce00b286288e9681dc40db38534)
@@ -331,5 +331,5 @@
 #            'wxPython>=2.8.11', 'pil',
 #            'periodictable>=1.3.0', 'scipy>=0.7.2']
-required = ['lxml','periodictable>=1.3.0','pyparsing==1.5.5']
+required = ['lxml','periodictable>=1.3.0','pyparsing<2.0.0']
 
 if os.name=='nt':
