summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorGene Czarcinski <gene@czarc.net>2013-04-17 08:25:07 -0400
committerCole Robinson <crobinso@redhat.com>2013-04-17 15:02:58 -0400
commitad3f69e12d8b16a84199be83c48568695697c692 (patch)
treef8617f00bbda59d6c42161f8ed047b38c48dfb56 /setup.py
parent2b298aa4246a32ee6eae5a7b7a00caa6aea0f2ef (diff)
downloadvirt-manager-ad3f69e12d8b16a84199be83c48568695697c692.tar.gz
automate @VERSION@ in virt-manager.spec
This update renames virt-manager.spec to be virt-manager.spec.in and changes the version-id to @VERSION@ ... setup.py is modified to copy the virt-manager-spec.in file to virt-manager.spec and replace @VERSION@ with the current/actual version id. .gitignore is updated to ignore virt-manager.spec . Signed-off-by: Gene Czarcinski <gene@czarc.net>
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index eecdecf5..f8ad2905 100644
--- a/setup.py
+++ b/setup.py
@@ -10,6 +10,7 @@ import sys
import unittest
from distutils.core import Command, setup
+from distutils.command.sdist import sdist
from distutils.command.install import install
from distutils.command.install_egg_info import install_egg_info
from distutils.sysconfig import get_config_var
@@ -180,6 +181,20 @@ class my_install(install):
install.finalize_options(self)
+class my_sdist(sdist_auto, sdist):
+ user_option = []
+ description = "Update virt-manager.spec; build sdist-tarball."
+
+ def run(self):
+ ver = cliconfig.__version__
+ f1 = open('virt-manager.spec.in', 'r')
+ f2 = open('virt-manager.spec', 'w')
+ for line in f1:
+ f2.write(line.replace('@VERSION@', ver))
+ f1.close()
+ f2.close()
+ sdist.run(self)
+
###################
# Custom commands #
@@ -474,7 +489,7 @@ setup(
'build_i18n': my_build_i18n,
'build_icons': my_build_icons,
- 'sdist': sdist_auto,
+ 'sdist': my_sdist,
'install': my_install,
'install_egg_info': my_egg_info,