-
Notifications
You must be signed in to change notification settings - Fork 28
/
setup.py
63 lines (59 loc) · 2.13 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
# setup.py ###
from __future__ import absolute_import
from __future__ import print_function
from setuptools import setup
import os
NAME = "okconfig"
VERSION = '1.4.2'
SHORT_DESC = "%s - Powertools to generate Nagios configuration files" % NAME
LONG_DESC = """
%s contains tools and templates for enterprise quality nagios configuration.
""" % NAME
def get_filelist(path):
"""Returns a list of all files in a given directory"""
files = []
directories_to_check = [path]
while len(directories_to_check) > 0:
current_directory = directories_to_check.pop(0)
for i in os.listdir(current_directory):
if i == '.gitignore':
continue
relative_path = current_directory + "/" + i
if os.path.isfile(relative_path):
files.append(relative_path)
elif os.path.isdir(relative_path):
directories_to_check.append(relative_path)
else:
print("what am i?", i)
return files
if __name__ == "__main__":
manpath = "share/man/man1/"
etcpath = "/etc/%s" % NAME
etcmodpath = "/etc/%s/modules" % NAME
initpath = "/etc/init.d/"
logpath = "/var/log/%s/" % NAME
varpath = "/var/lib/%s/" % NAME
rotpath = "/etc/logrotate.d"
datarootdir = "/usr/share/%s" % NAME
template_files = get_filelist('usr/share/okconfig')
data_files = [("/" + os.path.dirname(x), [x]) for x in template_files]
data_files.append((logpath, []))
data_files.append((rotpath, ["etc/logrotate.d/okconfig"]))
#data_files.append(( manpath, ['docs/okconfig.1.gz'] ))
setup(
name='%s' % NAME,
version=VERSION,
author='Pall Sigurdsson',
description=SHORT_DESC,
long_description=LONG_DESC,
author_email='[email protected]',
maintainer='Gardar Thorsteinsson',
maintainer_email='[email protected]',
url='http://okconfig.org',
license='GPL',
scripts=['usr/bin/okconfig'],
packages=['okconfig'],
requires=['unittest2'],
install_requires=['paramiko','pynag','six','future','setuptools_rust'],
data_files=data_files,
)