More fixes to get the basic end-to-end delivery mechanisms working.
[mailman.git] / setup.py
blobb3327c0380fc973cbb8befd21e1fb2c231fe3700
1 # Copyright (C) 2007-2008 by the Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify it
4 # under the terms of the GNU General Public License as published by the Free
5 # Software Foundation; either version 2 of the License, or (at your option)
6 # any later version.
8 # This program is distributed in the hope that it will be useful, but WITHOUT
9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 # more details.
13 # You should have received a copy of the GNU General Public License along with
14 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 # Place - Suite 330, Boston, MA 02111-1307, USA.
17 import ez_setup
18 ez_setup.use_setuptools()
20 import sys
21 from string import Template
23 import mailman.bin
24 from mailman.Version import VERSION as __version__
25 from setuptools import setup, find_packages
29 if sys.hexversion < 0x20500f0:
30 print 'Mailman requires at least Python 2.5'
31 sys.exit(1)
35 # Ensure that all the .mo files are generated from the corresponding .po file.
36 # This procedure needs to be made sane, probably when the language packs are
37 # properly split out.
39 import os
40 import mailman.messages
42 start_dir = os.path.dirname(mailman.messages.__file__)
43 for dirpath, dirnames, filenames in os.walk(start_dir):
44 for filename in filenames:
45 po_file = os.path.join(dirpath, filename)
46 basename, ext = os.path.splitext(po_file)
47 if ext <> '.po':
48 continue
49 mo_file = basename + '.mo'
50 if (not os.path.exists(mo_file) or
51 os.path.getmtime(po_file) > os.path.getmtime(mo_file)):
52 # The mo file doesn't exist or is older than the po file.
53 os.system('bin/msgfmt.py -o %s %s' % (mo_file, po_file))
57 # XXX The 'bin/' prefix here should be configurable.
58 template = Template('bin/$script = mailman.bin.$script:main')
59 scripts = set(
60 template.substitute(script=os.path.splitext(script)[0])
61 for script in mailman.bin.__all__
62 if not script.startswith('_')
67 setup(
68 name = 'mailman',
69 version = __version__,
70 description = 'Mailman -- the GNU mailing list manager',
71 long_description= """\
72 This is GNU Mailman, a mailing list management system distributed under the
73 terms of the GNU General Public License (GPL). The name of this software is
74 spelled 'Mailman' with a leading capital 'M' but with a lower case second `m'.
75 Any other spelling is incorrect.""",
76 author = 'The Mailman Developers',
77 author_email = 'mailman-developers@python.org',
78 license = 'GPL',
79 url = 'http://www.list.org',
80 keywords = 'email',
81 packages = find_packages(),
82 include_package_data = True,
83 entry_points = {
84 'console_scripts': list(scripts),
85 # Entry point for plugging in different database backends.
86 'mailman.archiver' : 'default = mailman.app.archiving:Pipermail',
87 'mailman.database' : 'stock = mailman.database:StockDatabase',
88 'mailman.mta' : 'stock = mailman.MTA:Manual',
89 'mailman.styles' : 'default = mailman.app.styles:DefaultStyle',
90 'mailman.mta' : 'stock = mailman.MTA:Manual',
91 'mailman.rules' : 'default = mailman.rules:initialize',
92 'mailman.handlers' : 'default = mailman.pipeline:initialize',
94 install_requires = [
95 'locknix',
96 'munepy',
97 'storm',
98 'wsgiref',
99 'zope.interface',
101 setup_requires = [
102 'setuptools_bzr',