In several cases, there has been an RPM in the Fedora repo's which I would like to use, but is out of date.
I'm using the following in order to pull the source rpm, bump the version and reinstall.
I'm using the cloc
tool here as an example. You may find it helpfult reference this guide from Fedora
Ensure you follow the first steps in the Fedora guide in order to setup the tooling needed.
$> sudo dnf download --source cloc
$> rpmbuild --rp cloc-1.72-6.fc29.src.rpm
This will extract the RPM and move the spec to ~/rpmbuild/SPEC
$> sudo dnf builddep ~/rpmbuild/SPEC/cloc.spec
This will install all the necessary build dependencies.
vim ~/rpmbuild/SPEC/cloc.spec
Here, I edited the version to bump it from 1.72 to 1.80.
Next, we need to use the spectool
to download the updated sources:
$> spectool -g -R ~/rpmbuild/SPEC/cloc.spec
$> rpmbuild -bb ~/rpmbuild//SPECS/cloc.spec
From here, you should have a new rpm located in ~/rpmbuild/RPMs
which you can install.