~ubuntu-branches/ubuntu/jaunty/python-docutils/jaunty

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Bazaar Package Importer
  • Author(s): Simon McVittie
  • Date: 2008-07-24 10:39:53 UTC
  • mfrom: (1.1.4 upstream) (3.1.7 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080724103953-8gh4uezg17g9ysgy
Tags: 0.5-2
* Upload docutils 0.5 to unstable
* Update rst.el to upstream Subversion r5596, which apparently fixes
  all its performance problems (17_speed_up_rst_el.dpatch, closes: #474941)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.
4
4
 
5
5
import sys
6
6
import os
7
7
import glob
8
 
from distutils.core import setup
9
 
from distutils.command.build_py import build_py
10
 
 
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']
 
8
try:
 
9
    from distutils.core import setup
 
10
    from distutils.command.build_py import build_py
 
11
    from distutils.command.install_data import install_data
 
12
except ImportError:
 
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.'
 
17
    sys.exit(1)
 
18
 
 
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']
 
25
 
 
26
 
 
27
class smart_install_data(install_data):
 
28
 
 
29
    # Hack for Python > 2.3.
 
30
    # From <http://wiki.python.org/moin/DistutilsInstallDataScattered>,
 
31
    # by Pete Shinners.
 
32
 
 
33
    def run(self):
 
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)
15
38
 
16
39
 
17
40
def do_setup():
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;
 
49
        # see
 
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}
24
53
    else:
 
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)
27
58
    return dist
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/',
44
 
    'version': '0.4',
 
75
    'version': '0.5',
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',
81
113
                 'tools/rst2latex.py',
82
114
                 'tools/rst2newlatex.py',
83
115
                 'tools/rst2xml.py',
84
 
                 'tools/rst2pseudoxml.py'],}
 
116
                 'tools/rst2pseudoxml.py',
 
117
                 'tools/rstpep2html.py',
 
118
                 ],}
85
119
"""Distutils setup parameters."""
86
120
 
87
121
classifiers = [