I've just added such a possibility to my PkgBuild software using the 'trackinstall' program which will track nearly any command you want and create a nice tgz package for you, if at all possible. It works even with interactive scripts such as the opera installer and flash_player plugin installer. Hmm, just occurred to me that I have a program that can run a GUI installer -I should check to see what happens when that runs...
Anyway, you can get PkgBuild here:
http://distro.ibiblio.org/pub/linux/...migo-PkgBuild/
Get at least the 0.9.8 version for the mentioned features.
After installing PkgBuild, running this command should do it for you:
trackinstall -S -r=".run"
You may need to refine or specify which documents to install using the -d DOCLIST option.
trackinstall, src2pkg and PkgBuild use the installwatch libraries to track the command(s) on a system level and will detect any files or directories created and create a package from that. PkgBuild also now has a very simple utility calle 'tracklist' which does nothing but create a list of files and directories created by whatever command:
tracklist sh .run
should create the list for you in the current dir.