comparison setup.py @ 4096:ab542607f2fb

Move man pages into 'share/man/man1' and simplify setup.py
author Stefan Seefeld <stefan@seefeld.name>
date Thu, 12 Mar 2009 14:27:20 +0000
parents eddb82d0964c
children 3c0852dbcf39
comparison
equal deleted inserted replaced
4095:01eb89b07c13 4096:ab542607f2fb
50 script = os.path.splitext(os.path.basename(path))[0] 50 script = os.path.splitext(os.path.basename(path))[0]
51 script = script.replace('_', '-') 51 script = script.replace('_', '-')
52 return script 52 return script
53 53
54 def main(): 54 def main():
55 # build list of scripts from their implementation modules
56 roundup_scripts = map(scriptname, glob('roundup/scripts/[!_]*.py'))
57
58 # template munching 55 # template munching
59 packagelist = [ 56 packages = [
60 'roundup', 57 'roundup',
61 'roundup.anypy', 58 'roundup.anypy',
62 'roundup.cgi', 59 'roundup.cgi',
63 'roundup.cgi.PageTemplates', 60 'roundup.cgi.PageTemplates',
64 'roundup.cgi.TAL', 61 'roundup.cgi.TAL',
65 'roundup.cgi.ZTUtils', 62 'roundup.cgi.ZTUtils',
66 'roundup.backends', 63 'roundup.backends',
67 'roundup.scripts', 64 'roundup.scripts',
68 ] 65 ]
69 installdatafiles = [ 66 py_modules = ['roundup.demo',]
67
68 # build list of scripts from their implementation modules
69 scripts = [scriptname(f) for f in glob('roundup/scripts/[!_]*.py')]
70
71 data_files = [
70 ('share/roundup/cgi-bin', ['frontends/roundup.cgi']), 72 ('share/roundup/cgi-bin', ['frontends/roundup.cgi']),
71 ] 73 ]
72 py_modules = ['roundup.demo',]
73
74 # install man pages on POSIX platforms 74 # install man pages on POSIX platforms
75 if os.name == 'posix': 75 if os.name == 'posix':
76 installdatafiles.append(('man/man1', ['doc/roundup-admin.1', 76 data_files.append(include('share/man/man1', '*'))
77 'doc/roundup-mailgw.1', 'doc/roundup-server.1',
78 'doc/roundup-demo.1']))
79 77
80 # add the templates to the data files lists 78 # add the templates to the data files lists
81 from roundup.init import listTemplates 79 from roundup.init import listTemplates
82 templates = [t['path'] for t in listTemplates(os.path.join('share','roundup','templates')).values()] 80 templates = [t['path'] for t in listTemplates(os.path.join('share','roundup','templates')).values()]
83 for tdir in templates: 81 for tdir in templates:
84 # scan for data files
85 for idir in '. detectors extensions html'.split(): 82 for idir in '. detectors extensions html'.split():
86 idir = os.path.join(tdir, idir) 83 data_files.append(include(os.path.join(tdir, idir), '*'))
87 if not os.path.isdir(idir):
88 continue
89 tfiles = []
90 for f in os.listdir(idir):
91 if f.startswith('.'):
92 continue
93 ifile = os.path.join(idir, f)
94 if os.path.isfile(ifile):
95 tfiles.append(ifile)
96 installdatafiles.append(
97 (os.path.join('share', 'roundup', idir), tfiles)
98 )
99 84
100 # add message files 85 # add message files
101 for (_dist_file, _mo_file) in list_message_files(): 86 for (_dist_file, _mo_file) in list_message_files():
102 installdatafiles.append((os.path.dirname(_mo_file), 87 data_files.append((os.path.dirname(_mo_file), [os.path.join("build", _mo_file)]))
103 [os.path.join("build", _mo_file)]))
104 88
105 # add docs 89 # add docs
106 installdatafiles.append(include(os.path.join('share', 'doc', 'roundup', 'html'), '*')) 90 data_files.append(include(os.path.join('share', 'doc', 'roundup', 'html'), '*'))
107 91
108 # perform the setup action 92 # perform the setup action
109 from roundup import __version__ 93 from roundup import __version__
110 94
111 setup(name='roundup', 95 setup(name='roundup',
138 'build_scripts': build_scripts, 122 'build_scripts': build_scripts,
139 'build_py': build_py, 123 'build_py': build_py,
140 'build': build, 124 'build': build,
141 'bdist_rpm': bdist_rpm, 125 'bdist_rpm': bdist_rpm,
142 }, 126 },
143 packages=packagelist, 127 packages=packages,
144 py_modules=py_modules, 128 py_modules=py_modules,
145 scripts=roundup_scripts, 129 scripts=scripts,
146 data_files=installdatafiles) 130 data_files=data_files)
147 131
148 if __name__ == '__main__': 132 if __name__ == '__main__':
149 main() 133 main()
150 134
151 # vim: set filetype=python sts=4 sw=4 et si : 135 # vim: set filetype=python sts=4 sw=4 et si :

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