# HG changeset patch
# User Daniel Veillard <veillard(a)redhat.com>
# Date 1193656844 -3600
# Node ID 5b601a0035127544c54feaf086fb7065f873e9f9
# Parent aaad430ea766d9a3bc0be035e595d8da17ee2122
RPM Packaging changes and associated cleanups:
- Augment some Makefiles variables with missing files
- add a spec file template
- extend the configure script to generate the spec file
- add a 'make rpm' target
- fix src/Makefile.am to use late binding of providerdir variable
Signed-off-by: Daniel Veillard <veillard(a)redhat.com>
There is still one thing missing I guess in the spec file: the registration
step, which I think should be run as a post-install script. The spec file
saves the provider-register.sh and register_base.sh scripts in
/usr/share/libvirt-cim/ so they are available at that point, but I don't
understand how to best call them, so it will need some attention by someone
who knows how that process should work.
Daniel
diff -r aaad430ea766 -r 5b601a003512 Makefile.am
--- a/Makefile.am Fri Oct 26 13:34:26 2007 -0700
+++ b/Makefile.am Mon Oct 29 12:20:44 2007 +0100
@@ -74,9 +74,11 @@ EXTRA_BASE_MOFS = \
schema/KVM_ResourceAllocationSettingData.mof
pkgdata_DATA = $(MOFS) $(REGS)
-pkgdata_SCRIPTS = provider-register.sh
+pkgdata_SCRIPTS = provider-register.sh register_base.sh
-EXTRA_DIST = schema $(pkgdata_DATA) $(pkgdata_SCRIPTS)
+EXTRA_DIST = schema $(pkgdata_DATA) $(pkgdata_SCRIPTS) \
+ libvirt-cim.spec.in libvirt-cim.spec \
+ doc/CodingStyle doc/SubmittingPatches
# Un/Register the providers and class definitions from/to the current CIMOM.
# @CIMSERVER@ is set by the configure script
@@ -88,3 +90,6 @@ preuninstall:
preuninstall:
sh provider-register.sh -d -t @CIMSERVER@ -n /root/ibmsd -r $(REGS) -m $(MOFS)
sh provider-register.sh -d -t @CIMSERVER@ -n /root/interop -r $(INTEROP_REGS) -m
$(INTEROP_MOFS)
+
+rpm: clean
+ @(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz)
diff -r aaad430ea766 -r 5b601a003512 configure.ac
--- a/configure.ac Fri Oct 26 13:34:26 2007 -0700
+++ b/configure.ac Mon Oct 29 12:20:44 2007 +0100
@@ -180,7 +180,7 @@ echo "----------------------------------
echo "----------------------------------------------------------"
# Generate configure scripts for the Makefile
-AC_OUTPUT
+AC_OUTPUT(libvirt-cim.spec)
echo "You may now run make"
diff -r aaad430ea766 -r 5b601a003512 libvirt-cim.spec.in
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libvirt-cim.spec.in Mon Oct 29 12:20:44 2007 +0100
@@ -0,0 +1,65 @@
+# -*- rpm-spec -*-
+
+Summary: A CIM provider for libvirt
+Name: libvirt-cim
+Version: @PACKAGE_VERSION@
+Release: 1%{?dist}%{?extra_release}
+License: LGPL
+Group: Development/Libraries
+Source: libvirt-cim-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+URL:
http://libvirt.org/CIM/
+Requires: libxml2
+Requires: libvirt >= 0.2.3
+BuildRequires: sblim-cmpi-devel
+BuildRequires: libvirt-devel >= 0.2.3
+BuildRequires: e2fsprogs-devel
+BuildRequires: libxml2-devel
+BuildRequires: libcmpiutil-devel
+
+%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.
+
+%prep
+%setup -q
+
+%build
+%configure --disable-werror
+make
+
+%install
+rm -fr %{buildroot}
+
+%makeinstall PROVIDERDIR=%{buildroot}%{_libdir}/cmpi
+cp provider-register.sh register_base.sh %{buildroot}%{_datadir}/libvirt-cim/
+rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
+rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
+rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.la
+rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.a
+
+%clean
+rm -fr %{buildroot}
+
+%post
+/sbin/ldconfig
+
+%postun
+/sbin/ldconfig
+
+%files
+%defattr(-, root, root)
+
+%doc README doc/CodingStyle doc/SubmittingPatches
+%doc provider-register.sh register_base.sh
+%{_libdir}/lib*.so*
+%{_libdir}/cmpi/lib*.so*
+%{_datadir}/libvirt-cim/*.sh
+%{_datadir}/libvirt-cim/*.mof
+%{_datadir}/libvirt-cim/*.registration
+
+%changelog
+* Fri Oct 26 2007 Daniel Veillard <veillard(a)redhat.com> - 0.1-1
+- created
diff -r aaad430ea766 -r 5b601a003512 libxkutil/Makefile.am
--- a/libxkutil/Makefile.am Fri Oct 26 13:34:26 2007 -0700
+++ b/libxkutil/Makefile.am Mon Oct 29 12:20:44 2007 +0100
@@ -4,7 +4,7 @@ SUBDIRS = tests
CFLAGS += $(CFLAGS_STRICT)
-noinst_HEADERS = cs_util.h misc_util.h device_parsing.h hostres.h
+noinst_HEADERS = cs_util.h misc_util.h device_parsing.h hostres.h xmlgen.h
lib_LTLIBRARIES = libxkutil.la
diff -r aaad430ea766 -r 5b601a003512 src/Makefile.am
--- a/src/Makefile.am Fri Oct 26 13:34:26 2007 -0700
+++ b/src/Makefile.am Mon Oct 29 12:20:44 2007 +0100
@@ -1,7 +1,20 @@
# Copyright IBM Corp. 2007
SUBDIRS = tests
-noinst_HEADERS = Virt_ElementConformsToProfile.h profiles.h
+noinst_HEADERS = profiles.h svpc_types.h \
+ Virt_AllocationCapabilities.h \
+ Virt_ComputerSystem.h \
+ Virt_ComputerSystemIndication.h \
+ Virt_Device.h \
+ Virt_DevicePool.h \
+ Virt_ElementConformsToProfile.h \
+ Virt_EnabledLogicalElementCapabilities.h \
+ Virt_HostSystem.h \
+ Virt_RASD.h \
+ Virt_RegisteredProfile.h \
+ Virt_SettingsDefineCapabilities.h \
+ Virt_VirtualSystemManagementCapabilities.h \
+ Virt_VSSD.h
XKUADD = $(top_builddir)/libxkutil/libxkutil.la
@@ -9,7 +22,7 @@ CFLAGS += -I$(top_builddir)/libxkutil $(
AM_LDFLAGS = $(XKUADD)
-providerdir = @PROVIDERDIR@
+providerdir = $(PROVIDERDIR)
provider_LTLIBRARIES = libVirt_ComputerSystem.la \
libVirt_Device.la \
--
Red Hat Virtualization group
http://redhat.com/virtualization/
Daniel Veillard | virtualization library
http://libvirt.org/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit
http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine
http://rpmfind.net/