Improve build-rpm.sh

Review 682 by @Tryneus
Issue #268