As Ignacio points out, you can use
But for the second step
rpm -ivh --relocate /usr=/home/username/usr --relocate /etc=/home/username/etc
rpm -ivh --relocate /=/home/username/progname
is probably easier.
If the RPM has any scripts that assume they are running as root, you might also need to add the
Plus you can add the
--aid option to resolve dependencies.
Yet another useful options in this case is
--root to avoid rpm to write to
/var path (since you're not root), so the command will be something like:
rpm -ivh --relocate /=/home/username/progname --root /home/username/progname