add schemas (de)registration with sfcb if found

in v2:
  - rebased
  - fixed patch to apply to libvirt-cim.spec.in
  - remove spurious changes coming from Fedora

Signed-off-by: Daniel Veillard <[email protected]>

diff --git a/libvirt-cim.spec.in b/libvirt-cim.spec.in
index d78eee7..571ee91 100644
--- a/libvirt-cim.spec.in
+++ b/libvirt-cim.spec.in
@@ -87,6 +87,8 @@ rm -fr $RPM_BUILD_ROOT
 
 /etc/init.d/tog-pegasus condrestart
 
+if [ -x /usr/sbin/cimserver ]
+then
 %{_datadir}/%{name}/provider-register.sh -t pegasus \
        -n @CIM_VIRT_NS@ \
        -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
@@ -102,8 +104,29 @@ rm -fr $RPM_BUILD_ROOT
 %{_datadir}/%{name}/provider-register.sh -t pegasus \
         -n root/cimv2\
         -r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true
+fi
+if [ -x /usr/sbin/sfcbd ]
+then
+%{_datadir}/%{name}/provider-register.sh -t sfcb \
+       -n root/virt \
+       -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
+%{_datadir}/%{name}/provider-register.sh -t sfcb \
+        -n root/virt \
+        -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
+%{_datadir}/%{name}/provider-register.sh -t sfcb \
+        -n root/interop \
+        -r %{INTEROP_REG} -m %{INTEROP_MOF} -v >/dev/null 2>&1 || true
+%{_datadir}/%{name}/provider-register.sh -t sfcb \
+        -n root/PG_InterOp \
+        -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} -v >/dev/null 2>&1 || true
+%{_datadir}/%{name}/provider-register.sh -t sfcb \
+        -n root/cimv2\
+        -r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true
+fi
 
 %preun
+if [ -x /usr/sbin/cimserver ]
+then
 %{_datadir}/%{name}/provider-register.sh -d -t pegasus \
        -n @CIM_VIRT_NS@ \
        -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
@@ -116,6 +139,22 @@ rm -fr $RPM_BUILD_ROOT
 %{_datadir}/%{name}/provider-register.sh -d -t pegasus \
        -n root/cimv2 \
        -r %{CIMV2_REG} -m %{CIMV2_MOF} >/dev/null 2>&1 || true
+fi
+if [ -x /usr/sbin/sfcbd ]
+then
+%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
+       -n root/virt \
+       -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
+%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
+       -n root/interop \
+       -r %{INTEROP_REG} -m %{INTEROP_MOF} >/dev/null 2>&1 || true
+%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
+       -n root/PG_InterOp \
+       -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} >/dev/null 2>&1 || true
+%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
+       -n root/cimv2 \
+       -r %{CIMV2_REG} -m %{CIMV2_MOF} >/dev/null 2>&1 || true
+fi
 
 %postun -p /sbin/ldconfig
 

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
[email protected]  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

_______________________________________________
Libvirt-cim mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvirt-cim

Reply via email to