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)
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
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/>.
19 ez_setup
.use_setuptools()
22 from string
import Template
24 sys
.path
.insert(0, 'src')
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'
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
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
)
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')
64 template
.substitute(script
=script
)
65 for script
in mailman
.bin
.__all
__
68 # Default email commands
69 template
= Template('$command = mailman.commands.$command')
71 template
.substitute(command
=command
)
72 for command
in mailman
.commands
.__all
__
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',
89 url
= 'http://www.list.org',
91 packages
= find_packages('src'),
92 package_dir
= {'': 'src'},
93 include_package_data
= True,
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',