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', |
Tony Mack | 9b7a8bd | 2013-06-24 15:08:01 -0400 | [diff] [blame] | 20 | scripts=['planetstack/planetstack-backend.py'], |
Tony Mack | 45ab56b | 2013-03-28 20:17:17 -0400 | [diff] [blame] | 21 | data_files=[ |
Tony Mack | c663d44 | 2013-05-10 16:51:12 -0400 | [diff] [blame] | 22 | ('/etc/planetstack/', ['planetstack/plstackapi_config']), |
Andy Bavier | 1e2c232 | 2013-10-28 15:17:35 -0400 | [diff] [blame] | 23 | ('/lib/systemd/system/', ['planetstack/redhat/planetstack-backend.service']), |
Tony Mack | 45ab56b | 2013-03-28 20:17:17 -0400 | [diff] [blame] | 24 | ]) |
Tony Mack | c663d44 | 2013-05-10 16:51:12 -0400 | [diff] [blame] | 25 | |
Scott Baker | 201ae3f | 2015-02-04 23:35:48 -0800 | [diff] [blame] | 26 | copytree('planetstack/', '/opt/xos') |