To setup for rpmbuild follow the command below (I’ve added a thing or two past basics.
Commands
# yum install rpmdevtools
# rpmdev-setuptree
# mkdir ~/rpmbuild/tmp
# -- Optional below here
# echo "%_tmppath %{_topdir}/tmp" >> ~/.rpmmacros
# echo "%packager YourName" >> ~/.rpmmacros
Provides These Files
Filename : /usr/bin/rpmdev-vercmp
Filename : /usr/bin/rpmdev-sort
Filename : /usr/bin/rpmdev-sha224
Filename : /usr/bin/rpmdev-sha1
Filename : /usr/bin/rpmdev-sum
Filename : /usr/bin/rpmdev-checksig
Filename : /usr/bin/rpmdev-sha384
Filename : /usr/bin/rpmdev-sha512
Filename : /usr/bin/rpmdev-newinit
Filename : /usr/bin/rpmdev-wipetree
Filename : /usr/bin/rpmdev-packager
Filename : /usr/bin/rpmdev-bumpspec
Filename : /usr/bin/rpmdev-newspec
Filename : /usr/bin/rpmdev-md5
Filename : /usr/bin/rpmdev-diff
Filename : /usr/bin/rpmdev-setuptree
Filename : /usr/bin/rpmdev-rmdevelrpms
Filename : /usr/bin/rpmdev-sha256
Filename : /usr/bin/rpmdev-cksum
Filename : /usr/bin/rpmdev-extract
Sets Up This Directory Tree (in home, ~/)
~/rpmbuild
├── BUILD
├── RPMS
├── SOURCES
├── SPECS
├── SRPMS
└── tmp
6 directories, 0 files
What are the Directories For?
Content | Macro Code | Function |
~/rpmbuild | %_topdir | The top most directory of your structure that everything else is based off of. |
~/rpmbuild/BUILD | %_builddir | The build directory for the source code package which is decompressed and compiled here. |
~/rpmbuild/RPMS | %_rpmdir | The binary RPM package is created and placed here. |
~/rpmbuild/SOURCES | %_sourcedir | The source files for the package (tar.gz, single files, etc), and all patches are stored in this directory. |
~/rpmbuild/SPECS | %_specdir | The RPM package configuration file (.spec) is stored here. |
~/rpmbuild/SRPMS | %_srcrpmdir | The source code RPM package (SRPM) is created and stored here. |
~/rpmbuild/tmp | %_tmppath | The tmp directory for extra packaging work in case wider permissions are not available. |