3 """Setup script for the Ogg module distribution."""
10 from distutils
.core
import setup
11 from distutils
.extension
import Extension
15 pyogg_version
= str(VERSION_MAJOR
) + "." + str(VERSION_MINOR
)
19 r
= re
.compile(r
'(\S+)\s*?=\s*(.+)')
21 if not os
.path
.isfile('Setup'):
22 print "No 'Setup' file. Perhaps you need to run the configure script."
25 f
= open('Setup', 'r')
27 for line
in f
.readlines():
30 print "Error in setup file:", line
39 ogg_include_dir
= data
['ogg_include_dir']
40 ogg_lib_dir
= data
['ogg_lib_dir']
41 ogg_libs
= string
.split(data
['ogg_libs'])
43 _oggmodule
= Extension(name
='_ogg',
44 sources
=['src/_oggmodule.c',
46 'src/pyoggstreamstate.c',
48 'src/pyoggpackbuff.c',
49 'src/pyoggsyncstate.c',
51 define_macros
= [('VERSION_MAJOR', VERSION_MAJOR
),
52 ('VERSION_MINOR', VERSION_MINOR
),
53 ('VERSION', '"%s"' % pyogg_version
)],
55 include_dirs
=[ogg_include_dir
, 'include'],
56 library_dirs
=[ogg_lib_dir
],
59 setup ( name
= "pyogg",
60 version
= pyogg_version
,
61 description
= "A wrapper for the Ogg libraries.",
62 author
= "Andrew Chatham",
63 author_email
= "andrew.chatham@duke.edu",
64 url
= "http://dulug.duke.edu/~andrew/pyogg",
66 headers
= ['include/pyogg/pyogg.h'],
68 package_dir
= {'ogg' : 'pysrc'},
70 ext_modules
= [_oggmodule
])