+* Thu Sep 27 16:37:47 CST 2012 Chengyi Zhao <chengyix.zhao@intel.com> - 1.3
+- Fix TIVI-158 connman failed to restart during upgrade
+
* Wed Sep 26 14:34:22 EEST 2012 Artem Bityutskiy * <artem.bityutskiy@linux.intel.com> - 1.3
- Back-port another 2 patches from upstream:
o baca467 rtnl: Ignore netlink messages generated by wext
install -c -m 600 %{SOURCE1} %{buildroot}/var/lib/connman/settings
%post
-systemctl daemon-reload
-systemctl restart connman.service
-
-%preun
-systemctl stop connman.service
-
-%postun
-systemctl daemon-reload
+if [ $1 -eq 1 ] ; then
+ # Initial installation
+ /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+%preun
+if [ $1 -eq 0 ] ; then
+ # Package removal, not upgrade
+ /bin/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || :
+ /bin/systemctl stop %{name}.service > /dev/null 2>&1 || :
+fi
+%postun
+/bin/systemctl --system daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+ # Package upgrade, not uninstall
+ /bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
+fi
%files
%defattr(-,root,root,-)