3 """Setup script for the Vorbis module distribution."""
5 import os
, re
, sys
, string
6 from distutils
.core
import setup
7 from distutils
.extension
import Extension
11 pyvorbis_version
= str(VERSION_MAJOR
) + '.' + str(VERSION_MINOR
)
16 print '''You must have the Ogg Python bindings
17 installed in order to build and install
18 these bindings. Import of ogg._ogg failed.'''
23 r
= re
.compile(r
'(\S+)\s*?=\s*(.+)')
25 if not os
.path
.isfile('Setup'):
26 print "No 'Setup' file. Perhaps you need to run the configure script."
29 f
= open('Setup', 'r')
31 for line
in f
.readlines():
34 print "Error in setup file:", line
44 vorbis_include_dir
= data
['vorbis_include_dir']
45 vorbis_lib_dir
= data
['vorbis_lib_dir']
46 vorbis_libs
= string
.split(data
['vorbis_libs'])
48 ogg_include_dir
= data
['ogg_include_dir']
49 ogg_lib_dir
= data
['ogg_lib_dir']
51 vorbismodule
= Extension(name
='vorbis',
52 sources
=['src/vorbismodule.c',
54 'src/pyvorbiscodec.c',
58 define_macros
= [('VERSION', '"%s"' %
60 include_dirs
=[vorbis_include_dir
,
62 library_dirs
=[vorbis_lib_dir
,
64 libraries
=vorbis_libs
)
66 setup ( name
= "pyvorbis",
67 version
= pyvorbis_version
,
68 description
= "A wrapper for the Vorbis libraries.",
69 author
= "Andrew Chatham",
70 author_email
= "andrew.chatham@duke.edu",
71 url
= "http://dulug.duke.edu/~andrew/pyogg",
74 package_dir
= {'ogg' : 'src'},
76 ext_modules
= [vorbismodule
])