title: Python package with compiled code
body: <p>I'm looking into releasing a python package which includes an existing fortran or C program. The fortran/C program is compiled by running</p>
  
  <pre><code>./configure
  make
  </code></pre>
  
  <p>The python code calls the resulting binary through subprocess calls (i.e. the code is not really wrapped as such). What I would like is that when the user types</p>
  
  <pre><code>python setup.py install
  </code></pre>
  
  <p>the fortran/C program is first compiled using the <code>./configure</code> and <code>make</code> commands, then I want the python module to be installed, and the binary to be installed in the python <code>bin/</code> directory alongside executables that are usually installed via the <code>scripts=</code> option in <code>distutils.core.setup</code>.</p>
  
  <p>First, are there any problems with doing this? And if not, what is the best way to do it via <code>setup.py</code>? Are there existing functions to automate the <code>./configure</code> and <code>make</code>, since this is pretty standard? Or should I just use <code>os.system</code> calls? And either way, where should those commands go in <code>setup.py</code>? Then should I have <code>make</code> output the binary to e.g. <code>scripts/</code> and then have <code>scripts=['scripts/mybinary']</code> in the <code>setup()</code> function?</p>