Fix fails archive builds

The problem was that the shell script called `dirname` (part of a `mkdir`)
with an unquoted path.