Show More
@@ -1,87 +1,91 | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | # |
|
3 | 3 | # This is the mercurial setup script. |
|
4 | 4 | # |
|
5 | 5 | # 'python setup.py install', or |
|
6 | 6 | # 'python setup.py --help' for more options |
|
7 | 7 | |
|
8 | 8 | import sys |
|
9 | 9 | if not hasattr(sys, 'version_info') or sys.version_info < (2, 3, 0, 'final'): |
|
10 | 10 | raise SystemExit, "Mercurial requires python 2.3 or later." |
|
11 | 11 | |
|
12 | 12 | import os |
|
13 | 13 | from distutils.core import setup, Extension |
|
14 | 14 | from distutils.command.install_data import install_data |
|
15 | 15 | |
|
16 | 16 | import mercurial.version |
|
17 | 17 | |
|
18 | 18 | extra = {} |
|
19 | 19 | |
|
20 | 20 | # py2exe needs to be installed to work |
|
21 | 21 | try: |
|
22 | 22 | import py2exe |
|
23 | 23 | |
|
24 | 24 | # Help py2exe to find win32com.shell |
|
25 | 25 | try: |
|
26 | 26 | import modulefinder |
|
27 | 27 | import win32com |
|
28 | 28 | for p in win32com.__path__[1:]: # Take the path to win32comext |
|
29 | 29 | modulefinder.AddPackagePath("win32com", p) |
|
30 | 30 | pn = "win32com.shell" |
|
31 | 31 | __import__(pn) |
|
32 | 32 | m = sys.modules[pn] |
|
33 | 33 | for p in m.__path__[1:]: |
|
34 | 34 | modulefinder.AddPackagePath(pn, p) |
|
35 | 35 | except ImportError: |
|
36 | 36 | pass |
|
37 | 37 | |
|
38 | 38 | extra['console'] = ['hg'] |
|
39 | 39 | |
|
40 | 40 | except ImportError: |
|
41 | 41 | pass |
|
42 | 42 | |
|
43 | if os.name in ['nt']: | |
|
44 | extra['scripts'] = ['hg'] | |
|
45 | else: | |
|
46 | extra['scripts'] = ['hg', 'hgmerge'] | |
|
47 | ||
|
43 | 48 | # specify version string, otherwise 'hg identify' will be used: |
|
44 | 49 | version = '' |
|
45 | 50 | |
|
46 | 51 | class install_package_data(install_data): |
|
47 | 52 | def finalize_options(self): |
|
48 | 53 | self.set_undefined_options('install', |
|
49 | 54 | ('install_lib', 'install_dir')) |
|
50 | 55 | install_data.finalize_options(self) |
|
51 | 56 | |
|
52 | 57 | mercurial.version.remember_version(version) |
|
53 | 58 | cmdclass = {'install_data': install_package_data} |
|
54 | 59 | |
|
55 | 60 | ext_modules=[ |
|
56 | 61 | Extension('mercurial.mpatch', ['mercurial/mpatch.c']), |
|
57 | 62 | Extension('mercurial.bdiff', ['mercurial/bdiff.c']), |
|
58 | 63 | Extension('mercurial.base85', ['mercurial/base85.c']), |
|
59 | 64 | Extension('mercurial.diffhelpers', ['mercurial/diffhelpers.c']) |
|
60 | 65 | ] |
|
61 | 66 | |
|
62 | 67 | try: |
|
63 | 68 | import posix |
|
64 | 69 | ext_modules.append(Extension('mercurial.osutil', ['mercurial/osutil.c'])) |
|
65 | 70 | except ImportError: |
|
66 | 71 | pass |
|
67 | 72 | |
|
68 | 73 | setup(name='mercurial', |
|
69 | 74 | version=mercurial.version.get_version(), |
|
70 | 75 | author='Matt Mackall', |
|
71 | 76 | author_email='mpm@selenic.com', |
|
72 | 77 | url='http://selenic.com/mercurial', |
|
73 | 78 | description='Scalable distributed SCM', |
|
74 | 79 | license='GNU GPL', |
|
75 | 80 | packages=['mercurial', 'mercurial.hgweb', 'hgext', 'hgext.convert'], |
|
76 | 81 | ext_modules=ext_modules, |
|
77 | 82 | data_files=[(os.path.join('mercurial', root), |
|
78 | 83 | [os.path.join(root, file_) for file_ in files]) |
|
79 | 84 | for root, dirs, files in os.walk('templates')], |
|
80 | 85 | cmdclass=cmdclass, |
|
81 | scripts=['hg', 'hgmerge'], | |
|
82 | 86 | options=dict(py2exe=dict(packages=['hgext']), |
|
83 | 87 | bdist_mpkg=dict(zipdist=True, |
|
84 | 88 | license='COPYING', |
|
85 | 89 | readme='contrib/macosx/Readme.html', |
|
86 | 90 | welcome='contrib/macosx/Welcome.html')), |
|
87 | 91 | **extra) |
General Comments 0
You need to be logged in to leave comments.
Login now