File libvirt-cim.spec of Package libvirt-cim

#
# spec file for package libvirt-cim (Version 0.4)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           libvirt-cim
BuildRequires:  e2fsprogs-devel libcmpiutil-devel libxml2-devel sblim-cmpi-devel sblim-sfcb xen-devel
BuildRequires:  libvirt-devel >= 0.3.2
Url:            http://libvirt.org/CIM/
License:        LGPL v2.1 or later
Group:          System/Management
AutoReqProv:    yes
Version:        0.4
Release:        22
Summary:        CMPI-based CIM provider implementing DMTF SVPC model
Source:         %{name}-%{version}.tar.bz2
Source1:        libvirt-cim-rpmlintrc
Patch0:         rm-dup-217-schema.patch
Patch1:         provider-reg.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       cim-server
Requires:       libxml2 >= 2.6.0
Requires:       libvirt >= 0.3.2
Requires:       cim-schema >= 2.17
Requires:       unzip
Provides:       xen-cim-cmpi = 0.2.0
Obsoletes:      xen-cim-cmpi < 0.2.0

%description
Libvirt-cim is a CMPI CIM provider that implements the DMTF SVPC
virtualization model. The goal is to support most of the features
exported by libvirt itself, enabling management of multiple platforms
with a single provider.



Authors:
--------
    Dan Smith <danms@us.ibm.com>

%define REGISTRATION %{_datadir}/%{name}/*.registration
%define SCHEMA %{_datadir}/%{name}/*.mof
%define INTEROP_REGISTRATION %{_datadir}/%{name}/RegisteredProfile.registration %{_datadir}/%{name}/ElementConformsToProfile.registration %{_datadir}/%{name}/ReferencedProfile.registration
%define INTEROP_SCHEMA %{_datadir}/%{name}/ComputerSystem.mof %{_datadir}/%{name}/HostSystem.mof %{_datadir}/%{name}/RegisteredProfile.mof %{_datadir}/%{name}/ElementConformsToProfile.mof %{_datadir}/%{name}/ReferencedProfile.mof

%prep
%setup -q
%patch0 -p1
%patch1 -p1
chmod -x src/* libxkutil/* schema/* README doc/* base_schema/README*
chmod +X src/* libxkutil/* schema/*

%build
export CFLAGS="$RPM_OPT_FLAGS"
%configure --disable-werror
make DOCS_DIR=%{_docdir}/%{name} HTML_DIR=%{_docdir}/%{name}

%install
%makeinstall DOCS_DIR=%{_docdir}/%{name} HTML_DIR=%{_docdir}/%{name}
%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/*.{a,la}
%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.{a,la}
%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/libxkutil.so
%{__rm} -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
%{__rm} -f $RPM_BUILD_ROOT%{_datadir}/%{name}/install_base_schema.sh
%{__rm} -f $RPM_BUILD_ROOT%{_datadir}/%{name}/cimv216-interop_mof
%{__rm} -f $RPM_BUILD_ROOT%{_datadir}/%{name}/cimv216Experimental-MOFs.zip
%{__rm} -f $RPM_BUILD_ROOT%{_datadir}/%{name}/fix_schema.patch

%clean
%{__rm} -rf $RPM_BUILD_ROOT
# do nothing if not an upgrade, otherwise deregister current providers

%pre
[ $1 -eq 1 ] && exit 0
%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
	-n root/virt \
	-r %{REGISTRATION} -m %{SCHEMA} || true
%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
	-n root/interop \
	-r %{INTEROP_REGISTRATION} -m %{INTEROP_SCHEMA} || true

%post
/sbin/ldconfig
%{_datadir}/%{name}/provider-register.sh -t sfcb \
	-n root/virt \
	-r %{REGISTRATION} -m %{SCHEMA} || true
%{_datadir}/%{name}/provider-register.sh -t sfcb \
	-n root/interop \
	-r %{INTEROP_REGISTRATION} -m %{INTEROP_SCHEMA} || true

%preun
%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
	-n root/virt \
	-r %{REGISTRATION} -m %{SCHEMA} || true
%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
	-n root/interop \
	-r %{INTEROP_REGISTRATION} -m %{INTEROP_SCHEMA} || true

%postun -p /sbin/ldconfig

%files 
%defattr(-, root, root)
%dir %{_datadir}/%{name}
%{_libdir}/lib*.so*
%{_libdir}/cmpi/lib*.so*
%{_datadir}/%{name}/*.sh
%{_datadir}/%{name}/*.mof
%{_datadir}/%{name}/*.registration

%changelog
* Fri Jul 18 2008 jfehlig@novell.com
- Provides/Obsoletes xen-cim-cmpi  bnc#403156
- Remove ExclusiveArch restriction
* Thu Jul 17 2008 jfehlig@novell.com
- Change "PreReq: sblim-sfcb" to "Requires: cim-server", allowing
  cimom neutral provider package.
* Thu Jun 26 2008 jfehlig@novell.com
- Updated to official libvirt-cim 0.4 release
* Mon May 19 2008 jfehlig@novell.com
- Change sblim-sfcb from Requires to PreReq.  bnc#391837
- Fix some packaging issues addressed by previous change
* Sun May 18 2008 aj@suse.de
- Add rpmlintrc file for modules.
- Package some extra files.
- Own lib directory.
* Fri May 16 2008 jfehlig@novell.com
- Remove inclusion of base schema and use cim-schema package instead
- Add provider schema to /root/interop namespace
* Tue May 06 2008 jfehlig@novell.com
- Fix handling of directories in install_base_schema.sh allowing
  the schema to be properly imported into sfcb.
* Thu May 01 2008 jfehlig@novell.com
- Initial creation of package
openSUSE Build Service is sponsored by