(Note: for puppet managed build hosts: include m_mock)

For info on building iRODS RPMs, click here.

Basic instructions:

1. Setup tree ~/rpmbuild

rpmdev-setuptree

or

svn co systems/apps/mock/rpmbuild

2. Populate rpm directory

via rpm
rpm -ivh something.src.rpm

or manually copy files into ~/rpmbuild/SOURCES (tar.gz)

Create a ".rpmmacros" file in your home directory. It should contain the following:

%_topdir      %(echo $HOME)/rpmbuild
%_smp_mflags  -j3
%__arch_install_post   /usr/lib/rpm/check-rpaths   /usr/lib/rpm/check-buildroot

This will build in ~/rpmbuild, not in /usr/local/redhat, which is the default and requires root.

3. Edit or create .spec file in ~/rpmbuild/SPECS.

A simple .spec file template can be viewed here, or downloaded here.
A more advanced example, the iRODS .spec file, can be viewed here, or downloaded here.

4. rebuild src.rpm

rpmbuild -bs --nodeps ~/rpmbuild/SPECS/something.spec

Make sure your user is in the 'mock' group so you don't get prompted to build as root. Usually, if you have to build an RPM as root, something is wrong.

5. rebuild rpm using mock

mock --rebuild ~/rpmbuild/SRPMS/something-X.Y.Z.src.rpm

Links (for further info/more details):

http://fedoraproject.org/wiki/Docs/Drafts/BuildingPackagesGuide

https://fedoraproject.org/wiki/Rpmdevtools

https://fedoraproject.org/wiki/Packaging/Guidelines

https://fedoraproject.org/wiki/PackageMaintainers/MockTricks

https://fedoraproject.org/wiki/Packaging/ScriptletSnippets

  • No labels

1 Comment

  1. nice docs! i'll play with mock when i stop coughn' a lung out.

    thx!