On 12/07/2015 02:06 AM, arnaud gaboury wrote:
In fact, I just did this and it build fine:
%files
%defattr(-, root, root, -)
%{_libdir}/%{name}/*
%{_localstatedir}/*
%{_sysconfdir}/*
When looking at various spec files from Fedora repo, I can't see such
method.Most spec files contain a very long list of files. Why? Is
there any reason not to use /* ?
As Michael said, it's good practice to guard against missing files (such
as an optional component not building and later not installing due to a
missing BuildRequires), and because you typically need specific paths
when you have sub-packages. The other thing you want to watch out for
is listing directories in the %files section that the package doesn't
really own.
For instance, look at the output of "rpm -qf /usr/bin". You'll see just
one package. However, if you listed "/*" in your %files section, then
/usr and /usr/bin would be part of your package. In the past, it also
created a situation where your package might specify different ownership
or permissions for those directories. IIRC, rpm now treats that as a
conflict, which would prevent your package from installing.
So, if your package were the only one that created "%{_libdir}/%{name}"
then you might want to list that, without the trailing wildcard, so that
the directory is correctly owned by your package and removed when the
package is removed.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org