To compile the RPM for PHP4 I had to modify the SPEC to this:
%{?!_without_php: [ -d "%{buildroot}/php4" ] && mv %{buildroot}/php4
%{buildroot}%{_datadir}/php}
Because the build is still sticking xapian.php into /php4/xapian.php
All the best,
Tim.