diff --git a/macros.sblim-cmpi-devel b/macros.sblim-cmpi-devel new file mode 100644 index 0000000..7e5492b --- /dev/null +++ b/macros.sblim-cmpi-devel @@ -0,0 +1,67 @@ +%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 diff --git a/sblim-cmpi-devel.spec b/sblim-cmpi-devel.spec index e91e28d..c246f0e 100644 --- a/sblim-cmpi-devel.spec +++ b/sblim-cmpi-devel.spec @@ -1,13 +1,15 @@ Name: sblim-cmpi-devel Version: 2.0.3 -Release: 6%{?dist} +Release: 7%{?dist} Summary: SBLIM CMPI Provider Development Support Group: Development/Libraries License: EPL URL: http://sblim.wiki.sourceforge.net/ Source0: http://downloads.sourceforge.net/sblim/%{name}-%{version}.tar.bz2 +# Source1: macro definitions +Source1: macros.sblim-cmpi-devel # Patch0: remove version from docdir Patch0: sblim-cmpi-devel-2.0.3-docdir.patch @@ -42,9 +44,9 @@ rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT # remove unused libtool files rm -f $RPM_BUILD_ROOT/%{_libdir}/*a - -%clean -rm -rf $RPM_BUILD_ROOT +# install macro definitions +mkdir -p $RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d +cp %{SOURCE1} $RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d %post -n libcmpiCppImpl0 -p /sbin/ldconfig @@ -53,14 +55,18 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc AUTHORS COPYING README - %{_includedir}/cmpi +%{_rpmconfigdir}/macros.d/macros.sblim-cmpi-devel %files -n libcmpiCppImpl0 %defattr(-,root,root,-) %{_libdir}/libcmpiCppImpl.so* %changelog +* Wed Feb 25 2015 Vitezslav Crhonek - 2.0.3-7 +- Add macros.sblim-cmpi-devel +- Remove %%clean section + * Mon Aug 18 2014 Fedora Release Engineering - 2.0.3-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild