~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to python/setup.py

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-12-08 14:59:50 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20071208145950-u1tykhpw56nyzqik
Tags: 5.4.1~dfsg-4ubuntu1
* Merge from debian unstable.
* Remaining Ubuntu changes:
  - Remove stop links from rc0 and rc6
  - Munge Maintainer field as per spec.
* Ubuntu changes dropped:
  - Symlink common files between the packages, CDBS ought to handle that
    for us automatically.
* The latest Debian changes has dropped history from the changelog. Slot in
  the Ubuntu changes as best I can. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from distutils.core import setup, Extension
 
2
from setuptools import setup, Extension, find_packages
 
3
import os
 
4
import re
 
5
import string
 
6
import sys
 
7
 
 
8
intree=0
 
9
 
 
10
args = sys.argv[:]
 
11
for arg in args:
 
12
    if string.find(arg,'--basedir=') == 0:
 
13
        basedir = string.split(arg,'=')[1]
 
14
        sys.argv.remove(arg)
 
15
        intree=1
 
16
 
 
17
if intree:
 
18
    netsnmp_libs = os.popen(basedir+'/net-snmp-config --libs').read()
 
19
    libdir = os.popen(basedir+'/net-snmp-config --build-lib-dirs '+basedir).read()
 
20
    incdir = os.popen(basedir+'/net-snmp-config --build-includes '+basedir).read()
 
21
    libs = re.findall(r"-l(\S+)", netsnmp_libs)
 
22
    libdirs = re.findall(r"-L(\S+)", libdir)
 
23
    incdirs = re.findall(r"-I(\S+)", incdir)
 
24
else:
 
25
    netsnmp_libs = os.popen('net-snmp-config --libs').read()
 
26
    libdirs = re.findall(r"-L(\S+)", netsnmp_libs)
 
27
    incdirs = []
 
28
    libs = re.findall(r"-l(\S+)", netsnmp_libs)
 
29
 
 
30
setup(
 
31
    name="netsnmp-python", version="1.0a1",
 
32
    description = 'The Net-SNMP Python Interface',
 
33
    author = 'G. S. Marzot',
 
34
    author_email = 'giovanni.marzot@sparta.com',
 
35
    url = 'http://www.net-snmp.org',
 
36
    license="BSD",
 
37
    packages=find_packages(),
 
38
    test_suite = "netsnmp.tests.test",
 
39
 
 
40
    ext_modules = [
 
41
       Extension("netsnmp.client_intf", ["netsnmp/client_intf.c"],
 
42
                 library_dirs=libdirs,
 
43
                 include_dirs=incdirs,
 
44
                 libraries=libs )
 
45
       ]
 
46
    )