forked from apel/ssm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
86 lines (72 loc) · 2.92 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
"""A setup script for APEL SSM.
This script installs the APEL SSM library, sender and reciever. This
should be similar to installing the RPM apel-ssm, although there
may be some differences.
Known differences are:
- the RPM installs pyc and pyo files, whereas this script does not.
- this script will not install system specific init style files.
Usage: 'python setup.py install'
Requires setuptools.
"""
from os import remove
from shutil import copyfile
import sys
from setuptools import setup, find_packages
from ssm import __version__
def main():
"""Called when run as script, e.g. 'python setup.py install'."""
# Create temporary files with deployment names
if 'install' in sys.argv:
copyfile('bin/receiver.py', 'bin/ssmreceive')
copyfile('bin/sender.py', 'bin/ssmsend')
copyfile('scripts/apel-ssm.logrotate', 'conf/apel-ssm')
copyfile('README.md', 'apel-ssm')
# conf_files will later be copied to conf_dir
conf_dir = '/etc/apel/'
conf_files = ['conf/receiver.cfg',
'conf/sender.cfg',
'conf/dns']
# For 'python setup.py install | test' to
# work (on Linux SL6), 'python-daemon'
# must be installed or included
# in install_required | tests_require
setup(name='apel-ssm',
version='%i.%i.%i' % __version__,
description=("Secure Stomp Messenger (SSM) is designed to simply "
"send messages using the STOMP protocol."),
author='APEL',
author_email='[email protected]',
url='http://apel.github.io/',
download_url='https://github.com/apel/ssm/releases',
license='Apache License, Version 2.0',
install_requires=[
'stomp.py<5.0.0', 'python-ldap<3.4.0', 'setuptools',
],
extras_require={
'AMS': ['argo-ams-library'],
'daemon': ['python-daemon<=2.3.0'],
'dirq': ['dirq'],
},
packages=find_packages(exclude=['bin', 'test']),
scripts=['bin/ssmreceive', 'bin/ssmsend'],
data_files=[(conf_dir, conf_files),
('/etc/logrotate.d', ['conf/apel-ssm']),
('/usr/share/doc/apel-ssm', ['apel-ssm']),
# Create empty directories
('/var/log/apel', []),
('/var/run/apel', []),
('/var/spool/apel', [])],
# zip_safe allows setuptools to install the project
# as a zipfile, for maximum performance!
# We have disabled this feature so installing via the setup
# script is similar to installing the RPM apel-ssm
zip_safe=False,
)
# Remove temporary files with deployment names
if 'install' in sys.argv:
remove('bin/ssmreceive')
remove('bin/ssmsend')
remove('conf/apel-ssm')
remove('apel-ssm')
if __name__ == "__main__":
main()