/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Martin Pool
  • Date: 2010-02-23 02:32:52 UTC
  • mto: This revision was merged to the branch mainline in revision 5054.
  • Revision ID: mbp@sourcefrog.net-20100223023252-zk4ds0sbeuga82et
Clarify Launchpad setup example

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    'version':      bzrlib.__version__,
38
38
    'author':       'Canonical Ltd',
39
39
    'author_email': 'bazaar@lists.canonical.com',
40
 
    'url':          'http://bazaar.canonical.com/',
 
40
    'url':          'http://www.bazaar.canonical.com/',
41
41
    'description':  'Friendly distributed version control system',
42
42
    'license':      'GNU GPL v2',
43
43
    'download_url': 'https://launchpad.net/bzr/+download',
186
186
    from distutils.command.build_ext import build_ext
187
187
else:
188
188
    have_pyrex = True
189
 
    pyrex_version_info = tuple(map(int, pyrex_version.split('.')))
190
189
 
191
190
 
192
191
class build_ext_if_possible(build_ext):
281
280
    add_pyrex_extension('bzrlib._dirstate_helpers_pyx',
282
281
                        libraries=['Ws2_32'])
283
282
    add_pyrex_extension('bzrlib._walkdirs_win32')
 
283
    z_lib = 'zdll'
284
284
else:
285
 
    if have_pyrex and pyrex_version_info[:3] == (0,9,4):
 
285
    if have_pyrex and pyrex_version.startswith('0.9.4'):
286
286
        # Pyrex 0.9.4.1 fails to compile this extension correctly
287
287
        # The code it generates re-uses a "local" pointer and
288
288
        # calls "PY_DECREF" after having set it to NULL. (It mixes PY_XDECREF
297
297
    else:
298
298
        add_pyrex_extension('bzrlib._dirstate_helpers_pyx')
299
299
    add_pyrex_extension('bzrlib._readdir_pyx')
300
 
add_pyrex_extension('bzrlib._chk_map_pyx')
 
300
    z_lib = 'z'
 
301
add_pyrex_extension('bzrlib._chk_map_pyx', libraries=[z_lib])
301
302
ext_modules.append(Extension('bzrlib._patiencediff_c',
302
303
                             ['bzrlib/_patiencediff_c.c']))
303
 
if have_pyrex and pyrex_version_info < (0, 9, 6, 3):
304
 
    print
305
 
    print 'Your Pyrex/Cython version %s is too old to build the simple_set' % (
306
 
        pyrex_version)
307
 
    print 'and static_tuple extensions.'
308
 
    print 'Please upgrade to at least Pyrex 0.9.6.3'
309
 
    print
310
 
    # TODO: Should this be a fatal error?
311
 
else:
312
 
    # We only need 0.9.6.3 to build _simple_set_pyx, but static_tuple depends
313
 
    # on simple_set
314
 
    add_pyrex_extension('bzrlib._simple_set_pyx')
315
 
    ext_modules.append(Extension('bzrlib._static_tuple_c',
316
 
                                 ['bzrlib/_static_tuple_c.c']))
 
304
add_pyrex_extension('bzrlib._simple_set_pyx')
 
305
ext_modules.append(Extension('bzrlib._static_tuple_c',
 
306
                             ['bzrlib/_static_tuple_c.c']))
317
307
add_pyrex_extension('bzrlib._btree_serializer_pyx')
318
308
 
319
309
 
468
458
 
469
459
def get_svn_py2exe_info(includes, excludes, packages):
470
460
    packages.append('subvertpy')
471
 
    packages.append('sqlite3')
472
461
 
473
462
 
474
463
if 'bdist_wininst' in sys.argv:
532
521
            install_data.run(self)
533
522
 
534
523
            py2exe = self.distribution.get_command_obj('py2exe', False)
535
 
            # GZ 2010-04-19: Setup has py2exe.optimize as 2, but give plugins
536
 
            #                time before living with docstring stripping
537
 
            optimize = 1
 
524
            optimize = py2exe.optimize
538
525
            compile_names = [f for f in self.outfiles if f.endswith('.py')]
539
526
            byte_compile(compile_names,
540
527
                         optimize=optimize,
541
528
                         force=self.force, prefix=self.install_dir,
542
529
                         dry_run=self.dry_run)
543
 
            self.outfiles.extend([f + 'o' for f in compile_names])
 
530
            if optimize:
 
531
                suffix = 'o'
 
532
            else:
 
533
                suffix = 'c'
 
534
            self.outfiles.extend([f + suffix for f in compile_names])
544
535
    # end of class install_data_with_bytecompile
545
536
 
546
537
    target = py2exe.build_exe.Target(script = "bzr",
550
541
                                     version = version_str,
551
542
                                     description = META_INFO['description'],
552
543
                                     author = META_INFO['author'],
553
 
                                     copyright = "(c) Canonical Ltd, 2005-2010",
 
544
                                     copyright = "(c) Canonical Ltd, 2005-2009",
554
545
                                     company_name = "Canonical Ltd.",
555
546
                                     comments = META_INFO['description'],
556
547
                                    )
569
560
    if sys.version.startswith('2.4'):
570
561
        # adding elementtree package
571
562
        additional_packages.add('elementtree')
572
 
    elif sys.version.startswith('2.6') or sys.version.startswith('2.5'):
 
563
    elif sys.version.startswith('2.5'):
573
564
        additional_packages.add('xml.etree')
574
565
    else:
575
566
        import warnings
621
612
            excludes.extend(["bzrlib.plugins." + d for d in dirs])
622
613
        x = []
623
614
        for i in files:
624
 
            # Throw away files we don't want packaged. Note that plugins may
625
 
            # have data files with all sorts of extensions so we need to
626
 
            # be conservative here about what we ditch.
627
 
            ext = os.path.splitext(i)[1]
628
 
            if ext.endswith('~') or ext in [".pyc", ".swp"]:
 
615
            if os.path.splitext(i)[1] not in [".py", ".pyd", ".dll", ".mo"]:
629
616
                continue
630
617
            if i == '__init__.py' and root == 'bzrlib/plugins':
631
618
                continue
688
675
                               "excludes": excludes,
689
676
                               "dll_excludes": dll_excludes,
690
677
                               "dist_dir": "win32_bzr.exe",
691
 
                               "optimize": 2,
 
678
                               "optimize": 1,
692
679
                              },
693
680
                   }
694
681
 
708
695
        # easy_install one
709
696
        DATA_FILES = [('man/man1', ['bzr.1'])]
710
697
 
711
 
    if sys.platform != 'win32':
712
 
        # see https://wiki.kubuntu.org/Apport/DeveloperHowTo
713
 
        #
714
 
        # checking the paths and hardcoding the check for root is a bit gross,
715
 
        # but I don't see a cleaner way to find out the locations in a way
716
 
        # that's going to align with the hardcoded paths in apport.
717
 
        if os.geteuid() == 0:
718
 
            DATA_FILES += [
719
 
                ('/usr/share/apport/package-hooks',
720
 
                    ['apport/source_bzr.py']),
721
 
                ('/etc/apport/crashdb.conf.d/',
722
 
                    ['apport/bzr-crashdb.conf']),]
723
 
 
724
698
    # std setup
725
699
    ARGS = {'scripts': ['bzr'],
726
700
            'data_files': DATA_FILES,