Debian Codegraph @

Xpjproject/pjsip-apps/src/python/setup-vc.py

raw symbols SCIP
1 #
2 # pjsua Setup script for Visual Studio
3 #
4 # Copyright (C) 2003-2008 Benny Prijono <[email protected]>
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #
20 from distutils.core import setup, Extension
21 import os
22 import sys
23
24 # Find version
25 pj_version=""
26 pj_version_major=""
27 pj_version_minor=""
28 pj_version_rev=""
29 pj_version_suffix=""
30 f = open('../../../version.mak', 'r')
31 for line in f:
32 if line.find("export PJ_VERSION_MAJOR") != -1:
33 tokens=line.split("=")
34 if len(tokens)>1:
35 pj_version_major= tokens[1].strip()
36 elif line.find("export PJ_VERSION_MINOR") != -1:
37 tokens=line.split("=")
38 if len(tokens)>1:
39 pj_version_minor= line.split("=")[1].strip()
40 elif line.find("export PJ_VERSION_REV") != -1:
41 tokens=line.split("=")
42 if len(tokens)>1:
43 pj_version_rev= line.split("=")[1].strip()
44 elif line.find("export PJ_VERSION_SUFFIX") != -1:
45 tokens=line.split("=")
46 if len(tokens)>1:
47 pj_version_suffix= line.split("=")[1].strip()
48
49 f.close()
50 if not pj_version_major:
51 print 'Unable to get PJ_VERSION_MAJOR'
52 sys.exit(1)
53
54 pj_version = pj_version_major + "." + pj_version_minor
55 if pj_version_rev:
56 pj_version += "." + pj_version_rev
57 if pj_version_suffix:
58 pj_version += "-" + pj_version_suffix
59
60 #print 'PJ_VERSION = "'+ pj_version + '"'
61
62
63 # Check that extension has been built
64 if not os.access('../../lib/_pjsua.pyd', os.R_OK):
65 print 'Error: file "../../lib/_pjsua.pyd" does not exist!'
66 print ''
67 print 'Please build the extension with Visual Studio first'
68 print 'For more info, see http://trac.pjsip.org/repos/wiki/Python_SIP_Tutorial'
69 sys.exit(1)
70
71 setup(name="pjsua",
72 version=pj_version,
73 description='SIP User Agent Library based on PJSIP',
74 url='http://trac.pjsip.org/repos/wiki/Python_SIP_Tutorial',
75 data_files=[('lib/site-packages', ['../../lib/_pjsua.pyd'])],
76 py_modules=["pjsua"]
77 )
78
79