ReleaseEngineering/PuppetAgain/HowTo/Build RPMs: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
Line 29: Line 29:
to update the metadata.
to update the metadata.


Note that, pending {{bug|772599}}, yum will cache the metadata for 6 hours, meaning you won't see your packages installed for that duration.
Note that, pending {{bug|772599}}, yum will cache the metadata for 6 hours, meaning you won't see your packages installed for that duration.  See mention of '''$repoflag''' in [[ReleaseEngineering/PuppetAgain/Modules/packages]] for the workaround.

Revision as of 15:36, 16 July 2012

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

Other Dependencies

If your package depends on other mozilla-specific packages, I'm not sure what the best way to build is. The less-than-awesome technique I used was to hack /etc/mock/epel-6-x86_64.cfg to include pointers to the public mirrors of the puppetagain repos.

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. Debuginfo RPMs are a good idea, too. Run

 createrepo --update $repo_path

to update the metadata.

Note that, pending bug 772599, yum will cache the metadata for 6 hours, meaning you won't see your packages installed for that duration. See mention of $repoflag in ReleaseEngineering/PuppetAgain/Modules/packages for the workaround.