linux - rpmbuild does not preserve permissions of directories -
i have application in /opt/myapp need pack rpm package using fpm follows:
fpm -e -s dir -t rpm --name 'myapp' --version '1.0' --iteration "12345" --directories /opt/myapp --epoch 0 /opt/myapp
(other options not relevant here)
all files , directories in myapp owned root (both user , group). there directory called "help" different permissions like
drwxrwxrwx.
i.e. users can write directory. when inspect spec file generated fpm, has
%defattr(-,root,root,-)
and directories (%dir) , files listed, expect original permissions preserved in package. however, when inspect using
rpm -qlvp myapp.rpm
the permission on "help" directory reset to:
drwxrwxr-x
i.e. other users cannot write there anymore. first guess add option
--rpm-use-file-permissions
but made things worse, because files in rpm owned user called fpm.
edited: i've achieved result using
--rpm-use-file-permissions --rpm-user root --rpm-group root
but still doesn't feel elegant , flexible. in advance.
the comment %defattr
, , absence of comments buildroot
tree may indicate confusion. according rpm.org:
if particular attribute not need specified (usually because file installed attribute set properly), attribute may replaced dash
that is, if no explicit permission given in %defattr
, permissions build-time %install
when constructing rpm satisfactory. there no guarantee match (or compatible with) actual system on rpm later installed.
Comments
Post a Comment