own rpm-packet: installation-path relative to an user-input

Hello,

I have a tar.gz-file, which should be unpacked by an own rpm-packet to an user-specific folder. In my spec-file (for rpmbuild) I wrote this:


...
%install
tar xfvz $RPM_SOURCE_DIR/archive.tar.gz -C /home/exampleuser/examplefolder/
...

=> What must I do to unpack the tar.gz-archive relative to an user-input :? ???

Thank you!!!

Just type the folder name - without /home/exampleuser/. Actually typing some user will be always realtive to the current patch, unless it begins with / or ~.

I’ve tried it several times, but it won’t work for me:


RPM build errors:
    File must begin with "/": ~/examplefolder/

How can I set “dynamic” the installation-path to a user input?