rpmbuild
Hello Masters, I am trying to build and rpm package which will display a message like "You have to be root in order to install this package..." if the user is not root. Is there a way to check for user privilege in the rpm spec file? You help is greatly appriciated. Thanks.
|
I don't think there is. One can only install rpm as root since update of rpm database will be done during the install.
Brian |
Like Brian1 said it won't pratical since you can only install packages as root account user, but that doesn't mean there is no way to accomplish this, just use a pre-install section in your .spec file:
Code:
%pre |
Thank you very much, I will try that in the %pre section of the spec file.
|
Hello UnSpawn,
Somehow the rpm checks for /var/lib/rpm/__db.000 lock first before the %pre section. What I get if I install the rpm as no-root is: error: can't create trasnsaction lock on /var/lib/rpm/__db.000. For new users, they don't know what the problem is. That's why I need to display that message out the the user. Is there anyother way? Thanks so much |
One option would be to create a shell script to your users instead of a raw rpm. The shell script could extract the rpm from the script itself and then run whatever commands you want. There are plenty of linux installers that do something like this. Take a look at http://megastep.org/makeself/. That may work for you.
|
All times are GMT -5. The time now is 05:31 AM. |