From: nravi Date: Wed, 15 Jan 2014 04:15:18 +0000 (+0530) Subject: Update /etc/ld.so.preload after un-installing the package X-Git-Tag: submit/tizen_common/20140521.163740~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F15007%2F5;p=platform%2Fcore%2Fsystem%2Fsys-assert.git Update /etc/ld.so.preload after un-installing the package Add %postun script to the spec file that removes the entry for libsys-assert.so from the /etc/ld.so.preload file with the bash script way, using sed Bug-Tizen: PTREL-11 Change-Id: If3c88b5c42fe9f9b66d208f63d30e8eaacc74d90 Signed-off-by: Ravi Nanjundappa --- diff --git a/packaging/sys-assert.spec b/packaging/sys-assert.spec index b20d26d..90d2210 100644 --- a/packaging/sys-assert.spec +++ b/packaging/sys-assert.spec @@ -30,22 +30,18 @@ make %{?_smp_mflags} %make_install mkdir -p %{buildroot}/opt/share/crash/info -%post -p ---Do not run this script inside the build environemt, it will cause issues. -if posix.stat("/.build") == nil then - if arg[2] == 1 then - local f = assert(io.open("%{_sysconfdir}/ld.so.preload", "a")) - local t = f:write("%{_libdir}/libsys-assert.so") - f:close() - posix.chmod("%{_sysconfdir}/ld.so.preload", 644) - end -end - +%post +if [ ! -d /.build ]; then + echo "%{_libdir}/libsys-assert.so" >> %{_sysconfdir}/ld.so.preload + chmod 644 %{_sysconfdir}/ld.so.preload +fi +/sbin/ldconfig %postun -# TBD: we need to remove the above, otherwise we will fail on everything -#that tries to preload that lib -# +orig="%{_libdir}/libsys-assert.so" +pattern=$(echo $orig | sed -e 's|/|\\/|g') +sed -i "/${pattern}/D" %{_sysconfdir}/ld.so.preload +/sbin/ldconfig %files %manifest %{name}.manifest