2011-12-30 20:50:15 -07:00
|
|
|
#!/usr/bin/env python2
|
2011-02-27 15:17:45 -07:00
|
|
|
'''
|
|
|
|
The setup script for salt
|
|
|
|
'''
|
2011-11-14 15:49:06 +00:00
|
|
|
|
2012-05-06 20:25:14 -07:00
|
|
|
# For Python 2.5. A no-op on 2.6 and above.
|
|
|
|
from __future__ import with_statement
|
|
|
|
|
2011-12-10 13:12:16 -07:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
from glob import glob
|
|
|
|
from distutils.core import setup, Extension
|
|
|
|
from distutils.command.sdist import sdist
|
2011-07-22 11:47:34 -06:00
|
|
|
from distutils.cmd import Command
|
2011-05-23 19:23:42 +01:00
|
|
|
from distutils.sysconfig import get_python_lib, PREFIX
|
2011-12-22 15:56:33 -07:00
|
|
|
|
2012-03-01 16:17:03 -08:00
|
|
|
if os.environ.get('VIRTUAL_ENV'):
|
|
|
|
from setuptools import setup
|
|
|
|
|
2012-04-19 11:15:25 -07:00
|
|
|
exec(compile(open("salt/version.py").read(), "salt/version.py", 'exec'))
|
2011-09-25 00:30:36 -06:00
|
|
|
|
2011-12-22 02:36:26 +01:00
|
|
|
class TestCommand(Command):
|
|
|
|
description = 'Run tests'
|
|
|
|
user_options = []
|
|
|
|
def initialize_options(self): pass
|
|
|
|
def finalize_options(self): pass
|
|
|
|
def run(self):
|
|
|
|
from subprocess import Popen
|
|
|
|
self.run_command('build')
|
|
|
|
build_cmd = self.get_finalized_command('build_ext')
|
|
|
|
runner = os.path.abspath('tests/runtests.py')
|
|
|
|
test_cmd = 'python %s' % runner
|
|
|
|
print("running test")
|
|
|
|
test_process = Popen(
|
|
|
|
test_cmd, shell=True,
|
|
|
|
stdout=sys.stdout, stderr=sys.stderr,
|
|
|
|
cwd=build_cmd.build_lib
|
|
|
|
)
|
|
|
|
test_process.communicate()
|
2012-05-05 17:23:39 +05:30
|
|
|
sys.exit(test_process.returncode)
|
2011-12-22 02:36:26 +01:00
|
|
|
|
2011-05-12 09:08:43 -06:00
|
|
|
NAME = 'salt'
|
2011-09-25 00:30:36 -06:00
|
|
|
VER = __version__
|
2011-11-09 14:12:15 +00:00
|
|
|
DESC = ('Portable, distributed, remote execution and '
|
|
|
|
'configuration management system')
|
2012-01-21 21:39:39 -07:00
|
|
|
mod_path = os.path.join(get_python_lib(), 'salt/modules')
|
2011-10-24 16:13:47 -06:00
|
|
|
doc_path = os.path.join(PREFIX, 'share/doc', NAME + '-' + VER)
|
2011-05-12 09:08:43 -06:00
|
|
|
example_path = os.path.join(doc_path, 'examples')
|
|
|
|
template_path = os.path.join(example_path, 'templates')
|
2011-11-09 11:57:51 +00:00
|
|
|
|
|
|
|
if 'SYSCONFDIR' in os.environ:
|
2011-05-23 20:00:14 -06:00
|
|
|
etc_path = os.environ['SYSCONFDIR']
|
|
|
|
else:
|
|
|
|
etc_path = os.path.join(os.path.dirname(PREFIX), 'etc')
|
2011-02-27 14:31:57 -07:00
|
|
|
|
2011-12-10 13:12:16 -07:00
|
|
|
libraries = ['ws2_32'] if sys.platform == 'win32' else []
|
|
|
|
|
2012-03-01 16:17:03 -08:00
|
|
|
requirements=''
|
|
|
|
with open('requirements.txt') as f:
|
|
|
|
requirements = f.read()
|
|
|
|
|
2011-08-02 23:02:00 -06:00
|
|
|
setup(
|
|
|
|
name=NAME,
|
2011-05-12 09:08:43 -06:00
|
|
|
version=VER,
|
|
|
|
description=DESC,
|
2011-02-27 14:31:57 -07:00
|
|
|
author='Thomas S Hatch',
|
|
|
|
author_email='thatch45@gmail.com',
|
2011-11-27 22:05:18 -07:00
|
|
|
url='http://saltstack.org',
|
2012-01-20 19:30:57 -07:00
|
|
|
cmdclass={'test': TestCommand},
|
2011-11-14 15:49:06 +00:00
|
|
|
classifiers=[
|
2011-05-06 08:28:34 -06:00
|
|
|
'Programming Language :: Python',
|
|
|
|
'Programming Language :: Cython',
|
2011-11-09 11:57:51 +00:00
|
|
|
'Programming Language :: Python :: 2.6',
|
2011-11-09 12:28:22 +00:00
|
|
|
'Programming Language :: Python :: 2.7',
|
2011-08-27 12:50:26 -06:00
|
|
|
'Development Status :: 5 - Production/Stable',
|
2011-05-06 08:28:34 -06:00
|
|
|
'Environment :: Console',
|
|
|
|
'Intended Audience :: Developers',
|
|
|
|
'Intended Audience :: Information Technology',
|
|
|
|
'Intended Audience :: System Administrators',
|
|
|
|
'License :: OSI Approved :: Apache Software License',
|
|
|
|
'Operating System :: POSIX :: Linux',
|
|
|
|
'Topic :: System :: Clustering',
|
|
|
|
'Topic :: System :: Distributed Computing',
|
|
|
|
],
|
2011-04-01 23:38:20 -06:00
|
|
|
packages=['salt',
|
2011-04-16 14:48:13 -06:00
|
|
|
'salt.cli',
|
2011-08-10 11:20:33 -06:00
|
|
|
'salt.ext',
|
|
|
|
'salt.grains',
|
|
|
|
'salt.modules',
|
2011-05-12 12:05:00 -06:00
|
|
|
'salt.renderers',
|
2011-08-10 11:20:33 -06:00
|
|
|
'salt.returners',
|
2011-06-02 22:33:58 -06:00
|
|
|
'salt.runners',
|
2011-04-29 16:07:53 -06:00
|
|
|
'salt.states',
|
2011-07-29 21:40:21 -06:00
|
|
|
'salt.utils',
|
2011-04-16 14:48:13 -06:00
|
|
|
],
|
2012-04-25 10:06:13 -06:00
|
|
|
package_data = {
|
2012-04-25 10:35:48 -06:00
|
|
|
'salt.modules': ['rh_ip/*.jinja'],
|
2012-04-25 10:06:13 -06:00
|
|
|
},
|
2011-02-27 14:31:57 -07:00
|
|
|
scripts=['scripts/salt-master',
|
2011-03-09 10:52:22 -07:00
|
|
|
'scripts/salt-minion',
|
2011-07-30 22:24:08 -06:00
|
|
|
'scripts/salt-syndic',
|
2011-05-12 09:08:43 -06:00
|
|
|
'scripts/salt-key',
|
2011-04-12 20:26:04 -06:00
|
|
|
'scripts/salt-cp',
|
2011-04-23 14:34:46 -06:00
|
|
|
'scripts/salt-call',
|
2011-06-02 22:33:58 -06:00
|
|
|
'scripts/salt-run',
|
2011-03-09 10:52:22 -07:00
|
|
|
'scripts/salt'],
|
2012-03-21 12:10:46 -06:00
|
|
|
data_files=[('share/man/man1',
|
2011-05-12 08:46:30 -06:00
|
|
|
['doc/man/salt-master.1',
|
2011-05-13 22:35:00 -06:00
|
|
|
'doc/man/salt-key.1',
|
2011-05-12 08:46:30 -06:00
|
|
|
'doc/man/salt.1',
|
2011-05-13 22:35:00 -06:00
|
|
|
'doc/man/salt-cp.1',
|
2011-08-27 11:32:54 -06:00
|
|
|
'doc/man/salt-call.1',
|
|
|
|
'doc/man/salt-syndic.1',
|
2011-07-09 17:09:15 -06:00
|
|
|
'doc/man/salt-run.1',
|
2011-05-12 08:46:30 -06:00
|
|
|
'doc/man/salt-minion.1',
|
2011-04-01 23:38:20 -06:00
|
|
|
]),
|
2011-04-01 23:22:19 -06:00
|
|
|
('share/man/man7',
|
2011-05-12 08:46:30 -06:00
|
|
|
['doc/man/salt.7',
|
2011-04-01 23:38:20 -06:00
|
|
|
]),
|
2011-02-27 14:31:57 -07:00
|
|
|
],
|
2012-03-01 16:17:03 -08:00
|
|
|
install_requires=requirements,
|
2011-02-27 14:31:57 -07:00
|
|
|
)
|