diff options
author | Scott Moser <smoser@ubuntu.com> | 2014-09-10 15:06:51 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-09-10 15:06:51 -0400 |
commit | 0ea631a556522060f5075496adbac5f5637e7597 (patch) | |
tree | ec363e83bd7ab44b61a19c96209a9123749c459c /setup.py | |
parent | 6386accbf4933ecb368d2f32b7db95583e03b525 (diff) | |
parent | 67f198ceb6dfeb82b2d3f78955d21d09d43fa7db (diff) | |
download | vyos-cloud-init-0ea631a556522060f5075496adbac5f5637e7597.tar.gz vyos-cloud-init-0ea631a556522060f5075496adbac5f5637e7597.zip |
merge from trunk
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 27 |
1 files changed, 18 insertions, 9 deletions
@@ -46,7 +46,7 @@ def tiny_p(cmd, capture=True): sp = subprocess.Popen(cmd, stdout=stdout, stderr=stderr, stdin=None) (out, err) = sp.communicate() - ret = sp.returncode # pylint: disable=E1101 + ret = sp.returncode if ret not in [0]: raise RuntimeError("Failed running %s [rc=%s] (%s, %s)" % (cmd, ret, out, err)) @@ -63,18 +63,28 @@ def systemd_unitdir(): INITSYS_FILES = { 'sysvinit': [f for f in glob('sysvinit/redhat/*') if is_f(f)], + 'sysvinit_freebsd': [f for f in glob('sysvinit/freebsd/*') if is_f(f)], 'sysvinit_deb': [f for f in glob('sysvinit/debian/*') if is_f(f)], 'systemd': [f for f in glob('systemd/*') if is_f(f)], 'upstart': [f for f in glob('upstart/*') if is_f(f)], } INITSYS_ROOTS = { 'sysvinit': '/etc/rc.d/init.d', + 'sysvinit_freebsd': '/usr/local/etc/rc.d', 'sysvinit_deb': '/etc/init.d', 'systemd': systemd_unitdir(), 'upstart': '/etc/init/', } INITSYS_TYPES = sorted(list(INITSYS_ROOTS.keys())) +# Install everything in the right location and take care of Linux (default) and +# FreeBSD systems. +USR = "/usr" +ETC = "/etc" +if os.uname()[0] == 'FreeBSD': + USR = "/usr/local" + ETC = "/usr/local/etc" + def get_version(): cmd = ['tools/read-version'] @@ -136,18 +146,17 @@ setuptools.setup(name='cloud-init', 'tools/cloud-init-per', ], license='GPLv3', - data_files=[('/etc/cloud', glob('config/*.cfg')), - ('/etc/cloud/cloud.cfg.d', glob('config/cloud.cfg.d/*')), - ('/etc/cloud/templates', glob('templates/*')), - ('/usr/share/cloud-init', []), - ('/usr/lib/cloud-init', + data_files=[(ETC + '/cloud', glob('config/*.cfg')), + (ETC + '/cloud/cloud.cfg.d', glob('config/cloud.cfg.d/*')), + (ETC + '/cloud/templates', glob('templates/*')), + (USR + '/lib/cloud-init', ['tools/uncloud-init', 'tools/write-ssh-key-fingerprints']), - ('/usr/share/doc/cloud-init', + (USR + '/share/doc/cloud-init', [f for f in glob('doc/*') if is_f(f)]), - ('/usr/share/doc/cloud-init/examples', + (USR + '/share/doc/cloud-init/examples', [f for f in glob('doc/examples/*') if is_f(f)]), - ('/usr/share/doc/cloud-init/examples/seed', + (USR + '/share/doc/cloud-init/examples/seed', [f for f in glob('doc/examples/seed/*') if is_f(f)]), ], install_requires=read_requires(), |