I want to unpack source RPM and apply patches to the upstream source.
What is almost OK for me is
rpm -i mypkg-*.src.rpm cd ~/rpmbuild rpmbuild -bp SPECS/mypkg.spec # frolic in BUILD/mypkg
My problem is that
rpm -i always deploys the sources in ~/rpmbuild. And since I want to do it in a middle of automated test (which is running under root), I'd rather do this at least in my own temporary tree.
I have tried
--prefix=mypath with RPM, but it seems that RPM ignored that (after hassling me about the path being relative ... nice job ;)).
Other thing that came to my mind was creating a temporary user and
su but that's ugly, adds overhead of creating/removing the user and is not non-intrusive anyway.
So what are my other, way better options?