~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

merged installer work

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /usr/bin/env python
2
2
 
3
 
# This is an installation script for bzr.  Run it with
4
 
# './setup.py install', or
5
 
# './setup.py --help' for more options
6
 
 
 
3
"""Installation script for bzr.
 
4
Run it with
 
5
 './setup.py install', or
 
6
 './setup.py --help' for more options
 
7
"""
 
8
 
 
9
##
 
10
# META INFORMATION FOR SETUP
 
11
 
 
12
META_INFO = {'name':         'bzr',
 
13
             'version':      '0.9pre',
 
14
             'author':       'Canonical Ltd',
 
15
             'author_email': 'bazaar-ng@lists.ubuntu.com',
 
16
             'url':          'http://www.bazaar-vcs.org/',
 
17
             'description':  'Friendly distributed version control system',
 
18
             'license':      'GNU GPL v2',
 
19
            }
 
20
 
 
21
BZRLIB = {'packages': ['bzrlib',
 
22
                       'bzrlib.benchmarks',
 
23
                       'bzrlib.bundle',
 
24
                       'bzrlib.bundle.serializer',
 
25
                       'bzrlib.doc',
 
26
                       'bzrlib.doc.api',
 
27
                       'bzrlib.export',
 
28
                       'bzrlib.plugins',
 
29
                       'bzrlib.plugins.launchpad',
 
30
                       'bzrlib.store',
 
31
                       'bzrlib.store.revision',
 
32
                       'bzrlib.store.versioned',
 
33
                       'bzrlib.tests',
 
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',
 
42
                       'bzrlib.transport',
 
43
                       'bzrlib.transport.http',
 
44
                       'bzrlib.ui',
 
45
                       'bzrlib.util',
 
46
                       'bzrlib.util.configobj',
 
47
                       'bzrlib.util.effbot.org',
 
48
                       'bzrlib.util.elementtree',
 
49
                      ],
 
50
         }
 
51
 
 
52
 
 
53
##
7
54
# Reinvocation stolen from bzr, we need python2.4 by virtue of bzr_man
8
55
# including bzrlib.help
9
56
 
10
 
import os, sys
 
57
import os
 
58
import sys
11
59
 
12
60
try:
13
61
    version_info = sys.version_info
76
124
        import generate_docs
77
125
        generate_docs.main(argv=["bzr", "man"])
78
126
 
 
127
 
79
128
########################
80
129
## Setup
81
130
########################
82
131
 
83
 
setup(name='bzr',
84
 
      version='0.9pre',
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',
89
 
      license='GNU GPL v2',
90
 
      packages=['bzrlib',
91
 
                'bzrlib.benchmarks',
92
 
                'bzrlib.doc',
93
 
                'bzrlib.doc.api',
94
 
                'bzrlib.export',
95
 
                'bzrlib.plugins',
96
 
                'bzrlib.plugins.launchpad',
97
 
                'bzrlib.store',
98
 
                'bzrlib.store.revision',
99
 
                'bzrlib.store.versioned',
100
 
                'bzrlib.tests',
101
 
                'bzrlib.tests.blackbox',
102
 
                'bzrlib.tests.branch_implementations',
103
 
                'bzrlib.tests.bzrdir_implementations',
104
 
                'bzrlib.tests.interrepository_implementations',
105
 
                'bzrlib.tests.interversionedfile_implementations',
106
 
                'bzrlib.tests.repository_implementations',
107
 
                'bzrlib.tests.revisionstore_implementations',
108
 
                'bzrlib.tests.workingtree_implementations',
109
 
                'bzrlib.transport',
110
 
                'bzrlib.transport.http',
111
 
                'bzrlib.ui',
112
 
                'bzrlib.util',
113
 
                'bzrlib.util.elementtree',
114
 
                'bzrlib.util.effbot.org',
115
 
                'bzrlib.util.configobj',
116
 
                'bzrlib.bundle',
117
 
                'bzrlib.bundle.serializer'
118
 
                ],
119
 
      scripts=['bzr'],
120
 
      cmdclass={'install_scripts': my_install_scripts, 'build': bzr_build},
121
 
      data_files=[('man/man1', ['bzr.1'])],
122
 
    #   todo: install the txt files from bzrlib.doc.api.
123
 
     )
 
132
if 'bdist_wininst' in sys.argv:
 
133
    # python's distutils-based win32 installer
 
134
    ARGS = {'scripts': ['bzr', 'tools/win32/bzr-win32-bdist-postinstall.py'],
 
135
            # install the txt files from bzrlib.doc.api.
 
136
            'package_data': {'bzrlib': ['doc/api/*.txt']},
 
137
           }
 
138
 
 
139
    ARGS.update(META_INFO)
 
140
    ARGS.update(BZRLIB)
 
141
    
 
142
    setup(**ARGS)
 
143
 
 
144
elif 'py2exe' in sys.argv:
 
145
    # py2exe setup
 
146
    import py2exe
 
147
 
 
148
    # pick real bzr version
 
149
    import bzrlib
 
150
 
 
151
    version_number = []
 
152
    for i in bzrlib.version_info[:4]:
 
153
        try:
 
154
            i = int(i)
 
155
        except ValueError:
 
156
            i = 0
 
157
        version_number.append(str(i))
 
158
    version_str = '.'.join(version_number)
 
159
 
 
160
    target = py2exe.build_exe.Target(script = "bzr",
 
161
                                     dest_base = "bzr",
 
162
                                     icon_resources = [(0,'bzr.ico')],
 
163
                                     name = META_INFO['name'],
 
164
                                     version = version_str,
 
165
                                     description = META_INFO['description'],
 
166
                                     author = META_INFO['author'],
 
167
                                     copyright = "(c) Canonical Ltd, 2005-2006",
 
168
                                     company_name = "Canonical Ltd.",
 
169
                                     comments = META_INFO['description'],
 
170
                                    )
 
171
    options_list = {"py2exe": {"packages": BZRLIB['packages'] +
 
172
                                           ['elementtree'],
 
173
                               "excludes": ["Tkinter", "medusa"],
 
174
                               "dist_dir": "win32_bzr.exe",
 
175
                              },
 
176
                   }
 
177
    setup(options=options_list,
 
178
          console=[target,
 
179
                   'tools/win32/bzr_postinstall.py',
 
180
                   'tools/bzr_test_dependencies.py',
 
181
                  ],
 
182
          zipfile='lib/library.zip')
 
183
 
 
184
else:
 
185
    # std setup
 
186
    ARGS = {'scripts': ['bzr'],
 
187
            'data_files': [('man/man1', ['bzr.1'])],
 
188
            # install the txt files from bzrlib.doc.api.
 
189
            'package_data': {'bzrlib': ['doc/api/*.txt']},
 
190
            'cmdclass': {'build': bzr_build,
 
191
                         'install_scripts': my_install_scripts,
 
192
                        },
 
193
           }
 
194
    
 
195
    ARGS.update(META_INFO)
 
196
    ARGS.update(BZRLIB)
 
197
 
 
198
    setup(**ARGS)
 
199