What is the web interface tool that Debian or Ubuntu use for publicizing their custom repositories on the web?
Like packages.debian.org
Is such tool open sourced, so that it could be re-used for a custom repository?
The scripts that manage the archive are open source, they're in a debian package called dak. I don't think this includes the web pages, but I'm not sure. I'd suggest emailling ftpmaster@debian.org or debian-www@lists.debian.org and asking.
Parsing the packages file is indeed very straightforward but there's still a lot of work to make a nice set of web pages from it so it would be worth seeing if you can get hold of what debian use.