How to make a src.rpm unpack the source to whatever directory I want?
13,237
Solution 1
The solution was as simple as calling tar in the spec file and then specifying the path I wanted to untar to.
Solution 2
use rpm2cpio to unpack rpm. Or use alien to convert the rpm to other packages (deb, tar...)
The exact syntax for using rpm2cio
rpm2cpio ./package_name-test-1.1-1.x86_64.rpm | cpio -idmv
Related videos on Youtube
Comments
-
barn over 1 year
I'm trying to make an rpm that will unpack the source to a custom directory, such as /asdf. When I run it, it always errors out saying "cannot create %sourcedir /usr/src/redhat/SOURCES". Is there something I can put in my .spec file that will make it unpack the source (which is just a .tar.gz file inside the src.rpm) to a custom directory when I do the command "rpm -i xyz.src.rpm"?
-
barn over 12 yearsI found the answer. logiqwest.com/TechnicalPapers/rpmScriptInstall.html provides step-by-step instructions for doing what I was trying to do.
-
-
barn over 12 yearsyes, that's exactly what I did. I just didn't understand how the spec file worked in terms of rpmbuild.
-
DustWolf over 3 yearsUse that option on what?
-
DustWolf over 3 yearsDoes not answer the question, how to unpack a source package.