-
Set up the build environment
- Install necessary packages
sudo yum -y install gcc rpm-build
-
Create ~/.rpmmacros with the following content:
%packager John Doe <jdoe@example.org> %vendor My Company %_topdir %{getenv:HOME}/rpm
(The
packager
andvendor
lines are optional) -
Make sure the following folders exist, creating them if necessary:
- rpm
- rpm/BUILD
- rpm/RPMS
- rpm/SOURCES
- rpm/SPECS
- rpm/SRPMS
cd ~ && mkdir rpm rpm/BUILD rpm/RPMS rpm/SOURCES rpm/SPECS rpm/SRPMS
- Install necessary packages
- Copy source tarballs and any other file you wish to be part of the package to rpm/SOURCES
-
Create a spec file for the package and put it in rpm/SPECS
- For more information on creating a spec file, see: How to create an RPM package
-
Build the RPM
rpmbuild -ba rpm/SPECS/PACKAGE.spec
Two RPMs will be created. The binary will be in rpm/RPMS/architecture, and the source RPM will be in rpm/SRPMS.
Building RPMs
Archived
This page has been archived and will receive no further updates.