6
6
'./setup.py --help' for more options
15
10
# META INFORMATION FOR SETUP
17
12
META_INFO = {'name': 'bzr',
18
'version': bzrlib.__version__,
13
'version': '<unknown>',
19
14
'author': 'Canonical Ltd',
20
15
'author_email': 'bazaar-ng@lists.ubuntu.com',
21
16
'url': 'http://www.bazaar-vcs.org/',
23
18
'license': 'GNU GPL v2',
26
# The list of packages is automatically generated later. Add other things
27
# that are part of BZRLIB here.
21
BZRLIB = {'packages': ['bzrlib',
24
'bzrlib.bundle.serializer',
29
'bzrlib.plugins.launchpad',
31
'bzrlib.store.revision',
32
'bzrlib.store.versioned',
34
'bzrlib.tests.blackbox',
35
'bzrlib.tests.branch_implementations',
36
'bzrlib.tests.bzrdir_implementations',
37
'bzrlib.tests.interrepository_implementations',
38
'bzrlib.tests.interversionedfile_implementations',
39
'bzrlib.tests.repository_implementations',
40
'bzrlib.tests.revisionstore_implementations',
41
'bzrlib.tests.workingtree_implementations',
43
'bzrlib.transport.http',
46
'bzrlib.util.configobj',
47
'bzrlib.util.effbot.org',
48
'bzrlib.util.elementtree',
30
PKG_DATA = {# install files from selftest suite
31
'package_data': {'bzrlib': ['doc/api/*.txt',
32
'tests/test_patches_data/*',
36
53
######################################################################
37
54
# Reinvocation stolen from bzr, we need python2.4 by virtue of bzr_man
38
55
# including bzrlib.help
41
61
version_info = sys.version_info
42
62
except AttributeError:
58
78
print >>sys.stderr, "bzr: error: cannot find a suitable python interpreter"
59
79
print >>sys.stderr, " (need %d.%d or later)" % NEED_VERS
61
if getattr(os, "unsetenv", None) is not None:
81
if hasattr(os, "unsetenv"):
62
82
os.unsetenv(REINVOKE)
65
def get_bzrlib_packages():
66
"""Recurse through the bzrlib directory, and extract the package names"""
69
base_path = os.path.dirname(os.path.abspath(bzrlib.__file__))
70
for root, dirs, files in os.walk(base_path):
71
if '__init__.py' in files:
72
assert root.startswith(base_path)
73
# Get just the path below bzrlib
74
package_path = root[len(base_path):]
75
# Remove leading and trailing slashes
76
package_path = package_path.strip('\\/')
78
package_name = 'bzrlib'
80
package_name = ('bzrlib.' +
81
package_path.replace('/', '.').replace('\\', '.'))
82
packages.append(package_name)
83
return sorted(packages)
86
BZRLIB['packages'] = get_bzrlib_packages()
89
85
from distutils.core import setup
90
86
from distutils.command.install_scripts import install_scripts
91
87
from distutils.command.build import build
150
146
########################
148
def get_bzr_version():
150
return bzrlib.__version__
152
153
if 'bdist_wininst' in sys.argv:
155
156
docs = glob.glob('doc/*.htm') + ['doc/default.css']
156
157
# python's distutils-based win32 installer
157
158
ARGS = {'scripts': ['bzr', 'tools/win32/bzr-win32-bdist-postinstall.py'],
159
# install the txt files from bzrlib.doc.api.
160
'package_data': {'bzrlib': ['doc/api/*.txt']},
159
162
'data_files': [('Doc/Bazaar', docs)],
162
165
ARGS.update(META_INFO)
166
ARGS.update({'version': get_bzr_version()})
163
167
ARGS.update(BZRLIB)
164
ARGS.update(PKG_DATA)
209
212
ARGS = {'scripts': ['bzr'],
210
213
'data_files': [('man/man1', ['bzr.1'])],
214
# install the txt files from bzrlib.doc.api.
215
'package_data': {'bzrlib': ['doc/api/*.txt']},
211
216
'cmdclass': {'build': bzr_build,
212
217
'install_scripts': my_install_scripts,
216
221
ARGS.update(META_INFO)
222
ARGS.update({'version': get_bzr_version()})
217
223
ARGS.update(BZRLIB)
218
ARGS.update(PKG_DATA)