Re: preserving file attributes from make install in rpm spec file

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

 





On Dec 13, 2007 11:03 AM, Bob Beers <bob.beers@xxxxxxxxx> wrote:
On Dec 13, 2007 10:35 AM, Jeff Johnson <n3npq.jbj@xxxxxxxxx> wrote:
>

> What you miss is %attr markers in the %files manifest.
>
> Add explicit
>    %attr(mode,user,group)
> (substituting the actual values for "mode", "user", "group" above)
> for paths listed in the %files manifest.
>
> There is also %defattr, and there's a certain art to expressing
>  %attr so that itscopes correctly across glob patterns, but rpm
> packaging easily separates the actual {mode,user,group} used
> during build from the same tuple used during install.
>

Thank you Jeff and Matthew for the rapid responses!

Do I understand correctlythat I can
 omit the make install line in %install section
 if I add appropriate %attr lines in the %file section?

You can't omit "make install" (and adding the DESTDIR=%{buildroot}
is perfectly sane if that is what you are doing).

Think of %{buildroot} as a staging area for package contents. However
you populate, with cp, or install or ... any other means. But you need to
populate the %{buildroot} with the contents that you want in packages.

(Note: yes I'm perfectly aware that one can package w/o BuildRoot:, but
let's not go there please.)

 

Something like this?

%files
%attr(755,root,root)
/usr/local/bin/file01
%attr(644,root,root)
/usr/local/bin/file02
%attr(750,root,wheel)
/usr/local/bin/file03
%attr(750,root,aaa)
/usr/local/bin/file04
%attr(750,root,bbb)
/usr/local/bin/file05

The scoping is up to next newline, so make sure the %attr is 
on the same line as the path or pattern.

73 de Jeff 
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux