Tony Mack | c663d44 | 2013-05-10 16:51:12 -0400 | [diff] [blame] | 1 | import os |
| 2 | import shutil |
Tony Mack | 0d44f86 | 2013-03-26 13:27:37 -0400 | [diff] [blame] | 3 | from distutils.core import setup |
Tony Mack | 0d44f86 | 2013-03-26 13:27:37 -0400 | [diff] [blame] | 4 | |
Tony Mack | c663d44 | 2013-05-10 16:51:12 -0400 | [diff] [blame] | 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', |
Tony Mack | 0d44f86 | 2013-03-26 13:27:37 -0400 | [diff] [blame] | 18 | version='0.1', |
Tony Mack | c663d44 | 2013-05-10 16:51:12 -0400 | [diff] [blame] | 19 | description='PlanetStack', |
Scott Baker | 7ff86d8 | 2015-02-18 22:30:22 -0800 | [diff] [blame] | 20 | scripts=['xos/xos-observer.py'], |
Tony Mack | 45ab56b | 2013-03-28 20:17:17 -0400 | [diff] [blame] | 21 | data_files=[ |
Scott Baker | 7ff86d8 | 2015-02-18 22:30:22 -0800 | [diff] [blame] | 22 | ('/lib/systemd/system/', ['xos/redhat/xos-observer.service']), |
Tony Mack | 45ab56b | 2013-03-28 20:17:17 -0400 | [diff] [blame] | 23 | ]) |
Tony Mack | c663d44 | 2013-05-10 16:51:12 -0400 | [diff] [blame] | 24 | |
Scott Baker | 7ff86d8 | 2015-02-18 22:30:22 -0800 | [diff] [blame] | 25 | copytree('xos/', '/opt/xos') |