title: Is there a standard way to create Debian packages for distributing Python programs?
body: <p>There is a ton of information on how to do this, but since <em>"there is more than one way to skin a cat"</em>, and all the tutorials/manuals that cover a bit of the process seem to make certain assumptions which are different from other tutorials, I still didn't manage to grasp it.</p>
  
  <p>So far this is what I think I understood.</p>
  
  <ol>
  <li>My final goal should be that of creating a "binary" .deb package. Such package will be platform-independent (32/64 bit) as all Python programs are such.</li>
  <li>To create a "binary" package I need first to create a source package.</li>
  <li>To create the source package I can use either <code>CDBS</code> or <code>debhelper</code>. Debhelper is the recommended way for beginners.</li>
  <li>The core of creating a source package is populating the <code>DEBIAN</code> directory in the source directory with a number of files clarifying where files need to be copied, what copyright and licensing scheme they are subject to, what dependencies they have, etc...</li>
  <li>Step #4 can be largely automated the <code>dh_make</code>command <em>if</em> the Python source also comes with a distutils' <code>setup.py</code> script.</li>
  </ol>
  
  <p>Now my questions:</p>
  
  <ol>
  <li><strong>Is my understanding of the process correct?</strong> Is there anything I am missing, or anything that I got wrong?</li>
  <li>Step #5 is really the more confusing to me: specifically the two points that remains most obscure to me are:
  
  <ul>
  <li><strong>How do I write a <code>setup.py</code> script that install a stand-alone programme?</strong> <strong>EDIT:</strong> By <em>standalone programme</em> I mean a program intended to be used by a desktop user (as opposed to a <em>module</em> which I understand like a collection of functionality to be used by other software after having been imported). In my specific case I would actually need <em>two</em> such "programs": the main software and a separate utility (in effect a second "program" that should be in the same package with the other one).</li>
  <li><strong>What are the specificities of such a script for DEB packages?</strong> The official documentation only seems to deal with RPM and Windows stuff...</li>
  </ul></li>
  </ol>
  
  <p>BTW: These are the best sources of information that I could find myself so far. If you have anything better than this, please share! :)</p>
  
  <ul>
  <li><a href="https://wiki.ubuntu.com/PackagingGuide/Python#The_debhelper_way" rel="noreferrer">Ubuntu's Python packaging guide</a></li>
  <li><a href="http://ghantoos.org/2008/10/19/creating-a-deb-package-from-a-python-setuppy/" rel="noreferrer">Creating a .deb package from a python setup.py</a> (it <em>shows</em> the steps, but it doesn't <em>explain</em> them enough for me to follow along)</li>
  <li><a href="http://showmedo.com/videotutorials/series?name=linuxJensMakingDebSeries" rel="noreferrer">ShowMeDo video on "creating a .deb package out of a python
  program"</a> (it doesn't seem up-to-date and - if I got it right - will produce packages for personal use, without dependencies
  and without a signed changelog and other key data that will make it incompatible with the Debian policy).</li>
  </ul>