# rpm -i postgres-[version number].src.rpm# rpmbuild -bb --target i686 /usr/src/redhat/SPECS/postgresql.spec

If you get a problem with unpackaged files, use the following trick:

vi /usr/lib/rpm/macros

An modify some of the lines as follows:

## Script gets packaged file list on input and buildroot as first parameter.# Returns list of unpackaged files, i.e. files in  not packaged.## Note: Disable (by commenting out) for legacy compatibility.#%__check_files         /usr/lib/rpm/check-files %{buildroot}## Should unpackaged files in a build root terminate a build?## Note: The default value should be 0 for legacy compatibility.%_unpackaged_files_terminate_build      0## Should missing %doc files in the build directory terminate a build?## Note: The default value should be 0 for legacy compatibility.%_missing_doc_files_terminate_build     0