rpmbuild Notes

The most commonly mentioned resource on building RPMs is (still, unfortunately) Maximum RPM by Edward C. Bailey (Indianapolis: SAMS, c1997). Although some of its contents can be helpful, it is woefully out of date. (A year 2000 version of the book is available online at Maximum RPM,) Most developers will probably want to avoid that source.

Since then, the rpm command's options for creating RPMs (options generally introduced with the -b option) have migrated to the rpmbuild command. The Fedora Project's wiki has a helpful article on the rpmbuild command, entitled How to create an RPM package.

Even that source isn't complete. Here are a few more options I have used. (Actually, I've only seen some of them used by others.):

The following can be used to produce a SRPM and a binary RPM from source code released as tarballs that contain a spec file:

$ rpmbuild -ta tarball

(Source: Guru Labs - Creating RPMS Guide, page 12-10.)

Apparently the above can be split into separate commands that create source and binary RPMs (respectively):

$ rpmbuild -ts tarball
$ rpmbuild -tb tarball

(Feel free to add input about the specifics of the above!)