aboutsummaryrefslogtreecommitdiff
path: root/external/miniupnpc/setup.py
diff options
context:
space:
mode:
authorMaxXor <admin@maxxor.org>2017-08-30 21:13:02 +0200
committerMaxXor <admin@maxxor.org>2017-08-30 21:13:02 +0200
commitb338dad2410b5e6cb1c811589f01a991766e7768 (patch)
treeae8fcc85d4a97038d78be66effe977fbbcceb115 /external/miniupnpc/setup.py
parentMerge pull request #2349 (diff)
downloadmonero-b338dad2410b5e6cb1c811589f01a991766e7768.tar.xz
update miniupnpc
Diffstat (limited to '')
-rwxr-xr-xexternal/miniupnpc/setup.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/external/miniupnpc/setup.py b/external/miniupnpc/setup.py
index aa632db82..24a676d85 100755
--- a/external/miniupnpc/setup.py
+++ b/external/miniupnpc/setup.py
@@ -1,19 +1,25 @@
#! /usr/bin/python
# vim: tabstop=8 shiftwidth=8 expandtab
# $Id: setup.py,v 1.9 2012/05/23 08:50:10 nanard Exp $
-# the MiniUPnP Project (c) 2007-2014 Thomas Bernard
+# the MiniUPnP Project (c) 2007-2017 Thomas Bernard
# http://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/
#
# python script to build the miniupnpc module under unix
#
-# replace libminiupnpc.a by libminiupnpc.so for shared library usage
-try:
- from setuptools import setup, Extension
-except ImportError:
- from distutils.core import setup, Extension
-from distutils import sysconfig
-sysconfig.get_config_vars()["OPT"] = ''
-sysconfig.get_config_vars()["CFLAGS"] = ''
+# Uses MAKE environment variable (defaulting to 'make')
+
+from setuptools import setup, Extension
+from setuptools.command import build_ext
+import subprocess
+import os
+
+EXT = ['libminiupnpc.a']
+
+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="miniupnpc",
version=open('VERSION').read().strip(),
author='Thomas BERNARD',
@@ -21,8 +27,9 @@ setup(name="miniupnpc",
license=open('LICENSE').read(),
url='http://miniupnp.free.fr/',
description='miniUPnP client',
+ cmdclass={'build_ext': make_then_build_ext},
ext_modules=[
Extension(name="miniupnpc", sources=["miniupnpcmodule.c"],
- extra_objects=["libminiupnpc.a"])
+ extra_objects=EXT)
])