Re: list files in %files section of .spec

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

 



On Mon, 7 Dec 2015 11:06:18 +0100, arnaud gaboury wrote:

> >> doubt is how deep I shall go in lisiting
> >> direcrories/subdirectories/files.

> >> What I would do is this:
> >>
> >> %files
> >>
> >> %{_libdir}/%{name}/bin/pandoc/        <--- dir
> >> %{_libdir}/%{name}/bin/postback/     <---- dir
> >> %{_libdir}/%{name}/bin/r-ldpath         <----- file
> >> %{_libdir}/%{name}/bin/rpostback      <---- file  
> >
> > ERRATA:  
> >>
> >> %{_libdir}%{name}/bin/pandoc/        <--- dir
> >> %{_libdir}%{name}/bin/postback/     <---- dir
> >> %{_libdir}%{name}/bin/r-ldpath         <----- file
> >> %{_libdir}%{name}/bin/rpostback      <---- file
> >>
> >> etc with all files  

> In fact, I just did this and it build fine:
> 
> %files
> %defattr(-, root, root, -)
> %{_libdir}/%{name}/*
> %{_localstatedir}/*
> %{_sysconfdir}/*

More correct would be

  %files
  %{_libdir}/%{name}/
  %{_localstatedir}/*
  %{_sysconfdir}/*

to include also %{_libdir}/%{name} and not only its contents. The trailing slash
on the path name is purely cosmetic, however:

  https://fedoraproject.org/wiki/Packaging:UnownedDirectories
  https://fedoraproject.org/wiki/Packaging:Guidelines#File_and_Directory_Ownership

> When looking at various spec files from Fedora repo, I can't see such
> method.

Then you've looked at the wrong spec files. Not all are good examples.

> Most spec files contain a very long list of files. Why? Is
> there any reason not to use /* ?

It depends. Explicitly including individual files requires the buildroot
to contain exactly the specified file. That can serve as a guard against
incomplete builds. Else, extra file existance checks in %install or %check
would be needed for similar protection. On the contrary, including entire
directory trees can lead to including too many files in the wrong
sub-packages or including added contents accidentally.
-- 
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