[build@client11 SPECS]$ rpmbuild -bs tar.spec Wrote: /home/build/rpmbuild/SRPMS/tar-1.22-1.src.rpmIf you are only building the source rpm, you don't need to bother with dependencies, so a good option here is to say nodeps.
[build@client11 SPECS]$ rpmbuild --nodeps -bs tar.spec Wrote: /home/build/rpmbuild/SRPMS/tar-1.22-1.src.rpmThe build options for rpmbuild are as follows
- -ba build everything
- -bb build binary
- -bp continue only to the %prep stage
- -bc continue only to the %build stage
- -bi continue only to the %install stage
- -bl just verify the %files section
- -bs build only the source package
[build@client11 SPECS]$ rpmbuild --short-circuit -bc tar.specOr if you have just built a package and it fails because you missed a file, you can just verify the files section again after making your change.
[build@client11 SPECS]$ rpmbuild --short-circuit -bl tar.spec Processing files: tar-1.22-1 Requires(rpmlib): rpmlib(CompressedFileNames) = 3.0.4-1 rpmlib(PayloadFilesHavePrefix) = 4.0-1 Requires: libc.so.6()(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.4)(64bit) librt.so.1()(64bit) librt.so.1(GLIBC_2.2.5)(64bit) rtld(GNU_HASH) Checking for unpackaged file(s): /usr/lib/rpm/check-files /tmp/rpm-buildroot-tar-1.22I don't think I'll have time to cover some advanced topics, but something we use a lot is --target. --target allows you to specify the architecture for which you are building. We typically build on x86_64 and then specify --target to build the i386 rpm. You need to use the program setarch in front of rpmbuild to achieve a true i386 package.
[build@client11 SPECS]$ setarch i386 rpmbuild --target i386 -bb tar.spec Building target platforms: i386 Building for target i386 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.85806 ... configure: error: C compiler cannot create executables See `config.log' for more details. error: Bad exit status from /var/tmp/rpm-tmp.85806 (%prep) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.85806 (%prep)There's a lot more to that problem though...you need a full i386 system installed so that you can compile i386 binaries on an x86_64 system. That means compilers, libraries, etc. The solution to that problem is beyond scope but I can summarize it with one word, mock.
It's doubtful you'll need any other options to rpmbuild, read the man page, but the rest are all margin case options.