forked from cloudant/sensu-trapd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·46 lines (41 loc) · 1.19 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python
# coding=utf-8
import os
import sys
import platform
from distutils.core import setup
distro = platform.dist()[0]
# Configure Data Files
data_files = list()
data_files.append(('', ['requirements.txt', 'version.txt']))
data_files.append(('', ['conf/config.json.default', 'conf/traps.json.default']))
def get_version():
"""
Read the version.txt file to get the new version string
Generate it if version.txt is not available. Generation
is required for pip installs
"""
try:
f = open('version.txt')
except IOError:
os.system("./version.sh > version.txt")
f = open('version.txt')
version = ''.join(f.readlines()).rstrip()
f.close()
return version
version = get_version()
setup(
name='sensu-trapd',
version=version,
url='https://github.com/cloudant/sensu-trapd',
author='Cloudant Inc.',
author_email='[email protected]',
license='MIT License',
description='SNMP Trap Receiver for Sensu',
package_dir={'': 'src'},
packages=['sensu', 'sensu.snmp'],
scripts=['src/bin/sensu-trapd'],
data_files=data_files,
#install_requires=install_requires,
#test_suite='test.main',
)