title: Is there a way to automatically determine dependencies when setting up a dpkg control file?
body: <p>Most of the fields in a dpkg (Debian) control file are straightforward. The tricky one is determining the list of dependencies (Depends:). I was hoping that dpkg-gencontrol could do this for me by looking at the ldd output for the executables in the package directory. Perhaps it can, but I can't get it to work.</p>
  
  <p>If this is what <code>dpkg-gencontrol</code> is for, the error I am getting is:</p>
  
  <pre><code>dpkg-gencontrol: error: syntax error in control_template at line 7: first block lacks a source field.
  </code></pre>
  
  <p>For reference, the command is <code>dpkg-gencontrol -v1.1 -ccontrol_template -lchangelog -Pdebian</code>. The control_template file contains this:</p>
  
  <pre><code>Package: my-package
  Maintainer: Joe Coder &lt;joe@coder.com&gt;
  Description: The my-package system
   A longer description that runs to the end of one line and then 
   extends to another line.
  Priority: optional
  </code></pre>
  
  <p>If this is not what <code>dpkg-gencontrol</code> is for, does anyone have any suggestions as to what I can do, or advice on how to set up the dependencies list, ideally automatically?</p>
  
  <p>Admittedly, inferring dependencies in a general way is probably a very difficult problem, especially if you extend the search to scripts and other programs. I am hoping that some tools exists that works most of the time.</p>
  
  <p>Note that this is for internal distribution only. I am not building a package to go into a Linux distribution or even to be downloaded by the general public, so I am happy to bend/break standard rules if needed.</p>