[PATCH] fix spec file for sblim-sfcb and systemctl

Right now the spec file is completely tied to tog-pegasus, this should allow the spec file to be compatible with sblim-sfcb too. This also switches to systemctl which is now used in Fedora. I would actually like some feedback on the patch if someone has an environment to test with sblim-sfcb Also I noted that if I built the package with sblim-sfcb installed it failed in the make install phase with the following error: ---------------------------------------------------------- /bin/sh /u/veillard/rpms/BUILD/libvirt-cim-0.6.1/install-sh -c -m 644 -t "/u/veillard/rpms/BUILDROOT/libvirt-cim-0.6.1-2.fc18.x86_64/usr/share/libvirt-cim" ./schema/RegisteredProfile.registration ./schema/ElementConformsToProfile.registration ./schema/ReferencedProfile.registration if [[ sfcb != pegasus ]]; then \ sed -i '/^# --/,/^# --!/d' .//u/veillard/rpms/BUILDROOT/libvirt-cim-0.6.1-2.fc18.x86_64/usr/share/libvirt-cim/RegisteredProfile.registration .//u/veillard/rpms/BUILDROOT/libvirt-cim-0.6.1-2.fc18.x86_64/usr/share/libvirt-cim/ElementConformsToProfile.registration .//u/veillard/rpms/BUILDROOT/libvirt-cim-0.6.1-2.fc18.x86_64/usr/share/libvirt-cim/ReferencedProfile.registration; \ fi sed: can't read .//u/veillard/rpms/BUILDROOT/libvirt-cim-0.6.1-2.fc18.x86_64/usr/share/libvirt-cim/RegisteredProfile.registration: No such file or directory sed: can't read .//u/veillard/rpms/BUILDROOT/libvirt-cim-0.6.1-2.fc18.x86_64/usr/share/libvirt-cim/ElementConformsToProfile.registration: No such file or directory sed: can't read .//u/veillard/rpms/BUILDROOT/libvirt-cim-0.6.1-2.fc18.x86_64/usr/share/libvirt-cim/ReferencedProfile.registration: No such file or directory make[2]: *** [install-data-local] Error 2 make[2]: Leaving directory `/home/veillard/rpms/BUILD/libvirt-cim-0.6.1' make[1]: *** [install-am] Error 2 make[1]: Leaving directory `/home/veillard/rpms/BUILD/libvirt-cim-0.6.1' make: *** [install-recursive] Error 1 ---------------------------------------------------------- Any idea ? thanks, Daniel --- libvirt-cim.spec 2012-02-10 13:49:31.679905149 +0800 +++ libvirt-cim.spec 2012-03-09 14:41:45.617781910 +0800 @@ -12,7 +12,8 @@ Requires: libxml2 >= 2.6.0 Requires: libvirt >= 0.9.0 Requires: unzip -Requires: tog-pegasus +# either tog-pegasus or sblim-sfcb should provide cim-server +Requires: cim-server BuildRequires: libcmpiutil >= 0.5.4 BuildRequires: tog-pegasus-devel BuildRequires: libvirt-devel >= 0.9.0 @@ -85,8 +86,18 @@ %{_datadir}/%{name}/install_base_schema.sh %{_datadir}/%{name} -/etc/init.d/tog-pegasus condrestart +if [ "`systemctl is-active tog-pegasus.service`" = "active" ] +then + systemctl restart tog-pegasus.service +fi + +if [ "`systemctl is-active sblim-sfcb.service`" = "active" ] +then + systemctl restart sblim-sfcb.service +fi +if [ -x /usr/sbin/cimserver ] +then %{_datadir}/%{name}/provider-register.sh -t pegasus \ -n root/virt \ -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true @@ -102,8 +113,29 @@ %{_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 root/virt \ -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true @@ -116,6 +148,22 @@ %{_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/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

