3 from distutils.core
import setup
5 from os.path
import join, relpath
7 _rpmVersion=
'__version__'
8 _name=
'__packagename__'
11 _description=
'__description__'
13 _packages=__python_packages__
14 _project=
'__project__'
15 _install_dir=
'__install_dir__'
16 _package_build_dir=
'__package_build_dir__'
20 scripts_base_dir = join(_package_build_dir,
'scripts')
21 scripts_map = dict((path, [join(path, f)
for f
in files])
for (path, _, files)
in walk(scripts_base_dir)
if len(files) > 0)
22 scripts_map = dict((join(_install_dir,
'bin', _project, relpath(path, scripts_base_dir)), scripts_map[path])
for path
in scripts_map)
24 etc_base_dir = join(_package_build_dir,
'etc')
25 etc_map = dict((path, [join(path, f)
for f
in files])
for (path, _, files)
in walk(etc_base_dir)
if len(files) > 0)
26 etc_map = dict((join(_install_dir,
'etc', relpath(path, etc_base_dir)), etc_map[path])
for path
in etc_map)
28 data_files = [(k, scripts_map[k])
for k
in scripts_map]
29 data_files += [(k, etc_map[k])
for k
in etc_map]
33 version = _rpmVersion,
34 description = _description,
36 author_email = _author_email,
39 data_files = data_files,
42 package_dir = {
'' :
''},
43 package_data = dict((pkg,[
'*.so'])
for pkg
in _packages)