10 """Searches defaults.py for the VERSION field and returns it."""
11 defaults
= os
.path
.join(os
.getcwd(), 'ugitlibs', 'defaults.py')
12 file = open(defaults
, 'r')
13 contents
= file.read()
15 for line
in contents
.splitlines():
16 if line
.startswith('VERSION = '):
17 version
= line
.replace('VERSION = ', '')
18 return version
.strip("'")
19 raise Exception("Could not find VERSION field in %s" % defaults
)
21 #############################################################################
24 VERSION
= get_version()
29 #############################################################################
32 opt
.tool_options('python')
33 opt
.tool_options('pyuic4', 'build')
36 #############################################################################
40 env
['PYMODS'] = pymod(env
['PREFIX'])
41 env
['PYMODS_UGIT'] = os
.path
.join(env
['PYMODS'], 'ugitlibs')
42 env
['ICONS'] = os
.path
.join(env
['PREFIX'], 'share', 'ugit', 'icons')
43 env
['BIN'] = os
.path
.join(env
['PREFIX'], 'bin')
45 conf
.check_tool('python')
46 conf
.check_tool('pyuic4', 'build')
47 conf
.check_tool('po2qm', 'build')
49 #############################################################################
52 bld
.add_subdirs('ui ugitlibs')
54 bin
= bld
.create_obj('py')
57 bin
.find_sources_in_dirs('bin')
59 qm
= bld
.create_obj('po2qm')
60 qm
.find_sources_in_dirs('po')
62 for icon
in glob
.glob('icons/*.png'):
63 Common
.install_files('ICONS', '', icon
)
65 Common
.symlink_as('BIN', 'ugit.py', 'ugit')
67 #############################################################################
70 """Returns a lib/python2.x/site-packages path relative to prefix"""
71 api_version
= sys
.version
[:3]
72 python_api
= 'python' + api_version
73 return os
.path
.join(prefix
, 'lib', python_api
, 'site-packages')