setup.py revision c88536d1f4a27d5cee1f38956223fec25861e013
1#! /usr/bin/env python 2 3import os, sys 4from distutils.core import setup, Extension 5from distutils.command.build_ext import build_ext 6 7try: 8 # load py2exe distutils extension, if available 9 import py2exe 10except ImportError: 11 pass 12 13try: 14 import numpy 15except ImportError: 16 print "*** Warning: FontTools needs the numpy library, see:" 17 print " http://numpy.scipy.org/" 18 19try: 20 import xml.parsers.expat 21except ImportError: 22 print "*** Warning: FontTools needs PyXML, see:" 23 print " http://sourceforge.net/projects/pyxml/" 24 25 26class build_ext_optional(build_ext): 27 """build_ext command which doesn't abort when it fails.""" 28 def build_extension(self, ext): 29 # Skip extensions which cannot be built 30 try: 31 build_ext.build_extension(self, ext) 32 except: 33 self.announce( 34 '*** WARNING: Building of extension "%s" ' 35 'failed: %s' % 36 (ext.name, sys.exc_info()[1])) 37 38 39if sys.version_info > (2, 3, 0, 'alpha', 1): 40 # Trove classifiers for PyPI 41 classifiers = {"classifiers": [ 42 "Development Status :: 4 - Beta", 43 "Environment :: Console", 44 "Environment :: Other Environment", 45 "Intended Audience :: Developers", 46 "Intended Audience :: End Users/Desktop", 47 "License :: OSI Approved :: BSD License", 48 "Natural Language :: English", 49 "Operating System :: OS Independent", 50 "Programming Language :: Python", 51 "Topic :: Multimedia :: Graphics", 52 "Topic :: Multimedia :: Graphics :: Graphics Conversion", 53 ]} 54else: 55 classifiers = {} 56 57long_description = """\ 58FontTools/TTX is a library to manipulate font files from Python. 59It supports reading and writing of TrueType/OpenType fonts, reading 60and writing of AFM files, reading (and partially writing) of PS Type 1 61fonts. The package also contains a tool called "TTX" which converts 62TrueType/OpenType fonts to and from an XML-based format. 63""" 64 65setup( 66 name = "fonttools", 67 version = "2.4", 68 description = "Tools to manipulate font files", 69 author = "Just van Rossum", 70 author_email = "just@letterror.com", 71 maintainer = "Just van Rossum", 72 maintainer_email = "just@letterror.com", 73 url = "http://fonttools.sourceforge.net/", 74 license = "OpenSource, BSD-style", 75 platforms = ["Any"], 76 long_description = long_description, 77 78 packages = [ 79 "", 80 "fontTools", 81 "fontTools.encodings", 82 "fontTools.misc", 83 "fontTools.pens", 84 "fontTools.ttLib", 85 "fontTools.ttLib.tables", 86 "fontTools.ttLib.test", 87 ], 88 package_dir = {'': 'Lib'}, 89 extra_path = 'FontTools', 90 ext_modules = [ 91 Extension( 92 "fontTools.misc.eexecOp", 93 ["Src/eexecOp/eexecOpmodule.c"], 94 include_dirs=[], 95 define_macros=[], 96 library_dirs=[], 97 libraries=[], 98 ) 99 ], 100 install_requires=[ 101 'numpy', 102 ], 103 scripts = ["Tools/ttx"], 104 console = ["Tools/ttx"], 105 cmdclass = {"build_ext": build_ext_optional}, 106 data_files = [('share/man/man1', ["Doc/ttx.1"])], 107 **classifiers 108 ) 109