# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1194625790 28800
# Node ID 7a89e6d4a4d5f5dc1e77992b22a8c1f173ded7df
# Parent 581a0f3fb078ccb003378d6d5974f5fe4636f123
Cleanups and schema install additions to the RPM spec
- Removed references to the register_bash.sh script
- Added schema install/uninstall to scriptlets
- Make HTML documentation be installed (and included in the RPM)
- Remove references to beam in configure.ac
- Check for xsltproc at configure time
- Make RPM use configure-time namespace
- Discard registration messages on %preun (failures are expected)
- Include the generated web content in "make dist"
I have tested this on Fedora 8 with the bundled pegasus installation.
We still need to figure out how we're going to get the CIM v2.16 Exp
schema on the box, but if you do that manually (into /root/virt) before
installing the RPM, it works as expected.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 581a0f3fb078 -r 7a89e6d4a4d5 configure.ac
--- a/configure.ac Fri Nov 09 08:10:08 2007 -0800
+++ b/configure.ac Fri Nov 09 08:29:50 2007 -0800
@@ -54,20 +54,20 @@ AC_ARG_WITH([maxmem],
[DEFINE_MAXMEM(4096)]
)
+AC_ARG_WITH(html-dir,
+ AC_HELP_STRING([--with-html-dir=path],
+ [path to html directory, default
$datadir/doc/$PACKAGE-$VERSION/html]),
+ [test "x$withval" != "x" &&
HTML_DIR="$withval"],
+ [HTML_DIR='$(datadir)/doc/$(PACKAGE)-$(VERSION)/html'])
+AC_SUBST(HTML_DIR)
+
# Autogenerate the autoconf header file to store build settings
AC_CONFIG_HEADER([config.h])
-# We need a absolute here for beam to work
topdir=`pwd`
AC_SUBST(topdir)
-AC_CHECK_PROG([found_beam_compile],[beam_compile],[yes])
-
-BEAMFILES="parser-messages BEAM_STATS BEAM-complaints MISC_ERRORS *.beam"
-AC_SUBST(BEAMFILES)
-
-# Autogenerate runbeam-c, which must be executable
-#AC_CONFIG_FILES([beam/runbeam-c],[chmod a+x beam/runbeam-c])
+AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
# Autogenerate the Makefile
AC_CONFIG_FILES([
@@ -140,11 +140,6 @@ else
TESTSUITE_SUPPORT=Enabled
fi
-#
-# Enable the beam source analysis system. This requires that beam's
-# bin directory is in your path
-#
-
CFLAGS_STRICT="-Werror"
CHECK_LIBCU
@@ -156,21 +151,6 @@ AC_ARG_ENABLE([werror],
fi])
AC_SUBST(CFLAGS_STRICT)
-
-AC_ARG_ENABLE([beam],
- [ --enable-beam use beam to compile source [[default=no]]],
- [if test "x$enableval" = "xyes"; then
- if test "x$found_beam_compile" = "xyes"; then
- AC_MSG_NOTICE(Building beam configuration)
- beam_configure --c $CC -o beam/compiler_c_config.tcl
- CC="\$(top_srcdir)/beam/runbeam-c"
- else
-
AC_CHECK_FAIL(beam,beam,http://w3.eda.ibm.com/beam,
- Can not find beam_compile in path! Can not enable beam analysis!
-)
- fi
- fi],
- )
CFLAGS="$CFLAGS $CC_WARNINGS"
diff -r 581a0f3fb078 -r 7a89e6d4a4d5 doc/Makefile.am
--- a/doc/Makefile.am Fri Nov 09 08:10:08 2007 -0800
+++ b/doc/Makefile.am Fri Nov 09 08:29:50 2007 -0800
@@ -1,9 +1,22 @@ XSLTPROC = /usr/bin/xsltproc
XSLTPROC = /usr/bin/xsltproc
-WEB_PAGES = index.html
+WEB_PAGES = index.html \
+ architecture.html \
+ downloads.html \
+ intro.html \
+ news.html \
+ platforms.html \
+ schema.html
+
+EXTRA_DIST = site.xsl libvirt-cim.html $(WEB_PAGES)
$(WEB_PAGES): libvirt-cim.html site.xsl
- $(XSLTPROC) --nonet --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/libvirt-cim.html
> index.html
+ -@(if [ -x $(XSLTPROC) ]; then \
+ $(XSLTPROC) --nonet --html $(top_srcdir)/doc/site.xsl
$(top_srcdir)/doc/libvirt-cim.html > index.html; \
+ fi);
+
+install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
+ @INSTALL@ -m 0644 $(srcdir)/*.html $(DESTDIR)$(HTML_DIR)
all: $(WEB_PAGES)
-
diff -r 581a0f3fb078 -r 7a89e6d4a4d5 libvirt-cim.spec.in
--- a/libvirt-cim.spec.in Fri Nov 09 08:10:08 2007 -0800
+++ b/libvirt-cim.spec.in Fri Nov 09 08:29:50 2007 -0800
@@ -34,7 +34,7 @@ rm -fr %{buildroot}
rm -fr %{buildroot}
%makeinstall PROVIDERDIR=%{buildroot}%{_libdir}/cmpi
-cp provider-register.sh register_base.sh %{buildroot}%{_datadir}/libvirt-cim/
+cp provider-register.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
@@ -43,8 +43,25 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.a
%clean
rm -fr %{buildroot}
+%pre
+%define REGISTRATION %{_datadir}/%{name}/*.registration
+%define SCHEMA %{_datadir}/%{name}/*.mof
+
+%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
+ -n /@CIM_VIRT_NS@ \
+ -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
+
%post
/sbin/ldconfig
+
+%{_datadir}/%{name}/provider-register.sh -t pegasus \
+ -n /@CIM_VIRT_NS@ \
+ -r %{REGISTRATION} -m %{SCHEMA} || true
+
+%preun
+%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
+ -n /@CIM_VIRT_NS@ \
+ -r %{REGISTRATION} -m %{SCHEMA} || true
%postun
/sbin/ldconfig
@@ -53,7 +70,8 @@ rm -fr %{buildroot}
%defattr(-, root, root)
%doc README doc/CodingStyle doc/SubmittingPatches
-%doc provider-register.sh register_base.sh
+%doc provider-register.sh
+%doc doc/*.html
%{_libdir}/lib*.so*
%{_libdir}/cmpi/lib*.so*
%{_datadir}/libvirt-cim/*.sh