diff options
author | Gene Czarcinski <gene@czarc.net> | 2013-04-17 08:25:07 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2013-04-17 15:02:58 -0400 |
commit | ad3f69e12d8b16a84199be83c48568695697c692 (patch) | |
tree | f8617f00bbda59d6c42161f8ed047b38c48dfb56 /setup.py | |
parent | 2b298aa4246a32ee6eae5a7b7a00caa6aea0f2ef (diff) | |
download | virt-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.py | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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, |