1import os
2import sys
3from distutils.core import setup, Extension
4
5if sys.version < '2.6.5':
6  sys.exit('ERROR: Sorry, python 2.6.5 is required for this module.')
7
8# FIXME: on some versions of sendmail, smutil is renamed to sm.
9# On slackware and debian, leave it out entirely.  It depends
10# on how libmilter was built by the sendmail package.
11#libs = ["milter", "smutil"]
12libs = ["milter"]
13libdirs = ["/usr/lib/libmilter"]    # needed for Debian
14modules = ["mime"]
15
16# NOTE: importing Milter to obtain version fails when milter.so not built
17setup(name = "pymilter", version = '1.0.4',
18	description="Python interface to sendmail milter API",
19	long_description="""\
20This is a python extension module to enable python scripts to
21attach to sendmail's libmilter functionality.  Additional python
22modules provide for navigating and modifying MIME parts, and
23sending DSNs or doing CBVs.
24""",
25	author="Jim Niemira",
26	author_email="urmane@urmane.org",
27	maintainer="Stuart D. Gathman",
28	maintainer_email="stuart@gathman.org",
29	license="GPL",
30	url="https://pythonhosted.org/milter/",
31	py_modules=modules,
32	packages = ['Milter'],
33	ext_modules=[
34	  Extension("milter", ["miltermodule.c"],
35            library_dirs=libdirs,
36	    libraries=libs,
37	    # set MAX_ML_REPLY to 1 for sendmail < 8.13
38	    define_macros = [ ('MAX_ML_REPLY',32) ],
39            # save lots of debugging time testing rfc2553 compliance
40            extra_compile_args = [ "-Werror=implicit-function-declaration" ]
41	  ),
42	],
43	keywords = ['sendmail','milter'],
44	classifiers = [
45	  'Development Status :: 5 - Production/Stable',
46	  'Environment :: No Input/Output (Daemon)',
47	  'Intended Audience :: System Administrators',
48	  'License :: OSI Approved :: GNU General Public License (GPL)',
49	  'Natural Language :: English',
50	  'Operating System :: POSIX',
51	  'Programming Language :: Python',
52	  'Topic :: Communications :: Email :: Mail Transport Agents',
53	  'Topic :: Communications :: Email :: Filters'
54	]
55)
56