-
Notifications
You must be signed in to change notification settings - Fork 60
/
setup.py
78 lines (64 loc) · 2.29 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env python3
# ELBE - Debian Based Embedded Rootfilesystem Builder
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2013-2014, 2017-2018 Linutronix GmbH
import os
import subprocess
from setuptools import setup
from setuptools.command.install import install
from elbepack.version import elbe_version
def abspath(path):
""" method to determine absolute path
for a relative path inside project's directory."""
return os.path.abspath(
os.path.join(
os.path.dirname(__file__), path))
class my_install(install):
def run(self):
install.run(self)
if self.root:
envvars = dict({'prefix': self.prefix,
'DESTDIR': self.root},
**dict(os.environ))
else:
envvars = dict({'prefix': self.prefix}, **dict(os.environ))
docs_dir = abspath('./docs/')
output = subprocess.Popen('make install',
shell=True,
stdout=subprocess.PIPE,
cwd=docs_dir,
env=envvars).communicate()[0]
print(output)
setup(name='elbe',
version=elbe_version,
description='RootFS builder',
author='Linutronix GmbH',
author_email='info@linutronix.de',
url='http://elbe-rfs.org/',
packages=['elbepack',
'elbepack.commands',
'elbepack.daemons',
'elbepack.daemons.soap',
'elbepack.init',
'elbepack.schema',
'elbevalidate',
],
package_data={'elbepack': ['makofiles/*.mako',
'init/*.mako',
'init/*.xml',
'default-preseed.xml',
'schema/dbsfed.xsd',
'schema/xml.xsd']},
entry_points={
'console_scripts': [
'elbe=elbepack.main:main',
],
},
cmdclass={'install': my_install},
install_requires=['lxml',
'Mako',
'passlib',
'pycdlib',
'python-debian',
'suds-community']
)