Our team frequently performs customization to various packages distributed with RHEL/CentOS. Our workflow involves installing the SRPM, executing rpmbuild -bp
to unpack and patch the source, making our changes and creating a .patch to be included in the specfile, and building the new customized SRPM for later use with mock:
$ rpm -i grub-0.97-13.5.1.src.rpm
$ rpmbuild -bp rpmbuild/SPECS/grub.spec
$ cp -a rpmbuild/BUILD/grub-0.97 grub-0.97.orig
$ cd rpmbuild/BUILD/grub-0.97
# Make modifications, generate .patch against ".orig" copy
$ vim rpmbuild/SPECS/grub.spec
# Add custom .patch to specfile, update version, etc
$ rpmbuild -bs rpmbuild/SPECS/grub.spec
$ mock -r default-x86_64.cfg rpmbuild/SRPMS/grub-0.97-13.5.1.custom-1.src.rpm
This process works well but we are not currently using any form of source control to keep track of our modifications and specfile changes. Based on my (admittedly basic) understanding of git, I think it should be possible to inject it into this workflow and leverage some of its power to optimize a few of the steps (in addition to the normal benefits of SCM).
For example, rather than creating a copy of the source to diff
against later we could create an initial commit of the upstream patched source and then make our modifications. When ready, use git format-patch
to create our feature patch and add it to the specfile.
I would also like to version control the specfiles as well, though I'm not sure how best to achieve that.
So my question is threefold:
- Does anyone out there use SCM when customizing upstream packages?
- What is the most effective way to integrate git into our workflow?
- Is there a better workflow that is more conducive to version-controlled custom RPM authoring?
Extra credit: Assuming a git-based workflow, how would I structure a central repository to accept pushes? One repo with submodules? One repo per package?
mock
for minor dev and rpmbuild would complain if dependencies aren't installed. A dash of--nodeps
added to rpmbuild makes everyone happy. – Vireo