Daniel, thanks for the patch. * Daniel Veillard <veillard@redhat.com> [Mar 09. 2012 08:12]:
Right now the spec file is completely tied to tog-pegasus, this should allow the spec file to be compatible with sblim-sfcb too. This also switches to systemctl which is now used in Fedora.
I would actually like some feedback on the patch if someone has an environment to test with sblim-sfcb
I'll test later today. For reference, you might want to take a look at the spec file of https://build.opensuse.org/package/files?package=libvirt-cim&project=systemsmanagement%3Awbem which is a pure-sfcb variant.
Also I noted that if I built the package with sblim-sfcb installed it failed in the make install phase with the following error:
Thats a bug in the Makefile.am which does an incomplete substitution - patch attached. Regards, Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany

On Fri, Mar 09, 2012 at 09:32:58AM +0100, Klaus Kaempf wrote:
Daniel,
thanks for the patch.
* Daniel Veillard <veillard@redhat.com> [Mar 09. 2012 08:12]:
Right now the spec file is completely tied to tog-pegasus, this should allow the spec file to be compatible with sblim-sfcb too. This also switches to systemctl which is now used in Fedora.
I would actually like some feedback on the patch if someone has an environment to test with sblim-sfcb
I'll test later today. For reference, you might want to take a look at the spec file of https://build.opensuse.org/package/files?package=libvirt-cim&project=systemsmanagement%3Awbem which is a pure-sfcb variant.
Also I noted that if I built the package with sblim-sfcb installed it failed in the make install phase with the following error:
Thats a bug in the Makefile.am which does an incomplete substitution - patch attached.
Hi Klaus, thanks for the patch, indeed it fixes the problem! I'm not sure what you are trying to fix in provider-reg.patch, but it seems to make sense to really pass them as 3 separate args instead of one big one. I think the biggest difference I can spot between the two spec files are the fact that you uninstall only the main schemas on %preun while we remove all the ones we registered in %post. Not really significant but I could have overlooked something :-) Chip, eduardo, could you look at those 3 paches ? Mine, the one that Klaus sent and https://build.opensuse.org/package/view_file?file=provider-reg.patch&package=libvirt-cim&project=systemsmanagement%3Awbem&rev=badf80eca4fd06ed9f84a67eafcbc760 thanks again ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On 03/12/2012 06:18 AM, Daniel Veillard wrote:
On Fri, Mar 09, 2012 at 09:32:58AM +0100, Klaus Kaempf wrote:
Daniel,
thanks for the patch.
* Daniel Veillard <veillard@redhat.com> [Mar 09. 2012 08:12]:
Right now the spec file is completely tied to tog-pegasus, this should allow the spec file to be compatible with sblim-sfcb too. This also switches to systemctl which is now used in Fedora.
I would actually like some feedback on the patch if someone has an environment to test with sblim-sfcb
I'll test later today. For reference, you might want to take a look at the spec file of https://build.opensuse.org/package/files?package=libvirt-cim&project=systemsmanagement%3Awbem which is a pure-sfcb variant.
Also I noted that if I built the package with sblim-sfcb installed it failed in the make install phase with the following error:
Thats a bug in the Makefile.am which does an incomplete substitution - patch attached.
Hi Klaus,
thanks for the patch, indeed it fixes the problem! I'm not sure what you are trying to fix in provider-reg.patch, but it seems to make sense to really pass them as 3 separate args instead of one big one. I think the biggest difference I can spot between the two spec files are the fact that you uninstall only the main schemas on %preun while we remove all the ones we registered in %post. Not really significant but I could have overlooked something :-) Chip, eduardo, could you look at those 3 paches ? Mine, the one that Klaus sent and https://build.opensuse.org/package/view_file?file=provider-reg.patch&package=libvirt-cim&project=systemsmanagement%3Awbem&rev=badf80eca4fd06ed9f84a67eafcbc760
The problem is that the patch for the spec file actually does not apply, can you resend it against .spec.in, instead of .spec? Anyway, I don't have much to say here, because I am not running with sblim-sfcb in my envioronment. I tested with pegasus and things still work fine. Second patch is also tested and works, but I don't see a reason for that third patch. What is the error it intends to fix? Best regards, Eduardo
thanks again !
Daniel
-- Eduardo de Barros Lima Software Engineer, Open Virtualization Linux Technology Center - IBM/Brazil eblima@br.ibm.com

