Import from v. 2.0.2 downloaded from http://getfo.org/texml/
[texml.git] / setup.py
1 import sys
2 from distutils.core import setup
3 import os.path
4 import re
5 import glob
6
7 def test_for_sax():
8     try:
9         import xml.sax
10     except ImportError:
11         sys.stderr.write('Please install the python pyxml modules\n')
12         sys.stdout.write('You must have this module before you can install texml\n')
13         sys.exit(1)
14
15 def get_dtd_location():
16     """
17     For now, this is not used
18
19     """
20     return
21     return '/home/paul/Documents/data/dtds/'
22
23
24 def get_version():
25     # Take the version from "scripts/texml.py"
26     version    = None
27     version_re = re.compile('^VERSION[^"]*"([^"]+)"; # GREPVERSION')
28     f = open(os.path.join('scripts', 'texml.py'))
29     for line in f:
30       match = version_re.search(line)
31       if match:
32         version = match.group(1)
33         break
34     f.close()
35     if None == version:
36       raise "Can't find version"
37     return version
38
39 if 'build' in sys.argv:
40     test_for_sax()
41
42 version = get_version()
43
44 setup(name="texml",
45     version= version ,
46     description="Convert TeXML to LaTeX or ConTeXt",
47     long_description = """TeXML is an XML syntax for TeX. The processor transforms the TeXML markup into the TeX markup, escaping special and out-of-encoding characters. The intended audience is developers who automatically generate [La]TeX or ConTeXt files.""",
48     author="Oleg Parashchenko, Paul Tremblay",
49     author_email="olpa@ http://uucode.com/",
50     license = 'MIT',
51     url = 'http://getfo.org/texml/',
52     packages=['Texml'],
53     scripts=['scripts/texml.py', 'scripts/texml'],
54     data_files=[
55       ('share/man/man1', ['docs/texml.1']),
56       ('share/doc/texml-%s' % version,
57         glob.glob(os.path.join('docs', '*.html')) +
58         glob.glob(os.path.join('docs', '*.css'))  +
59         glob.glob(os.path.join('docs', '*.png')))
60     ]
61   )
62