I am not sure how I shall lsit my files under the %files section. My doubt is how deep I shall go in lisiting direcrories/subdirectories/files.
Below is part of the content of my buildroot ---------------------------------------------------------------- % ls usr/lib64/rstudio-server bin/ resources/ www-symbolmaps/ INSTALL README.md VERSION R/ www/ COPYING NOTICE SOURCE
% ls -al usr/lib64/rstudio-server/bin/ total 22M drwxr-xr-x 1 poisonivy poisonivy 142 Dec 7 08:12 ./ drwxr-xr-x 1 poisonivy poisonivy 144 Dec 7 08:11 ../ drwxr-xr-x 1 poisonivy poisonivy 42 Dec 7 08:11 pandoc/ drwxr-xr-x 1 poisonivy poisonivy 178 Dec 7 08:11 postback/ -rwxr-xr-x 1 poisonivy poisonivy 629 Dec 7 08:09 r-ldpath* -rwxr-xr-x 1 poisonivy poisonivy 3.3M Dec 7 08:12 rpostback* -rwxr-xr-x 1 poisonivy poisonivy 4.6M Dec 7 08:12 rserver* -rwxr-xr-x 1 poisonivy poisonivy 2.8M Dec 7 08:12 rserver-pam* -rwxr-xr-x 1 poisonivy poisonivy 11M Dec 7 08:12 rsession* -rwxr-xr-x 1 poisonivy poisonivy 3.1K Dec 7 08:09 rstudio-server* --------------------------------------------------------------------
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
etc with all files
Is this correct? pandoc/ and postbac directories only contain files, no subdir.
Why not simply:
%{_libdir}/%{name}/bin/
Thank you for hints.
On Mon, Dec 7, 2015 at 10:02 AM, arnaud gaboury arnaud.gaboury@gmail.com wrote:
I am not sure how I shall lsit my files under the %files section. My doubt is how deep I shall go in lisiting direcrories/subdirectories/files.
Below is part of the content of my buildroot
% ls usr/lib64/rstudio-server bin/ resources/ www-symbolmaps/ INSTALL README.md VERSION R/ www/ COPYING NOTICE SOURCE
% ls -al usr/lib64/rstudio-server/bin/ total 22M drwxr-xr-x 1 poisonivy poisonivy 142 Dec 7 08:12 ./ drwxr-xr-x 1 poisonivy poisonivy 144 Dec 7 08:11 ../ drwxr-xr-x 1 poisonivy poisonivy 42 Dec 7 08:11 pandoc/ drwxr-xr-x 1 poisonivy poisonivy 178 Dec 7 08:11 postback/ -rwxr-xr-x 1 poisonivy poisonivy 629 Dec 7 08:09 r-ldpath* -rwxr-xr-x 1 poisonivy poisonivy 3.3M Dec 7 08:12 rpostback* -rwxr-xr-x 1 poisonivy poisonivy 4.6M Dec 7 08:12 rserver* -rwxr-xr-x 1 poisonivy poisonivy 2.8M Dec 7 08:12 rserver-pam* -rwxr-xr-x 1 poisonivy poisonivy 11M Dec 7 08:12 rsession*
-rwxr-xr-x 1 poisonivy poisonivy 3.1K Dec 7 08:09 rstudio-server*
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
Is this correct? pandoc/ and postbac directories only contain files, no subdir.
Why not simply:
%{_libdir}/%{name}/bin/
Thank you for hints.
--
google.com/+arnaudgabourygabx
On Mon, Dec 7, 2015 at 10:22 AM, arnaud gaboury arnaud.gaboury@gmail.com wrote:
On Mon, Dec 7, 2015 at 10:02 AM, arnaud gaboury arnaud.gaboury@gmail.com wrote:
I am not sure how I shall lsit my files under the %files section. My doubt is how deep I shall go in lisiting direcrories/subdirectories/files.
Below is part of the content of my buildroot
% ls usr/lib64/rstudio-server bin/ resources/ www-symbolmaps/ INSTALL README.md VERSION R/ www/ COPYING NOTICE SOURCE
% ls -al usr/lib64/rstudio-server/bin/ total 22M drwxr-xr-x 1 poisonivy poisonivy 142 Dec 7 08:12 ./ drwxr-xr-x 1 poisonivy poisonivy 144 Dec 7 08:11 ../ drwxr-xr-x 1 poisonivy poisonivy 42 Dec 7 08:11 pandoc/ drwxr-xr-x 1 poisonivy poisonivy 178 Dec 7 08:11 postback/ -rwxr-xr-x 1 poisonivy poisonivy 629 Dec 7 08:09 r-ldpath* -rwxr-xr-x 1 poisonivy poisonivy 3.3M Dec 7 08:12 rpostback* -rwxr-xr-x 1 poisonivy poisonivy 4.6M Dec 7 08:12 rserver* -rwxr-xr-x 1 poisonivy poisonivy 2.8M Dec 7 08:12 rserver-pam* -rwxr-xr-x 1 poisonivy poisonivy 11M Dec 7 08:12 rsession*
-rwxr-xr-x 1 poisonivy poisonivy 3.1K Dec 7 08:09 rstudio-server*
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}/*
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 /* ?
Is this correct? pandoc/ and postbac directories only contain files, no subdir.
Why not simply:
%{_libdir}/%{name}/bin/
Thank you for hints.
--
google.com/+arnaudgabourygabx
--
google.com/+arnaudgabourygabx
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_Owner...
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.
On Mon, Dec 7, 2015 at 1:22 PM, Michael Schwendt mschwendt@gmail.com wrote:
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_Owner...
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.
Very clear. Thank you so much.
-- 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
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.