update rpm packaging script to build rpm automatically