Need help in maintaining permissions in RPM

Ramin Rad raminsrad at gmail.com
Fri Jul 1 16:26:22 UTC 2011


If the tar file is the file that you are installing, then just use the 
"%attr" directive under "%files". 
(http://www.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html)

If you are extracting the tar file in your %pre or %post scripts, use 
the '-p' option to tar to preserve the mode for the files in the tar 
image. (See the man pages for tar)

Hope this helps.

-ramin


On 7/1/2011 12:10 PM, James R Maxwell wrote:
>
> I have a tar file that contains certain permissions, ownerships and 
> groups.
>
> My question is how do I specify in the Spec file that I want to 
> maintain the same permissions, ownerships and groups of my tarfile 
> when the RPM is installed.
>
> I have the following line in my spec file;
>
> %defattr (-,root,root,-)
>
> However my tarfile contains files and directories of different 
> permissions for directories/files and ownership/groups.
>
> Any help would be appreciated.
>
> Jim
>
>
> _______________________________________________
> Rpm-list mailing list
> Rpm-list at lists.rpm.org
> http://lists.rpm.org/mailman/listinfo/rpm-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20110701/cfe80f76/attachment.html>


More information about the Rpm-list mailing list