Changeset 2172


Ignore:
Timestamp:
Jul 24, 2008 12:20:08 PM (16 years ago)
Author:
bennylp
Message:

Tweak setup.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/python/setup.py

    r2120 r2172  
     1# $Id:$ 
     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# 
    121from distutils.core import setup, Extension 
    222import os 
    323import sys 
    424 
    5 VERSION = "0.9.0" 
     25# find pjsip 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_VERSION' 
     35    sys.exit(1) 
     36#print 'PJ_VERSION = "'+ pj_version + '"' 
     37 
    638 
    739# Fill in pj_inc_dirs 
     
    941f = os.popen("make -f helper.mak inc_dir") 
    1042for line in f: 
    11         pj_inc_dirs.append(line.rstrip("\r\n")) 
     43    pj_inc_dirs.append(line.rstrip("\r\n")) 
    1244f.close() 
    1345 
     
    1648f = os.popen("make -f helper.mak lib_dir") 
    1749for line in f: 
    18         pj_lib_dirs.append(line.rstrip("\r\n")) 
     50    pj_lib_dirs.append(line.rstrip("\r\n")) 
    1951f.close() 
    2052 
     
    2355f = os.popen("make -f helper.mak libs") 
    2456for line in f: 
    25         pj_libs.append(line.rstrip("\r\n")) 
     57    pj_libs.append(line.rstrip("\r\n")) 
    2658f.close() 
    2759 
    2860# Mac OS X depedencies 
    2961if sys.platform == 'darwin': 
    30         extra_link_args = ["-framework", "CoreFoundation",  
    31                            "-framework", "AudioToolbox"] 
     62    extra_link_args = ["-framework", "CoreFoundation",  
     63                       "-framework", "AudioToolbox"] 
    3264else: 
    33         extra_link_args = [] 
     65    extra_link_args = [] 
    3466 
    3567 
    36 setup(name="_pjsua", version=VERSION, 
    37         ext_modules = [ 
    38                 Extension("_pjsua",  
    39                           ["_pjsua.c"],  
    40                           define_macros=[('PJ_AUTOCONF', '1'),], 
    41                           include_dirs=pj_inc_dirs,  
    42                           library_dirs=pj_lib_dirs,  
    43                           libraries=pj_libs, 
    44                           extra_link_args=extra_link_args), 
    45         ]) 
    46  
    47 setup(name="pjsua", version=VERSION, py_modules=["pjsua"]) 
     68setup(name="pjsua",  
     69      version=pj_version, 
     70      description='SIP User Agent Library based on PJSIP', 
     71      url='http://trac.pjsip.org/repos/wiki/Python_SIP_Tutorial', 
     72      ext_modules = [Extension("_pjsua",  
     73                               ["_pjsua.c"],  
     74                               define_macros=[('PJ_AUTOCONF', '1'),], 
     75                               include_dirs=pj_inc_dirs,  
     76                               library_dirs=pj_lib_dirs,  
     77                               libraries=pj_libs, 
     78                               extra_link_args=extra_link_args 
     79                              ) 
     80                    ], 
     81      py_modules=["pjsua"] 
     82     ) 
    4883 
    4984 
Note: See TracChangeset for help on using the changeset viewer.