bin/prepare: Use temporary spec file name when replacing tokens