sblim-cmpi-devel/macros.sblim-cmpi-devel
2015-02-25 11:18:48 +01:00

68 lines
1.6 KiB
Plaintext

%sblim_pre() \
function unregister() \
{ \
# don't let registration failure when server not running fail upgrade! \
%{_datadir}/%{name}/provider-register.sh -d $1 -m %{SCHEMA} -r %{REGISTRATION} > /dev/null 2>&1 || :; \
} \
\
# if upgrading, deregister old version \
if [ $1 -gt 1 ]; then \
unregistered=no \
if [ -e /usr/sbin/cimserver ]; then \
unregister "-t pegasus"; \
unregistered=yes \
fi \
if [ -e /usr/sbin/sfcbd ]; then \
unregister "-t sfcb"; \
unregistered=yes \
fi \
if [ "$unregistered" != yes ]; then \
unregister \
fi \
fi
%sblim_post() \
function register() \
{ \
# don't let registration failure when server not running fail install! \
%{_datadir}/%{name}/provider-register.sh $1 -m %{SCHEMA} -r %{REGISTRATION} > /dev/null 2>&1 || :; \
} \
\
/sbin/ldconfig \
if [ $1 -ge 1 ]; then \
registered=no \
if [ -e /usr/sbin/cimserver ]; then \
register "-t pegasus"; \
registered=yes \
fi \
if [ -e /usr/sbin/sfcbd ]; then \
register "-t sfcb"; \
registered=yes \
fi \
if [ "$registered" != yes ]; then \
register \
fi \
fi
%sblim_preun() \
function unregister() \
{ \
# don't let registration failure when server not running fail upgrade! \
%{_datadir}/%{name}/provider-register.sh -d $1 -m %{SCHEMA} -r %{REGISTRATION} > /dev/null 2>&1 || :; \
} \
\
if [ $1 -eq 0 ]; then \
unregistered=no \
if [ -e /usr/sbin/cimserver ]; then \
unregister "-t pegasus"; \
unregistered=yes \
fi \
if [ -e /usr/sbin/sfcbd ]; then \
unregister "-t sfcb"; \
unregistered=yes \
fi \
if [ "$unregistered" != yes ]; then \
unregister \
fi \
fi