cahimira said:
How can I create a binary package (.pkg) from a port but without installing the port?
I can't answer that, but what I can do is share how I'm addressing my current scenario which is comparable to yours.
cahimira said:
- I have 10 boxes (servers) running FreeBSD
- I have one computer where I compile all the ports for the boxes use. I need to create in this computer the binary packages of those ports and then install them on the 10 boxes.
I'm currently maintaining four FreeBSD servers where my scenario is comparable to yours: they all use the same ports (with the sole exception of my main server which has a few extra ports installed due to personal and/or hobby interests).
I'm currently in the process of building and tuning a custom made solution for this and right now I'm simply building all the updates on a backup server using
portmaster which I instruct to not only update (install) the new ports but also to create binary packages out of them (using the
-g parameter). When the build process succeeds without problems I usually test the updated environment package against my configuration (if applicable) after which I provide the binary packages to the rest of the network.
On those servers I too use
portmaster to update the ports but simply tell it that it should use packages but if that somehow fails also fall back to the regular process of manually building (using the
-P parameter).
The main reason for that is that I also came to realize that in some cases the time advantage can be a bit overrated. Meaning: during the build process the services continue to be operational, only during the moment of actually (re)installing the new port will the services become unavailable for a short moment.
And well, the actual risk of a port not building is something I will already have addressed during this stage, simply because all my servers share the same environment (I'm pretty sure that if a port builds on my backup server it will also build on the rest of the network).
cahimira said:
A second question: how can I check if a port needs an update (re-compile and re-install) if I don't have that port installed?
You could run
# make package-name from the port directory or check its
Makefile, then compare the shown version with the one which is being used.
Even so, I think the better approach is to use a server which environment is identical to the rest of the network. Not merely due to ease of use (no need to manually check for versions or perform cryptical build processes; just let
portsnap and
portmaster sort it all out) but also because this "provisioning server" could then also be used to test the updates in a semi-real environment before you push them onto the rest of the network.
I'd always test updates before distribution.