/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: 2007-09-14 06:31:28 UTC
  • mfrom: (2822 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2823.
  • Revision ID: mbp@sourcefrog.net-20070914063128-0p7mh6zfb4pzdg9p
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
 
104
104
        if sys.platform == "win32":
105
105
            try:
106
 
                scripts_dir = self.install_dir
 
106
                scripts_dir = os.path.join(sys.prefix, 'Scripts')
107
107
                script_path = self._quoted_path(os.path.join(scripts_dir,
108
108
                                                             "bzr"))
109
109
                python_exe = self._quoted_path(sys.executable)
110
110
                args = self._win_batch_args()
111
111
                batch_str = "@%s %s %s" % (python_exe, script_path, args)
112
 
                batch_path = script_path + ".bat"
 
112
                batch_path = os.path.join(self.install_dir, "bzr.bat")
113
113
                f = file(batch_path, "w")
114
114
                f.write(batch_str)
115
115
                f.close()
195
195
            ext_modules.append(Extension(module_name, [c_name]))
196
196
 
197
197
 
 
198
add_pyrex_extension('bzrlib._dirstate_helpers_c')
198
199
add_pyrex_extension('bzrlib._knit_load_data_c')
 
200
ext_modules.append(Extension('bzrlib._patiencediff_c', ['bzrlib/_patiencediff_c.c']))
199
201
 
200
202
 
201
203
if unavailable_files:
206
208
 
207
209
 
208
210
if 'bdist_wininst' in sys.argv:
209
 
    import glob
210
 
    # doc files
211
 
    docs = glob.glob('doc/*.htm') + ['doc/default.css']
212
 
    dev_docs = glob.glob('doc/developers/*.htm')
 
211
    def find_docs():
 
212
        docs = []
 
213
        for root, dirs, files in os.walk('doc'):
 
214
            r = []
 
215
            for f in files:
 
216
                if os.path.splitext(f)[1] in ('.html', '.css'):
 
217
                    r.append(os.path.join(root, f))
 
218
            if r:
 
219
                relative = root[4:]
 
220
                if relative:
 
221
                    target = os.path.join('Doc\\Bazaar', relative)
 
222
                else:
 
223
                    target = 'Doc\\Bazaar'
 
224
                docs.append((target, r))
 
225
        return docs
 
226
 
213
227
    # python's distutils-based win32 installer
214
228
    ARGS = {'scripts': ['bzr', 'tools/win32/bzr-win32-bdist-postinstall.py'],
215
229
            'ext_modules': ext_modules,
216
230
            # help pages
217
 
            'data_files': [('Doc/Bazaar', docs),
218
 
                           ('Doc/Bazaar/developers', dev_docs),
219
 
                          ],
 
231
            'data_files': find_docs(),
220
232
            # for building pyrex extensions
221
233
            'cmdclass': {'build_ext': build_ext},
222
234
           }
282
294
          zipfile='lib/library.zip')
283
295
 
284
296
else:
 
297
    # ad-hoc for easy_install
 
298
    DATA_FILES = []
 
299
    if not 'bdist_egg' in sys.argv:
 
300
        # generate and install bzr.1 only with plain install, not easy_install one
 
301
        DATA_FILES = [('man/man1', ['bzr.1'])]
 
302
 
285
303
    # std setup
286
304
    ARGS = {'scripts': ['bzr'],
287
 
            'data_files': [('man/man1', ['bzr.1'])],
 
305
            'data_files': DATA_FILES,
288
306
            'cmdclass': command_classes,
289
307
            'ext_modules': ext_modules,
290
308
           }
291
 
    
 
309
 
292
310
    ARGS.update(META_INFO)
293
311
    ARGS.update(BZRLIB)
294
312
    ARGS.update(PKG_DATA)