A Sourceforge-like mirroring system for use in my servers?

view full story

http://serverfault.com – I want to set up a download area within a site, (FTP or HTTP, doesn't matter) and I would like to have at least a handful of mirrors scattered around the world. I would like the download links to choose a mirror transparently for the user. It may be random, round-robin, or it may have some smart IP proximity logic. Is there some good package (e.g. a Python or PHP library) I could use for that end? (HowTos)