Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm just trying to figure out how to know in an rpm package that calls sudo, and put some files in the non-root home folder for the users who call sudo or are root.

I tried with something like this:

%define whoami %(eval who am i | awk '{print $1}')

then I try to copy some files to /home/%{whoami}/target after that (and some more instructions) I build the package, without problems, actually can run pretty well the package in my machine, the problem is when I try to run the same package in other machine with a different user name, it doesn't copy the files because it looks for my original home user folder instead of the other user.

share|improve this question
    
Shouldn't this question be asked on Stack Overflow? –  BenjiWiebe Feb 12 '13 at 18:50
add comment

1 Answer

RPM packages are installed by root, there is no need to fool around with sudo or anything else. Check Fedora's RPM guidelines for a detailed explanation of how to create spec files. The guidelines are (mostly) applicable to all RPM-based distributions, and as RHEL (and thus CentOS) are downstream from Fedora, they should apply with only minor fudging for recent updates.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.