Creating a Private Mirror of MacPorts...

Ryan Schmidt ryandesign at macports.org
Thu Mar 29 15:01:56 PDT 2012


On Mar 29, 2012, at 16:22, Jeremy Lavergne wrote:

>> I have mac users who cannot connect to the Internet.
>> 
>> I need to create a private mirror for MacPorts for them... But, so far, I haven't been able to find any documentation on how to do that.
>> 
>> Does anybody know where I can find documentation for that? Has anybody done it?

People who wanted to host mirrors have typically emailed us at the portmgr address, so the discussions and the instructions we send haven't appeared on a public list. Not that it's a secret particularly. We could probably put something in the wiki.


>> Whee!!!
>> 
>> -RZ
>> 
>> p.s.  the only server I have available for a MacPorts mirror is running Linux.
> 
> You might check out `port -p mirror` to grab dist files (this might be a case where port can run natively on Linux). You can then point a web server at the folder where everything is saved.

Right. Alternately, you can rsync from any of our distfiles servers, listed on the Mirrors wiki page. (Pick one close to you.) This will get you lots of obsolete files you probably don't need, since the mirrors keep files forever. On the other hand, it means you don't have to have MacPorts installed. (Many (most?) of our mirrors aren't running OS X either.)


> I think you can then just have the internet-less citizens point distfiles.macports.org to your server, or add it to the list of macports_distfiles fetch mirrors:
> ${prefix}/var/macports/sources/rsync.macports.org/release/ports/_resources/port1.0/fetch/mirror_sites.tcl

If you sync your ports with rsync, as the above path suggests, your changes will be wiped out next time you sync, which isn't so great. But if you switch to using a Subversion working copy for your ports, your change is kept. This is what I do; I have several local machines, and on each one, the others' addresses are listed in mirror_sites.tcl.

MacPorts does not subsist on distfiles alone, of course; you need the actual portfiles too. You can rsync those too. To specify an alternate location to get portfiles from, you'll want to edit sources.conf.




More information about the macports-users mailing list