File: setup.py

package info (click to toggle)
osm-gps-map 0.7.3-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 716 kB
  • sloc: ansic: 4,734; makefile: 248; python: 203; xml: 35; sh: 16
file content (35 lines) | stat: -rw-r--r-- 998 bytes parent folder | download
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
#!/usr/bin/env python

import os
from distutils.core import setup, Extension

def pkg_config_parse(pkg, opt):
    conf = os.popen('pkg-config %s %s' % (opt,pkg)).read()
    opt = opt[-2:]
    return [x.lstrip(opt) for x in conf.split()]

def get_include(pkg):
    return pkg_config_parse(pkg,'--cflags-only-I')

def get_lib_dirs(pkg):
    return pkg_config_parse(pkg,'--libs-only-L')

def get_libs(pkg):
    return pkg_config_parse(pkg,'--libs-only-l')

VERSION = "0.7.3"

_osmgpsmap = Extension(name = 'osmgpsmap',
            sources= ['osmgpsmapmodule.c','osmgpsmap.c'],
            include_dirs = get_include('osmgpsmap pygobject-2.0'),
            library_dirs = get_lib_dirs('osmgpsmap pygobject-2.0'),
            libraries = get_libs('osmgpsmap pygobject-2.0'),
            define_macros = [('VERSION', '"""%s"""' % VERSION)],
            )

setup( name = "python-osmgpsmap",
    version = VERSION,
    description = "python interface for osmgpsmap",
    ext_modules = [_osmgpsmap],
    )