Sort the packages into category directories.