Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Aug 2006 09:55:01 +0200
From:      Jonathan McKeown <jonathan@hst.org.za>
To:        Free BSD Questions list <freebsd-questions@freebsd.org>
Subject:   Re: Building ports with sorces on a local mirror?
Message-ID:  <200608280955.01902.jonathan@hst.org.za>
In-Reply-To: <20060826201512.GA17777@teddy.fas.com>
References:  <20060826201512.GA17777@teddy.fas.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 26 August 2006 22:15, stan wrote:
> I'm in the process of seting up to build a fair number of machines behind a
> very restrictive firewall (and besides that the outbound link is very
> slow).
>
> What I have in mind is setting up a machine using mirror software to create
> a local mirror of the FreeBSD site, including the distfiles for the ports
> tree.
>
> Is thee a way to get the ports build system to look for distfiles on this
> local mirror?

I'm doing something similar, but I'm keeping the ports tree on one machine and 
NFS-mounting /usr/ports from there on all my other hosts. Each host other 
than the master has

WRKDIRPREFIX=/usr/local/ports

in /etc/make.conf.

Each time I build a port on any of the machines, it downloads the distfile if 
it doesn't already exist - but because /usr/ports is on the master server, 
that's where all the distfiles end up (in /usr/ports/distfiles), so I 
download each source tarball once, the first time it needs to be installed. 
This saves bandwidth as I'm not trying to mirror all the distfiles whether I 
need them or not.

You can also make packages which will be stored on the master server so you 
don't even have to compile more than once unless you need to. Word of 
warning: take steps to avoid downloading prebuilt packages if you don't have 
a locally-built package. For example, with portupgrade, edit
/usr/local/etc/pkgtools.conf and add

ENV['PKG_FETCH']='false'

which prevents ever fetching a package from the Internet: if there isn't a 
local package it will build from source in the ports tree.

Jonathan




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608280955.01902.jonathan>