0
1
I want to make a RPM using a certain user, from a specified build directory location. The RPM contains multiple files or one gzip, and should copy those files to a preset location (so it should be relocatable).
I've been to the Fedora site and other tutorials out there (including Stack Overflow), but nothing seems to work. All I could get (at best) was just a src.rpm which gives an error trying to write in %sourcedir /usr/src/redhat/SOURCES for some reason.
All I want is one spec file that can create an RPM which can handle one gzip or multiple plain text files, unpack it/copy them to the preset location. The rpm build should generate a rpm file in RPM directory.
I'm not interested in other tools that create RPMs, but how to create one using rpm build.
Using RPM version 4.4.2.3
Update: The prefix tag is clearly documented here: http://www.rpm.org/max-rpm/s1-rpm-reloc-prefix-tag.html. I'll update your example to be more clearly about the prefix use.
– None – 2014-07-21T10:45:22.867Thanks for your answer. One thing I don't see is how do you set the install location. I've read something about "Prefix". Can you include it in your example? Thanks. – None – 2013-12-23T10:07:40.487
You need to create the appropriate director structure into your build directory. In case you want your files end up in
/home/foouser/bardir/bazdir/
, then just make %{buildroot}/home/foouser/bardir/bazdir/ and go from there. I'm not sure if I understood your question correctly, though. – Sami Laine – 2013-12-30T11:08:51.113I meant how to set up the rpm, so you can give the install path at install time, using rpm --prefix. – None – 2013-12-31T16:00:31.370
Now I read you. This comes from the top of my head as I don't have an opportunity to test it. But adding just
– Sami Laine – 2013-12-31T18:08:23.377Prefix:
should do it and you can afterwards userpm --relocate
to change/usr/local
to whatever you want in that example. More details is in http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch10s05.html .