From: Mariusz Domanski Date: Wed, 20 Feb 2013 14:43:36 +0000 (+0100) Subject: Proper %post and %postun scripts in spec file X-Git-Tag: submit/tizen_2.1/20130424.233001~5^2~5^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef6876f927342db5a7f3eafeb5f8cb40b7712ca7;p=platform%2Fcore%2Fsecurity%2Fsecurity-server.git Proper %post and %postun scripts in spec file [Issue#] N/A [Bug] errors when upgrading rpm package via rpm -U command [Cause] bugged %post and %postun scripts in spec file [Solution] fixed %post and %postun scripts to handle upgrades properly [Verification] Build and install rpm files, then increment version number in spec file and build and install with rpm -U. No security-server related errors should appear after second installation, S10security-server symlinks in /etc/rc.d/rc3.d/ and /etc/rc.d/rc5.d/ should exist. After package uninstallation symlinks should be gone. Change-Id: I5f0ec6e640f14c12335de0338d3e75d883d1a79e --- diff --git a/packaging/security-server.spec b/packaging/security-server.spec index 07684c3..224ff5b 100644 --- a/packaging/security-server.spec +++ b/packaging/security-server.spec @@ -121,13 +121,15 @@ if [ $1 == 1 ]; then fi mkdir -p /etc/rc.d/rc3.d mkdir -p /etc/rc.d/rc5.d -ln -s /etc/rc.d/init.d/security-serverd /etc/rc.d/rc3.d/S10security-server -ln -s /etc/rc.d/init.d/security-serverd /etc/rc.d/rc5.d/S10security-server +ln -sf /etc/rc.d/init.d/security-serverd /etc/rc.d/rc3.d/S10security-server +ln -sf /etc/rc.d/init.d/security-serverd /etc/rc.d/rc5.d/S10security-server %postun systemctl daemon-reload -rm -f /etc/rc.d/rc3.d/S10security-server -rm -f /etc/rc.d/rc5.d/S10security-server +if [ "$1" = 0 ]; then + rm -f /etc/rc.d/rc3.d/S10security-server + rm -f /etc/rc.d/rc5.d/S10security-server +fi %post -n libsecurity-server-client -p /sbin/ldconfig