File: setup.py

package info (click to toggle)
libnatpmp 20230423-1.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 344 kB
  • sloc: ansic: 1,530; java: 317; makefile: 151; python: 33
file content (34 lines) | stat: -rw-r--r-- 1,041 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
#! /usr/bin/env python
# vim: tabstop=8 shiftwidth=8 expandtab
# $Id: setup.py,v 1.5 2023/04/23 10:56:16 nanard Exp $
#
# python script to build the libnatpmp module under unix

from setuptools import setup, Extension
from setuptools.command import build_ext
import subprocess
import os

EXT = ['libnatpmp.so']

class make_then_build_ext(build_ext.build_ext):
      def run(self):
            subprocess.check_call([os.environ.get('MAKE','make')] + EXT)
            build_ext.build_ext.run(self)

setup(name="libnatpmp",
      version="1.0",
      author='Thomas BERNARD',
      author_email='miniupnp@free.fr',
      license=open('LICENSE').read(),
      description='NAT-PMP library',
      # debian: this stop crossbuild due to lack of make vars
      # let it build externally
      # cmdclass={'build_ext': make_then_build_ext},
      ext_modules=[
        Extension(name="libnatpmp", sources=["libnatpmpmodule.c"],
                  extra_objects=EXT,
                  define_macros=[('ENABLE_STRNATPMPERR', None)]
        )]
     )