File libvirt-cim.spec of Package libvirt-cim

#
# spec file for package libvirt-cim (Version 0.5.2)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# 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
BuildRequires:  libvirt-devel >= 0.3.2
Url:            http://libvirt.org/CIM/
License:        LGPL v2.1 or later
Group:          System/Management
AutoReqProv:    yes
Version:        0.5.2
Release:        4.<RELEASE22>
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
Patch2:         versions.patch
Patch3:         lxc-procrasd.patch
Patch4:         lxc-sched-param.patch
Patch5:         lxc-sched-procrasd.patch
Patch6:         vcpu-count.patch
Patch7:         proc-rasd.patch
Patch8:         eth-device.patch
Patch9:         graphics-device.patch
Patch10:        disk-flags.patch
Patch11:        rm-console-prov.patch
Patch12:        keymap.patch
Patch13:        disk-rasd-emu-type.patch
Patch14:        disk-type.patch
Patch15:        default-net-source.patch
Patch16:        emulator-device.patch
Patch17:        774-maxvcpu.patch
Patch18:        776-snap-service-job.patch
Patch19:        777-diskpool-fix.patch
Patch20:        gdev-listen.patch
Patch21:        clock1.patch
Patch22:        clock2.patch
Patch23:        clock3.patch
Patch24:        clock4.patch
Patch25:        automake.patch
Patch26:        767_error_base.patch
Patch27:        768_error.patch
Patch28:        799_error_clean.patch
Patch29:        800_error.patch
Patch30:        875-lxc.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
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
chmod -x src/* libxkutil/* schema/* README doc/* base_schema/README*
chmod +X src/* libxkutil/* schema/*

%build
autoreconf -i -f
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
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/libvirt/cim

%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
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/cim

%changelog
openSUSE Build Service is sponsored by