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)
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
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.
18 ez_setup
.use_setuptools()
21 from string
import Template
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'
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
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
)
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')
60 template
.substitute(script
=os
.path
.splitext(script
)[0])
61 for script
in Mailman
.bin
.__all
__
62 if not script
.startswith('_')
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',
79 url
= 'http://www.list.org',
81 packages
= find_packages(),
82 include_package_data
= True,
84 'console_scripts': list(scripts
),
85 'setuptools.file_finders': 'bzr = setuptools_bzr:find_files_for_bzr',
86 # Entry point for plugging in different database backends.
87 'mailman.archiver' : 'stock = Mailman.app.archiving:Pipermail',
88 'mailman.database' : 'stock = Mailman.database:StockDatabase',
89 'mailman.mta' : 'stock = Mailman.MTA:Manual',
90 'mailman.styles' : 'default = Mailman.app.styles:DefaultStyle',
91 'mailman.mta' : 'stock = Mailman.MTA:Manual',
92 'mailman.rules' : 'default = Mailman.rules:initialize',
94 # Third-party requirements.