fpm
fpm copied to clipboard
how to set multiple non-default file attrs in rpm build
Can you provide an example of how I can define the specific attrs on multiple files to be packaged into one rpm ? What I'm looking for is the ability to define one file with all the non-default mode/user/group settings ala
%attr (0711,root,-) /some/file/here %attr (0770,user1,group1) /some/other/file
I know a lame workaround is to do this in a postinstall scriptlet, but do you have support for specifying a set of attributes in a easy to cook up file ?
I was looking at the code, because I'm having the same problem. When it sets the attributes in the RPM it actually sets each file defined with the --rpm-user --rpm-group. There would need to be an additional flag like --rpm-attr something along the lines of --rpm-userfile --rpm-groupfile that overrides the default ona per file basis. For the actual permissions, you can use --rpm-attr [ATTR][FILE] to accomplish that.
Something like --rpm-attr 0755/some/executable/file
A working (in my case) exampple: --rpm-attr 0755,apache,apache:/var/run/samplefile (the colon is used to separate ATTR and FILE)
@pmst Thanks for that example! Saved me a bunch of time. ^_^
Can you use globs like you can in RPM SPEC files?
e.g. --rpm-attr 0755,apache,apache:/usr/lib/python/site-packages/my_package.egg-info/*
Would it be too much to ask for 'one' authoritative example of anything fpm?
Great tool but basically too bad so sad you figure it out yourself for anybody trying to use the rpm features. On Mar 11, 2016 1:25 PM, "Deven Phillips" [email protected] wrote:
Can you use globs like you can in RPM SPEC files?
e.g. --rpm-attr 0755,apache,apache:/usr/lib/python/site-packages/my_package.egg-info/*
— Reply to this email directly or view it on GitHub https://github.com/jordansissel/fpm/issues/983#issuecomment-195561146.
I'm looking at this as well and am a bit stumped this is not really documented.
I want to do this in my .fpm
file:
--rpm-defattrdir 0755
--rpm-defattrfile 0644
--rpm-attr 1770,root,root:/opt/informix-client-sdk-4.50.FC9/tmp
--rpm-attr 0755,root,root:/opt/informix-client-sdk-4.50.FC9/bin/Informix.Net.Core.dll
--rpm-attr 0755,root,root:/opt/informix-client-sdk-4.50.FC9/bin/check_version
--rpm-attr 0755,root,root:/opt/informix-client-sdk-4.50.FC9/bin/chkenv
But the generated RPM file applies the default attribute regardless of my overwrites. Any tips on how to handle this?
Ok, at least I just solved my issue. I had to put the individual attributes before the default ones. Makes sense if you think about.
Would be nice to support it for deb packages as well. For now I use after-upgrade
and after-install
scripts to set file/dir permissions.