File: setup.py

package info (click to toggle)
wader 0.5.12-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,672 kB
  • ctags: 5,053
  • sloc: python: 17,191; makefile: 142; sh: 131
file content (122 lines) | stat: -rw-r--r-- 4,510 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2008  Vodafone España, S.A.
# Copyright (C) 2008-2009  Warp Networks, S.L.
# Author:  Pablo Martí
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
setuptools file for Wader
"""

from os.path import join, isdir, walk
import sys

from distutils.core import Extension
from setuptools import setup

from wader.common.consts import (APP_VERSION, APP_NAME,
                                 APP_SLUG_NAME, BASE_DIR)

DATA_DIR = join(BASE_DIR, 'usr', 'share', APP_SLUG_NAME)
BIN_DIR = join(BASE_DIR, 'usr', 'bin')
RESOURCES = join(DATA_DIR, 'resources')
DBUS_SYSTEMD = join(BASE_DIR, 'etc', 'dbus-1', 'system.d')
DBUS_SYSTEM_SERVICES = join(BASE_DIR, 'usr', 'share', 'dbus-1',
                            'system-services')
UDEV_RULESD = join(BASE_DIR, 'lib', 'udev', 'rules.d')


def list_files(path, exclude=None):
    result = []

    def walk_callback(arg, directory, files):
        for ext in ['.svn', '.git']:
            if ext in files:
                files.remove(ext)
        if exclude:
            for f in files:
                if f.startswith(exclude):
                    files.remove(f)
        result.extend(join(directory, f) for f in files
                      if not isdir(join(directory, f)))

    walk(path, walk_callback, None)
    return result

data_files = [
   (join(RESOURCES, 'extra'), list_files('resources/extra')),
   (join(RESOURCES, 'config'), list_files('resources/config')),
   (join(DATA_DIR, 'plugins'), list_files('plugins/devices')),
   (join(DATA_DIR, 'plugins'), list_files('plugins/oses')),
   (join(DATA_DIR, 'core'), list_files('core')),
   (join(DATA_DIR, 'core', 'backends'), list_files('core/backends')),
   (join(DATA_DIR, 'core', 'hardware'), list_files('core/hardware')),
   (join(DATA_DIR, 'core', 'oses'), list_files('core/oses')),
   (join(DATA_DIR, 'core', 'statem'), list_files('core/statem')),
   (join(DATA_DIR, 'test'), ['test/test_dbus.py', 'test/test_dbus_ussd_de.py']),
   (DATA_DIR, ['core-tap.py']),
   (BIN_DIR, ['bin/wader-core-ctl']),
   (DBUS_SYSTEMD, ['resources/dbus/org.freedesktop.ModemManager.conf']),
   (DBUS_SYSTEM_SERVICES,
                ['resources/dbus/org.freedesktop.ModemManager.service']),
]

ext_modules = []

if sys.platform.startswith('linux'):
    data_files.append((UDEV_RULESD, list_files('resources/udev')))

elif sys.platform == 'darwin':
    # XXX This is broken.
    osxserialports = Extension('wader.common.oses.osxserialports',
                            sources=['wader/common/oses/_osxserialports.c'],
                            extra_link_args=['-framework', 'CoreFoundation',
                                             '-framework', 'IOKit'])
    ext_modules.append(osxserialports)

packages = [
    'wader',
    'wader.common',
    'wader.common.backends',
]

setup(name=APP_NAME,
      version=APP_VERSION,
      description='3G device manager for Linux and OSX',
      download_url="http://www.wader-project.org",
      author='Pablo Martí Gamboa',
      author_email='pmarti@warp.es',
      license='GPL',
      packages=packages,
      data_files=data_files,
      ext_modules=ext_modules,
      zip_safe=False,
      test_suite='test',
      classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: No Input/Output (Daemon)',
        'Framework :: Twisted',
        'Intended Audience :: Developers',
        'Intended Audience :: Telecommunications Industry',
        'License :: OSI Approved :: GNU General Public License (GPL)',
        'Natural Language :: English',
        'Operating System :: POSIX :: Linux',
        'Operating System :: MacOS :: MacOS X',
        'Programming Language :: Python :: 2.5',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Topic :: Communications :: Telephony',
      ],
)