~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Robert Collins
  • Date: 2007-07-04 08:08:13 UTC
  • mfrom: (2572 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2587.
  • Revision ID: robertc@robertcollins.net-20070704080813-wzebx0r88fvwj5rq
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
META_INFO = {'name':         'bzr',
18
18
             'version':      bzrlib.__version__,
19
19
             'author':       'Canonical Ltd',
20
 
             'author_email': 'bazaar-ng@lists.ubuntu.com',
 
20
             'author_email': 'bazaar@lists.canonical.com',
21
21
             'url':          'http://www.bazaar-vcs.org/',
22
22
             'description':  'Friendly distributed version control system',
23
23
             'license':      'GNU GPL v2',
99
99
    Create bzr.bat for win32.
100
100
    """
101
101
    def run(self):
102
 
        import os
103
 
        import sys
104
 
 
105
102
        install_scripts.run(self)   # standard action
106
103
 
107
104
        if sys.platform == "win32":
127
124
            return path
128
125
 
129
126
    def _win_batch_args(self):
130
 
        if os.name == 'nt':
 
127
        from bzrlib.win32utils import winver
 
128
        if winver == 'Windows NT':
131
129
            return '%*'
132
130
        else:
133
131
            return '%1 %2 %3 %4 %5 %6 %7 %8 %9'
149
147
## Setup
150
148
########################
151
149
 
 
150
command_classes = {'install_scripts': my_install_scripts,
 
151
                  'build': bzr_build}
 
152
ext_modules = []
 
153
try:
 
154
    from Pyrex.Distutils import build_ext
 
155
except ImportError:
 
156
    # try to build the extension from the prior generated source.
 
157
    print ("Pyrex not available, while bzr will build, "
 
158
           "you cannot modify the C extensions.")
 
159
    from distutils.command.build_ext import build_ext
 
160
    from distutils.extension import Extension
 
161
    #ext_modules.append(
 
162
    #    Extension("bzrlib.modulename", ["bzrlib/foo.c"], libraries = []))
 
163
else:
 
164
    from distutils.extension import Extension
 
165
    #ext_modules.append(
 
166
    #    Extension("bzrlib.modulename", ["bzrlib/foo.pyx"], libraries = []))
 
167
command_classes['build_ext'] = build_ext
 
168
 
152
169
if 'bdist_wininst' in sys.argv:
153
170
    import glob
154
171
    # doc files
155
172
    docs = glob.glob('doc/*.htm') + ['doc/default.css']
 
173
    dev_docs = glob.glob('doc/developers/*.htm')
156
174
    # python's distutils-based win32 installer
157
175
    ARGS = {'scripts': ['bzr', 'tools/win32/bzr-win32-bdist-postinstall.py'],
158
176
            # help pages
159
 
            'data_files': [('Doc/Bazaar', docs)],
 
177
            'data_files': [('Doc/Bazaar', docs),
 
178
                           ('Doc/Bazaar/developers', dev_docs),
 
179
                          ],
160
180
           }
161
181
 
162
182
    ARGS.update(META_INFO)
188
208
                                     version = version_str,
189
209
                                     description = META_INFO['description'],
190
210
                                     author = META_INFO['author'],
191
 
                                     copyright = "(c) Canonical Ltd, 2005-2006",
 
211
                                     copyright = "(c) Canonical Ltd, 2005-2007",
192
212
                                     company_name = "Canonical Ltd.",
193
213
                                     comments = META_INFO['description'],
194
214
                                    )
 
215
 
 
216
    additional_packages =  []
 
217
    if sys.version.startswith('2.4'):
 
218
        # adding elementtree package
 
219
        additional_packages.append('elementtree')
 
220
    elif sys.version.startswith('2.5'):
 
221
        additional_packages.append('xml.etree')
 
222
    else:
 
223
        import warnings
 
224
        warnings.warn('Unknown Python version.\n'
 
225
                      'Please check setup.py script for compatibility.')
 
226
 
195
227
    options_list = {"py2exe": {"packages": BZRLIB['packages'] +
196
 
                                           ['elementtree'],
197
 
                               "excludes": ["Tkinter", "medusa"],
 
228
                                           additional_packages,
 
229
                               "excludes": ["Tkinter", "medusa", "tools"],
198
230
                               "dist_dir": "win32_bzr.exe",
199
231
                              },
200
232
                   }
208
240
    # std setup
209
241
    ARGS = {'scripts': ['bzr'],
210
242
            'data_files': [('man/man1', ['bzr.1'])],
211
 
            'cmdclass': {'build': bzr_build,
212
 
                         'install_scripts': my_install_scripts,
213
 
                        },
 
243
            'cmdclass': command_classes,
 
244
            'ext_modules': ext_modules,
214
245
           }
215
246
    
216
247
    ARGS.update(META_INFO)