2 from setuptools import setup, Extension
4 from distutils.core import setup, Extension
6 import distutils.command.install
10 class bogus_uninstall(distutils.command.install.install):
12 Slightly bogus uninstall, just here to satisfy automake's make
13 distcheck. Do NOT actually use this to uninstall the module!
16 # I believe the word 'bogus' is operative here. When we run
17 # get_outputs() it will create subcommands, which will try to
18 # create the original 'install' object, which does not exist
19 # at this point. We need to make sure that the --prefix
20 # argument gets propagated to said object. This is not the
21 # right way to do that, but it works, for now.
22 install = self.distribution.get_command_obj('install')
23 install.prefix = self.prefix
24 install.ensure_finalized()
26 for f in self.get_outputs():
27 dirs[os.path.dirname(f)] = 1
31 print "Trying to remove file", f
36 # Gently try to remove any empty directories.
37 # This is really not guaranteed to work!!!
39 while d != self.prefix:
40 print "Trying to remove dir", d
42 if d.endswith(".egg-info"):
43 files=[os.path.join(d,f) for f in os.listdir(d)]
44 print "Trying to remove:", " ".join(files)
45 for f in files: os.unlink(f)
49 d = os.path.dirname(d)
51 libraries = ['sphinxbase']
52 if sys.platform == "cygwin":
53 libraries.append("iconv")
55 setup(name = 'SphinxBase',
56 version = '@VERSION@',
57 author = 'David Huggins-Daines',
58 author_email = 'dhuggins@cs.cmu.edu',
59 description = 'Python interface to CMU Sphinx base libraries',
61 url = 'http://cmusphinx.org',
63 Extension('sphinxbase',
64 sources=['sphinxbase.c'],
66 include_dirs=['@top_builddir@/include',
67 '@top_srcdir@/include'],
68 library_dirs=['@top_builddir@/src/libsphinxbase/.libs'])
70 cmdclass = {'bogus_uninstall' : bogus_uninstall}