On Fri, Mar 09, 2012 at 09:32:58AM +0100, Klaus Kaempf wrote:
Daniel,
thanks for the patch.
* Daniel Veillard <veillard@redhat.com> [Mar 09. 2012 08:12]:
Right now the spec file is completely tied to tog-pegasus, this should allow the spec file to be compatible with sblim-sfcb too. This also switches to systemctl which is now used in Fedora.
I would actually like some feedback on the patch if someone has an environment to test with sblim-sfcb
I'll test later today. For reference, you might want to take a look at the spec file of https://build.opensuse.org/package/files?package=libvirt-cim&project=systemsmanagement%3Awbem which is a pure-sfcb variant.
Also I noted that if I built the package with sblim-sfcb installed it failed in the make install phase with the following error:
Thats a bug in the Makefile.am which does an incomplete substitution - patch attached.
Ping, I'm raising this again, can we apply the patch from Klaus ? thanks ! Daniel
Regards,
Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany
diff -wruN -x '*~' ../orig-libvirt-cim-0.6.1/Makefile.am ./Makefile.am --- ../orig-libvirt-cim-0.6.1/Makefile.am 2012-02-08 14:23:43.000000000 +0100 +++ ./Makefile.am 2012-02-09 16:45:16.000000000 +0100 @@ -189,7 +189,7 @@ $(install_sh_DATA) -t "$(DESTDIR)$(pkgdatadir)" $(INTEROP_MOFS) $(install_sh_DATA) -t "$(DESTDIR)$(pkgdatadir)" $(INTEROP_REGS) if [[ @CIMSERVER@ != pegasus ]]; then \ - sed -i '/^# --/,/^# --!/d' $(subst schema,$(DESTDIR)$(pkgdatadir), $(PGINTEROP_REGS)); \ + sed -i '/^# --/,/^# --!/d' $(subst ./schema,$(DESTDIR)$(pkgdatadir), $(PGINTEROP_REGS)); \ fi
uninstall-local:
-- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Fri, Mar 09, 2012 at 09:32:58AM +0100, Klaus Kaempf wrote:
Daniel,
thanks for the patch.
* Daniel Veillard <veillard@redhat.com> [Mar 09. 2012 08:12]:
Right now the spec file is completely tied to tog-pegasus, this should allow the spec file to be compatible with sblim-sfcb too. This also switches to systemctl which is now used in Fedora.
I would actually like some feedback on the patch if someone has an environment to test with sblim-sfcb
I'll test later today. For reference, you might want to take a look at the spec file of https://build.opensuse.org/package/files?package=libvirt-cim&project=systemsmanagement%3Awbem which is a pure-sfcb variant.
Also I noted that if I built the package with sblim-sfcb installed it failed in the make install phase with the following error:
Thats a bug in the Makefile.am which does an incomplete substitution - patch attached.
Regards,
Klaus --- SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany
diff -wruN -x '*~' ../orig-libvirt-cim-0.6.1/Makefile.am ./Makefile.am --- ../orig-libvirt-cim-0.6.1/Makefile.am 2012-02-08 14:23:43.000000000 +0100 +++ ./Makefile.am 2012-02-09 16:45:16.000000000 +0100 @@ -189,7 +189,7 @@ $(install_sh_DATA) -t "$(DESTDIR)$(pkgdatadir)" $(INTEROP_MOFS) $(install_sh_DATA) -t "$(DESTDIR)$(pkgdatadir)" $(INTEROP_REGS) if [[ @CIMSERVER@ != pegasus ]]; then \ - sed -i '/^# --/,/^# --!/d' $(subst schema,$(DESTDIR)$(pkgdatadir), $(PGINTEROP_REGS)); \ + sed -i '/^# --/,/^# --!/d' $(subst ./schema,$(DESTDIR)$(pkgdatadir), $(PGINTEROP_REGS)); \ fi
uninstall-local:
Okay, I also pushed Klaus' patch today, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Daniel Veillard
-
Eduardo Lima (Etrunko)
-
Klaus Kaempf