summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorHarm Weites <harm@weites.com>2014-08-10 11:50:19 +0000
committerHarm Weites <harm@weites.com>2014-08-10 11:50:19 +0000
commit833ebcba6ca333183284d1f9a0fe5f53df802712 (patch)
tree1e2fb2785dc489bcd63b47d7318fc2e01803ae34 /setup.py
parentde0e832b51624603664eab189a083e612554125a (diff)
downloadvyos-cloud-init-833ebcba6ca333183284d1f9a0fe5f53df802712.tar.gz
vyos-cloud-init-833ebcba6ca333183284d1f9a0fe5f53df802712.zip
change: Install everything in the right location on both Linux (which
ofcourse already was good) and FreeBSD (which realy likes /usr/local for this).
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py51
1 files changed, 37 insertions, 14 deletions
diff --git a/setup.py b/setup.py
index 7b061824..b09c0456 100755
--- a/setup.py
+++ b/setup.py
@@ -90,6 +90,42 @@ def read_requires():
return str(deps).splitlines()
+# Install everything in the right location and take care of Linux (default) and
+# FreeBSD systems.
+def read_datafiles():
+ sysname = os.uname()[0]
+ if sysname == 'FreeBSD':
+ return [
+ ('/usr/local/etc/cloud', glob('config/*.cfg')),
+ ('/usr/local/etc/cloud/cloud.cfg.d', glob('config/cloud.cfg.d/*')),
+ ('/usr/local/etc/cloud/templates', glob('templates/*')),
+ ('/usr/local/share/cloud-init', []),
+ ('/usr/local/lib/cloud-init',
+ ['tools/uncloud-init', 'tools/write-ssh-key-fingerprints']),
+ ('/usr/local/share/doc/cloud-init',
+ [f for f in glob('doc/*') if is_f(f)]),
+ ('/usr/local/share/doc/cloud-init/examples',
+ [f for f in glob('doc/examples/*') if is_f(f)]),
+ ('/usr/local/share/doc/cloud-init/examples/seed',
+ [f for f in glob('doc/examples/seed/*') if is_f(f)]),
+ ]
+ else:
+ return [
+ ('/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',
+ ['tools/uncloud-init', 'tools/write-ssh-key-fingerprints']),
+ ('/usr/share/doc/cloud-init',
+ [f for f in glob('doc/*') if is_f(f)]),
+ ('/usr/share/doc/cloud-init/examples',
+ [f for f in glob('doc/examples/*') if is_f(f)]),
+ ('/usr/share/doc/cloud-init/examples/seed',
+ [f for f in glob('doc/examples/seed/*') if is_f(f)]),
+ ]
+
+
# TODO: Is there a better way to do this??
class InitsysInstallData(install):
init_system = None
@@ -138,20 +174,7 @@ 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',
- ['tools/uncloud-init',
- 'tools/write-ssh-key-fingerprints']),
- ('/usr/share/doc/cloud-init',
- [f for f in glob('doc/*') if is_f(f)]),
- ('/usr/share/doc/cloud-init/examples',
- [f for f in glob('doc/examples/*') if is_f(f)]),
- ('/usr/share/doc/cloud-init/examples/seed',
- [f for f in glob('doc/examples/seed/*') if is_f(f)]),
- ],
+ data_files=read_datafiles(),
install_requires=read_requires(),
cmdclass={
# Use a subclass for install that handles