Fix 64 bit incompatibility.
[mailman.git] / setup.py
blob4d807a5ee69b17f54689bd107a416705e2bb6580
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 sys
22 from string import Template
24 sys.path.insert(0, 'src')
26 import mailman.bin
27 from mailman.version import VERSION as __version__
28 from setuptools import setup, find_packages
32 if sys.hexversion < 0x20600f0:
33 print 'Mailman requires at least Python 2.6'
34 sys.exit(1)
38 # Ensure that all the .mo files are generated from the corresponding .po file.
39 # This procedure needs to be made sane, probably when the language packs are
40 # properly split out.
42 import os
43 import mailman.commands
44 import mailman.messages
46 start_dir = os.path.dirname(mailman.messages.__file__)
47 for dirpath, dirnames, filenames in os.walk(start_dir):
48 for filename in filenames:
49 po_file = os.path.join(dirpath, filename)
50 basename, ext = os.path.splitext(po_file)
51 if ext <> '.po':
52 continue
53 mo_file = basename + '.mo'
54 if (not os.path.exists(mo_file) or
55 os.path.getmtime(po_file) > os.path.getmtime(mo_file)):
56 # The mo file doesn't exist or is older than the po file.
57 os.system('msgfmt -o %s %s' % (mo_file, po_file))
61 # XXX The 'bin/' prefix here should be configurable.
62 template = Template('$script = mailman.bin.$script:main')
63 scripts = set(
64 template.substitute(script=script)
65 for script in mailman.bin.__all__
68 # Default email commands
69 template = Template('$command = mailman.commands.$command')
70 commands = set(
71 template.substitute(command=command)
72 for command in mailman.commands.__all__
77 setup(
78 name = 'mailman',
79 version = __version__,
80 description = 'Mailman -- the GNU mailing list manager',
81 long_description= """\
82 This is GNU Mailman, a mailing list management system distributed under the
83 terms of the GNU General Public License (GPL) version 3 or later. The name of
84 this software is spelled 'Mailman' with a leading capital 'M' but with a lower
85 case second `m'. Any other spelling is incorrect.""",
86 author = 'The Mailman Developers',
87 author_email = 'mailman-developers@python.org',
88 license = 'GPLv3',
89 url = 'http://www.list.org',
90 keywords = 'email',
91 packages = find_packages('src'),
92 package_dir = {'': 'src'},
93 include_package_data = True,
94 entry_points = {
95 'console_scripts': list(scripts),
96 'mailman.commands' : list(commands),
97 'mailman.database' : 'stock = mailman.database:StockDatabase',
98 'mailman.handlers' : 'default = mailman.pipeline:initialize',
99 'mailman.rules' : 'default = mailman.rules:initialize',
100 'mailman.scrubber' : 'stock = mailman.archiving.pipermail:Pipermail',
102 install_requires = [
103 'lazr.config',
104 'locknix',
105 'munepy',
106 'storm',
107 'zope.interface',
109 setup_requires = [
110 'setuptools_bzr',