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

Reply via email to