File ownership from RPM spec file
Hi,
How can I write a spec file so that after installation of the package the files belong to a user defined by an external factor? The use case is that the files delivered by a package belong to different user accounts on prod servers than on dev and test. Thanks in advance for any assistance. Regards, Rotty |
You can do chown in a script in the %post section based on something present or absent on the target system.
For example it could install the files for the production case, then in %post check for a file named /tmp/MYRPM_TEST. |
Hi,
Thanks for that. I could write quite a simple bit of bash for the %post section that uses the hostname to determine if it is a prod, test or dev install. From that I can work out which account to chown the files to. However, from within the %post section how can I enumerate the files being dropped by the RPM? Without that I will have hard code all the files in the chown command (or top level directories if I'm using 'chown -R'), which is a problem for maintainability. Thanks, Rotty |
I'm not sure if this would work, but you could try 'rpm -qpl rpmname' to list files.
|
All times are GMT -5. The time now is 12:32 PM. |