ReleaseEngineering/PuppetAgain/HowTo/Build RPMs

From MozillaWiki
Jump to navigation Jump to search

Building

Find a suitable machine with 'mock' installed. It's best to do this on a target machine, since its /etc/mock/default.cfg will already be set up correctly.

Download the srpm from puppetagain.pub.build.mozilla.org/data/repos/yum/releng/public and unpack it:

mkdir foopkg && cd foopkg
rpm2cpio $srpm | cpio -ivd

You should see a .spec file appear. Check that it is identical to the one in http://hg.mozilla.org/build/puppet under modules/packages/manifests/mozilla e.g., with an md5 hash. If not, figure out what the differences are, and which corresponds to the running version of the package.

Edit the spec file to your heart's content. To build an RPM, you'll need to stop off at an SRPM:

mock --buildsrpm --spec /path/to/spec --sources $PWD

The script output will tell you where the SRPM is. Copy it somewhere else, or mock will delete it. Then build the SRPM into an RPM:

run mock --rebuild /path/to/srpm

Testing

For testing purposes, it's best to install the RPM locally, rather than dropping it into the puppetagain data directory and risking affecting production. You can do that too, if you're confident it won't affect anything.

Review

For review, include the modified .spec in your r? for changes to the puppet repository.

Landing

When the patch is r+'d, commit it as usual, and also add *both* the RPM (or multiple RPMs if multiple architectures are required!) and the SRPM into /data on the designated puppet master, so that it will be distributed to other systems.