title: Distributing pre-built libraries with python modules
body: <p>I use the following script to distribute a module containing pure python code.</p>
  
  <pre><code>from distutils.core import setup, Extension
  import os
  setup (name = 'mtester',
         version = '0.1',
         description = 'Python wrapper for libmtester',
         packages=['mtester'],
         package_dir={'mtester':'module'},
         )
  </code></pre>
  
  <p>The problem I have is, I modified one of the files that uses an external library (a .so file), which I need to ship along with the existing module. I was suggested to use package_data to include the library. I modified the script to the following.</p>
  
  <pre><code>from distutils.core import setup, Extension
  import os
  data_dir = os.path.abspath('../lib64/')
  setup (name = 'mtester',
         version = '0.1',
         description = 'Python wrapper for libmtester',
         packages=['mtester'],
         package_dir={'mtester':'module'},
         package_data={'mtester':[data_dir+'mhelper.so']},
         )
  </code></pre>
  
  <p>The problem is, adding package_data did not make any difference. This is not installing the mhelper.so in any location (neither in site-packages nor in site-packages/mtester).</p>
  
  <p>System info: Fedora 10, 64 bit, python 2.5 (Yes it is ancient. But it is our build machine, and it needs to stay that way to maintain backward compatibility)</p>
  
  <p>Any suggestions that would help me resolve this would be well appreciated!</p>