| 1 | #! /usr/bin/env python |
|---|
| 2 | |
|---|
| 3 | from distutils.core import setup |
|---|
| 4 | from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm |
|---|
| 5 | from distutils.command.install import install as _install |
|---|
| 6 | |
|---|
| 7 | class bdist_rpm(_bdist_rpm): |
|---|
| 8 | def initialize_options(self): |
|---|
| 9 | _bdist_rpm.initialize_options(self) |
|---|
| 10 | #self.config_files = None |
|---|
| 11 | |
|---|
| 12 | def _make_spec_file(self): |
|---|
| 13 | self.config_files = [ |
|---|
| 14 | '/etc/tycoon/tycoon.conf', |
|---|
| 15 | '/etc/tycoon/bank_public_key', |
|---|
| 16 | '/etc/tycoon/defaults/tycoon.conf', |
|---|
| 17 | '/etc/yum.repos.d/tycoon_$distribution_code$.repo', |
|---|
| 18 | ] |
|---|
| 19 | f = _bdist_rpm._make_spec_file(self) |
|---|
| 20 | if self.config_files: |
|---|
| 21 | for cf in self.config_files: |
|---|
| 22 | f.append("%%config %s" % (cf,)) |
|---|
| 23 | f.append("%%attr(444, root, root) /etc/tycoon/defaults/tycoon.conf") |
|---|
| 24 | return f |
|---|
| 25 | |
|---|
| 26 | # Not sure why this is necessary. |
|---|
| 27 | # Something is generating .pyo, but not adding them to INSTALLED_FILES |
|---|
| 28 | # This causes rpmbuild to die. |
|---|
| 29 | class install(_install): |
|---|
| 30 | def initialize_options(self): |
|---|
| 31 | _install.initialize_options(self) |
|---|
| 32 | self.optimize = True |
|---|
| 33 | |
|---|
| 34 | ld = """Tycoon: A Distributed Market-based Resource Allocator |
|---|
| 35 | |
|---|
| 36 | XXX |
|---|
| 37 | """ |
|---|
| 38 | |
|---|
| 39 | classifiers = """\ |
|---|
| 40 | Development Status :: 2 - Pre-Alpha |
|---|
| 41 | Intended Audience :: Developers |
|---|
| 42 | License :: OSI Approved :: GNU General Public License (GPL) |
|---|
| 43 | Programming Language :: Python |
|---|
| 44 | Topic :: Software Development :: Libraries :: Python Modules |
|---|
| 45 | Operating System :: POSIX :: Linux |
|---|
| 46 | """ |
|---|
| 47 | |
|---|
| 48 | setup( |
|---|
| 49 | cmdclass={'bdist_rpm': bdist_rpm, 'install': install}, |
|---|
| 50 | name = "tycoon", |
|---|
| 51 | version = "$tycoon_version$", |
|---|
| 52 | release = "", |
|---|
| 53 | author = "Kevin Lai", |
|---|
| 54 | author_email = "klai@hp.com", |
|---|
| 55 | url = "http://www.hpl.hp.com/personal/Kevin_Lai", |
|---|
| 56 | description = "A distributed resource allocation system", |
|---|
| 57 | long_description = ld, |
|---|
| 58 | license = "GPL", |
|---|
| 59 | #classifiers = filter(None, classifiers.split("\n")), |
|---|
| 60 | package_dir = {"": "src"}, |
|---|
| 61 | packages = ["Tycoon", "Tycoon.Virtualization", "Tycoon.Prediction", |
|---|
| 62 | "Tycoon.Prediction.Distributions", |
|---|
| 63 | "Tycoon.Prediction.Utilities", |
|---|
| 64 | ], |
|---|
| 65 | scripts = [ |
|---|
| 66 | 'src/scripts/tycoon', |
|---|
| 67 | 'src/scripts/tycoon_ssh', |
|---|
| 68 | 'src/scripts/tycoon_scp', |
|---|
| 69 | 'src/scripts/tycoon_bench', |
|---|
| 70 | ], |
|---|
| 71 | data_files = [ |
|---|
| 72 | ('/etc/tycoon', ['etc/tycoon/tycoon.conf', 'etc/tycoon/bank_public_key']), |
|---|
| 73 | ('/etc/tycoon/defaults', ['etc/tycoon/defaults/tycoon.conf']), |
|---|
| 74 | ('/etc/yum.repos.d', ['src/tycoon_$distribution_code$.repo']), |
|---|
| 75 | ], |
|---|
| 76 | ) |
|---|