From: Christian Kastner <debian@kvr.at>
Date: Mon, 3 Mar 2014 01:29:39 +0100
Subject: Do not call swig unconditionally

every time setup.py is used, especially when using setup.py install.
The bug upstream refers to is not reproducible here.
---
 python/setup.py | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

Index: libfann-2.1.0~beta~dfsg/python/setup.py
===================================================================
--- libfann-2.1.0~beta~dfsg.orig/python/setup.py	2014-03-03 02:04:00.000000000 +0100
+++ libfann-2.1.0~beta~dfsg/python/setup.py	2014-03-03 17:29:44.288988000 +0100
@@ -19,11 +19,6 @@
 documented, and fast. 
 """
 
-#These lines are needed to circumvent a bug in distutils
-swig_cmd = 'swig -c++ -python pyfann/pyfann.i'
-print 'Running SWIG before:', swig_cmd
-os.system(swig_cmd)
-
 #This utility function searches for files
 def hunt_files(root, which):
     return glob.glob(os.path.join(root, which))
@@ -40,11 +35,12 @@
     url='http://sourceforge.net/projects/fann/',
     license='GNU LESSER GENERAL PUBLIC LICENSE (LGPL)',
     py_modules=['pyfann.libfann'],
-    ext_modules=[Extension('pyfann._libfann',['pyfann/pyfann_wrap.cxx'], 
-                            include_dirs=['../src/include'], 
-                            extra_objects=['../src/.libs/doublefann.o'],
-                            define_macros=[("SWIG_COMPILE",None)]
-                            ),
+    ext_modules=[Extension('pyfann._libfann',['pyfann/pyfann.i'],
+                            swig_opts=['-c++', '-I../src/include'],
+                            include_dirs=['../src/include'],
+                            library_dirs=['../src/.libs/'],
+                            libraries=['doublefann']
+                            )
                 ]
 )
 
