# Shared ports collection?



## mcgee (Aug 26, 2011)

So I have two (or more) machines of the same architecture, both running 8.2R (actually VMs on the same host). The idea being to reduce the amount of redundantly stored data, and speed up the process of installing a port (once it's built on one machine, a 2nd machine should be able to quickly install the binaries without recompiling) -- is it possible, practical, or wise to share a single ports tree among two or more machines? (As in, install the ports tree on host1, then export /usr/ports via NFS and mount it on host2.)

I tried playing with this a bit, the issue I ran into is that after I "make install" a port on one machine, doing "make install" for that port on the other machine doesn't actually do anything. I tried "make clean install", which work, but also forces a recompile of the port (which we're trying to avoid). I also tried "make reinstall", but that is also forcing some rebuilds.


----------



## graudeejs (Aug 26, 2011)

Simply make packages on one machine and distribute them with NFS to others.
Then on other PC's pkg_add it


----------



## wblock@ (Aug 26, 2011)

Flag files are created in a port's work directory.  To pick a random example, devel/ccache has these after an install:

```
.build_done.ccache._usr_local
.configure_done.ccache._usr_local
.extract_done.ccache._usr_local
.install_done.ccache._usr_local
```

These flag files keep the port from repeating steps that have already been completed.  If you delete .install_done..., make install should work on the second machine.

If some special config is done during install, there could be problems the second time.  graudeejs' suggestion of packages would avoid that.


----------



## SirDice (Aug 26, 2011)

I have /usr/ports/, /usr/ports/packages/ and /usr/ports/distfiles/ NFS exported read-only. I build all my ports on one machine and use portmaster -dg <port> to build them and package them up. If /usr/ports/packages/ exists (it doesn't by default) the resulting packages will all go there. I use those packages to install other machines.

If you set *WRKDIRPREFIX* to a writable directory you can build ports locally if /usr/ports/ is read-only.


----------



## garrych (Aug 26, 2011)

I'm considering ports-mgmt/tinderbox


----------



## mcgee (Aug 27, 2011)

Cool, it looks like repackaging is doing what I want. Thanks, folks!


----------

