~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.1.0/pjsip-apps/src/python/setup.py

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# $Id: setup.py 4232 2012-08-20 06:01:41Z ming $
 
2
#
 
3
# pjsua Setup script.
 
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
#
 
21
from distutils.core import setup, Extension
 
22
import os
 
23
import sys
 
24
import platform
 
25
 
 
26
# find pjsip version
 
27
pj_version=""
 
28
pj_version_major=""
 
29
pj_version_minor=""
 
30
pj_version_rev=""
 
31
pj_version_suffix=""
 
32
f = open('../../../version.mak', 'r')
 
33
for line in f:
 
34
    if line.find("export PJ_VERSION_MAJOR") != -1:
 
35
        tokens=line.split("=")
 
36
        if len(tokens)>1:
 
37
                pj_version_major= tokens[1].strip()
 
38
    elif line.find("export PJ_VERSION_MINOR") != -1:
 
39
        tokens=line.split("=")
 
40
        if len(tokens)>1:
 
41
                pj_version_minor= line.split("=")[1].strip()
 
42
    elif line.find("export PJ_VERSION_REV") != -1:
 
43
        tokens=line.split("=")
 
44
        if len(tokens)>1:
 
45
                pj_version_rev= line.split("=")[1].strip()
 
46
    elif line.find("export PJ_VERSION_SUFFIX") != -1:
 
47
        tokens=line.split("=")
 
48
        if len(tokens)>1:
 
49
                pj_version_suffix= line.split("=")[1].strip()
 
50
 
 
51
f.close()
 
52
if not pj_version_major:
 
53
    print 'Unable to get PJ_VERSION_MAJOR'
 
54
    sys.exit(1)
 
55
 
 
56
pj_version = pj_version_major + "." + pj_version_minor
 
57
if pj_version_rev:
 
58
        pj_version += "." + pj_version_rev
 
59
if pj_version_suffix:
 
60
        pj_version += "-" + pj_version_suffix
 
61
 
 
62
#print 'PJ_VERSION = "'+ pj_version + '"'
 
63
 
 
64
 
 
65
# Fill in pj_inc_dirs
 
66
pj_inc_dirs = []
 
67
f = os.popen("make -f helper.mak inc_dir")
 
68
for line in f:
 
69
    pj_inc_dirs.append(line.rstrip("\r\n"))
 
70
f.close()
 
71
 
 
72
# Fill in pj_lib_dirs
 
73
pj_lib_dirs = []
 
74
f = os.popen("make -f helper.mak lib_dir")
 
75
for line in f:
 
76
    pj_lib_dirs.append(line.rstrip("\r\n"))
 
77
f.close()
 
78
 
 
79
# Fill in pj_libs
 
80
pj_libs = []
 
81
f = os.popen("make -f helper.mak libs")
 
82
for line in f:
 
83
    pj_libs.append(line.rstrip("\r\n"))
 
84
f.close()
 
85
 
 
86
# Mac OS X depedencies
 
87
if platform.system() == 'Darwin':
 
88
    extra_link_args = ["-framework", "CoreFoundation", 
 
89
                       "-framework", "AudioToolbox"]
 
90
    version = platform.mac_ver()[0].split(".")    
 
91
    # OS X Lion (10.7.x) or above support
 
92
    if version[0] == '10' and int(version[1]) >= 7:
 
93
        extra_link_args += ["-framework", "AudioUnit"]
 
94
else:
 
95
    extra_link_args = []
 
96
 
 
97
 
 
98
setup(name="pjsua", 
 
99
      version=pj_version,
 
100
      description='SIP User Agent Library based on PJSIP',
 
101
      url='http://trac.pjsip.org/repos/wiki/Python_SIP_Tutorial',
 
102
      ext_modules = [Extension("_pjsua", 
 
103
                               ["_pjsua.c"], 
 
104
                               define_macros=[('PJ_AUTOCONF', '1'),],
 
105
                               include_dirs=pj_inc_dirs, 
 
106
                               library_dirs=pj_lib_dirs, 
 
107
                               libraries=pj_libs,
 
108
                               extra_link_args=extra_link_args
 
109
                              )
 
110
                    ],
 
111
      py_modules=["pjsua"]
 
112
     )
 
113
 
 
114