This is an archive of past FreeBSD releases; it's part of the FreeBSD Documentation Archive.
A. Ah. You must be thinking of the serial ports on the back of your computer. We're using `port' here to mean the result of `porting' a program from one version of Unix to another. (It's an unfortunate bad habit of computer people to use the same word to refer to several completely different things).
A. Yes, that's usually the quickest and easiest way of doing it.
A. Several reasons:-
A. A patch is a small (usually) file that specifies how to go from one version of a file to another. It contains text that says, in effect, things like ``delete line 23'', ``add these two lines after line 468'' or ``change line 197 to this''. Also known as a `diff', since it's generated by a program of that name.
A. It's a file ending in .tar.gz (with variations like .tar.Z, or even .tgz if you're trying to squeeze the names into a DOS filesystem).
Basically, it's a directory tree that's been archived into a single file (.tar) and then compressed (.gz). This technique was originally used for Tape ARchives (hence the name `tar'), but it's a widely used way of distributing program source code around the Internet.
You can see what files are in them, or even extract them yourself, by using the standard Unix tar program, which comes with the base FreeBSD system, like this:-
tar tvzf foobar.tar.gz # View contents of foobar.tar.gz tar xzvf foobar.tar.gz # Extract contents into the current directory
A. It's a number generated by adding up all the data in the file you want to check. If any of the characters change, the checksum will no longer be equal to the total, so a simple comparison will allow you to spot the difference. (In practice, it's done in a more complicated way to spot problems like position-swapping, which won't show up with a simplistic addition).
# make install >> cku190.tar.gz doesn't seem to exist on this system. >> Attempting to fetch from ftp://kermit.columbia.edu/kermit/archives/.Why can't it find it? Have I got a dud CDROM?
A. The licensing terms for kermit don't allow us to put the tarball for it on the CDROM, so you'll have to fetch it by hand - sorry! The reason why you got all those error messages was because you weren't connected to the Internet at the time. Once you've downloaded it from any of the sites above, you can re-start the process (try and choose the nearest site to you, though, to save your time and the Internet's bandwidth).
A. The ports mechanism looks for the tarball in /usr/ports/distfiles, but you won't be able to copy anything there because it's sym-linked to the CDROM, which is read-only. You can tell it to look somewhere else by doing
DISTDIR=/where/you/put/it make install
A. You can use the PORTSDIR and PREFIX variables to tell the ports mechanism to use different directories. For instance,
PORTSDIR=/u/people/guests/wurzburger/ports make install
will compile the port in /u/people/guests/wurzburger/ports and install everything under /usr/local.
PREFIX=/u/people/guests/wurzburger/local make install
will compile it in /usr/ports and install it in /u/people/guests/wurzburger/local.
And of course
PORTSDIR=.../ports PREFIX=.../local make install
will combine the two (it's too long to fit on the page if I write it in full, but I'm sure you get the idea).
If you don't fancy typing all that in every time you install a port (and to be honest, who would?), it's a good idea to put these variables into your environment.
A. To get every single tarball for the ports collection, do
# cd /usr/ports # make fetch
For all the tarballs for a single ports directory, do
# cd /usr/ports/directory # make fetch
and for just one port - well, I think you've guessed already.
A. 'make fetch-list' will display a list of the files needed for a port.
A. Doing 'make extract' will stop it after it has fetched and extracted the source code.
A. Yep, 'make patch' is what you want. And by the way, thank you for your efforts!
A. Yes, with version 2.6.3 of gcc (the version shipped with FreeBSD 2.1.0 and 2.1.5), the -O2 option could result in buggy code unless you used the -fno-strength-reduce option as well. (Most of the ports don't use -O2). You should be able to specify the compiler options used by something like
# CFLAGS='-O2 -fno-strength-reduce' make install
or by editing /etc/make.conf, but this doesn't always seem to get picked up. The surest way is to do 'make configure', then go into the source directory and inspect the Makefiles by hand, but this can get tedious if the source has lots of sub-directories, each with their own Makefiles.
A. Look in the INDEX file in /usr/ports.
A. The 'foo' port needs something that's supplied with 'bar' - for instance, if 'foo' uses graphics, 'bar' might have a library with useful graphics processing routines. Or 'bar' might be a tool that's needed to compile the 'foo' port.
A. No problem, just do
pkg_delete grizzle-6.5
A. Not at all, you can find it out by doing
pkg_info -a | grep grizzle
And it'll tell you:-
Information for grizzle-6.5: grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arcade game.
A. Do 'pkg_manage' to get a friendly front-end to the package manager.
A. Yes, if you've installed the program and are fairly certain you won't need the source again, there's no point in keeping it hanging around. The best way to do this is
# cd /usr/ports # make clean
which will go through all the ports subdirectories and delete everything except the skeletons for each port.
A. Yes, if you're sure you've finished with them, those can go as well.
A. Just do
# cd /usr/ports # make install
A. No, the problem is that some of the ports need to ask you questions that we can't answer for you (eg ``Do you want to print on A4 or US letter sized paper?'') and they need to have someone on hand to answer them.
A. OK, do this before you go to bed/work/the local park:-
# cd /usr/ports # make -DBATCH install
This will install every port that does not require user input. Then, when you come back, do
# cd /usr/ports # make -DIS_INTERACTIVE install
to finish the job.
A. No problem, assuming you know how to make patches for your changes:-
# cd /usr/ports/somewhere/frobble # make extract # cd work/frobble-2.8 [Apply your patches] # cd ../.. # make package
A. Nothing secret about it at all, just look at the bsd.ports.mk and bsd.ports.subdir.mk files in your makefiles directory. (Note: readers with an aversion to intricate shell-scripts are advised not to follow this link...)