In my experience, the best way to learn about how to package RPMs is to look at how other people package RPMs. That means looking at lots of spec files. Sure fedpkg
will let you clone lots of package repos, but what if you only have the SRPM? You can get the spec file out of a SRPM, but it takes a little work with cpio
, a tool with so many options that I can never remember the exact invocation. So I wrote a quick two-liner to save me some aggravation:
#! /bin/sh
spec=$(rpm -qlp $1 | grep -E '\.spec$')
rpm2cpio $1 | cpio -i --to-stdout $spec
And how can you get the SRPM? Simple, install yum-utils
then run
$ yumdownloader --source --downloadonly PACKAGE_NAME
Tim Bielawa
15 Nov 2014 03:11 pm
My preferred way to open up RPM’s (source or binary) is with the
rpmdev-extract
command. This command is available in therpmdevtools
package. It provides several other utilities as well for more advanced work with RPMs.Tim Bielawa
15 Nov 2014 04:11 pm
Example of usage, here:
https://gist.github.com/anonymous/8581ccce14509df3aa1b