Description: Use Debian's libstemmer.
 Dynamically Link against libstemmer rather than using included libstemmer_c
 sources.
Author: Stefano Rivera <stefanor@debian.org>
Forwarded: not-needed
Last-Update: 2011-08-21

--- a/setup.py
+++ b/setup.py
@@ -9,31 +9,14 @@
 except:
     have_pyrex = 0
 
-# Directory which libstemmer sources are unpacked in.
-library_dir = 'libstemmer_c'
-
-# Directories in libstemmer which contain libstemmer sources (ie, not
-# examples, etc).
-library_core_dirs = ('src_c', 'runtime', 'libstemmer', 'include')
-
-# Read the manifest of files in libstemmer.
-src_files = [os.path.join(library_dir, line.strip().replace(' \\', ''))
-             for line in open(os.path.join(library_dir, 'mkinc_utf8.mak'))
-             if len(line.strip()) > 2
-             and (line.strip().endswith('.c \\') or line.strip().endswith('.c'))
-             and os.path.split(line.strip())[0] in library_core_dirs]
-
-# Set the include path to include libstemmer.
-include_dirs = ('src', os.path.join(library_dir, 'include'))
-
 if have_pyrex:
     # Add the pyrex sources, and a special rule so distutils knows how to
     # use them.
-    src_files.append('src/Stemmer.pyx')
+    src_files = ['src/Stemmer.pyx']
     cmdclass = {'build_ext': build_ext}
 else:
     # Add just the C sources.
-    src_files.append('src/Stemmer.c')
+    src_files = ['src/Stemmer.c']
     cmdclass = {}
       
 long_description = r"""
@@ -108,7 +91,7 @@
       ],
 
       ext_modules = [Extension('Stemmer', src_files,
-                               include_dirs = include_dirs)],
+                               libraries=['stemmer'])],
       cmdclass = cmdclass
      )
 
