[libvirt] [PATCH] fix soem missing directories and ownership in spec file

Daniel Veillard veillard at redhat.com
Tue Apr 28 11:50:19 UTC 2009


On Tue, Apr 28, 2009 at 10:38:50AM +0100, Daniel P. Berrange wrote:
> On Tue, Apr 28, 2009 at 11:34:38AM +0200, Daniel Veillard wrote:
> >   The spec file in CVs was missing the creation fo some directories
> > and forgot to take ownership of the cache subdir used for memory dumps
> > with QEmu/KVM
> 
> > @@ -305,6 +305,13 @@
> >  rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
> >  rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la
> >  rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a
> > +install -d -m 0755 $RPM_BUILD_ROOT%{_localstatedir}/run/libvirt/
> > +# Default dir for disk images
> > +install -d -m 0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/libvirt/images/
> > +# Default dir for kernel+initrd images
> > +install -d -m 0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/libvirt/boot/
> > +# used for virDomainMemoryPeek
> > +install -d -m 0700 $RPM_BUILD_ROOT%{_localstatedir}/cache/libvirt/
> 
> I'd removed all these rules a while ago, in favour of adding a rule to
> the bottom ofo src/Makefile.am, so everyone installing libvirt gets the
> right directories, instead of just RPM users

  Right it's better.

> We should just need to add the 'cache' option to the Makefile.am too

  Actually it's there:

install-exec-local:
        $(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt"
        $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images"
        $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot"
if WITH_QEMU
        $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu"
        $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu"

  on the other hand $(localstatedir)/run/libvirt might not be created
if network/qemu/lxc/uml are disabled, but that's probably fine as is.


> > @@ -422,6 +429,7 @@
> >  %dir %{_localstatedir}/lib/libvirt/
> >  %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/images/
> >  %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/boot/
> > +%dir %attr(0700, root, root) %{_localstatedir}/cache/libvirt/
> >  
> >  %if %{with_qemu}
> >  %dir %{_localstatedir}/run/libvirt/qemu/

  That is still needed as well as

@@ -482,6 +483,7 @@
 %dir %{_includedir}/libvirt
 %{_includedir}/libvirt/*.h
 %{_libdir}/pkgconfig/libvirt.pc
+%dir %{_datadir}/gtk-doc/html/libvirt/
 %doc %{_datadir}/gtk-doc/html/libvirt/*.devhelp
 %doc %{_datadir}/gtk-doc/html/libvirt/*.html
 %doc %{_datadir}/gtk-doc/html/libvirt/*.png

which I missed in my initial patch, currently we create the directory
but the -devel rpm doesn't own it, so those 2 dir directive are still
needed I think.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/
-------------- next part --------------
Index: libvirt.spec.in
===================================================================
RCS file: /data/cvs/libxen/libvirt.spec.in,v
retrieving revision 1.116
diff -u -r1.116 libvirt.spec.in
--- libvirt.spec.in	24 Apr 2009 14:04:55 -0000	1.116
+++ libvirt.spec.in	28 Apr 2009 11:50:06 -0000
@@ -422,6 +422,7 @@
 %dir %{_localstatedir}/lib/libvirt/
 %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/images/
 %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/boot/
+%dir %attr(0700, root, root) %{_localstatedir}/cache/libvirt/
 
 %if %{with_qemu}
 %dir %{_localstatedir}/run/libvirt/qemu/
@@ -482,6 +483,7 @@
 %dir %{_includedir}/libvirt
 %{_includedir}/libvirt/*.h
 %{_libdir}/pkgconfig/libvirt.pc
+%dir %{_datadir}/gtk-doc/html/libvirt/
 %doc %{_datadir}/gtk-doc/html/libvirt/*.devhelp
 %doc %{_datadir}/gtk-doc/html/libvirt/*.html
 %doc %{_datadir}/gtk-doc/html/libvirt/*.png


More information about the libvir-list mailing list