Issue
I am just wondering if there is a way to specify the current user(who is installing the RPM) user:group privileges to installed folder of RPM(/usr/lib/appfloder) in the Spec(.spec) file.
Example: Currently while installing the RPM it is considering root:root privileges if we do not create the user and group and not added in section (%defattr(777, maya, maya, 777)) in the spec file. if we add defattr it is considering maya as a user.
Expecting, please consider the current user 'user1' is installing the RPM, the privileges should under 'user1'. if 'user2' is installing the RPM it should under 'user2'.. Why?
I have an RPM package which install on /usr/lib/app and run as a service. And my application needs the current user home directory to search for some package which is installed for the current user.
Solution
The user who installs the rpm
is always root, because you need root privileges to be able to install an rpm.
So you cannot do this. You need to find some other way, a package should not provide files inside the /home
directory of a user. If you have general config to package; put it in /etc
.
Answered By - Chris Maes Answer Checked By - Marie Seifert (WPSolving Admin)