Packaging
Everyone can contribue to packages maintained by the Hyperscale SIG via pull requests. This document explains the recommended contribution workflows; SIG members will also want to see our documentation on building packages.
Prerequisites¶
We recommend using a Fedora Linux or CentOS Stream (with EPEL enabled) system for development. The necessary tools can be installed with:
$ sudo dnf install mock mock-centos-sig-configs centpkg-sig
You will also want to clone the centos-git-common repository for get_sources.sh.
SIG-maintained packages are hosted on GitLab under the cXs-hs or cXs-sig-hyperscale branches, where cXs refers to the CentOS Stream version (e.g. c8s for CentOS Stream 8).
Branching new packages for Hyperscale¶
If a package is not currently branched, please file a ticket on our issue tracker explaining why you'd like it to be included.
Cloning and building a package¶
To clone an existing package:
$ git clone https://gitlab.com/CentOS/Hyperscale/rpms/$rpm
And checkout the relevant branch:
$ git checkout cXs-sig-hyperscale
Fetch the sources from lookaside:
$ ~/centos-git-common/get_sources.sh $rpm.spec
You can use mock to do a local test build, for example:
$ mock -r centos-stream-hyperscale-9-x86_64 --sources . --spec $rpm.spec --postinstall
Use centos-stream-hyperscale-$releasever-$arch for packages targeting the Hyperscale main repo, and centos-stream-hyperscale-experimental-$releasever-$arch for packages targeting the experimental repo.
Making changes¶
Make a branch for your work:
$ git checkout -b work
and do your changes. Remember to add a changelog entry and to bump the Release field.
Merging upstream changes¶
Sometimes it is necessary to catch up a Hyperscale-branched packaged with the latest changes that had happened upstream. Note that "upstream" for a Hyperscale package could be either the corresponding CentOS Stream branch (for modifications of exisiting CentOS packages), or a Fedora branch (for backports), and these are hosted in different places:
- CentOS Stream sources are in the
cXsbranches on GitLab, wherecXsrefers to the CentOS Stream version (e.g.c9sfor CentOS Stream 9). - Fedora sources are in the corresponding branch on Fedora dist-git
If you're not sure, please ask before embarking on this work.
To beging with, add the relevant remote to your local checkout. For a package originating from CentOS Stream 9 that would be:
$ git remote add centos-upstream https://gitlab.com/redhat/centos-stream/rpms/$package.git
Once you have the remote, fetch all changes, checkout the Hyperscale branch and merge the upstream branch into it:
$ git fetch --all
$ git checkout c9s-hs
$ git merge centos-upstream/c9s
Resolving conflicts¶
If the Hyperscale package was a straight unmodified backport (e.g. from Fedora), this should just work. In almost all other cases, this will result in a conflict that you will have to resolve. Usually the conflict is around the Release and changelog sections, but other parts of the specfile could be affected too. For Release, you'll want to follow our versioning policy. For the changelog, interleave the new upstream entries with the previous Hyperscale entries and ensure they're in chronological order, then add a new changelog entry detailing your changes.
Submitting changes¶
You will need to fork the repository on GitLab if you haven't already (by clicking the "Fork" button on the repository page). Once you have a fork, add the corresponding remote to your local checkout:
$ git remote add $user https://gitlab.com/$user/$package.git
Once you're ready to submit your changes, push them to your fork:
$ git push $user work
and create a MR against the corresponding SIG branch
Joining SIG¶
If you want to contribute regularly, consider joining our SIG group. See internal package building docs.