At some point I intend to implement a view source tool, but in the mean time here are some useful recipes.
fedpkg is a great little command line tool for checking out, building and modifying Fedora packages. On this page I’m collecting a few simple recipes, useful for all Fedora users. You will need to
yum install fedpkg but apart from that no other preparation is required. All the recipes use
binutils as an example, but you can use any package name.
Do you have a recipe using fedpkg? Post it in the comments.
Upgrade to the Rawhide version of a Fedora package
fedpkg clone -a -B binutils cd binutils/master
master corresponds to Rawhide. There are also directories for each branch, eg.
f20 for Fedora 20. At this point you may need to install build dependencies:
sudo yum-builddep binutils.spec
Build the package on your local machine. This builds it against whatever version of Fedora is installed on your machine:
To install the package:
sudo yum install */*.rpm
Apply a source patch to a Fedora package
Note: One aim of the proposed view-source tool will be to make this almost completely automated.
fedpkg clone -a -B binutils cd binutils/fXX
(Choose your current Fedora version instead of
fXX, or use
master for Rawhide)
Apply the patch:
cp /tmp/test.patch . rpmdev-bumpspec -r binutils.spec vi binutils.spec
Near the top of the spec file, add:
%prep section, add:
Now build and install the patched package as usual:
sudo yum-builddep binutils.spec fedpkg local sudo yum localupdate */*.rpm
Examine the source of a package
Sure, you can look at the upstream package sources, but often you want to look at the older / patched source as it applies to your version of Fedora, since that might be different …
fedpkg clone -a -B binutils cd binutils/fXX fedpkg prep
fXX to your version of Fedora. The
prep subcommand will unpack the tarball and apply all the patches.