Subject: Don't import pyhoca.wxgui just for the version in setup.py
From: Orion Poplawski <[email-masked]>
To: [email-masked]
Date: Tue, 18 Dec 2012 10:00:49 -0700

Package: pyhoca-gui
Version: 0.2.1.1
Tags: patch

Importing all of pyhoca.wxgui in setup.py causes rpmbuild problems due to 
DISPLAY not being set.  It is overkill as well, causing extra dependencies to 
be installed at build time.  The attached patch fixes.

Something similar can be done for the other python packages as well.

-- 
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder Office                  FAX: 303-415-9702
3380 Mitchell Lane                       [email-masked]
Boulder, CO 80301                   http://www.nwra.com
diff -up pyhoca-gui-0.2.1.1/setup.py.version pyhoca-gui-0.2.1.1/setup.py
--- pyhoca-gui-0.2.1.1/setup.py.version	2012-12-18 05:02:18.000000000 -0700
+++ pyhoca-gui-0.2.1.1/setup.py	2012-12-18 09:56:38.711286882 -0700
@@ -21,11 +21,13 @@
 # import the PyHoca-GUI
 import sys
 import os
-import pyhoca.wxgui
 
 PROGRAM_NAME = 'PyHoca-GUI'
 PROGRAM_DESC = '%s is a cross-platform (Windows, MacOS X, Linux) graphical X2Go client.' % PROGRAM_NAME
-PROGRAM_VERSION = pyhoca.wxgui.__VERSION__
+for line in file(os.path.join('pyhoca', 'wxgui', '__init__.py')).readlines():
+    if (line.startswith('__VERSION__')):
+        exec(line.strip())
+PROGRAM_VERSION = __VERSION__
 PROGRAM_ICON = "pixmaps/pyhoca_x2go-logo-ubuntu.ico"
 LICENSE = 'AGPLv3+'
 AUTHOR = 'Mike Gabriel, Dick Kniep'