title: Workflow for compiling and installing software with Puppet
body: <p>I need to manually compile and install FFMPEG as one of my dependencies using Puppet manifests. I want to do this myself to customize the configuration of FFMPEG to the needs of my project.</p>
  
  <p>I'm not sure as to how to structure the entire process with classes. The logic should go something like this:</p>
  
  <ol>
  <li>If <code>/usr/local/bin/ffmpeg</code> doesn't exist, compile:
  <ol>
  <li>Install build dependencies from apt-get.</li>
  <li>Create a directory for the library sources <code>/tmp/ffmpeg</code></li>
  <li>Download and compile the Yasm assembler
  <ol>
  <li>Download.</li>
  <li>Extract.</li>
  <li>Configure</li>
  <li>Make</li>
  <li>Make Install</li>
  </ol></li>
  <li>Download and compile x264
  <ol>
  <li>Clone the source.</li>
  <li>Configure.</li>
  <li>Make</li>
  <li>Make Install</li>
  </ol></li>
  <li>Download and compile fdk-aac:
  <ol>
  <li>...</li>
  </ol></li>
  <li>....</li>
  </ol></li>
  </ol>
  
  <p>I can easily branch all of these out into their own modules and declare them as dependencies of FFMPEG, that's not the problem.</p>
  
  <p>My main problem is understanding how to do the whole download/extract/compile process for each module <em>only if it's not already present on the system.</em></p>
  
  <p>How do I structure my classes to only act if the software is not already installed?</p>