μHAL (v2.8.19)
Part of the IPbus software repository
Loading...
Searching...
No Matches
setupTemplate.py
Go to the documentation of this file.
2import os, sys
3from setuptools import setup
4from os import walk
5from 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
20scripts_base_dir = join(_package_build_dir, 'scripts')
21scripts_map = dict((path, [join(path, f) for f in files]) for (path, _, files) in walk(scripts_base_dir) if len(files) > 0)
22scripts_map = dict((join(_install_dir, 'bin', _project, relpath(path, scripts_base_dir)), scripts_map[path]) for path in scripts_map)
23
24etc_base_dir = join(_package_build_dir, 'etc')
25etc_map = dict((path, [join(path, f) for f in files]) for (path, _, files) in walk(etc_base_dir) if len(files) > 0)
26etc_map = dict((join(_install_dir, 'etc', relpath(path, etc_base_dir)), etc_map[path]) for path in etc_map)
27
28data_files = [(k, scripts_map[k]) for k in scripts_map]
29data_files += [(k, etc_map[k]) for k in etc_map]
30
31
32setup(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 zip_safe=False,
44 package_data = dict((pkg,['*.so']) for pkg in _packages)
45 )
46
Definition: pytypes.h:1694
size_t len(handle h)
Get the length of a Python object.
Definition: pytypes.h:2002
Definition: setup.py:1