forked from Linutronix/elbe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
57 lines (45 loc) · 1.81 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
#!/usr/bin/env python
import subprocess
import os
import glob
from distutils.core import setup
from distutils.command.install import install
from elbepack.version import elbe_version
def abspath(path):
"""A 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='Torben Hohn',
author_email='[email protected]',
url='http://elbe-rfs.org/',
packages=['elbepack', \
'elbepack.commands', 'elbepack.daemons', 'elbepack.daemons.soap', ],
package_data = {'elbepack': ["mako/*.mako", "init/*.mako", "init/*.xml", \
"*.pub", "dbsfed.xsd", "default-preseed.xml", "xsdtoasciidoc.mako"] },
scripts=['elbe'],
cmdclass={"install": my_install},
data_files= [
('/usr/share/doc/elbe-doc/', glob.glob("docs/elbe-schema-reference*")),
('/usr/share/doc/elbe-doc/', glob.glob("docs/elbeoverview-en*")),
('/usr/share/doc/elbe-doc/contrib/linux', glob.glob("contrib/linux/*")),
('/usr/share/doc/elbe-doc/examples', glob.glob("examples/*xml"))],
)