The FreeBSD Diary |
(TM) | Providing practical examples since 1998If you buy from Amazon USA, please support us by using this link. |
And one port to install them all!
14 January 2002
|
Today I was setting up a new box and wanted to get all my favorite ports installed with a minimum of fuss. My first thoughts of were of a shell script. But then I thought of using a port to install ports. After all, some ports have dependencies, and they install the ports they need. Why can't I write a port which just installs ports?
So I asked around. And I was told to use a meta-port. I was pointed at
|
The Makefile
|
All the files for this port are available in the samples directory. You can download the files for this port from newbox-checklist.tgz. The Makefile is pretty simple. Here is it: # New ports collection makefile for: newbox-checklist # Date created: 13 January 2002 # Whom: Dan Langille # # $Id: meta-ports.php,v 1.6 2007-08-27 16:34:47 dan Exp $ # PORTNAME= newbox-checklist PORTVERSION= 1.0 CATEGORIES= misc MASTER_SITES= # none DISTFILES= # none MAINTAINER= ports@freebsddiary.org RUN_DEPENDS= bash:${PORTSDIR}/shells/bash2 \ joe:${PORTSDIR}/editors/joe \ screen:${PORTSDIR}/misc/screen \ sudo:${PORTSDIR}/security/sudo \ xtail:${PORTSDIR}/misc/xtail \ ${PREFIX}/distributed.net/dnetc:${PORTSDIR}/misc/dnetc \ ${PREFIX}/etc/logcheck.sh:${PORTSDIR}/security/logcheck NO_WRKSUBDIR= YES NO_BUILD= YES do-install: # empty .include <bsd.port.mk> Here are a few comments on the various parts of this Makefile.
For more information on the RUN_DEPENDS, or any other entry in a Makefile, please read /usr/ports/Mk/bsd.port.mk |
Using the makefile
|
To use the port, download it from newbox-checklist.tgz. Then unpack the tarball and install it.
Do not be concerned if you see the following error:
That is to be expected. This is the ports tree attempting to do the right thing.
We told the ports tree with our RUN_DEPENDS entry that sudo
was required by our port. But because we already had sudo installed before I ran
this port, this dependency is not registered with sudo.
|
Other uses for metaports
|
In this example, all that we have done with this port is install other ports. But you an also use the ports tree for system administration. You could distribute configuration files for example. A good template to use might be misc/instant-workstation. This port installs several ports, modifies /etc/rc.conf, and adds /etc/ntp.conf, amongst other things. |