IMailTransportAgent -> IMailTransportAgentAliases
[mailman.git] / setup.py
blob7dcac047df6c47bea54dd945812e883996b0b6fd
1 # Copyright (C) 2007-2009 by the Free Software Foundation, Inc.
3 # This file is part of GNU Mailman.
5 # GNU Mailman is free software: you can redistribute it and/or modify it under
6 # the terms of the GNU General Public License as published by the Free
7 # Software Foundation, either version 3 of the License, or (at your option)
8 # any later version.
10 # GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 # more details.
15 # You should have received a copy of the GNU General Public License along with
16 # GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
18 import ez_setup
19 ez_setup.use_setuptools()
21 import os
22 import re
23 import sys
25 from setuptools import setup, find_packages
26 from string import Template
28 if sys.hexversion < 0x20600f0:
29 print 'Mailman requires at least Python 2.6'
30 sys.exit(1)
33 # Calculate the version number without importing the mailman package.
34 with open('src/mailman/version.py') as fp:
35 for line in fp:
36 mo = re.match('VERSION = "(?P<version>[^"]+?)"', line)
37 if mo:
38 __version__ = mo.group('version')
39 break
40 else:
41 print 'No version number found'
42 sys.exit(1)
46 # Ensure that all the .mo files are generated from the corresponding .po file.
47 # This procedure needs to be made sane, probably when the language packs are
48 # properly split out.
50 # Create the .mo files from the .po files. There may be errors and warnings
51 # here and that could cause the digester.txt test to fail.
52 start_dir = os.path.dirname('src/mailman/messages')
53 for dirpath, dirnames, filenames in os.walk(start_dir):
54 for filename in filenames:
55 po_file = os.path.join(dirpath, filename)
56 basename, ext = os.path.splitext(po_file)
57 if ext <> '.po':
58 continue
59 mo_file = basename + '.mo'
60 if (not os.path.exists(mo_file) or
61 os.path.getmtime(po_file) > os.path.getmtime(mo_file)):
62 # The mo file doesn't exist or is older than the po file.
63 os.system('msgfmt -o %s %s' % (mo_file, po_file))
67 # XXX The 'bin/' prefix here should be configurable.
68 template = Template('$script = mailman.bin.$script:main')
69 scripts = set(
70 template.substitute(script=script)
71 for script in ('mailman', 'qrunner', 'master')
76 setup(
77 name = 'mailman',
78 version = __version__,
79 description = 'Mailman -- the GNU mailing list manager',
80 long_description= """\
81 This is GNU Mailman, a mailing list management system distributed under the
82 terms of the GNU General Public License (GPL) version 3 or later. The name of
83 this software is spelled 'Mailman' with a leading capital 'M' but with a lower
84 case second `m'. Any other spelling is incorrect.""",
85 author = 'The Mailman Developers',
86 author_email = 'mailman-developers@python.org',
87 license = 'GPLv3',
88 url = 'http://www.list.org',
89 keywords = 'email',
90 packages = find_packages('src'),
91 package_dir = {'': 'src'},
92 include_package_data = True,
93 entry_points = {
94 'console_scripts' : list(scripts),
96 install_requires = [
97 'argparse',
98 'lazr.config',
99 'lazr.delegates',
100 'lazr.restful',
101 'lazr.smtptest',
102 'locknix',
103 'munepy',
104 'storm',
105 'zope.component',
106 'zope.interface',
107 'zope.schema',
109 setup_requires = [
110 'setuptools_bzr',
112 extras_require=dict(
113 docs=['Sphinx', 'z3c.recipe.sphinxdoc'],