1
1
#! /usr/bin/env python
3
# This is an installation script for bzr. Run it with
4
# './setup.py install', or
5
# './setup.py --help' for more options
3
"""Installation script for bzr.
5
'./setup.py install', or
6
'./setup.py --help' for more options
12
# META INFORMATION FOR SETUP
14
META_INFO = {'name': 'bzr',
15
'version': bzrlib.__version__,
16
'author': 'Canonical Ltd',
17
'author_email': 'bazaar-ng@lists.ubuntu.com',
18
'url': 'http://www.bazaar-vcs.org/',
19
'description': 'Friendly distributed version control system',
20
'license': 'GNU GPL v2',
23
BZRLIB = {'packages': ['bzrlib',
26
'bzrlib.bundle.serializer',
31
'bzrlib.plugins.launchpad',
33
'bzrlib.store.revision',
34
'bzrlib.store.versioned',
36
'bzrlib.tests.blackbox',
37
'bzrlib.tests.branch_implementations',
38
'bzrlib.tests.bzrdir_implementations',
39
'bzrlib.tests.interrepository_implementations',
40
'bzrlib.tests.intertree_implementations',
41
'bzrlib.tests.interversionedfile_implementations',
42
'bzrlib.tests.repository_implementations',
43
'bzrlib.tests.revisionstore_implementations',
44
'bzrlib.tests.tree_implementations',
45
'bzrlib.tests.workingtree_implementations',
47
'bzrlib.transport.http',
50
'bzrlib.util.configobj',
51
'bzrlib.util.effbot.org',
52
'bzrlib.util.elementtree',
57
######################################################################
7
58
# Reinvocation stolen from bzr, we need python2.4 by virtue of bzr_man
8
59
# including bzrlib.help
13
65
version_info = sys.version_info
55
107
if sys.platform == "win32":
57
109
scripts_dir = self.install_dir
58
script_path = os.path.join(scripts_dir, "bzr")
59
batch_str = "@%s %s %%*\n" % (sys.executable, script_path)
110
script_path = self._quoted_path(os.path.join(scripts_dir,
112
python_exe = self._quoted_path(sys.executable)
113
args = self._win_batch_args()
114
batch_str = "@%s %s %s" % (python_exe, script_path, args)
60
115
batch_path = script_path + ".bat"
61
116
f = file(batch_path, "w")
62
117
f.write(batch_str)
76
144
import generate_docs
77
145
generate_docs.main(argv=["bzr", "man"])
79
148
########################
81
150
########################
85
author='Canonical Ltd',
86
author_email='bazaar-ng@lists.ubuntu.com',
87
url='http://bazaar-vcs.org/',
88
description='Friendly distributed version control system',
96
'bzrlib.plugins.launchpad',
98
'bzrlib.store.revision',
99
'bzrlib.store.versioned',
101
'bzrlib.tests.blackbox',
102
'bzrlib.tests.branch_implementations',
103
'bzrlib.tests.bzrdir_implementations',
104
'bzrlib.tests.interrepository_implementations',
105
'bzrlib.tests.intertree_implementations',
106
'bzrlib.tests.interversionedfile_implementations',
107
'bzrlib.tests.repository_implementations',
108
'bzrlib.tests.revisionstore_implementations',
109
'bzrlib.tests.tree_implementations',
110
'bzrlib.tests.workingtree_implementations',
112
'bzrlib.transport.http',
115
'bzrlib.util.elementtree',
116
'bzrlib.util.effbot.org',
117
'bzrlib.util.configobj',
119
'bzrlib.bundle.serializer'
122
cmdclass={'install_scripts': my_install_scripts, 'build': bzr_build},
123
data_files=[('man/man1', ['bzr.1'])],
124
# todo: install the txt files from bzrlib.doc.api.
152
if 'bdist_wininst' in sys.argv:
155
docs = glob.glob('doc/*.htm') + ['doc/default.css']
156
# python's distutils-based win32 installer
157
ARGS = {'scripts': ['bzr', 'tools/win32/bzr-win32-bdist-postinstall.py'],
158
# install the txt files from bzrlib.doc.api.
159
'package_data': {'bzrlib': ['doc/api/*.txt']},
161
'data_files': [('Doc/Bazaar', docs)],
164
ARGS.update(META_INFO)
169
elif 'py2exe' in sys.argv:
173
# pick real bzr version
177
for i in bzrlib.version_info[:4]:
182
version_number.append(str(i))
183
version_str = '.'.join(version_number)
185
target = py2exe.build_exe.Target(script = "bzr",
187
icon_resources = [(0,'bzr.ico')],
188
name = META_INFO['name'],
189
version = version_str,
190
description = META_INFO['description'],
191
author = META_INFO['author'],
192
copyright = "(c) Canonical Ltd, 2005-2006",
193
company_name = "Canonical Ltd.",
194
comments = META_INFO['description'],
196
options_list = {"py2exe": {"packages": BZRLIB['packages'] +
198
"excludes": ["Tkinter", "medusa"],
199
"dist_dir": "win32_bzr.exe",
202
setup(options=options_list,
204
'tools/win32/bzr_postinstall.py',
206
zipfile='lib/library.zip')
210
ARGS = {'scripts': ['bzr'],
211
'data_files': [('man/man1', ['bzr.1'])],
212
# install the txt files from bzrlib.doc.api.
213
'package_data': {'bzrlib': ['doc/api/*.txt']},
214
'cmdclass': {'build': bzr_build,
215
'install_scripts': my_install_scripts,
219
ARGS.update(META_INFO)