Re: list files in %files section of .spec

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

 



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@xxxxxxxxxxxxxxxxxxxxxxx
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



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux