2013-03-17 05:32:29 +04:00
#!/usr/bin/env python
2014-01-20 20:09:13 +04:00
# Copyright (C) 2013, 2014 Red Hat, Inc.
2013-03-17 05:32:29 +04:00
2013-04-11 00:02:28 +04:00
# pylint: disable=W0201
# Attribute defined outside __init__: custom commands require breaking this
2013-04-17 23:14:52 +04:00
import datetime
2013-03-17 05:32:29 +04:00
import glob
2013-04-04 03:07:42 +04:00
import fnmatch
2013-03-17 05:32:29 +04:00
import os
2013-03-18 02:18:22 +04:00
import sys
import unittest
2013-03-17 05:32:29 +04:00
from distutils . core import Command , setup
2013-04-19 00:51:44 +04:00
from distutils . command . build import build
2013-04-11 01:25:39 +04:00
from distutils . command . install import install
2013-03-17 05:32:29 +04:00
from distutils . command . install_egg_info import install_egg_info
2013-04-19 00:51:44 +04:00
from distutils . command . sdist import sdist
2013-04-11 01:25:39 +04:00
from distutils . sysconfig import get_config_var
sysprefix = get_config_var ( " prefix " )
2013-03-17 05:32:29 +04:00
from virtcli import cliconfig
2013-04-04 03:07:42 +04:00
def _generate_potfiles_in ( ) :
def find ( dirname , ext ) :
ret = [ ]
2013-04-12 16:26:21 +04:00
for root , ignore , filenames in os . walk ( dirname ) :
2013-04-04 03:07:42 +04:00
for filename in fnmatch . filter ( filenames , ext ) :
ret . append ( os . path . join ( root , filename ) )
ret . sort ( key = lambda s : s . lower ( ) )
return ret
2013-04-19 00:03:43 +04:00
scripts = [ " virt-manager " , " virt-install " ,
2014-01-19 19:37:14 +04:00
" virt-clone " , " virt-image " , " virt-convert " , " virt-xml " ]
2013-04-04 03:07:42 +04:00
potfiles = " \n " . join ( scripts ) + " \n \n "
potfiles + = " \n " . join ( find ( " virtManager " , " *.py " ) ) + " \n \n "
potfiles + = " \n " . join ( find ( " virtcli " , " *.py " ) ) + " \n \n "
potfiles + = " \n " . join ( find ( " virtconv " , " *.py " ) ) + " \n \n "
potfiles + = " \n " . join ( find ( " virtinst " , " *.py " ) ) + " \n \n "
potfiles + = " \n " . join ( [ " [type: gettext/glade] " + f for
f in find ( " ui " , " *.ui " ) ] )
return potfiles
2013-04-19 00:51:44 +04:00
class my_build_i18n ( build ) :
2013-03-17 05:32:29 +04:00
"""
Add our desktop files to the list , saves us having to track setup . cfg
"""
2013-04-19 00:51:44 +04:00
user_options = [
( ' merge-po ' , ' m ' , ' merge po files against template ' ) ,
]
2013-03-17 05:32:29 +04:00
2013-04-19 00:51:44 +04:00
def initialize_options ( self ) :
self . merge_po = False
def finalize_options ( self ) :
pass
2013-03-17 05:32:29 +04:00
2013-04-04 03:07:42 +04:00
def run ( self ) :
potfiles = _generate_potfiles_in ( )
potpath = " po/POTFILES.in "
try :
print " Writing %s " % potpath
file ( potpath , " w " ) . write ( potfiles )
2013-04-19 00:51:44 +04:00
self . _run ( )
2013-04-04 03:07:42 +04:00
finally :
print " Removing %s " % potpath
os . unlink ( potpath )
2013-04-19 00:51:44 +04:00
def _run ( self ) :
# Borrowed from python-distutils-extra
desktop_files = [
( " share/applications " , [ " data/virt-manager.desktop.in " ] ) ,
2013-09-24 04:40:43 +04:00
( " share/appdata " , [ " data/virt-manager.appdata.xml " ] ) ,
2013-04-19 00:51:44 +04:00
]
po_dir = " po "
# Update po(t) files and print a report
# We have to change the working dir to the po dir for intltool
cmd = [ " intltool-update " ,
( self . merge_po and " -r " or " -p " ) , " -g " , " virt-manager " ]
wd = os . getcwd ( )
os . chdir ( " po " )
self . spawn ( cmd )
os . chdir ( wd )
max_po_mtime = 0
for po_file in glob . glob ( " %s /*.po " % po_dir ) :
lang = os . path . basename ( po_file [ : - 3 ] )
mo_dir = os . path . join ( " build " , " mo " , lang , " LC_MESSAGES " )
mo_file = os . path . join ( mo_dir , " virt-manager.mo " )
if not os . path . exists ( mo_dir ) :
os . makedirs ( mo_dir )
cmd = [ " msgfmt " , po_file , " -o " , mo_file ]
po_mtime = os . path . getmtime ( po_file )
mo_mtime = ( os . path . exists ( mo_file ) and
os . path . getmtime ( mo_file ) ) or 0
if po_mtime > max_po_mtime :
max_po_mtime = po_mtime
if po_mtime > mo_mtime :
self . spawn ( cmd )
targetpath = os . path . join ( " share/locale " , lang , " LC_MESSAGES " )
self . distribution . data_files . append ( ( targetpath , ( mo_file , ) ) )
# merge .in with translation
for ( file_set , switch ) in [ ( desktop_files , " -d " ) ] :
for ( target , files ) in file_set :
build_target = os . path . join ( " build " , target )
if not os . path . exists ( build_target ) :
os . makedirs ( build_target )
files_merged = [ ]
for f in files :
if f . endswith ( " .in " ) :
file_merged = os . path . basename ( f [ : - 3 ] )
else :
file_merged = os . path . basename ( f )
file_merged = os . path . join ( build_target , file_merged )
cmd = [ " intltool-merge " , switch , po_dir , f ,
file_merged ]
mtime_merged = ( os . path . exists ( file_merged ) and
os . path . getmtime ( file_merged ) ) or 0
mtime_file = os . path . getmtime ( f )
if ( mtime_merged < max_po_mtime or
mtime_merged < mtime_file ) :
# Only build if output is older than input (.po,.in)
self . spawn ( cmd )
files_merged . append ( file_merged )
self . distribution . data_files . append ( ( target , files_merged ) )
class my_build ( build ) :
2013-03-17 05:32:29 +04:00
"""
Create simple shell wrappers for / usr / bin / tools to point to / usr / share
Compile . pod file
"""
2013-03-18 03:32:19 +04:00
def _make_bin_wrappers ( self ) :
cmds = [ " virt-manager " , " virt-install " , " virt-clone " ,
2014-01-19 19:37:14 +04:00
" virt-image " , " virt-convert " , " virt-xml " ]
2013-03-17 05:32:29 +04:00
2013-03-18 03:32:19 +04:00
if not os . path . exists ( " build " ) :
os . mkdir ( " build " )
2013-03-17 05:32:29 +04:00
for app in cmds :
2013-04-11 01:34:52 +04:00
sharepath = os . path . join ( cliconfig . install_asset_dir , app )
2013-03-17 05:32:29 +04:00
wrapper = " #!/bin/sh \n \n "
2013-03-18 03:32:19 +04:00
wrapper + = " exec \" %s \" \" $@ \" " % ( sharepath )
newpath = os . path . abspath ( os . path . join ( " build " , app ) )
print " Generating %s " % newpath
file ( newpath , " w " ) . write ( wrapper )
def _make_man_pages ( self ) :
for path in glob . glob ( " man/*.pod " ) :
base = os . path . basename ( path )
mantype = " 1 "
newbase = base
if base == " virt-image-xml.pod " :
mantype = " 5 "
newbase = " virt-image.pod "
2013-08-19 00:04:54 +04:00
appname = os . path . splitext ( newbase ) [ 0 ]
2013-03-18 03:32:19 +04:00
newpath = os . path . join ( os . path . dirname ( path ) ,
2013-08-19 00:04:54 +04:00
appname + " . " + mantype )
2013-03-18 03:32:19 +04:00
print " Generating %s " % newpath
2013-08-19 00:04:54 +04:00
ret = os . system ( ' pod2man '
2013-03-18 03:32:19 +04:00
' --center " Virtual Machine Manager " '
2013-08-19 00:04:54 +04:00
' --release %s --name %s '
' < %s > %s ' % ( cliconfig . __version__ ,
appname . upper ( ) ,
path , newpath ) )
2013-03-18 03:32:19 +04:00
if ret != 0 :
raise RuntimeError ( " Generating ' %s ' failed. " % newpath )
if os . system ( " grep -IRq ' Hey! ' man/ " ) == 0 :
raise RuntimeError ( " man pages have errors in them! "
" (grep for ' Hey! ' ) " )
2013-04-19 00:51:44 +04:00
def _build_icons ( self ) :
for size in glob . glob ( os . path . join ( " data/icons " , " * " ) ) :
2013-03-17 05:32:29 +04:00
for category in glob . glob ( os . path . join ( size , " * " ) ) :
icons = [ ]
2013-04-13 22:34:52 +04:00
for icon in glob . glob ( os . path . join ( category , " * " ) ) :
2013-04-19 00:51:44 +04:00
icons . append ( icon )
2013-03-17 05:32:29 +04:00
if not icons :
continue
category = os . path . basename ( category )
dest = ( " share/icons/hicolor/ %s / %s " %
( os . path . basename ( size ) , category ) )
if category != " apps " :
dest = dest . replace ( " share/ " , " share/virt-manager/ " )
2013-04-19 00:51:44 +04:00
self . distribution . data_files . append ( ( dest , icons ) )
def run ( self ) :
self . _make_bin_wrappers ( )
self . _make_man_pages ( )
self . _build_icons ( )
self . run_command ( " build_i18n " )
build . run ( self )
2013-03-17 05:32:29 +04:00
class my_egg_info ( install_egg_info ) :
"""
Disable egg_info installation , seems pointless for a non - library
"""
def run ( self ) :
pass
2013-04-11 01:25:39 +04:00
class my_install ( install ) :
"""
Error if we weren ' t ' configure ' d with the correct install prefix
"""
def finalize_options ( self ) :
if self . prefix is None :
if cliconfig . prefix != sysprefix :
print " Using prefix from ' configure ' : %s " % cliconfig . prefix
self . prefix = cliconfig . prefix
elif self . prefix != cliconfig . prefix :
print ( " Install prefix= %s doesn ' t match configure prefix= %s \n "
" Pass matching --prefix to ' setup.py configure ' " %
( self . prefix , cliconfig . prefix ) )
sys . exit ( 1 )
install . finalize_options ( self )
2013-04-17 04:44:16 +04:00
2013-04-19 00:51:44 +04:00
class my_sdist ( sdist ) :
2013-04-27 00:45:19 +04:00
user_options = sdist . user_options + [
2013-04-19 00:51:44 +04:00
( " snapshot " , " s " , " add snapshot id to version " ) ,
]
2013-04-17 04:44:16 +04:00
2013-04-17 16:25:07 +04:00
description = " Update virt-manager.spec; build sdist-tarball. "
2013-04-17 04:44:16 +04:00
def initialize_options ( self ) :
self . snapshot = None
2013-04-19 00:51:44 +04:00
sdist . initialize_options ( self )
2013-04-17 04:44:16 +04:00
def finalize_options ( self ) :
if self . snapshot is not None :
self . snapshot = 1
cliconfig . __snapshot__ = 1
2013-04-19 00:51:44 +04:00
sdist . finalize_options ( self )
2013-04-17 04:44:16 +04:00
2013-04-17 16:25:07 +04:00
def run ( self ) :
2013-04-17 23:14:52 +04:00
# Note: cliconfig.__snapshot__ by default is 0, it can be set to 1 by
# either sdist or rpm and then the snapshot suffix is appended.
2013-04-17 16:25:07 +04:00
ver = cliconfig . __version__
2013-04-17 04:44:16 +04:00
if cliconfig . __snapshot__ == 1 :
2013-04-17 23:14:52 +04:00
ver = ver + ' . ' + datetime . date . today ( ) . isoformat ( ) . replace ( ' - ' , ' ' )
2013-04-17 04:44:16 +04:00
cliconfig . __version__ = ver
2013-04-17 23:14:52 +04:00
2013-04-17 04:44:16 +04:00
setattr ( self . distribution . metadata , ' version ' , ver )
2013-04-17 16:25:07 +04:00
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 ( )
2013-04-17 23:14:52 +04:00
2013-04-19 00:51:44 +04:00
sdist . run ( self )
2013-04-17 16:25:07 +04:00
2013-04-11 01:25:39 +04:00
2013-03-17 05:32:29 +04:00
###################
# Custom commands #
###################
class my_rpm ( Command ) :
2013-04-17 23:14:52 +04:00
user_options = [ ( " snapshot " , " s " , " add snapshot id to version " ) ]
2013-04-17 04:44:16 +04:00
description = " Build src and noarch rpms. "
2013-03-17 05:32:29 +04:00
def initialize_options ( self ) :
2013-04-17 04:44:16 +04:00
self . snapshot = None
2013-04-11 01:25:39 +04:00
2013-03-17 05:32:29 +04:00
def finalize_options ( self ) :
2013-04-17 04:44:16 +04:00
if self . snapshot is not None :
self . snapshot = 1
cliconfig . __snapshot__ = 1
2013-03-17 05:32:29 +04:00
def run ( self ) :
"""
Run sdist , then ' rpmbuild ' the tar . gz
"""
self . run_command ( ' sdist ' )
2013-04-17 04:44:16 +04:00
os . system ( ' rpmbuild -ta --clean dist/virt-manager- %s .tar.gz ' %
2013-03-17 05:32:29 +04:00
cliconfig . __version__ )
class configure ( Command ) :
user_options = [
2013-04-11 01:25:39 +04:00
( " prefix= " , None , " installation prefix " ) ,
2013-10-03 02:50:01 +04:00
( " pkgversion= " , None , " user specified version-id " ) ,
2013-03-17 05:32:29 +04:00
( " qemu-user= " , None ,
" user libvirt uses to launch qemu processes (default=root) " ) ,
( " libvirt-package-names= " , None ,
" list of libvirt distro packages virt-manager will check for on "
" first run. comma separated string (default=none) " ) ,
( " kvm-package-names= " , None ,
" recommended kvm packages virt-manager will check for on first run "
" (default=none) " ) ,
( " askpass-package-names= " , None ,
" name of your distro ' s askpass package(s) (default=none) " ) ,
( " preferred-distros= " , None ,
" Distros to list first in the New VM wizard (default=none) " ) ,
2014-01-20 20:09:13 +04:00
( " stable-defaults " , None ,
" Hide config bits that are not considered stable (default=no) " ) ,
2013-03-17 05:32:29 +04:00
( " default-graphics= " , None ,
2013-05-28 02:51:12 +04:00
" Default graphics type (spice or vnc) (default=spice) " ) ,
2013-03-17 05:32:29 +04:00
]
description = " Configure the build, similar to ./configure "
def finalize_options ( self ) :
pass
def initialize_options ( self ) :
2013-04-11 01:25:39 +04:00
self . prefix = sysprefix
2013-10-03 02:50:01 +04:00
self . pkgversion = None
self . qemu_user = None
self . libvirt_package_names = None
self . kvm_package_names = None
self . askpass_package_names = None
self . preferred_distros = None
2014-01-20 20:09:13 +04:00
self . stable_defaults = None
2013-10-03 02:50:01 +04:00
self . default_graphics = None
2013-03-17 05:32:29 +04:00
def run ( self ) :
template = " "
template + = " [config] \n "
2013-04-11 01:25:39 +04:00
template + = " prefix = %s \n " % self . prefix
2013-10-03 02:50:01 +04:00
if self . pkgversion is not None :
template + = " pkgversion = %s \n " % self . pkgversion
if self . qemu_user is not None :
template + = " default_qemu_user = %s \n " % self . qemu_user
if self . libvirt_package_names is not None :
template + = " libvirt_packages = %s \n " % self . libvirt_package_names
if self . kvm_package_names is not None :
template + = " hv_packages = %s \n " % self . kvm_package_names
if self . askpass_package_names is not None :
template + = " askpass_packages = %s \n " % self . askpass_package_names
if self . preferred_distros is not None :
template + = " preferred_distros = %s \n " % self . preferred_distros
2014-01-20 20:09:13 +04:00
if self . stable_defaults is not None :
template + = ( " stable_defaults = %s \n " %
self . stable_defaults )
2013-10-03 02:50:01 +04:00
if self . default_graphics is not None :
template + = " default_graphics = %s \n " % self . default_graphics
2013-03-17 05:32:29 +04:00
file ( cliconfig . cfgpath , " w " ) . write ( template )
print " Generated %s " % cliconfig . cfgpath
2013-03-18 02:18:22 +04:00
class TestBaseCommand ( Command ) :
2013-07-03 01:37:45 +04:00
user_options = [
( ' debug ' , ' d ' , ' Show debug output ' ) ,
2013-07-14 00:32:46 +04:00
( ' coverage ' , ' c ' , ' Show coverage report ' ) ,
( " only= " , None ,
" Run only testcases whose name contains the passed string " ) ,
2013-07-03 01:37:45 +04:00
]
2013-03-18 02:18:22 +04:00
def initialize_options ( self ) :
self . debug = 0
2013-07-03 01:37:45 +04:00
self . coverage = 0
2013-07-14 00:32:46 +04:00
self . only = None
2013-03-18 02:18:22 +04:00
self . _testfiles = [ ]
self . _dir = os . getcwd ( )
def finalize_options ( self ) :
if self . debug and " DEBUG_TESTS " not in os . environ :
os . environ [ " DEBUG_TESTS " ] = " 1 "
def run ( self ) :
try :
import coverage
2013-07-03 01:37:45 +04:00
use_cov = True
2013-03-18 02:18:22 +04:00
except :
2013-07-03 01:37:45 +04:00
use_cov = False
2014-01-08 13:09:57 +04:00
cov = None
2013-07-03 01:37:45 +04:00
if use_cov :
omit = [ " /usr/* " , " /*/tests/* " ]
cov = coverage . coverage ( omit = omit )
cov . erase ( )
cov . start ( )
import tests as testsmodule
testsmodule . cov = cov
2013-03-18 02:18:22 +04:00
if hasattr ( unittest , " installHandler " ) :
try :
unittest . installHandler ( )
except :
print " installHandler hack failed "
2013-07-14 00:32:46 +04:00
tests = unittest . TestLoader ( ) . loadTestsFromNames ( self . _testfiles )
if self . only :
newtests = [ ]
for suite1 in tests :
for suite2 in suite1 :
for testcase in suite2 :
if self . only in str ( testcase ) :
newtests . append ( testcase )
if not newtests :
print " --only didn ' t find any tests "
sys . exit ( 1 )
tests = unittest . TestSuite ( newtests )
print " Running only: "
for test in newtests :
print " %s " % test
print
t = unittest . TextTestRunner ( verbosity = 1 )
2013-03-18 02:18:22 +04:00
try :
result = t . run ( tests )
except KeyboardInterrupt :
sys . exit ( 1 )
2013-07-03 01:37:45 +04:00
if use_cov :
cov . stop ( )
cov . save ( )
err = int ( bool ( len ( result . failures ) > 0 or
len ( result . errors ) > 0 ) )
if not err and use_cov and self . coverage :
cov . report ( show_missing = False )
sys . exit ( err )
2013-03-18 02:18:22 +04:00
class TestCommand ( TestBaseCommand ) :
description = " Runs a quick unit test suite "
2013-07-14 00:32:46 +04:00
user_options = TestBaseCommand . user_options + [
( " testfile= " , None , " Specific test file to run (e.g "
" validation, storage, ...) " ) ,
( " skipcli " , None , " Skip CLI tests " ) ,
]
2013-03-18 02:18:22 +04:00
def initialize_options ( self ) :
TestBaseCommand . initialize_options ( self )
self . testfile = None
self . skipcli = None
def finalize_options ( self ) :
TestBaseCommand . finalize_options ( self )
def run ( self ) :
'''
Finds all the tests modules in tests / , and runs them .
'''
testfiles = [ ]
for t in glob . glob ( os . path . join ( self . _dir , ' tests ' , ' *.py ' ) ) :
if ( t . endswith ( " __init__.py " ) or
2013-09-28 22:42:37 +04:00
t . endswith ( " test_urls.py " ) or
t . endswith ( " test_inject.py " ) ) :
2013-03-18 02:18:22 +04:00
continue
base = os . path . basename ( t )
if self . testfile :
check = os . path . basename ( self . testfile )
if base != check and base != ( check + " .py " ) :
continue
if self . skipcli and base . count ( " clitest " ) :
continue
testfiles . append ( ' . ' . join ( [ ' tests ' , os . path . splitext ( base ) [ 0 ] ] ) )
if not testfiles :
raise RuntimeError ( " --testfile didn ' t catch anything " )
self . _testfiles = testfiles
TestBaseCommand . run ( self )
class TestURLFetch ( TestBaseCommand ) :
description = " Test fetching kernels and isos from various distro trees "
2013-09-26 19:49:16 +04:00
user_options = TestBaseCommand . user_options + [
( " path= " , None , " Paths to local iso or directory or check "
" for installable distro. Comma separated " ) ,
]
2013-03-18 02:18:22 +04:00
def initialize_options ( self ) :
TestBaseCommand . initialize_options ( self )
self . path = " "
def finalize_options ( self ) :
TestBaseCommand . finalize_options ( self )
origpath = str ( self . path )
if not origpath :
self . path = [ ]
else :
self . path = origpath . split ( " , " )
def run ( self ) :
2013-09-26 02:52:41 +04:00
self . _testfiles = [ " tests.test_urls " ]
2013-03-18 02:18:22 +04:00
if self . path :
2013-09-27 02:32:50 +04:00
import tests
tests . URLTEST_LOCAL_MEDIA + = self . path
2013-03-18 02:18:22 +04:00
TestBaseCommand . run ( self )
2013-09-28 22:42:37 +04:00
class TestInitrdInject ( TestBaseCommand ) :
description = " Test initrd inject with real kernels, fetched from URLs "
user_options = TestBaseCommand . user_options + [
( " distro= " , None , " Comma separated list of distros to test, from "
" the tests internal URL dictionary. " )
]
def initialize_options ( self ) :
TestBaseCommand . initialize_options ( self )
self . distro = " "
def finalize_options ( self ) :
TestBaseCommand . finalize_options ( self )
orig = str ( self . distro )
if not orig :
self . distro = [ ]
else :
self . distro = orig . split ( " , " )
def run ( self ) :
self . _testfiles = [ " tests.test_inject " ]
if self . distro :
import tests
tests . INITRD_TEST_DISTROS + = self . distro
TestBaseCommand . run ( self )
2013-04-11 00:02:28 +04:00
class CheckPylint ( Command ) :
user_options = [ ]
description = " Check code using pylint and pep8 "
def initialize_options ( self ) :
pass
def finalize_options ( self ) :
pass
def run ( self ) :
files = [ " setup.py " , " virt-install " , " virt-clone " , " virt-image " ,
2014-01-19 19:37:14 +04:00
" virt-convert " , " virt-xml " , " virt-manager " ,
2013-04-11 00:02:28 +04:00
" virtcli " , " virtinst " , " virtconv " , " virtManager " ,
2013-04-19 00:03:43 +04:00
" tests " ]
2013-04-11 00:02:28 +04:00
output_format = sys . stdout . isatty ( ) and " colorized " or " text "
cmd = " pylint "
cmd + = " --output-format= %s " % output_format
cmd + = " " . join ( files )
2013-04-13 22:01:20 +04:00
os . system ( cmd + " --rcfile tests/pylint.cfg " )
2013-04-11 00:02:28 +04:00
2013-04-13 22:34:52 +04:00
print " running pep8 "
cmd = " pep8 "
cmd + = " " . join ( files )
os . system ( cmd + " --config tests/pep8.cfg " )
2013-04-11 00:02:28 +04:00
2013-03-17 05:32:29 +04:00
setup (
2013-04-13 22:34:52 +04:00
name = " virt-manager " ,
version = cliconfig . __version__ ,
author = " Cole Robinson " ,
author_email = " virt-tools-list@redhat.com " ,
url = " http://virt-manager.org " ,
license = " GPLv2+ " ,
2013-03-17 05:32:29 +04:00
2013-03-18 03:32:19 +04:00
# These wrappers are generated in our custom build command
2013-04-13 22:34:52 +04:00
scripts = ( [
2013-03-18 03:32:19 +04:00
" build/virt-manager " ,
" build/virt-clone " ,
" build/virt-install " ,
" build/virt-image " ,
2014-01-19 19:37:14 +04:00
" build/virt-convert " ,
" build/virt-xml " ] ) ,
2013-03-17 05:32:29 +04:00
2013-04-13 22:34:52 +04:00
data_files = [
2013-03-18 03:32:19 +04:00
( " share/virt-manager/ " , [
" virt-manager " ,
" virt-install " ,
" virt-clone " ,
" virt-image " ,
" virt-convert " ,
2014-01-19 19:37:14 +04:00
" virt-xml " ,
2013-03-18 03:32:19 +04:00
] ) ,
2013-04-18 01:39:25 +04:00
( " share/glib-2.0/schemas " ,
[ " data/org.virt-manager.virt-manager.gschema.xml " ] ) ,
2013-03-17 05:32:29 +04:00
( " share/virt-manager/ui " , glob . glob ( " ui/*.ui " ) ) ,
2013-03-18 03:32:19 +04:00
( " share/man/man1 " , [
" man/virt-manager.1 " ,
" man/virt-install.1 " ,
" man/virt-clone.1 " ,
" man/virt-image.1 " ,
2014-01-19 19:37:14 +04:00
" man/virt-convert.1 " ,
" man/virt-xml.1 "
2013-03-18 03:32:19 +04:00
] ) ,
( " share/man/man5 " , [ " man/virt-image.5 " ] ) ,
2013-03-17 05:32:29 +04:00
( " share/virt-manager/virtManager " , glob . glob ( " virtManager/*.py " ) ) ,
2013-03-18 03:32:19 +04:00
2013-04-11 01:13:02 +04:00
( " share/virt-manager/virtcli " ,
2013-04-14 20:51:22 +04:00
glob . glob ( " virtcli/*.py " ) + glob . glob ( " virtcli/cli.cfg " ) ) ,
2013-03-18 03:32:19 +04:00
( " share/virt-manager/virtinst " , glob . glob ( " virtinst/*.py " ) ) ,
( " share/virt-manager/virtconv " , glob . glob ( " virtconv/*.py " ) ) ,
( " share/virt-manager/virtconv/parsers " ,
glob . glob ( " virtconv/parsers/*.py " ) ) ,
2013-04-19 00:03:43 +04:00
] ,
2013-03-17 05:32:29 +04:00
2013-04-13 22:34:52 +04:00
cmdclass = {
2013-03-17 05:32:29 +04:00
' build ' : my_build ,
' build_i18n ' : my_build_i18n ,
2013-04-11 01:25:39 +04:00
2013-04-17 16:25:07 +04:00
' sdist ' : my_sdist ,
2013-04-11 01:25:39 +04:00
' install ' : my_install ,
2013-03-17 05:32:29 +04:00
' install_egg_info ' : my_egg_info ,
' configure ' : configure ,
2013-04-11 00:02:28 +04:00
' pylint ' : CheckPylint ,
2013-03-17 05:32:29 +04:00
' rpm ' : my_rpm ,
2013-03-18 02:18:22 +04:00
' test ' : TestCommand ,
' test_urls ' : TestURLFetch ,
2013-09-28 22:42:37 +04:00
' test_initrd_inject ' : TestInitrdInject ,
2013-03-17 05:32:29 +04:00
}
)