Re: %files section (was : Evolution testing specfile)



> Matthias Saou wrote:
> 
> > Right here, there will be some problems when uninstalling :
> > 
> <snip> 
> 
> Ahh,  Thanks for the information, I'm not all certain of how the %dir 
> works, it registers the directory as belonging to the package, yes? but, 
> how will it then work with its contents, would those still be included 
> with only
> 
>   %dir %{_libdir}/evolution
> 
> or do i have to mention the contents of the directory specificly?

OK, here I go for a quick useful explanation :-)

Well, if you have :
/usr/share/gnome/apps/Applications/whatever.desktop
/usr/share/whatever/... (many files and subdirs)

Putting something like :
%{_datadir}/*
whould be wrong since the package would try to remove (and complain about
not being able to) the /usr/share/gnome directory and the two other ones in
it.

On the other hand :
%{_datadir}/gnome/apps/Applications/*
%{_datadir}/whatever/*
would also be wrong since the /usr/share/whatever directory itself would not
be referenced as part of the RPM and would not be removed (even if empty)
upon uninstallation of the package.

I suppose you get the point ;-)

Now a much more common case, a main and a -devel package :

For the main package :
%dir %{_libdir}/whatever
%{_libdir}/whatever/*.so*

For the -devel package :
%{_libdir}/whatever/*.a
%{_libdir}/whatever/*.la

And of course, put a requirement for the main package in the -devel one. The
subdir of /usr/lib will be owned by the main package, but since we used the
%dir tag, its content will NOT be recursively added to the package! That's
the whole point and I hope you all get the idea ;-)

When you list the files, always ask yourself if you're not forgetting some,
forgetting directories (this happens far too often!) or putting too much in
(like I've seen "%{_datadir}" alone, yuck!).

Cheers,
Matthias

--
Matthias Saou
matthias accelance fr




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]