blob: 2abb13b4eca15effab6b1d0e1488549d7ab5b046 [file] [log] [blame]
Benny Prijonode2c5f02008-07-24 12:20:53 +00001# $Id:$
2#
3# pjsua Setup script for Visual Studio
4#
5# Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20#
21from distutils.core import setup, Extension
22import os
23import sys
24
25# Find version
26pj_version=""
27f = open('../../../pjlib/src/pj/config.c', 'r')
28for line in f:
29 if line.find("PJ_VERSION") != -1:
30 pj_version = line.split("=")[1].strip('";\r\n ')
31 break
32f.close()
33if pj_version=="":
34 print 'Unable to get PJ_pj_version'
35 sys.exit(1)
36#print 'PJ_VERSION = "'+ pj_version + '"'
37
38# Check that extension has been built
39if not os.access('../../lib/_pjsua.pyd', os.R_OK):
40 print 'Error: file "../../lib/_pjsua.pyd" does not exist!'
41 print ''
42 print 'Please build the extension with Visual Studio first'
43 print 'For more info, see http://trac.pjsip.org/repos/wiki/Python_SIP_Tutorial'
44 sys.exit(1)
45
46setup(name="pjsua",
47 version=pj_version,
48 description='SIP User Agent Library based on PJSIP',
49 url='http://trac.pjsip.org/repos/wiki/Python_SIP_Tutorial',
50 data_files=[('lib/site-packages', ['../../lib/_pjsua.pyd'])],
51 py_modules=["pjsua"]
52 )
53
54