1
1
#!/usr/bin/env python
2
# $Id: setup.py 4260 2006-01-09 18:28:09Z fwiemann $
2
# $Id: setup.py 5034 2007-03-21 23:00:23Z dkuhlman $
3
3
# Copyright: This file has been placed in the public domain.
8
from distutils.core import setup
9
from distutils.command.build_py import build_py
11
# From <http://groups.google.de/groups?as_umsgid=f70e3538.0404141327.6cea58ca@posting.google.com>.
12
from distutils.command.install import INSTALL_SCHEMES
13
for scheme in INSTALL_SCHEMES.values():
14
scheme['data'] = scheme['purelib']
9
from distutils.core import setup
10
from distutils.command.build_py import build_py
11
from distutils.command.install_data import install_data
13
print 'Error: The "distutils" standard module, which is required for the '
14
print 'installation of Docutils, could not be found. You may need to '
15
print 'install a package called "python-devel" (or similar) on your '
16
print 'system using your package manager.'
19
if sys.hexversion < 0x02030000:
20
# Hack for Python < 2.3.
21
# From <http://groups.google.de/groups?as_umsgid=f70e3538.0404141327.6cea58ca@posting.google.com>.
22
from distutils.command.install import INSTALL_SCHEMES
23
for scheme in INSTALL_SCHEMES.values():
24
scheme['data'] = scheme['purelib']
27
class smart_install_data(install_data):
29
# Hack for Python > 2.3.
30
# From <http://wiki.python.org/moin/DistutilsInstallDataScattered>,
34
#need to change self.install_dir to the library dir
35
install_cmd = self.get_finalized_command('install')
36
self.install_dir = getattr(install_cmd, 'install_lib')
37
return install_data.run(self)
21
44
kwargs['py_modules'] = extras
22
45
if sys.hexversion >= 0x02030000: # Python 2.3
23
46
kwargs['classifiers'] = classifiers
47
# Install data files properly. Note that we use a different
48
# hack for Python 2.2, which does not *always* work, though;
50
# <http://article.gmane.org/gmane.text.docutils.user/2867>.
51
# So for Python 2.3+, we prefer this hack.
52
kwargs['cmdclass'] = {'install_data': smart_install_data}
54
# Install data files properly. (Another hack for Python 2.2
55
# is at the top of this file.)
25
56
kwargs['cmdclass'] = {'build_py': dual_build_py}
26
57
dist = setup(**kwargs)
41
72
input Docutils supports reStructuredText, an easy-to-read,
42
73
what-you-see-is-what-you-get plaintext markup syntax.""", # wrap at col 60
43
74
'url': 'http://docutils.sourceforge.net/',
45
76
'author': 'David Goodger',
46
'author_email': 'goodger@users.sourceforge.net',
77
'author_email': 'goodger@python.org',
47
78
'license': 'public domain, Python, BSD, GPL (see COPYING.txt)',
48
79
'platforms': 'OS-independent',
49
80
'package_dir': {'docutils': 'docutils', '': 'extras'},
65
96
'data_files': ([('docutils/parsers/rst/include',
66
97
glob.glob('docutils/parsers/rst/include/*.txt')),
67
98
('docutils/writers/html4css1',
68
['docutils/writers/html4css1/html4css1.css']),
99
['docutils/writers/html4css1/html4css1.css',
100
'docutils/writers/html4css1/template.txt']),
69
101
('docutils/writers/latex2e',
70
102
['docutils/writers/latex2e/latex2e.tex']),
71
103
('docutils/writers/newlatex2e',