--- spideroak-bin-4.7.9948.ebuild.orig 2012-08-30 18:08:49.333150726 -0700 +++ spideroak-bin-4.7.9948.ebuild 2012-10-11 07:15:24.798099441 -0700 @@ -22,7 +22,7 @@ SSL_SLOT="0.9.8" -DEPEND="" +DEPEND="dev-util/patchelf" RDEPEND=" dbus? ( sys-apps/dbus ) !headless? ( @@ -113,6 +113,16 @@ # Remove bundled python interpreter => dev-lang/python:2.7 rm usr/lib/SpiderOak/py || die "rm py failed" fi + + # Set RPATH for preserve-libs handling (bug #400979). + cd "${S}/usr/lib/SpiderOak" || die + local x + for x in * ; do + # Use \x7fELF header to separate ELF executables and libraries + [[ -f ${x} && $(od -t x1 -N 4 "${x}") == *"7f 45 4c 46"* ]] || continue + patchelf --set-rpath '$ORIGIN' "${x}" || \ + die "patchelf failed on ${x}" + done } src_install() {