backport configure and rpmbuild fixes.