%make_install
mkdir -p %{buildroot}/opt/share/crash/info
-%post -p <lua>
---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