Gentoo has a very nice build "sandbox" working now. The sandbox prevents an ebuild from writing any changes outside of the temporary install directory during configuration and compiling of package tarballs. A previous ebuild submission of mine violated the sandbox when building the pdf manuals because a font it needed wasn't prebuilt during the tetex installation. (I got this bug assigned to me!).
I love it when I wake up in the morning and my problems are magically solved! A gentoo developer, azarah, updated the tetex ebuild so that it created all the fonts during installation. All I had to do to fix the moldy sandbox violation was to change the dependencies to depend on the new tetex ebuild. Sometimes life is easy.