mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-22 13:34:07 +03:00
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:
parent
2b298aa424
commit
ad3f69e12d
1
.gitignore
vendored
1
.gitignore
vendored
@ -21,4 +21,5 @@ virt-installc
|
||||
/man/virt-convert.1
|
||||
/man/virt-image.5
|
||||
|
||||
/virt-manager.spec
|
||||
/virtcli/cli.cfg
|
||||
|
17
setup.py
17
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,
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
# End local config
|
||||
|
||||
|
||||
%define _version 0.9.4
|
||||
%define _version @VERSION@
|
||||
%define _release 1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user