fix rpm script errors when $target is not exported