I use something like that :
First, i batch rename my pkg on my root folder before install with pkg_rename in a format like %TITLEID%-%TITLE%
I use Ant renomer to remove all special char
I install all pkg, and then i execute a script who take the titleid from name files, create titleid directory...