How can I find what options an rpm was compiled with

I need to find the compile options for exim, as packaged by fedora 11. More generally, is there an easy way to find what options a particular rpm was compiled with?


Well, the closest thing you can do (that I'm aware of) is to query the OPTFLAGS variable of the exim package:

 [root@fedora11 ~]# rpm -q --queryformat="%{NAME}: %{OPTFLAGS}\n" exim
 exim: -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
 --param=ssp-buffer-size=4 -m64 -mtune=generic
 [root@fedora11 ~]#

You'll get better answer, however, if you download the source rpm of exim (rpm -qivp exim*.rpm shows the filename in the "Source RPM" tag) and install it with "rpm -i exim-4.69-10.fc11.src.rpm". Then look into the exim .spec file in the /usr/src/redhat/SPECS/ directory (if you do this as root; this location can vary) and see how exactly it was configured and built. There you'll e.g. also find the configure options that were specified.

(You can also use rpm2cpio exim-4.69-10.fc11.src.rpm | cpio -id to extract the contents of the src rpm (including the .spec file) to the current directory instead of installing it.)