-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
163 lines (151 loc) · 5.14 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""distutils configuration: python setup.py install"""
__author__ = '[email protected] (Thomas Stromberg)'
import os
from libnamebench import version
from distutils.core import setup
try:
import py2exe
except ImportError:
pass
# If you don't want 3rd party libraries included, set this in your environment.
if os.getenv('NO_THIRD_PARTY', None):
packages=['libnamebench']
else:
packages = [
'libnamebench',
'nb_third_party',
'nb_third_party/dns',
'nb_third_party/dns/rdtypes',
'nb_third_party/dns/rdtypes/ANY',
'nb_third_party/dns/rdtypes/IN',
'nb_third_party/graphy',
'nb_third_party/jinja2',
'nb_third_party/httplib2',
'nb_third_party/simplejson',
'nb_third_party/graphy/backends',
'nb_third_party/graphy/backends/google_chart_api'
]
RT_MANIFEST = 24
manifest_template = '''
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="5.0.0.0"
processorArchitecture="x86"
name="%(prog)s"
type="win32"
/>
<description>%(prog)s Program</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
'''
rt90_manifest = """<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>
"""
setup(name='namebench',
version=version.VERSION,
py_modules=['namebench'],
description='DNS service benchmarking tool',
author='Thomas Stromberg',
author_email='[email protected]',
url='http://namebench.googlecode.com/',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache 2.0',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Programming Language :: Python',
'Topic :: Networking',
],
packages=packages,
platforms=['Any'],
license='Apache 2.0',
scripts=['namebench.py'],
data_files=[
('namebench/config',
['config/namebench.cfg',
'config/hostname_reference.cfg',
'config/data_sources.cfg']
),
('namebench/templates',
['templates/ascii.tmpl',
'templates/html.tmpl',
'templates/resolv.conf.tmpl',
'templates/style.css'
]
),
('namebench/data',
['data/alexa-top-2000-domains.txt',
'data/cache-hit.txt',
'data/cache-miss.txt',
'data/cache-mix.txt'
]
)
],
# py2exe specific garbarge below.
options={
'py2exe': {
'bundle_files': 3, # 1 nor 2 does not work
'ascii': False,
'packages': ['nb_third_party'],
'excludes': ['dns', 'jinja2', 'graphy', 'httplib2', 'tcl', 'simplejson'],
'dll_excludes': ["w9xpopen.exe","MSVCP90.dll", "MSVCR90.DLL"],
}
},
zipfile = "namebench.zip", # None - when bundle_files 1 or 2 can work.
windows=[{
'script': "namebench.py",
'dest_base': "namebench",
'name': "namebench",
'copyright': "(c) 2009 Google, Inc.",
'comments': "http://namebench.googlecode.com/",
'other_resources': [
# Windows Common Controls, XP Look
(RT_MANIFEST, 1, manifest_template % dict(prog="namebench")),
# VCRT 2008
(RT_MANIFEST, 1, rt90_manifest), # 1 - EXE CRT Manifest, 2 - DLL
],
}],
# console=['namebench.py']
)