• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5from distutils.core import setup, Extension
6
7# C extension modules.
8DEPS=['Makefile', 'setup.py', 'pyiftun.version']
9PYIFTUN_SRC = [
10    'pyiftun.c',
11    'wrapper_linux_if.c',
12    'wrapper_linux_if_tun.c',
13    'wrapper_sys_ioctl.c',
14]
15PYIFTUN_DEPS = DEPS + PYIFTUN_SRC
16
17CFLAGS=['-O2', '-Wall', '-Werror']
18
19ext_mods = []
20ext_mods.append(Extension('pyiftun',
21    sources = PYIFTUN_SRC,
22    extra_compile_args=CFLAGS,
23    extra_link_args = ['-Wl,--version-script=pyiftun.version'],
24    depends = DEPS + PYIFTUN_SRC,
25))
26
27# Python modules.
28py_mods = [
29    'lansim.host',
30    'lansim.simulator',
31    'lansim.tools',
32    'lansim.tuntap',
33]
34
35setup(name = 'lansim',
36    version = '1',
37    description = 'A LAN simulator in Python',
38    maintainer = 'Alex Deymo',
39    maintainer_email = 'deymo@chromium.org',
40    # Pure python modules from lansim_py:
41    package_dir = { 'lansim': 'py' },
42    py_modules = py_mods,
43    # Compiled modules on the package:
44    ext_package = 'lansim',
45    ext_modules = ext_mods,
46)
47