From 80609cb370b0de3c105c2855733aca86389a450e Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Thu, 10 Jan 2013 22:18:33 +0100 Subject: rteval.spec: Added missing new files (version.py*) These files was added by commit a99fa86133705e63bc7183db7b287d8855c3648d Also added some more tweaks to avoid importing libxml2 and other python modules. These modules might not be available on the build box, and shouldn't be needed when building and packaging rteval. Signed-off-by: David Sommerseth --- setup.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 30ff468..cd8d08f 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,6 @@ from distutils.sysconfig import get_python_lib from distutils.core import setup from os.path import isfile, join import glob, os, shutil, gzip -from rteval import RTEVAL_VERSION # Get PYTHONLIB with no prefix so --prefix installs work. @@ -21,6 +20,12 @@ except OSError, e: raise e shutil.copy('rteval-cmd','dist/rteval') +# Hack to avoid importing libxml2 and a lot of other stuff +# when getting the rteval version. These are modules which +# might not be available on the build box. +shutil.copy('rteval/version.py','dist/__init__.py') +from dist import RTEVAL_VERSION + # Compress the man page, so distutil will only care for the compressed file mangz = gzip.GzipFile('dist/rteval.8.gz', 'w', 9) man = open('doc/rteval.8', 'r') @@ -73,6 +78,9 @@ mean, variance and standard deviation) and a report is generated. # Clean-up from our little hack os.unlink('dist/rteval') os.unlink('dist/rteval.8.gz') +os.unlink('dist/__init__.py') +os.unlink('dist/__init__.pyc') + if distcreated: try: os.rmdir('dist') -- cgit