μHAL (v2.7.9)
Part of the IPbus software repository
setupTemplate.py
Go to the documentation of this file.
1 
2 import os, sys
3 from distutils.core import setup
4 from os import walk
5 from os.path import join, relpath
6 
7 _rpmVersion='__version__'
8 _name='__packagename__'
9 _author='__author__'
10 _author_email=''
11 _description='__description__'
12 _url='__url__'
13 _packages=__python_packages__
14 _project='__project__'
15 _install_dir='__install_dir__'
16 _package_build_dir='__package_build_dir__'
17 
18 
19 # Find standard data files: scripts
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)
23 
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)
27 
28 data_files = [(k, scripts_map[k]) for k in scripts_map]
29 data_files += [(k, etc_map[k]) for k in etc_map]
30 
31 
32 setup(name=_name,
33  version = _rpmVersion,
34  description = _description,
35  author = _author,
36  author_email = _author_email,
37  url = _url,
38  license = 'GPLv3',
39  data_files = data_files,
40 
41  packages = _packages,
42  package_dir = {'' : ''},
43  package_data = dict((pkg,['*.so']) for pkg in _packages)
44  )
45