Seems unnecessarily complicated.<p>A script like this gets you 95% of the way there:<p><pre><code>  mkdir AppDir
  mkdir AppDir&#x2F;bin
  mkdir AppDir&#x2F;data
  
  cp $INSTALLDIR&#x2F;app AppDir&#x2F;bin
  cp -r $INSTALLDIR&#x2F;data AppDir
  cp `ldd AppDir&#x2F;bin&#x2F;app | grep -o &#x27;\W&#x2F;[^ ]*&#x27;` AppDir&#x2F;bin
  
  cat &lt;&lt; &quot;EOF&quot; &gt; AppDir&#x2F;app
  #!&#x2F;bin&#x2F;bash
  SCRIPT_PATH=$(dirname $(readlink -f $0))
  $SCRIPT_PATH&#x2F;bin&#x2F;ld-*.so.2 --library-path $SCRIPT_PATH&#x2F;bin $SCRIPT_PATH&#x2F;bin&#x2F;app $* 
  EOF
</code></pre>
(Sometimes I wonder if people make a big mystery of Linux app distribution on purpose, to discourage distribution outside of proper, secure channels.)