[4] | 1 | #!/usr/bin/env python |
---|
| 2 | |
---|
| 3 | """Setup script for the mmpython distribution.""" |
---|
| 4 | |
---|
| 5 | __revision__ = "$Id: setup.py,v 1.12 2004/05/25 14:10:19 the_krow Exp $" |
---|
| 6 | |
---|
| 7 | from distutils.core import setup, Extension |
---|
| 8 | import popen2 |
---|
| 9 | import version |
---|
| 10 | |
---|
| 11 | extensions = [ Extension('mmpython/disc/cdrom', ['disc/cdrommodule.c']) ] |
---|
| 12 | # check for libdvdread (bad hack!) |
---|
| 13 | # Windows does not have Popen4, so catch exception here |
---|
| 14 | try: |
---|
| 15 | child = popen2.Popen4('gcc -ldvdread') |
---|
| 16 | if child.fromchild.readline().find('cannot find') == -1: |
---|
| 17 | # gcc failed, but not with 'cannot find', so libdvd must be |
---|
| 18 | # somewhere (I hope) |
---|
| 19 | extensions.append(Extension('mmpython/disc/ifoparser', ['disc/ifomodule.c'], |
---|
| 20 | libraries=[ 'dvdread' ], |
---|
| 21 | library_dirs=['/usr/local/lib'], |
---|
| 22 | include_dirs=['/usr/local/include'])) |
---|
| 23 | child.wait() |
---|
| 24 | except AttributeError, e: |
---|
| 25 | print "No Popen4 found. This seems to be Windows." |
---|
| 26 | print "Installing without libdvdread support." |
---|
| 27 | # Hack: disable extensions for Windows. |
---|
| 28 | # This would better be done by a clean detect of windows. But how? |
---|
| 29 | extensions = [] |
---|
| 30 | |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | setup (# Distribution meta-data |
---|
| 34 | name = "mmpython", |
---|
| 35 | version = version.VERSION, |
---|
| 36 | description = "Module for retrieving information about media files", |
---|
| 37 | author = "Thomas Schueppel, Dirk Meyer", |
---|
| 38 | author_email = "freevo-devel@lists.sourceforge.net", |
---|
| 39 | url = "http://mmpython.sf.net", |
---|
| 40 | |
---|
| 41 | scripts = [ 'mminfo' ], |
---|
| 42 | package_dir = {'mmpython.video': 'video', |
---|
| 43 | 'mmpython.audio': 'audio', |
---|
| 44 | 'mmpython.audio.eyeD3': 'audio/eyeD3', |
---|
| 45 | 'mmpython.image': 'image', |
---|
| 46 | 'mmpython.disc' : 'disc', |
---|
| 47 | 'mmpython.misc' : 'misc', |
---|
| 48 | 'mmpython': ''}, |
---|
| 49 | |
---|
| 50 | packages = [ 'mmpython', 'mmpython.video', 'mmpython.audio', 'mmpython.audio.eyeD3', |
---|
| 51 | 'mmpython.image', 'mmpython.disc', 'mmpython.misc' ], |
---|
| 52 | |
---|
| 53 | # Description of the modules and packages in the distribution |
---|
| 54 | ext_modules = extensions |
---|
| 55 | |
---|
| 56 | ) |
---|
| 57 | |
---|