Product SiteDocumentation Site

8.3. Verifying Your RPMS

After you've built an RPM, you can use the techniques from Chapter 4, Using the RPM Database to verify the RPM. You can also use the –bl option to the rpmbuild command to verify the list of files in the RPM. Use a command like the following:
rpmbuild –bl spec_file
For example:
$ rpmbuild -bl /usr/src/redhat/SPECS/jikes.spec
Processing files: jikes-1.17-1
error: File not found: /tmp/jikesrpm/usr/bin/jikes
error: File not found: /tmp/jikesrpm/usr/doc/jikes-1.17/license.htm
error: File not found by glob: /tmp/jikesrpm/usr/man/man1/jikes.1*
Provides: jikes
RPM build errors:
File not found: /tmp/jikesrpm/usr/bin/jikes
File not found: /tmp/jikesrpm/usr/doc/jikes-1.17/license.htm
File not found by glob: /tmp/jikesrpm/usr/man/man1/jikes.1*
This example shows a number of errors. The -bl option checks that all the necessary files are located within the buildroot directory. The buildroot directory is a location that acts like the final installed root directory. From the previous example, this package was not properly built yet.
In a situation like this, you can start over, or use the --short-circuit option to restart the build from a given section in the spec file. As you create an RPM, you will need to go back and forth restarting the build as you detect and fix errors.
You can also use the rpm command with options such as –V for verification on a fully-built package. For example:
$ rpm -Vp /usr/src/redhat/RPMS/i386/jikes-1.17-1.i386.rpm
S.5....T /usr/bin/jikes
.......T d /usr/doc/jikes-1.17/license.htm
..5....T d /usr/man/man1/jikes.1.gz
In this case, you see some file sizes and times differ. These differences can be explained by the fact that the original package was compiled on a different system and older version of Red Hat Linux than the version compiled locally.
Cross Reference
See the on "Verifying Installed RPM Packages" section in Chapter 4, Using the RPM Database for more on the -V option.