comparison setup.py @ 2776:10e96f3ee658

install demo.py as a module in roundup package. fix collecting template files: listir() broke for non-existing extensions subdir.
author Alexander Smishlajev <a1s@users.sourceforge.net>
date Mon, 18 Oct 2004 07:51:46 +0000
parents 94229a0832bd
children fdad30b046e2
comparison
equal deleted inserted replaced
2775:2907abb10e55 2776:10e96f3ee658
14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
18 # 18 #
19 # $Id: setup.py,v 1.71 2004-09-25 16:14:32 a1s Exp $ 19 # $Id: setup.py,v 1.72 2004-10-18 07:51:46 a1s Exp $
20 20
21 from distutils.core import setup, Extension 21 from distutils.core import setup, Extension
22 from distutils.util import get_platform 22 from distutils.util import get_platform
23 from distutils.command.build_scripts import build_scripts 23 from distutils.command.build_scripts import build_scripts
24 from distutils.command.build import build 24 from distutils.command.build import build
25 from distutils.command.build_py import build_py
25 26
26 import sys, os, string 27 import sys, os, string
27 from glob import glob 28 from glob import glob
28 29
29 # patch distutils if it can't cope with the "classifiers" keyword 30 # patch distutils if it can't cope with the "classifiers" keyword
221 n-len(err), n) 222 n-len(err), n)
222 print 'Missing:', '\nMissing: '.join(err) 223 print 'Missing:', '\nMissing: '.join(err)
223 sys.exit(1) 224 sys.exit(1)
224 225
225 226
227 class build_py_roundup(build_py):
228
229 def find_modules(self):
230 # Files listed in py_modules are in the toplevel directory
231 # of the source distribution.
232 modules = []
233 for module in self.py_modules:
234 path = string.split(module, '.')
235 package = string.join(path[0:-1], '.')
236 module_base = path[-1]
237 module_file = module_base + '.py'
238 if self.check_module(module, module_file):
239 modules.append((package, module_base, module_file))
240 return modules
241
242
226 class build_roundup(build): 243 class build_roundup(build):
227 244
228 def build_message_files(self): 245 def build_message_files(self):
229 """Copy all .mo files to their locale directories""" 246 """Copy all .mo files to their locale directories"""
230 for (_src, _dst) in list_message_files(): 247 for (_src, _dst) in list_message_files():
251 'roundup.cgi', 268 'roundup.cgi',
252 'roundup.cgi.PageTemplates', 269 'roundup.cgi.PageTemplates',
253 'roundup.cgi.TAL', 270 'roundup.cgi.TAL',
254 'roundup.cgi.ZTUtils', 271 'roundup.cgi.ZTUtils',
255 'roundup.backends', 272 'roundup.backends',
256 'roundup.scripts' 273 'roundup.scripts',
257 ] 274 ]
258 installdatafiles = [ 275 installdatafiles = [
259 ('share/roundup/cgi-bin', ['cgi-bin/roundup.cgi']), 276 ('share/roundup/cgi-bin', ['cgi-bin/roundup.cgi']),
260 ] 277 ]
278 py_modules = ['roundup.demo',]
261 279
262 # install man pages on POSIX platforms 280 # install man pages on POSIX platforms
263 if os.name == 'posix': 281 if os.name == 'posix':
264 installdatafiles.append(('man/man1', ['doc/roundup-admin.1', 282 installdatafiles.append(('man/man1', ['doc/roundup-admin.1',
265 'doc/roundup-mailgw.1', 'doc/roundup-server.1'])) 283 'doc/roundup-mailgw.1', 'doc/roundup-server.1']))
269 templates = [t['path'] for t in listTemplates('templates').values()] 287 templates = [t['path'] for t in listTemplates('templates').values()]
270 for tdir in templates: 288 for tdir in templates:
271 # scan for data files 289 # scan for data files
272 for idir in '. detectors extensions html'.split(): 290 for idir in '. detectors extensions html'.split():
273 idir = os.path.join(tdir, idir) 291 idir = os.path.join(tdir, idir)
292 if not os.path.isdir(idir):
293 continue
274 tfiles = [] 294 tfiles = []
275 for f in os.listdir(idir): 295 for f in os.listdir(idir):
276 if f.startswith('.'): 296 if f.startswith('.'):
277 continue 297 continue
278 ifile = os.path.join(idir, f) 298 ifile = os.path.join(idir, f)
322 author = "Richard Jones", 342 author = "Richard Jones",
323 author_email = "richard@users.sourceforge.net", 343 author_email = "richard@users.sourceforge.net",
324 url = 'http://roundup.sourceforge.net/', 344 url = 'http://roundup.sourceforge.net/',
325 download_url = 'http://sourceforge.net/project/showfiles.php?group_id=31577', 345 download_url = 'http://sourceforge.net/project/showfiles.php?group_id=31577',
326 packages = packagelist, 346 packages = packagelist,
347 py_modules = py_modules,
327 classifiers = [ 348 classifiers = [
328 'Development Status :: 4 - Beta', 349 'Development Status :: 4 - Beta',
329 'Environment :: Console', 350 'Environment :: Console',
330 'Environment :: Web Environment', 351 'Environment :: Web Environment',
331 'Intended Audience :: End Users/Desktop', 352 'Intended Audience :: End Users/Desktop',
342 ], 363 ],
343 364
344 # Override certain command classes with our own ones 365 # Override certain command classes with our own ones
345 cmdclass = { 366 cmdclass = {
346 'build_scripts': build_scripts_roundup, 367 'build_scripts': build_scripts_roundup,
368 'build_py': build_py_roundup,
347 'build': build_roundup, 369 'build': build_roundup,
348 }, 370 },
349 scripts = roundup_scripts, 371 scripts = roundup_scripts,
350 372
351 data_files = installdatafiles 373 data_files = installdatafiles

Roundup Issue Tracker: http://roundup-tracker.org/