Generate spec file from a directory