[PATCH] Cleanups and schema install additions to the RPM spec

# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1194624610 28800 # Node ID d2f6398c7174f362fddc07d9d07024e5ac9538b8 # 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 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@us.ibm.com> diff -r 581a0f3fb078 -r d2f6398c7174 configure.ac --- a/configure.ac Fri Nov 09 08:10:08 2007 -0800 +++ b/configure.ac Fri Nov 09 08:10:10 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 d2f6398c7174 doc/Makefile.am --- a/doc/Makefile.am Fri Nov 09 08:10:08 2007 -0800 +++ b/doc/Makefile.am Fri Nov 09 08:10:10 2007 -0800 @@ -1,9 +1,25 @@ 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): 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) + +clean-local: + rm -f $(WEB_PAGES) all: $(WEB_PAGES) - diff -r 581a0f3fb078 -r d2f6398c7174 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:10:10 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,17 +43,34 @@ 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} || true + %post /sbin/ldconfig -%postun +%{_datadir}/%{name}/provider-register.sh -t pegasus \ + -n /@CIM_VIRT_NS@ \ + -r %{REGISTRATION} -m %{SCHEMA} || true + +%preun /sbin/ldconfig + +%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ + -n /@CIM_VIRT_NS@ \ + -r %{REGISTRATION} -m %{SCHEMA} || true %files %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

On Fri, Nov 09, 2007 at 08:10:58AM -0700, Dan Smith wrote: [...]
diff -r 581a0f3fb078 -r d2f6398c7174 doc/Makefile.am --- a/doc/Makefile.am Fri Nov 09 08:10:08 2007 -0800 +++ b/doc/Makefile.am Fri Nov 09 08:10:10 2007 -0800 @@ -1,9 +1,25 @@ 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
I would add $(WEB_PAGES) to $(EXTRA_DIST)
$(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) + +clean-local: + rm -f $(WEB_PAGES)
and probably not remove on make clean to be able to 'make dist' with them embedded in the tarball as xsltproc is not really a build requirement.
all: $(WEB_PAGES) - diff -r 581a0f3fb078 -r d2f6398c7174 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:10:10 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,17 +43,34 @@ 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} || true + %post /sbin/ldconfig
-%postun +%{_datadir}/%{name}/provider-register.sh -t pegasus \ + -n /@CIM_VIRT_NS@ \ + -r %{REGISTRATION} -m %{SCHEMA} || true + +%preun /sbin/ldconfig
hum ... on uninstalls shouldn't ldconfig be run after the list have been removed (and hence in %postun) ?
+ +%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ + -n /@CIM_VIRT_NS@ \ + -r %{REGISTRATION} -m %{SCHEMA} || true
%files %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
Except those tiny issues looks fine to me, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

DV> I would add $(WEB_PAGES) to $(EXTRA_DIST) Ah, right. DV> and probably not remove on make clean to be able to 'make dist' DV> with them embedded in the tarball as xsltproc is not really a DV> build requirement. Yep, good point. DV> hum ... on uninstalls shouldn't ldconfig be run after the list DV> have been removed (and hence in %postun) ? Ah, right. DV> Except those tiny issues looks fine to me, Replacement patch on the way... :) Thanks for applying your experienced eye to this packaging stuff! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

On Fri, Nov 09, 2007 at 08:31:00AM -0800, Dan Smith wrote:
DV> I would add $(WEB_PAGES) to $(EXTRA_DIST)
Ah, right.
DV> and probably not remove on make clean to be able to 'make dist' DV> with them embedded in the tarball as xsltproc is not really a DV> build requirement.
Yep, good point.
DV> hum ... on uninstalls shouldn't ldconfig be run after the list DV> have been removed (and hence in %postun) ?
Ah, right.
DV> Except those tiny issues looks fine to me,
Replacement patch on the way... :)
Thanks for applying your experienced eye to this packaging stuff!
Heh, I don't understand much to the CIM C code so I try to compensate :) Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (2)
-
Dan Smith
-
Daniel Veillard