How to build RPMs

You need to install rpmbuild to be able to pack and unpack RPM's
 	yum install rpmbuild
In your home area make create a rpm macro to sign off the rpm's you build
 	vim .rpmmacros

	%packager Ananth Ak
	%vendor ARC
	%_topdir /home/ananth/rpm
	%_sourcddir /home/ananth/rpm/SOURCES
	%dist .rh5.aan
Create the directory structure for building and unpacking rpms within your home directory
 	mkdir -p ~/rpms/{BUILD,RPMS,SPECS,SOURCES,SRPMS}
Add a "mockbuild" group and user
 
sudo /usr/sbin/groupadd mockbuild
sudo /usr/sbin/useradd -gmockbuild mockbuild
Download a source rpms from a website and unpack while you are in your home directory
 	wget http://www.anandhacorp.co.uk/download/ckermit-8.0.211-0.rh5.aan.i386.rpm
	rpm -Uvh ckermit-8.0.211-0.rh5.aan.i386.rpm
All the files will go into the relevant directories.

To make changes to your build before compling modify the spec file found in /home/ARC/aan/rpm/SPECS/ckermit.spec

After making changes build the rpm using the following command
 	rpmbuild -v -bb --clean ~/rpm/SPECS/ckermit.spec
The rebuilt RPM will be in: /home/ananth/rpm/RPMS/

Back to Resources