1
# $Id: setup-vc.py 4121 2012-05-14 10:42:56Z bennylp $
3
# pjsua Setup script for Visual Studio
5
# Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
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.
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.
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
21
from distutils.core import setup, Extension
31
f = open('../../../version.mak', 'r')
33
if line.find("export PJ_VERSION_MAJOR") != -1:
34
tokens=line.split("=")
36
pj_version_major= tokens[1].strip()
37
elif line.find("export PJ_VERSION_MINOR") != -1:
38
tokens=line.split("=")
40
pj_version_minor= line.split("=")[1].strip()
41
elif line.find("export PJ_VERSION_REV") != -1:
42
tokens=line.split("=")
44
pj_version_rev= line.split("=")[1].strip()
45
elif line.find("export PJ_VERSION_SUFFIX") != -1:
46
tokens=line.split("=")
48
pj_version_suffix= line.split("=")[1].strip()
51
if not pj_version_major:
52
print 'Unable to get PJ_VERSION_MAJOR'
55
pj_version = pj_version_major + "." + pj_version_minor
57
pj_version += "." + pj_version_rev
59
pj_version += "-" + pj_version_suffix
61
#print 'PJ_VERSION = "'+ pj_version + '"'
64
# Check that extension has been built
65
if not os.access('../../lib/_pjsua.pyd', os.R_OK):
66
print 'Error: file "../../lib/_pjsua.pyd" does not exist!'
68
print 'Please build the extension with Visual Studio first'
69
print 'For more info, see http://trac.pjsip.org/repos/wiki/Python_SIP_Tutorial'
74
description='SIP User Agent Library based on PJSIP',
75
url='http://trac.pjsip.org/repos/wiki/Python_SIP_Tutorial',
76
data_files=[('lib/site-packages', ['../../lib/_pjsua.pyd'])],