rpm-spec and Home's user folder

0

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.

Carlos Dueñas

Posted 2013-02-12T18:30:47.660

Reputation: 1

Shouldn't this question be asked on Stack Overflow? – BenjiWiebe – 2013-02-12T18:50:42.150

Answers

0

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.

vonbrand

Posted 2013-02-12T18:30:47.660

Reputation: 2 083