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>
This commit is contained in:
Gene Czarcinski 2013-04-17 08:25:07 -04:00 committed by Cole Robinson
parent 2b298aa424
commit ad3f69e12d
3 changed files with 18 additions and 2 deletions

1
.gitignore vendored
View File

@ -21,4 +21,5 @@ virt-installc
/man/virt-convert.1
/man/virt-image.5
/virt-manager.spec
/virtcli/cli.cfg

View File

@ -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,

View File

@ -20,7 +20,7 @@
# End local config
%define _version 0.9.4
%define _version @VERSION@
%define _release 1