~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Jelmer Vernooij
  • Date: 2005-11-04 17:26:05 UTC
  • mfrom: (1185.16.146)
  • mto: (1185.33.1)
  • mto: This revision was merged to the branch mainline in revision 1509.
  • Revision ID: jelmer@samba.org-20051104172605-9288f261492667fd
MergeĀ fromĀ Martin

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# './setup.py install', or
5
5
# './setup.py --help' for more options
6
6
 
 
7
# Reinvocation stolen from bzr, we need python2.4 by virtue of bzr_man
 
8
# including bzrlib.help
 
9
 
 
10
import os, sys
 
11
 
 
12
try:
 
13
    version_info = sys.version_info
 
14
except AttributeError:
 
15
    version_info = 1, 5 # 1.5 or older
 
16
 
 
17
REINVOKE = "__BZR_REINVOKE"
 
18
NEED_VERS = (2, 4)
 
19
KNOWN_PYTHONS = ('python2.4',)
 
20
 
 
21
if version_info < NEED_VERS:
 
22
    if not os.environ.has_key(REINVOKE):
 
23
        # mutating os.environ doesn't work in old Pythons
 
24
        os.putenv(REINVOKE, "1")
 
25
        for python in KNOWN_PYTHONS:
 
26
            try:
 
27
                os.execvp(python, [python] + sys.argv)
 
28
            except OSError:
 
29
                pass
 
30
    print >>sys.stderr, "bzr: error: cannot find a suitable python interpreter"
 
31
    print >>sys.stderr, "  (need %d.%d or later)" % NEED_VERS
 
32
    sys.exit(1)
 
33
if hasattr(os, "unsetenv"):
 
34
    os.unsetenv(REINVOKE)
 
35
 
 
36
 
7
37
from distutils.core import setup
8
38
from distutils.command.install_scripts import install_scripts
9
 
 
 
39
from distutils.command.build import build
10
40
 
11
41
###############################
12
42
# Overridden distutils actions
36
66
                print "ERROR: Unable to create %s: %s" % (batch_path, e)
37
67
 
38
68
 
 
69
class bzr_build(build):
 
70
    """Customized build distutils action.
 
71
    Generate bzr.1.
 
72
    """
 
73
    def run(self):
 
74
        build.run(self)
 
75
 
 
76
        import bzr_man
 
77
        bzr_man.main()
 
78
 
39
79
########################
40
80
## Setup
41
81
########################
42
82
 
43
83
setup(name='bzr',
44
 
      version='0.1',
 
84
      version='0.7pre',
45
85
      author='Martin Pool',
46
86
      author_email='mbp@sourcefrog.net',
47
87
      url='http://www.bazaar-ng.org/',
58
98
                'bzrlib.util.configobj',
59
99
                ],
60
100
      scripts=['bzr'],
61
 
      cmdclass={'install_scripts': my_install_scripts},
 
101
      cmdclass={'install_scripts': my_install_scripts, 'build': bzr_build},
 
102
      data_files=[('man/man1', ['bzr.1'])],
62
103
     )