Fix #1217 spec file fails to build due to duplicate files and unused files