-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·74 lines (67 loc) · 2.34 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
#!/usr/bin/env python
# vim: set fileencoding=utf-8 sw=4 ts=4 et :
# Copyright (C) 2006-2020 CS GROUP - France
# License: GNU GPL v2 <http://www.gnu.org/licenses/gpl-2.0.html>
import os, sys
from setuptools import setup, find_packages
sysconfdir = os.getenv("SYSCONFDIR", "/etc")
localstatedir = os.getenv("LOCALSTATEDIR", "/var")
tests_require = [
'nose',
'coverage',
]
def install_i18n(i18ndir, destdir):
data_files = []
langs = []
for f in os.listdir(i18ndir):
if os.path.isdir(os.path.join(i18ndir, f)) and not f.startswith("."):
langs.append(f)
for lang in langs:
for f in os.listdir(os.path.join(i18ndir, lang, "LC_MESSAGES")):
if f.endswith(".mo"):
data_files.append(
(os.path.join(destdir, lang, "LC_MESSAGES"),
[os.path.join(i18ndir, lang, "LC_MESSAGES", f)])
)
return data_files
def get_data_files():
files = []
for d in ["new", "prod", "tmp", "old"]:
files.append((os.path.join(sysconfdir, "vigilo/vigiconf", d), []))
files.append((os.path.join(sysconfdir, "vigilo/vigiconf"), ["settings-local.ini"]))
files.append((os.path.join(localstatedir, "lib/vigilo/vigiconf"), []))
return files
setup(name='vigilo-vigiconf-local',
version='5.2.0',
author='Vigilo Team',
author_email='[email protected]',
url='https://www.vigilo-nms.com/',
license='http://www.gnu.org/licenses/gpl-2.0.html',
description="Local client for VigiConf",
long_description="This program installs the configuration pushed "
"by VigiConf.",
install_requires=[
"setuptools",
"vigilo-common",
],
extras_require={
'tests': tests_require,
},
namespace_packages = [
'vigilo',
],
message_extractors={
'src': [
('**.py', 'python', None),
],
},
packages=find_packages("src"),
entry_points={
'console_scripts': [
'vigiconf-local = vigilo.vigiconf_local:main',
],
},
package_dir={'': 'src'},
data_files=get_data_files() +
install_i18n("i18n", os.path.join(sys.prefix, 'share', 'locale')),
)