A made a tool called Whack [1] as an attempt to solve a small part of the problem. The idea was that you could write scripts that would build statically-linked versions of binaries, such as Apache HTTPD [2]. Then, you could run a command like:<p><pre><code> whack install git+https://github.com/mwilliamson/whack-package-apache2-mod-php5 apps/apache2
</code></pre>
to install to any location you wanted, and the installation would still work if you mv'd the entire directory somewhere else, or even onto another distribution (provided it didn't have an older libc).<p>I never really the pushed the idea further since I think doing a decent job requires a lot of time and effort, and it solves something which is a minor annoyance for me, rather than causing significant pain. I do still use it for when I need to quickly get a WordPress server for development up and running since it's one command to deploy from scratch.<p>It feels to me like there's lots of scope for something similar to apt-get that builds and installs static binaries (or, at the very least, lets you install to different directories without root, similar to, say, virtualenv for Python or RVM for Ruby).<p>EDIT: actually, from a quick glance, it seems like Gentoo Prefix [3], as mentioned by ryao, allows you to install things as you normally would on a Gentoo machine, but without being root and with a prefix of your choosing.<p>[1] <a href="https://github.com/mwilliamson/whack" rel="nofollow">https://github.com/mwilliamson/whack</a>
[2] <a href="https://github.com/mwilliamson/whack-package-apache2-mod-php5" rel="nofollow">https://github.com/mwilliamson/whack-package-apache2-mod-php...</a>
[3] <a href="https://www.gentoo.org/proj/en/gentoo-alt/prefix/" rel="nofollow">https://www.gentoo.org/proj/en/gentoo-alt/prefix/</a>