moving the shell files out to where they belong
[plstackapi.git] / setup.py
1 import os
2 import shutil 
3 from distutils.core import setup
4
5 def copytree(src, dst, symlinks=False, ignore=None):
6     if not os.path.exists(dst):
7         os.makedirs(dst)
8     for item in os.listdir(src):
9         s = os.path.join(src, item)
10         d = os.path.join(dst, item)
11         if os.path.isdir(s):
12             copytree(s, d, symlinks, ignore)
13         else:
14             if not os.path.exists(d) or os.stat(src).st_mtime - os.stat(dst).st_mtime > 1:
15                 shutil.copy2(s, d)
16
17 setup(name='planetstack',
18       version='0.1',
19       description='PlanetStack',
20       scripts=['planetstack/planetstack-backend.py'],
21       data_files=[
22         ('/etc/planetstack/', ['planetstack/plstackapi_config']),
23         ('/lib/systemd/system/', ['planetstack/redhat/planetstack-backend.service']),
24         ])
25
26 copytree('planetstack/', '/opt/planetstack')