From b88cbabc970130d49d83c5d8ceec740dc5fb9954 Mon Sep 17 00:00:00 2001
From: Chris Costello
Date: Sun, 19 Sep 1999 01:28:54 +0000
Subject: [PATCH] - Fix indenting. x 8 ->
- Fix misspelling of "specinfo"
- Remove whitespace from blank lines.
- Remove whitespace from end of lines.
---
.../books/handbook/ports/chapter.sgml | 1304 ++++++++---------
.../books/porters-handbook/book.sgml | 1304 ++++++++---------
.../books/handbook/ports/chapter.sgml | 1304 ++++++++---------
.../books/porters-handbook/book.sgml | 1304 ++++++++---------
4 files changed, 2608 insertions(+), 2608 deletions(-)
diff --git a/en_US.ISO8859-1/books/handbook/ports/chapter.sgml b/en_US.ISO8859-1/books/handbook/ports/chapter.sgml
index d8754a9169..f1d732b29d 100644
--- a/en_US.ISO8859-1/books/handbook/ports/chapter.sgml
+++ b/en_US.ISO8859-1/books/handbook/ports/chapter.sgml
@@ -1,17 +1,17 @@
-
+
Installing Applications: The Ports collection
-
+
Contributed by &a.jraynard;.
-
+
The FreeBSD Ports collection allows you to compile and install a very
wide range of applications with a minimum of effort.
-
+
For all the hype about open standards, getting a program to work on
different versions of Unix in the real world can be a tedious and tricky
business, as anyone who has tried it will know. You may be lucky enough
@@ -21,7 +21,7 @@
programs, you will find yourself doing a fair bit of head-scratching, and
there are quite a few programs that will result in premature greying, or
even chronic alopecia...
-
+
Some software distributions have attacked this problem by providing
configuration scripts. Some of these are very clever, but they have an
unfortunate tendency to triumphantly announce that your system is
@@ -30,72 +30,72 @@
your system's gethitlist function return a const pointer to a fromboz or
a pointer to a const fromboz? Do you have Foonix style unacceptable
exception handling? And if not, why not?).
-
+
Fortunately, with the Ports collection, all the hard work involved has
already been done, and you can just type make install
and get a working program.
-
+
Why Have a Ports Collection?
-
+
The base FreeBSD system comes with a very wide range of tools and
system utilities, but a lot of popular programs are not in the base
system, for good reasons:-
-
+
Programs that some people cannot live without and other people
cannot stand, such as a certain Lisp-based editor.
-
+
Programs which are too specialised to put in the base system
(CAD, databases).
-
+
Programs which fall into the “I must have a look at that
when I get a spare minute” category, rather than
system-critical ones (some languages, perhaps).
-
+
Programs that are far too much fun to be supplied with a serious
operating system like FreeBSD ;-)
-
+
However many programs you put in the base system, people will
always want more, and a line has to be drawn somewhere (otherwise
FreeBSD distributions would become absolutely enormous).
-
+
Obviously it would be unreasonable to expect everyone to port their
favourite programs by hand (not to mention a tremendous amount of
duplicated work), so the FreeBSD Project came up with an ingenious way
of using standard tools that would automate the process.
-
+
Incidentally, this is an excellent illustration of how “the
Unix way” works in practice by combining a set of simple but very
flexible tools into something very powerful.
-
+
How Does the Ports Collection Work?
-
+
Programs are typically distributed on the Internet as a tarball consisting of a Makefile and
the source code for the program and usually some instructions (which are
unfortunately not always as instructive as they could be), with perhaps
a configuration script.
-
+
The standard scenario is that you FTP down the tarball, extract it
somewhere, glance through the instructions, make any changes that seem
necessary, run the configure script to set things up and use the
standard make program to compile and install the
program from the source.
-
+
FreeBSD ports still use the tarball mechanism, but use a skeleton to hold the
"knowledge" of how to get the program working on FreeBSD,
@@ -103,7 +103,7 @@
supply their own customised Makefile, so that almost every port
can be built in the same way.
-
+
If you look at a port skeleton (either on your FreeBSD
system or Getting a port).
-
+
“How on earth can this do anything?” I hear you cry.
“There is no source code there!”
-
+
Fear not, gentle reader, all will become clear (hopefully). Let us
see what happens if we try and install a port. I have chosen
ElectricFence, a useful tool for developers,
as the skeleton is more straightforward than most.
-
+
If you are trying this at home, you will need to be root.
-
+
&prompt.root; cd /usr/ports/devel/ElectricFence
&prompt.root; make install
>> Checksum OK for ElectricFence-2.0.5.tar.gz.
@@ -142,57 +142,57 @@ install -c -o root -g wheel -m 444 /usr/ports/devel/ElectricFence/work/ElectricF
install -c -o root -g wheel -m 444 /usr/ports/devel/ElectricFence/work/ElectricFence-2.0.5/libefence.3 /usr/local/man/man3
===> Compressing manual pages for ElectricFence-2.0.5
===> Registering installation for ElectricFence-2.0.5
-
+
To avoid confusing the issue, I have completely removed the build
output.
-
+
If you tried this yourself, you may well have got something like
this at the start:-
-
+
&prompt.root; make install
>> ElectricFence-2.0.5.tar.gz doesn't seem to exist on this system.
>> Attempting to fetch from ftp://ftp.doc.ic.ac.uk/Mirrors/sunsite.unc.edu/pub/Linux/devel/lang/c/.
-
+
The make program has noticed that you did not
have a local copy of the source code and tried to FTP it down so it
could get the job done. I already had the source handy in my example,
so it did not need to fetch it.
-
+
Let's go through this and see what the make
program was doing.
-
+
Locate the source code tarball. If it is not available
locally, try to grab it from an FTP site.
-
+
Run a checksum test on the
tarball to make sure it has not been tampered with, accidentally
truncated, downloaded in ASCII mode, struck by neutrinos while in
transit, etc.
-
+
Extract the tarball into a temporary work directory.
-
+
Apply any patches needed to
get the source to compile and run under FreeBSD.
-
+
Run any configuration script required by the build process and
correctly answer any questions it asks.
-
+
(Finally!) Compile the code.
-
+
Install the program executable and other supporting files, man
pages, etc. under the /usr/local hierarchy
@@ -202,7 +202,7 @@ install -c -o root -g wheel -m 444 /usr/ports/devel/ElectricFence/work/ElectricF
makes sure that all the ports you install will go in the same place,
instead of being flung all over your system.
-
+
Register the installation in a database. This means that, if
you do not like the program, you can cleanly
-
+
Scroll up to the make output and see if you can
match these steps to it. And if you were not impressed before, you
should be by now!
-
+
Getting a FreeBSD Port
-
+
There are two ways of getting hold of the FreeBSD port for a
program. One requires a FreeBSD CDROM,
the other involves using an Internet
Connection.
-
+
Compiling ports from CDROM
-
+
Assuming that your FreeBSD CDROM is in the drive and mounted on
/cdrom (and the mount point
must be /cdrom), you should
@@ -252,7 +252,7 @@ WRKDIRPREFIX= /tmp
/tmp/cdrom/ports; for instance,
games/oneko will be built under
/tmp/cdrom/ports/games/oneko.
-
+
There are some ports for which we cannot provide the original
source in the CDROM due to licensing limitations. In that case, you
@@ -261,10 +261,10 @@ WRKDIRPREFIX= /tmp
connection.
-
+
Compiling ports from the Internet
-
+
If you do not have a CDROM, or you want to make sure you get the
very latest version of the port you want, you will need to download
the skeleton for the port. Now
@@ -276,13 +276,13 @@ WRKDIRPREFIX= /tmp
from the ports web
page. These packages include files that have been updated
since the release that you may need to compile new ports.
-
+
The key to the skeletons is that the FreeBSD FTP server can create
on-the-fly tarballs for you.
Here is how it works, with the gnats program in the databases
directory as an example (the bits in square brackets are comments. Do
not type them in if you are trying this yourself!):-
-
+
&prompt.root; cd /usr/ports
&prompt.root; mkdir databases
&prompt.root; cd databases
@@ -298,24 +298,24 @@ password. Remember to use binary (also known as image) mode!]
&prompt.root; cd gnats
&prompt.root; make install
[build and install gnats]
-
+
What happened here? We connected to the FTP server in the usual
way and went to its databases sub-directory.
When we gave it the command get gnats.tar, the FTP
server tarred up the gnats
directory for us.
-
+
We then extracted the gnats skeleton and went into the gnats
directory to build the port. As we explained earlier, the make process noticed we
did not have a copy of the source locally, so it fetched one before
extracting, patching and building it.
-
+
Let us try something more ambitious now. Instead of getting a
single port skeleton, we will get a whole sub-directory, for example all
the database skeletons in the ports collection. It looks almost the
same:-
-
+
&prompt.root; cd /usr/ports
&prompt.root; ftp ftp.FreeBSD.org
[log in as `ftp' and give your email address when asked for a
@@ -329,34 +329,34 @@ password. Remember to use binary (also known as image) mode!]
&prompt.root; cd databases
&prompt.root; make install
[build and install all the database ports]
-
+
With half a dozen straightforward commands, we have now got a set
of database programs on our FreeBSD machine! All we did that was
different from getting a single port skeleton and building it was that
we got a whole directory at once, and compiled everything in it at
once. Pretty impressive, no?
-
+
If you expect to be installing many ports, it is probably worth
downloading all the ports directories.
-
+
Skeletons
-
+
A team of compulsive hackers who have forgotten to eat in a frantic
attempt to make a deadline? Something unpleasant lurking in the FreeBSD
attic? No, a skeleton here is a minimal framework that supplies
everything needed to make the ports magic work.
-
+
Makefile
-
+
The most important component of a skeleton is the Makefile. This
contains various statements that specify how the port should be
compiled and installed. Here is the Makefile for
ElectricFence:-
-
+
# New ports collection makefile for: Electric Fence
# Version required: 2.0.5
@@ -380,19 +380,19 @@ do-install:
${INSTALL_MAN} ${WRKSRC}/libefence.3 ${PREFIX}/man/man3
.include <bsd.port.mk>
-
+
The lines beginning with a "#" sign are comments for the
benefit of human readers (as in most Unix script files).
-
+
DISTNAME specifies the name of the tarball, but without the
extension.
-
+
CATEGORIES states what kind of program this is.
In this case, a utility for developers. See the categories section of this
handbook for a complete list.
-
+
MASTER_SITES is the URL(s) of the master FTP
site, which is used to retrieve the tarball if it is not available on the
@@ -400,18 +400,18 @@ do-install:
normally the one from which the program is officially distributed (in
so far as any software is "officially" distributed on the
Internet).
-
+
MAINTAINER is the email address of the person
who is responsible for updating the skeleton if, for example a new
version of the program comes out.
-
+
Skipping over the next few lines for a minute, the line
.include <bsd.port.mk> says that the other
statements and commands needed for this port are in a standard file
called bsd.port.mk. As these are the same for
all ports, there is no point in duplicating them all over the place,
so they are kept in a single standard file.
-
+
This is probably not the place to go into a detailed examination
of how Makefiles work; suffice it to say that the line starting with
MAN3 ensures that the ElectricFence man page is
@@ -421,31 +421,31 @@ do-install:
do-install ensure that the files produced by
this port are placed in the correct destination.
-
+
The files directory
-
+
The file containing the checksum for the port is called
md5, after the MD5 algorithm used for ports
checksums. It lives in a directory with the slightly confusing name
of files.
-
+
This directory can also contain other miscellaneous files that are
required by the port and do not belong anywhere else.
-
+
The patches directory
-
+
This directory contains the patches needed to make everything work
properly under FreeBSD.
-
+
The pkg directory
-
+
This program contains three quite useful files:-
@@ -453,12 +453,12 @@ do-install:
COMMENT — a one-line description of
the program.
-
+
DESCR — a more detailed
description.
-
+
PLIST — a list of all the files
that will be created when the program is installed.
@@ -466,18 +466,18 @@ do-install:
-
+
What to do when a port does not work.
-
+
Oh. You can do one of four (4) things :
-
+
Fix it yourself. Technical details on how ports work can be
found in Porting applications.
-
+
Gripe. This is done by e-mail only! Send
such e-mail to the maintainer of the port, first. Type
@@ -490,12 +490,12 @@ do-install:
you can try filing a bug report with send-pr.
-
+
Forget it. This is the easiest for most — very few of the
programs in ports can be classified as essential!
-
+
Grab the pre-compiled package from a ftp server. The
“master” package collection is on FreeBSD's FTP server
@@ -509,10 +509,10 @@ do-install:
-
+
Some Questions and Answers
-
+
@@ -529,7 +529,7 @@ do-install:
things).
-
+
I thought you were supposed to use packages to install extra
@@ -541,7 +541,7 @@ do-install:
it.
-
+
So why bother with ports then?
@@ -549,25 +549,25 @@ do-install:
Several reasons:-
-
+
The licensing conditions on some software distributions
require that they be distributed as source code, not
binaries.
-
+
Some people do not trust binary distributions. At least
with source code you can (in theory) read through it and look
for potential problems yourself.
-
+
If you have some local patches, you will need the source to
add them yourself.
-
+
You might have opinions on how a program should be compiled
that differ from the person who did the package — some
@@ -575,13 +575,13 @@ do-install:
used, whether to build debug versions and then strip them or
not, etc. etc.
-
+
Some people like having code around, so they can read it if
they get bored, hack around with it, borrow from it (licence
terms permitting, of course!) and so on.
-
+
If you ain't got the source, it ain't software! ;-)
@@ -589,7 +589,7 @@ do-install:
-
+
What is a patch?
@@ -604,7 +604,7 @@ do-install:
generated by a program of that name.
-
+
What is all this about
@@ -616,25 +616,25 @@ do-install:
.tar.gz (with variations like
.tar.Z, or even .tgz if
you are trying to squeeze the names into a DOS filesystem).
-
+
Basically, it is a directory tree that has been archived into a
single file (.tar) and optionally compressed
(.gz). This technique was originally used for
Tape ARchives (hence the
name tar), but it is 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:-
-
- &prompt.user; tar tvzf foobar.tar.gz
+
+ &prompt.user; tar tvzf foobar.tar.gz
&prompt.user; tar xzvf foobar.tar.gz
&prompt.user; tar tvf foobar.tar
&prompt.user; tar xvf foobar.tar
-
+
And a checksum?
@@ -650,7 +650,7 @@ do-install:
addition).
-
+
I did what you said for compiling ports from a CDROM and it
@@ -659,7 +659,7 @@ do-install:
&prompt.root; 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 it not be found? Have I got a dud CDROM?
@@ -676,7 +676,7 @@ do-install:
bandwidth).
-
+
I did that, but when I tried to put it into
@@ -690,11 +690,11 @@ do-install:
to copy anything there because it is sym-linked to the CDROM, which
is read-only. You can tell it to look somewhere else by
doing
-
+
&prompt.root; make DISTDIR=/where/you/put/it install
-
+
Does the ports scheme only work if you have everything in
@@ -708,31 +708,31 @@ do-install:
You can use the PORTSDIR and
PREFIX variables to tell the ports mechanism to
use different directories. For instance,
-
+
&prompt.root; make PORTSDIR=/u/people/guests/wurzburger/ports install
-
+
will compile the port in
/u/people/guests/wurzburger/ports and install
everything under /usr/local.
-
+
&prompt.root; make PREFIX=/u/people/guests/wurzburger/local install
-
+
will compile it in /usr/ports and install
it in /u/people/guests/wurzburger/local.
-
+
And of course
-
+
&prompt.root; make PORTSDIR=.../ports PREFIX=.../local install
-
+
will combine the two (it is too long to fit on the page if I
write it in full, but I am sure you get the idea).
-
+
If you do not fancy typing all that in every time you install a
port (and to be honest, who would?), it is a good idea to put these
variables into your environment.
-
+
I do not have a FreeBSD CDROM, but I would like to have all
@@ -744,20 +744,20 @@ do-install:
To get every single tarball for the ports collection,
do
-
+
&prompt.root; cd /usr/ports
&prompt.root; make fetch
-
+
For all the tarballs for a single ports directory, do
-
+
&prompt.root; cd /usr/ports/directory
&prompt.root; make fetch
-
+
and for just one port — well, I think you have guessed
already.
-
+
I know it is probably faster to fetch the tarballs from one
@@ -776,7 +776,7 @@ do-install:
&prompt.root; make MASTER_SITE_OVERRIDE=ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch
-
+
I want to know what files make is going to need before it
@@ -788,7 +788,7 @@ do-install:
the files needed for a port.
-
+
Is there any way to stop the port from compiling? I want to
@@ -801,7 +801,7 @@ do-install:
has fetched and extracted the source code.
-
+
I am trying to make my own port and I want to be able to
@@ -816,7 +816,7 @@ do-install:
as well. And by the way, thank you for your efforts!
-
+
I have heard that some compiler options can cause bugs. Is
@@ -832,9 +832,9 @@ do-install:
(Most of the ports do not use ). You
should be able to specify the compiler options
used by something like
-
+
&prompt.root; make CFLAGS='-O2 -fno-strength-reduce' install
-
+
or by editing /etc/make.conf, but
unfortunately not all ports respect this. The surest way is to do
make configure, then go into the source directory
@@ -843,7 +843,7 @@ do-install:
Makefiles.
-
+
There are so many ports it is hard to find the one I want.
@@ -861,7 +861,7 @@ do-install:
&prompt.user; make search key=lisp
-
+
I went to install the foo port but the
@@ -878,7 +878,7 @@ do-install:
foo port.
-
+
I installed the
@@ -889,7 +889,7 @@ do-install:
No problem, just do
-
+
&prompt.root; pkg_delete grizzle-6.5Alternatively, you can do
@@ -898,7 +898,7 @@ do-install:
&prompt.root; make deinstall
-
+
@@ -909,13 +909,13 @@ do-install:
Not at all, you can find it out by doing
-
+
&prompt.root; pkg_info -a | grep grizzle
Information for grizzle-6.5:
grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arcade game.
-
+
Talking of disk space, the ports directory seems to be
@@ -927,15 +927,15 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
Yes, if you have installed the program and are fairly
certain you will not need the source again, there is no point in
keeping it hanging around. The best way to do this is
-
+
&prompt.root; cd /usr/ports
&prompt.root; make clean
-
+
which will go through all the ports subdirectories and delete
everything except the skeletons for each port.
-
+
I tried that and it still left all those tarballs or
@@ -948,7 +948,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
go as well.
-
+
I like having lots and lots of programs to play with. Is
@@ -957,12 +957,12 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
Just do
-
+
&prompt.root; cd /usr/ports
&prompt.root; make install
-
+
OK, I tried that, but I thought it would take a very long
@@ -978,7 +978,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
someone on hand to answer them.
-
+
I really do not want to spend all day staring at the
@@ -988,20 +988,20 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
OK, do this before you go to bed/work/the local
park:-
-
+
&prompt.root cd /usr/ports
&prompt.root; make -DBATCH install
-
+
This will install every port that does not
require user input. Then, when you come back, do
-
+
&prompt.root; cd /usr/ports
&prompt.root; make -DIS_INTERACTIVE install
-
+
to finish the job.
-
+
At work, we are using frobble, which is
@@ -1013,7 +1013,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
No problem, assuming you know how to make patches for your
changes:-
-
+
&prompt.root; cd /usr/ports/somewhere/frobble
&prompt.root; make extract
&prompt.root; cd work/frobble-2.8
@@ -1022,7 +1022,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
&prompt.root; make package
-
+
This ports stuff is really clever. I am desperate to find
@@ -1042,16 +1042,16 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
-
+
Making a port yourself
-
+
Contributed by &a.jkh;, &a.gpalmer;, &a.asami;, &a.obrien;,
and &a.hoek;. 28 August 1996.So, now you are interested in making your own port or upgrading
an existing one? Great!
-
+
What follows are some guidelines for creating a new port for
FreeBSD. If you want to upgrade an existing port, you should read this
and then read .
@@ -1061,7 +1061,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
include. Even if you do not hack Makefiles daily, it is well
commented, and you will still gain much knowledge from it.
Additionally, you may send specific questions to &a.ports;.
-
+
Only a fraction of the overridable variables
(VAR) are mentioned in
@@ -1073,30 +1073,30 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
set to use the correct value by typing :set tabstop=4
once the file has been loaded.
-
+
Quick Porting
-
+
This section tells you how to do a quick port. In many cases, it
is not enough, but we will see.
-
+
First, get the original tarball and put it into
DISTDIR, which defaults to
/usr/ports/distfiles.
-
+
The following assumes that the software compiled out-of-the-box,
i.e., there was absolutely no change required for the port to work
on your FreeBSD box. If you needed to change something, you will
have to refer to the next section too.
-
+
Writing the Makefile
-
+
The minimal Makefile would look something
like this:
-
+
# New ports collection makefile for: oneko
# Version required: 1.1b
@@ -1124,19 +1124,19 @@ USE_IMAKE= yes
tree. You can find a more detailed example in the sample Makefile section.
-
+
Writing the description files
-
+
There are three description files that are required for any
port, whether they actually package or not. They are
COMMENT, DESCR, and
PLIST, and reside in the
pkg subdirectory.
-
+
COMMENT
-
+
This is the one-line description of the port.
Please do not include the package name (or
version number of the software) in the comment. The comment
@@ -1146,10 +1146,10 @@ USE_IMAKE= yes
A cat chasing a mouse all over the screen
-
+
DESCR
-
+
This is a longer description of the port. One to a few
paragraphs concisely explaining what the port does is
sufficient.
@@ -1166,10 +1166,10 @@ A cat chasing a mouse all over the screen
WWW: so that automated tools will work
correctly.
-
+
It is recommended that you sign your name at the end of this
file, as in:
-
+
This is a port of oneko, in which a cat chases a poor mouse all over
the screen.
@@ -1181,10 +1181,10 @@ WWW: http://www.oneko.org/
- Satoshi
asami@cs.berkeley.edu
-
+
PLIST
-
+
This file lists all the files installed by the port. It is
also called the “packing list” because the package is
generated by packing the files listed here. The pathnames are
@@ -1193,9 +1193,9 @@ asami@cs.berkeley.edu
/usr/X11R6). If you are using the
MANn variables (as
you should be), do not list any manpages here.
-
+
Here is a small example:
-
+
bin/oneko
lib/X11/app-defaults/Oneko
@@ -1203,7 +1203,7 @@ lib/X11/oneko/cat1.xpm
lib/X11/oneko/cat2.xpm
lib/X11/oneko/mouse.xpm
@dirrm lib/X11/oneko
-
+
Refer to the &man.pkg.create.1; man page for details on the
packing list.
@@ -1225,18 +1225,18 @@ lib/X11/oneko/mouse.xpm
-
+
Creating the checksum file
-
+
Just type make makesum. The ports make rules
will automatically generate the file
files/md5.
-
+
Testing the port
-
+
You should make sure that the port rules do exactly what you
want it to do, including packaging up the port. These are the
important points you need to verify.
@@ -1246,56 +1246,56 @@ lib/X11/oneko/mouse.xpm
PLIST does not contain anything not
installed by your port
-
+
PLIST contains everything that is
installed by your port
-
+
Your port can be installed multiple times using the
reinstall target
-
+
Your port cleans up
after itself upon deinstall
-
+
Recommended test ordering
-
+
make install
-
+
make package
-
+
make deinstall
-
+
pkg_add package-name
-
+
make deinstall
-
+
make reinstall
-
+
make package
-
+
Make sure that there are not any warnings issued in any of the
package and
deinstall stages, After step 3, check to
@@ -1303,10 +1303,10 @@ lib/X11/oneko/mouse.xpm
using the software after step 4, to ensure that is works correctly
when installed from a package.
-
+
Checking your port with portlint
-
+
Please use portlint to see if your port
conforms to our guidelines. The portlint program
is part of the ports collection. In particular, your may want to
@@ -1315,13 +1315,13 @@ lib/X11/oneko/mouse.xpm
linkend="porting-pkgname">package is named
appropriately.
-
+
Submitting the port
-
+
First, make sure you have read the Do's and Dont's section.
-
+
Now that you are happy with your port, the only thing remaining
is to put it in the main FreeBSD ports tree and make everybody else
happy about it too. We do not need your work
@@ -1342,7 +1342,7 @@ lib/X11/oneko/mouse.xpm
One more time, do not include the original source
distfile, the work directory, or the package
you built with make package.
-
+
In the past, we asked you to upload new port submissions in
our ftp site (ftp.FreeBSD.org). This
@@ -1350,7 +1350,7 @@ lib/X11/oneko/mouse.xpm
incoming/ directory of that site due to the
large amount of pirated software showing up there.
-
+
We will look at your port, get back to you if necessary, and put
it in the tree. Your name will also appear in the list of
“Additional FreeBSD contributors” on the FreeBSD
@@ -1358,29 +1358,29 @@ lib/X11/oneko/mouse.xpm
-->:)
-
+
Slow Porting
-
+
Ok, so it was not that simple, and the port required some
modifications to get it to work. In this section, we will explain,
step by step, how to modify it to get it to work with the ports
paradigm.
-
+
How things work
-
+
First, this is the sequence of events which occurs when the user
first types make in your port's directory, and
you may find that having bsd.port.mk in another
window while you read this really helps to understand it.
-
+
But do not worry if you do not really understand what
bsd.port.mk is doing, not many people do...
:>
-
+
-
+
The fetch target is run. The
fetch target is responsible for making
@@ -1397,7 +1397,7 @@ lib/X11/oneko/mouse.xpm
the file in DISTDIR for future use and
proceed.
-
+
The extract target is run. It
looks for your port's distribution file (typically a gzip'd
@@ -1405,7 +1405,7 @@ lib/X11/oneko/mouse.xpm
temporary subdirectory specified by WRKDIR
(defaults to work).
-
+
The patch target is run. First,
any patches defined in PATCHFILES are
@@ -1414,24 +1414,24 @@ lib/X11/oneko/mouse.xpm
patches subdirectory), they are applied at
this time in alphabetical order.
-
+
The configure target is run. This
can do any one of many different things.
-
+
If it exists, scripts/configure is
run.
-
+
If HAS_CONFIGURE or
GNU_CONFIGURE is set,
WRKSRC/configure is
run.
-
+
If USE_IMAKE is set,
XMKMF (default: xmkmf
@@ -1439,7 +1439,7 @@ lib/X11/oneko/mouse.xpm
-
+
The build target is run. This is
responsible for descending into the port's private working
@@ -1449,7 +1449,7 @@ lib/X11/oneko/mouse.xpm
be used.
-
+
The above are the default actions. In addition, you can define
targets
pre-something or
@@ -1457,7 +1457,7 @@ lib/X11/oneko/mouse.xpm
or put scripts with those names, in the scripts
subdirectory, and they will be run before or after the default
actions are done.
-
+
For example, if you have a post-extract
target defined in your Makefile, and a file
pre-build in the scripts
@@ -1468,7 +1468,7 @@ lib/X11/oneko/mouse.xpm
Makefile targets if the actions are simple
enough, because it will be easier for someone to figure out what
kind of non-default action the port requires.
-
+
The default actions are done by the
bsd.port.mk targets
do-something.
@@ -1488,22 +1488,22 @@ lib/X11/oneko/mouse.xpm
do-extract, but never ever touch
extract!
-
+
Now that you understand what goes on when the user types
make, let us go through the recommended steps to
create the perfect port.
-
+
Getting the original sources
-
+
Get the original sources (normally) as a compressed tarball
(foo.tar.gz or
foo.tar.Z) and copy
it into DISTDIR. Always use
mainstream sources when and where you
can.
-
+
If you cannot find a ftp/http site that is well-connected to the
net, or can only find sites that have irritatingly non-standard
formats, you might want to put a copy on a reliable ftp or http
@@ -1519,7 +1519,7 @@ lib/X11/oneko/mouse.xpm
as the last resort. Please refer to this location as
MASTER_SITE_LOCAL. Send mail to the &a.ports;if
you are not sure what to do.
-
+
If your port's distfile changes all the time for no good reason,
consider putting the distfile in your home page and listing it as
the first MASTER_SITES. This will prevent users
@@ -1528,7 +1528,7 @@ lib/X11/oneko/mouse.xpm
there is only one master site for the port, it is recommended that
you house a backup at your site and list it as the second
MASTER_SITES.
-
+
If your port requires some additional `patches' that are
available on the Internet, fetch them too and put them in
DISTDIR. Do not worry if they come from a site
@@ -1536,10 +1536,10 @@ lib/X11/oneko/mouse.xpm
handle these situations (see the description of PATCHFILES below).
-
+
Modifying the port
-
+
Unpack a copy of the tarball in a private directory and make
whatever changes are necessary to get the port to compile properly
under the current version of FreeBSD. Keep careful
@@ -1547,14 +1547,14 @@ lib/X11/oneko/mouse.xpm
the process shortly. Everything, including the deletion, addition
or modification of files should be doable using an automated script
or patch file when your port is finished.
-
+
If your port requires significant user interaction/customization
to compile or install, you should take a look at one of Larry Wall's
classic Configure scripts and perhaps do
something similar yourself. The goal of the new ports collection is
to make each port as “plug-and-play” as possible for the
end-user while using a minimum of disk space.
-
+
Unless explicitly stated, patch files, scripts, and other
files you have created and contributed to the FreeBSD ports
@@ -1562,10 +1562,10 @@ lib/X11/oneko/mouse.xpm
conditions.
-
+
Patching
-
+
In the preparation of the port, files that have been added or
changed can be picked up with a recursive diff for later feeding to
patch. Each set of patches you wish to apply should be collected
@@ -1584,10 +1584,10 @@ lib/X11/oneko/mouse.xpm
patch-ab both changing
WRKSRC/foobar.c).
-
+
Configuring
-
+
Include any additional customization commands to your
configure script and save it in the
scripts subdirectory. As mentioned above, you
@@ -1595,10 +1595,10 @@ lib/X11/oneko/mouse.xpm
scripts with the name pre-configure or
post-configure.
-
+
Handling user input
-
+
If your port requires user input to build, configure or install,
then set IS_INTERACTIVE in your Makefile. This
will allow “overnight builds” to skip your port if the
@@ -1614,23 +1614,23 @@ lib/X11/oneko/mouse.xpm
packages for CD-ROMs and ftp.
-
+
Configuring the Makefile
-
+
Configuring the Makefile is pretty simple, and again we suggest
that you look at existing examples before starting. Also, there is a
sample Makefile in this
handbook, so take a look and please follow the ordering of variables
and sections in that template to make your port easier for others to
read.
-
+
Now, consider the following problems in sequence as you design
your new Makefile:
-
+
The original source
-
+
Does it live in DISTDIR as a standard gzip'd
tarball? If so, you can go on to the next step. If not, you should
look at overriding any of the EXTRACT_CMD,
@@ -1641,15 +1641,15 @@ lib/X11/oneko/mouse.xpm
file is. (The most common case is
EXTRACT_SUFX=.tar.Z, when the tarball is
condensed by regular compress, not gzip.)
-
+
In the worst case, you can simply create your own
do-extract target to override the default,
though this should be rarely, if ever, necessary.
-
+
DISTNAME
-
+
You should set DISTNAME to be the base name
of your port. The default rules expect the distribution file list
(DISTFILES) to be named
@@ -1657,12 +1657,12 @@ lib/X11/oneko/mouse.xpm
it is a normal tarball, is going to be something like
foozolix-1.0.tar.gz for a setting of
DISTNAME=foozolix-1.0.
-
+
The default rules also expect the tarball(s) to extract into a
subdirectory called
work/DISTNAME, e.g.
work/foozolix-1.0/.
-
+
All this behavior can be overridden, of course; it simply
represents the most common time-saving defaults. For a port
requiring multiple distribution files, simply set
@@ -1673,20 +1673,20 @@ lib/X11/oneko/mouse.xpm
and the rest will be just left in DISTDIR for
later use.
-
+
PKGNAME
-
+
If DISTNAME does not conform to our guidelines for a good package
name, you should set the PKGNAME
variable to something better. See the abovementioned guidelines for
more details.
-
+
CATEGORIES
-
+
When a package is created, it is put under
/usr/ports/packages/All and links are made from
one or more subdirectories of
@@ -1716,25 +1716,25 @@ lib/X11/oneko/mouse.xpm
mistype the category name, so be careful!
-
+
MASTER_SITES
-
+
Record the directory part of the ftp/http-URL pointing at the
original tarball in MASTER_SITES. Do not forget
the trailing slash (/)!
-
+
The make macros will try to use this
specification for grabbing the distribution file with
FETCH if they cannot find it already on the
system.
-
+
It is recommended that you put multiple sites on this list,
preferably from different continents. This will safeguard against
wide-area network problems, and we are even planning to add support
for automatically determining the closest master site and fetching
from there!
-
+
If the original tarball is part of one of the following popular
archives: X-contrib, GNU, Perl CPAN, TeX CTAN, or Linux Sunsite, you
refer to those sites in an easy compact form using
@@ -1749,33 +1749,33 @@ lib/X11/oneko/mouse.xpm
MASTER_SITES= ${MASTER_SITE_XCONTRIB}
MASTER_SITE_SUBDIR= applications
-
+
The user can also set the MASTER_SITE_*
variables in /etc/make.conf to override our
choices, and use their favorite mirrors of these popular archives
instead.
-
+
PATCHFILES
-
+
If your port requires some additional patches that are available
by ftp or http, set PATCHFILES to the names of
the files and PATCH_SITES to the URL of the
directory that contains them (the format is the same as
MASTER_SITES).
-
+
If the patch is not relative to the top of the source tree
(i.e., WKRSRC) because it contains some extra
pathnames, set PATCH_DIST_STRIP accordingly. For
instance, if all the pathnames in the patch have an extra
foozolix-1.0/ in front of the filenames, then set
PATCH_DIST_STRIP=-p1.
-
+
Do not worry if the patches are compressed, they will be
decompressed automatically if the filenames end with
.gz or .Z.
-
+
If the patch is distributed with some other files, such as
documentation, in a gzip'd tarball, you cannot just use
PATCHFILES. If that is the case, add the name
@@ -1797,30 +1797,30 @@ MASTER_SITE_SUBDIR= applications
target.
-
+
MAINTAINER
-
+
Set your mail-address here. Please. :)
-
+
For detailed description of the responsibility of maintainers,
refer to MAINTAINER on
Makefiles section.
-
+
Dependencies
-
+
Many ports depend on other ports. There are five variables that
you can use to ensure that all the required bits will be on the
user's machine. There are also some pre-supported dependency
variables for common cases, plus a few more to control the behaviour
of dependencies.
-
+
LIB_DEPENDS
-
+
This variable specifies the shared libraries this port depends
on. It is a list of
lib:dir:target
@@ -1842,7 +1842,7 @@ MASTER_SITE_SUBDIR= applications
to ldconfig -r | grep -wF. There shall be no
regular expressions in this variable.
-
+
The dependency is checked twice, once from within the
extract target and then from within the
install target. Also, the name of the
@@ -1850,10 +1850,10 @@ MASTER_SITE_SUBDIR= applications
pkg_add will automatically install it if it is
not on the user's system.
-
+
RUN_DEPENDS
-
+
This variable specifies executables or files this port depends
on during run-time. It is a list of
path:dir:target
@@ -1869,11 +1869,11 @@ MASTER_SITE_SUBDIR= applications
path.For example,
-
+
RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
wish8.0:${PORTSDIR}/x11-toolkits/tk80
-
+
will check if the file or directory
/usr/local/etc/innd exists, and build and
install it from the news/inn subdirectory of
@@ -1882,14 +1882,14 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
path, and descend into the x11-toolkits/tk80
subdirectory of your ports tree to build and install it if it is
not found.
-
+
In this case, innd is actually an
executable; if an executable is in a place that is not expected
to be in a normal user's search path, you should use the full
pathname.
-
+
The dependency is checked from within the
install target. Also, the name of the
dependency is put in to the package so that
@@ -1898,10 +1898,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
part can be omitted if it is the same
DEPENDS_TARGET.
-
+
BUILD_DEPENDS
-
+
This variable specifies executables or files this port
requires to build. Like RUN_DEPENDS, it is a
list of
@@ -1920,10 +1920,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
the same as DEPENDS_TARGET
-
+
FETCH_DEPENDS
-
+
This variable specifies executables or files this port
requires to fetch. Like the previous two, it is a list of
path:dir:target
@@ -1932,16 +1932,16 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
executable called ncftp2, and descend into the
net/ncftp2 subdirectory of your ports tree to
build and install it if it is not found.
-
+
The dependency is checked from within the
fetch target. The
target part can be omitted if it is the
same as DEPENDS_TARGET.
-
+
DEPENDS
-
+
If there is a dependency that does not fall into either of the
above four categories, or your port requires to have the source of
the other port extracted in addition to having them installed,
@@ -1951,10 +1951,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
target part can be omitted if it is the
same as DEPENDS_TARGET.
-
+
Common dependency variables
-
+
Define USE_XLIB=yes if your port requires
the X Window System to be installed (it is implied by
USE_IMAKE). Define
@@ -1968,10 +1968,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
some versions of FreeBSD has perl5 as part of the base system
while others do not.)
-
+
Notes on dependencies
-
+
As mentioned above, the default target to call when a
dependency is required is DEPENDS_TARGET.
It defaults to install. This is a user
@@ -2009,10 +2009,10 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
intention will be clear.
-
+
Building mechanisms
-
+
If your package uses GNU make, set
USE_GMAKE=yes. If your package uses
configure, set
@@ -2030,7 +2030,7 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
GNU_CONFIGURE, and will cause
autoconf to be run before
configure.
-
+
If your package is an X application that creates
Makefiles from Imakefiles
using imake, then set
@@ -2043,7 +2043,7 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
NO_INSTALL_MANPAGES=yes should be set. In
addition, the author of the original port should be shot. :>
-
+
If your port's source Makefile has
something else than all as the main build
target, set ALL_TARGET accordingly. Same goes
@@ -2051,23 +2051,23 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
INSTALL_TARGET.
-
+
Special considerations
-
+
There are some more things you have to take into account when you
create a port. This section explains the most common of those.ldconfig
-
+
If your port installs a shared library, add a
post-install target to your
Makefile that runs ${LDCONFIG}
-m on the directory where the new library is installed
(usually PREFIX/lib) to
register it into the shared library cache.
-
+
Also, add a matching @exec /sbin/ldconfig -m
and @unexec /sbin/ldconfig -R pair to your
pkg/PLIST file so that a user who installed the
@@ -2080,7 +2080,7 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
lib/libtvl80.so.1
@exec /sbin/ldconfig -m %D/lib
@unexec /sbin/ldconfig -R
-
+
Never, ever, ever add a line that says
ldconfig without any arguments to your
Makefile or pkg/PLIST.
@@ -2093,10 +2093,10 @@ lib/libtvl80.so.1
(not necessarily in that order…)
-
+
ELF support
-
+
Since FreeBSD is moving to ELF shortly after 3.0-RELEASE, we need
to convert many ports that build shared libraries to support ELF.
Complicating this task is that a 3.0 system can run as both ELF and
@@ -2110,7 +2110,7 @@ lib/libtvl80.so.1
Moving a.out libraries out of the way
-
+
A.out libraries should be moved out of
/usr/local/lib and similar to an
aout subdirectory. (If you do not move them out
@@ -2121,10 +2121,10 @@ lib/libtvl80.so.1
only move a.out libs so it is safe to call it on a system with both
ELF and a.out libs in the standard directories.
-
+
Format
-
+
The ports tree will build packages in the format the machine is
in. This means a.out for 2.2 and a.out or ELF for 3.0 depending on
what `objformat` returns. Also, once users move
@@ -2139,10 +2139,10 @@ lib/libtvl80.so.1
system.
-
+
PORTOBJFORMAT
-
+
bsd.port.mk will set
PORTOBJFORMAT to aout or
elf and export it in the environments
@@ -2155,26 +2155,26 @@ lib/libtvl80.so.1
The variable is set using this line in
bsd.port.mk:
-
+
PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
-
+
Ports' make processes should use this variable to decide what to
do. However, if the port's configure script
already automatically detects an ELF system, it is not necessary to
refer to PORTOBJFORMAT.
-
+
Building shared libraries
-
+
The following are differences in handling shared libraries for
a.out and ELF.
-
+
Shared library versions
-
+
An ELF shared library should be called
libfoo.so.M
where M is the single version number,
@@ -2188,10 +2188,10 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
libfoo.so.N.
-
+
Linker command lines
-
+
Assuming cc -shared is used rather than
ld directly, the only difference is that you
need to add
@@ -2199,7 +2199,7 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
-
+
You need to install a symlink from
libfoo.so to
libfoo.so.N to make
@@ -2209,20 +2209,20 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aoutPORTOBJFORMAT.
-
+
LIB_DEPENDS
-
+
All port Makefiles are edited to remove minor numbers from
LIB_DEPENDS, and also to have the regexp support
removed. (E.g., foo\\.1\\.\\(33|40\\) becomes
foo.2.) They will be matched using grep
-wF.
-
+
PLIST
-
+
PLIST should contain the short (ELF) shlib
names if the a.out minor number is zero, and the long (a.out) names
otherwise. bsd.port.mk will automatically add
@@ -2240,18 +2240,18 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aoutPLIST mentioned in the previous
paragraph.
-
+
ldconfig
-
+
The ldconfig line in Makefiles should
read:
-
+
${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ....In PLIST it should read;
-
+
@exec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -m ...
@unexec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -R
@@ -2261,10 +2261,10 @@ ${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ....
default format of the system.
-
+
MASTERDIR
-
+
If your port needs to build slightly different versions of
packages by having a variable (for instance, resolution, or paper
size) take different values, create one subdirectory per package to
@@ -2279,7 +2279,7 @@ ${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ....
This will be best demonstrated by an example. This is part of
japanese/xdvi300/Makefile;
-
+
PKGNAME= ja-xdvi${RESOLUTION}-17
:
@@ -2287,8 +2287,8 @@ PKGNAME= ja-xdvi${RESOLUTION}-17
RESOLUTION?= 300
.if ${RESOLUTION} != 118 && ${RESOLUTION} != 240 && \
${RESOLUTION} != 300 && ${RESOLUTION} != 400
- @${ECHO} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\""
- @${ECHO} "Possible values are: 118, 240, 300 (default) and 400."
+ @${ECHO} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\""
+ @${ECHO} "Possible values are: 118, 240, 300 (default) and 400."
@${FALSE}
.endif
@@ -2317,10 +2317,10 @@ MASTERDIR= ${.CURDIR}/../xdvi300
xdvi300/Makefile and the port will be built with
resolution set to 118.
-
+
Shared library versions
-
+
First, please read our policy on
shared library versioning to understand what to do with
shared library versions in general. Do not blindly assume software
@@ -2351,10 +2351,10 @@ MASTERDIR= ${.CURDIR}/../xdvi300
libfoo4.so.1.0 so both version 3.2 and 4.0 can be
linked from other ports.
-
+
Manpages
-
+
The MAN[1-9LN] variables will automatically add
any manpages to pkg/PLIST (this means you must
not list manpages in the
@@ -2363,7 +2363,7 @@ MASTERDIR= ${.CURDIR}/../xdvi300
makes the install stage automatically compress or uncompress manpages
depending on the setting of NOMANCOMPRESS in
/etc/make.conf.
-
+
If your port tries to install multiple names for manpages using
symlinks or hardlinks, you must use the MLINKS
variable to identify these. The link installed by your port will
@@ -2371,7 +2371,7 @@ MASTERDIR= ${.CURDIR}/../xdvi300
to make sure it points to the correct file. Any manpages
listed in MLINKS must not be listed in the
PLIST.
-
+
To specify whether the manpages are compressed upon installation,
use the MANCOMPRESSED variable. This variable can
take three values, yes, no and
@@ -2401,9 +2401,9 @@ MASTERDIR= ${.CURDIR}/../xdvi300
name of the languages to MANLANG. The value of
this variable defaults to "" (i.e., English
only).
-
+
Here is an example that puts it all together.
-
+
MAN1= foo.1
MAN3= bar.3
@@ -2414,7 +2414,7 @@ MAN3PREFIX= ${PREFIX}/share/foobar
MANCOMPRESSED= yesThis states that six files are installed by this port;
-
+
${PREFIX}/man/man1/foo.1.gz
${PREFIX}/man/ja/man1/foo.1.gz
@@ -2427,12 +2427,12 @@ ${PREFIX}/man/ja/man4/baz.4.gz
may or may-not be installed by your port. Regardless, a
symlink will be made to join the foo(1) manpage and
alt-name(8) manpage.
-
+
Ports that require Motif
-
+
There are many programs that require a Motif library (available
from several commercial vendors, while there is a free clone reported
to be able to run many applications in
@@ -2442,18 +2442,18 @@ ${PREFIX}/man/ja/man4/baz.4.gz
handling ports that require Motif in a way that we can easily compile
binaries linked either dynamically (for people who are compiling from
the port) or statically (for people who distribute packages).
-
+
REQUIRES_MOTIF
-
+
If your port requires Motif, define this variable in the
Makefile. This will prevent people who do not own a copy of Motif
from even attempting to build it.
-
+
MOTIFLIB
-
+
This variable will be set by bsd.port.mk to
be the appropriate reference to the Motif library. Please patch the
source to use this wherever the Motif library is referenced in the
@@ -2461,7 +2461,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz
Imakefile.There are two common cases:
-
+
If the port refers to the Motif library as
@@ -2469,7 +2469,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz
Imakefile, simply substitute
${MOTIFLIB} for it.
-
+
If the port uses XmClientLibs in its
Imakefile, change it to
@@ -2477,17 +2477,17 @@ ${PREFIX}/man/ja/man4/baz.4.gz
${XLIB}.
-
+
Note that MOTIFLIB (usually) expands to
-L/usr/X11R6/lib -lXm or
/usr/X11R6/lib/libXm.a, so there is no need to
add -L or -l in front.
-
+
X11 fonts
-
+
If your port installs fonts for the X Window system, put them in
X11BASE/lib/X11/fonts/local.
This directory is new to XFree86 release 3.3.3. If it does not exist,
@@ -2495,10 +2495,10 @@ ${PREFIX}/man/ja/man4/baz.4.gz
their XFree86 to 3.3.3 or newer, or at least add this directory to the
font path in /etc/XF86Config.
-
+
Info files
-
+
The new version of texinfo (included in 2.2.2-RELEASE and onwards)
contains a utility called install-info to add and
delete entries to the dir file. If your port
@@ -2510,7 +2510,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz
beautiful listing, so please bear with me!First, this is what you (as a porter) need to know
-
+
&prompt.user; install-info --help
install-info [OPTION]... [INFO-FILE [DIR-FILE]]
Install INFO-FILE in the Info directory file DIR-FILE.
@@ -2522,24 +2522,24 @@ Options:
--entry=TEXT Insert TEXT as an Info directory entry.
:
--section=SEC Put this file's entries in section SEC of the directory. :
-
+
This program will not actually install info
files; it merely inserts or deletes entries in the
dir file.
-
+
Here's a seven-step procedure to convert ports to use
install-info. I will use
editors/emacs as an example.
-
+
Look at the texinfo sources and make a patch to insert
@dircategory and @direntry
statements to files that do not have them. This is part of my
patch:
-
+
--- ./man/vip.texi.org Fri Jun 16 15:31:11 1995
+++ ./man/vip.texi Tue May 20 01:28:33 1997
@@ -2555,21 +2555,21 @@ Options:
@iftex
@finalout
:
-
+
The format should be self-explanatory. Many authors leave a
dir file in the source tree that contains all
the entries you need, so look around before you try to write your
own. Also, make sure you look into related ports and make the
section names and entry indentations consistent (we recommend that
all entry text start at the 4th tab stop).
-
+
Note that you can put only one info entry per file because
of a bug in install-info --delete that
deletes only the first entry if you specify multiple entries in
the @direntry section.
-
+
You can give the dir entries to
install-info as arguments
( and ) instead
@@ -2586,7 +2586,7 @@ Options:
PLIST of japanese/skk
for examples on how to do this).
-
+
Go back to the port directory and do a make clean;
make and verify that the info files are regenerated
@@ -2598,7 +2598,7 @@ Options:
Makefile.in so it will descend into the
man subdirectory to rebuild the info
pages.
-
+
--- ./Makefile.in.org Mon Aug 19 21:12:19 1996
+++ ./Makefile.in Tue Apr 15 00:15:28 1997
@@ -2608,7 +2608,7 @@ Options:
# and you cannot remake them without installing Emacs first.
-SUBDIR = lib-src src
+SUBDIR = lib-src src man
-
+
# The makefiles of the directories in $SUBDIR.
SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile
--- ./man/Makefile.in.org Thu Jun 27 15:27:19 1996
@@ -2621,7 +2621,7 @@ Options:
info: $(INFO_TARGETS)
dvi: $(DVI_TARGETS)
-
+
The second hunk was necessary because the default target in
the man subdir is called
info, while the main
@@ -2631,14 +2631,14 @@ Options:
one with the same name in /usr/share/info
(that patch is not shown here).
-
+
If there is a place in the Makefile that
is installing the dir file, delete it. Your
port may not be doing it. Also, remove any commands that are
otherwise mucking around with the dir
file.
-
+
--- ./Makefile.in.org Mon Aug 19 21:12:19 1996
+++ ./Makefile.in Mon Apr 14 23:38:07 1997
@@ -2658,14 +2658,14 @@ Options:
${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \
chmod a+r ${infodir}/$$f); \
-
+
(This step is only necessary if you are modifying an existing
port.) Take a look at pkg/PLIST and delete
anything that is trying to patch up info/dir.
They may be in pkg/INSTALL or some other
file, so search extensively.
-
+
Index: pkg/PLIST
===================================================================
@@ -2685,7 +2685,7 @@ diff -u -r1.15 PLIST
info/cl-1
info/cl-2
-
+
Add a post-install target to the
Makefile to call
@@ -2694,7 +2694,7 @@ diff -u -r1.15 PLIST
dir file yourself;
install-info automatically creates this
file if it does not exist.)
-
+
Index: Makefile
===================================================================
@@ -2714,13 +2714,13 @@ diff -u -r1.26 Makefile
.include <bsd.port.mk>
-
+
Edit PLIST and add equivalent
@exec statements and also
@unexec for
pkg_delete.
-
+
Index: pkg/PLIST
===================================================================
@@ -2755,7 +2755,7 @@ diff -u -r1.15 PLIST
the dir file.
-
+
Test and admire your
work. :). Check the
@@ -2763,17 +2763,17 @@ diff -u -r1.15 PLIST
-
+
The pkg/ subdirectory
-
+
There are some tricks we have not mentioned yet about the
pkg/ subdirectory that come in handy
sometimes.
-
+
MESSAGE
-
+
If you need to display a message to the installer, you may place
the message in pkg/MESSAGE. This capability is
often useful to display additional installation steps to be taken
@@ -2788,10 +2788,10 @@ diff -u -r1.15 PLIST
post-install target yourself.
-
+
INSTALL
-
+
If your port needs to execute commands when the binary package
is installed with pkg_add you can do this via the
pkg/INSTALL script. This script will
@@ -2804,7 +2804,7 @@ diff -u -r1.15 PLIST
environmental variable will be set to the package installation
directory. See &man.pkg.add.1; for
additional information.
-
+
This script is not run automatically if you install the port
with make install. If you are depending on it
@@ -2812,17 +2812,17 @@ diff -u -r1.15 PLIST
Makefile.
-
+
REQ
-
+
If your port needs to determine if it should install or not, you
can create a pkg/REQ “requirements”
script. It will be invoked automatically at
installation/deinstallation time to determine whether or not
installation/deinstallation should proceed.
-
+
Changing PLIST based on make
variables
@@ -2847,7 +2847,7 @@ diff -u -r1.15 PLIST
%%VAR%%' will be
substituted with VALUE in the
PLIST.
-
+
For instance, if you have a port that installs many files in a
version-specific subdirectory, you can put something like
@@ -2860,7 +2860,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
in PLIST. That way, when you upgrade the port,
you will not have to change dozens (or in some cases, hundreds) of
lines in the PLIST.
-
+
This substitution (as well as addition of any man pages) will be done between
the do-install and
@@ -2874,11 +2874,11 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
post-install to a file named
TMPPLIST.
-
+
Changing the names of files in the
pkg subdirectory
-
+
All the filenames in the pkg subdirectory
are defined using variables so you can change them in your
Makefile if need be. This is especially useful
@@ -2899,38 +2899,38 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
Default value
-
+
COMMENT${PKGDIR}/DESCR
-
+
DESCR${PKGDIR}/DESCR
-
+
PLIST${PKGDIR}/PLIST
-
+
PKGINSTALL${PKGDIR}/PKGINSTALL
-
+
PKGDEINSTALL${PKGDIR}/PKGDEINSTALL
-
+
PKGREQ${PKGDIR}/REQ
-
+
PKGMESSAGE${PKGDIR}/MESSAGE
@@ -2938,7 +2938,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
-
+
Please change these variables rather than overriding
PKG_ARGS. If you change
PKG_ARGS, those files will not correctly be
@@ -2946,10 +2946,10 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
port.
-
+
Licensing Problems
-
+
Some software packages have restrictive licenses or can be in
violation to the law (PKP's patent on public key crypto, ITAR (export
of crypto software) to name just two of them). What we can do with
@@ -2963,10 +2963,10 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
source or compiled binaries either via ftp or CD-ROM. If in doubt,
please contact the &a.ports;.
-
+
There are two variables you can set in the Makefile to handle the
situations that arise frequently:
-
+
If the port has a “do not sell for profit” type of
@@ -2975,7 +2975,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
into the CD-ROM come release time. The distfile and package will
still be available via ftp.
-
+
If the resulting package needs to be built uniquely for each
site, or the resulting binary package cannot be distributed due to
@@ -2984,7 +2984,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
will not go on the ftp site, nor into the CD-ROM come release time.
The distfile will still be included on both however.
-
+
If the port has legal restrictions on who can use it (e.g.,
crypto stuff) or has a “no commercial use” license,
@@ -2993,34 +2993,34 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
will not be available even from our ftp sites.
-
+
The GNU General Public License (GPL), both version 1 and 2,
should not be a problem for ports.
-
+
If you are a committer, make sure you update the
ports/LEGAL file too.
-
+
Upgrading
-
+
When you notice that a port is out of date compared to the latest
version from the original authors, first make sure you have the latest
port. You can find them in the
ports/ports-current directory of the ftp mirror
sites. You may also use CVSup to keep your whole ports collection
up-to-date, as described in .
-
+
The next step is to send a mail to the maintainer, if one is
listed in the port's Makefile. That person may
already be working on an upgrade, or have a reason to not upgrade the
port right now (because of, for example, stability problems of the new
version).
-
+
If the maintainer asks you to do the upgrade or there is not any
such person to begin with, please make the upgrade and send the
recursive diff (either unified or context diff is fine, but port
@@ -3037,14 +3037,14 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
and uuencode it; otherwise, just include it in as is in the PR.
- Once again, please use &man.diff.1; and not &man.shar.1; to send
+ Once again, please use &man.diff.1; and not &man.shar.1; to send
updates to existing ports!
-
+
Do's and Dont's
-
+
Here is a list of common do's and dont's that you encounter during
the porting process.You should check your own port against this list,
but you can also check ports in the PR database that others have
@@ -3053,10 +3053,10 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
Commentary. Checking ports in the PR database will both make
it faster for us to commit them, and prove that you know what you are
doing.
-
+
Strip Binaries
-
+
Do strip binaries. If the original source already strips the
binaries, fine; otherwise you should add a
post-install rule to to it yourself. Here is an
@@ -3070,45 +3070,45 @@ post-install:
check whether the binary is stripped or not. If it does not say
not stripped, it is stripped.
-
+
INSTALL_* macros
-
+
Do use the macros provided in bsd.port.mk
to ensure correct modes and ownership of files in your own
*-install targets. They are:
-
+
INSTALL_PROGRAM is a command to install
binary executables.
-
+
INSTALL_SCRIPT is a command to install
executable scripts.
-
+
INSTALL_DATA is a command to install
sharable data.
-
+
INSTALL_MAN is a command to install
manpages and other documentation (it does not compress
anything).
-
+
These are basically the install command with
all the appropriate flags. See below for an example on how to use
them.
-
+
WRKDIR
-
+
Do not write anything to files outside
WRKDIR. WRKDIR is the only
place that is guaranteed to be writable during the port build (see
@@ -3118,25 +3118,25 @@ post-install:
linkend="porting-pkgsubdir">redefining a variable, not by
writing over it.
-
+
WRKDIRPREFIX
-
+
Make sure your port honors WRKDIRPREFIX.
Most ports do not have to worry about this. In particular, if you
are referring to a WRKDIR of another port, note
that the correct location is
WRKDIRPREFIXPORTSDIR/subdir/name/work not PORTSDIR/subdir/name/work or .CURDIR/../../subdir/name/work or some such.
-
+
Also, if you are defining WRKDIR yourself,
make sure you prepend
${WKRDIRPREFIX}${.CURDIR} in the
front.
-
+
Differentiating operating systems and OS versions
-
+
You may come across code that needs modifications or conditional
compilation based upon what version of UNIX it is running under. If
you need to make such changes to the code for conditional
@@ -3144,63 +3144,63 @@ post-install:
so that we can back-port code to FreeBSD 1.x systems and cross-port
to other BSD systems such as 4.4BSD from CSRG, BSD/386, 386BSD,
NetBSD, and OpenBSD.
-
+
The preferred way to tell 4.3BSD/Reno (1990) and newer versions
of the BSD code apart is by using the BSD macro
defined in <sys/param.h>. Hopefully that
file is already included; if not, add the code:
-
+
#if (defined(__unix__) || defined(unix)) && !defined(USG)
#include <sys/param.h>
#endif
-
+
to the proper place in the .c file. We
believe that every system that defines these two symbols has
sys/param.h. If you find a system that
does not, we would like to know. Please send mail to the
&a.ports;.
-
+
Another way is to use the GNU Autoconf style of doing
this:
-
+
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
-
+
Do not forget to add -DHAVE_SYS_PARAM_H to the
CFLAGS in the Makefile for
this method.
-
+
Once you have sys/param.h included, you may
use:
-
+
#if (defined(BSD) && (BSD >= 199103))
-
+
to detect if the code is being compiled on a 4.3 Net2 code base
or newer (e.g. FreeBSD 1.x, 4.3/Reno, NetBSD 0.9, 386BSD, BSD/386
1.1 and below).
-
+
Use:
-
+
#if (defined(BSD) && (BSD >= 199306))
-
+
to detect if the code is being compiled on a 4.4 code base or
newer (e.g. FreeBSD 2.x, 4.4, NetBSD 1.0, BSD/386 2.0 or
above).
-
+
The value of the BSD macro is
199506 for the 4.4BSD-Lite2 code base. This is
stated for informational purposes only. It should not be used to
distinguish between versions of FreeBSD based only on 4.4-Lite vs.
versions that have merged in changes from 4.4-Lite2. The
__FreeBSD__ macro should be used instead.
-
+
Use sparingly:
-
+
__FreeBSD__ is defined in all versions of
@@ -3210,14 +3210,14 @@ post-install:
strerror() are Berkeleyisms, not FreeBSD
changes.
-
+
In FreeBSD 2.x, __FreeBSD__ is defined to
be 2. In earlier versions, it is
1. Later versions will bump it to match
their major version number.
-
+
If you need to tell the difference between a FreeBSD 1.x
system and a FreeBSD 2.x or 3.x system, usually the right answer
@@ -3228,7 +3228,7 @@ post-install:
__FreeBSD__ > 1 to detect a FreeBSD 2.x and later
system. If you need more granularity in detecting FreeBSD
systems since 2.0-RELEASE you can use the following:
-
+
#if __FreeBSD__ >= 2
#include <osreldate.h>
@@ -3245,83 +3245,83 @@ post-install:
__FreeBSD_version
-
+
2.0-RELEASE119411
-
+
2.1-CURRENTs199501, 199503
-
+
2.0.5-RELEASE199504
-
+
2.2-CURRENT before 2.1199508
-
+
2.1.0-RELEASE199511
-
+
2.2-CURRENT before 2.1.5199512
-
+
2.1.5-RELEASE199607
-
+
2.2-CURRENT before 2.1.6199608
-
+
2.1.6-RELEASE199612
-
+
2.1.7-RELEASE199612
-
+
2.2-RELEASE220000
-
+
2.2.1-RELEASE220000 (no change)
-
+
2.2-STABLE after 2.2.1-RELEASE220000 (no change)
-
+
2.2-STABLE after texinfo-3.9221001
-
+
2.2-STABLE after top221002
-
+
2.2.2-RELEASE222000
@@ -3331,105 +3331,105 @@ post-install:
2.2-STABLE after 2.2.2-RELEASE222001
-
+
2.2.5-RELEASE225000
-
+
2.2-STABLE after 2.2.5-RELEASE225001
-
+
2.2-STABLE after ldconfig -R merge225002
-
+
2.2.6-RELEASE226000
-
+
2.2.7-RELEASE227000
-
+
2.2-STABLE after 2.2.7-RELEASE227001
-
+
2.2-STABLE after semctl(2) change227002
-
+
2.2.8-RELEASE228000
-
+
2.2-STABLE after 2.2.8-RELEASE228001
-
+
3.0-CURRENT before mount(2) change300000
-
+
3.0-CURRENT after mount(2) change300001
-
+
3.0-CURRENT after semctl(2) change300002
-
+
3.0-CURRENT after ioctl arg changes300003
-
+
3.0-CURRENT after ELF conversion300004
-
+
3.0-RELEASE300005
-
+
3.0-CURRENT after 3.0-RELEASE300006
-
+
3.0-STABLE after 3/4 branch300007
-
+
3.1-RELEASE310000
-
+
3.1-STABLE after 3.1-RELEASE310001
- 3.1-STABLE after C++ constructor/destructor order
- change
+ 3.1-STABLE after C++ constructor/destructor order
+ change310002
@@ -3445,7 +3445,7 @@ post-install:
3.2-STABLE after binary-incompatible IPFW and
- socket changes
+ socket changes
320002
@@ -3453,21 +3453,21 @@ post-install:
3.3-RELEASE330000
-
+
4.0-CURRENT after 3/4 branch400000
- 4.0-CURRENT after change in dynamic linker
- handling
+ 4.0-CURRENT after change in dynamic linker
+ handling400001
- 4.0-CURRENT after C++ constructor/destructor
- order change
+ 4.0-CURRENT after C++ constructor/destructor
+ order change400002
@@ -3478,14 +3478,14 @@ post-install:
4.0-CURRENT after __deregister_frame_info dynamic linker
- bug fix
- (also 4.0-CURRENT after EGCS 1.1.2 integration)
+ bug fix (also 4.0-CURRENT after EGCS 1.1.2 integration)
+
4000044.0-CURRENT after suser(9) API change
- (also 4.0-CURRENT after newbus)
+ (also 4.0-CURRENT after newbus)
400005
@@ -3495,21 +3495,21 @@ post-install:
- 4.0-CURRENT after the addition of so_cred for
- socket level credentials
+ 4.0-CURRENT after the addition of so_cred for
+ socket level credentials400007
- 4.0-CURRENT after the addition of a poll syscall
- wrapper to libc_r
+ 4.0-CURRENT after the addition of a poll syscall
+ wrapper to libc_r4000084.0-CURRENT after the change of the kernel's
dev_t type to struct
- spacinfo pointer
+ specinfo pointer
400009
@@ -3517,7 +3517,7 @@ post-install:
-
+
Note that 2.2-STABLE sometimes identifies itself as
“2.2.5-STABLE” after the 2.2.5-RELEASE. The pattern
@@ -3529,13 +3529,13 @@ post-install:
worry about old -CURRENTs; they are listed here just for your
reference.
-
+
In the hundreds of ports that have been done, there have only
been one or two cases where __FreeBSD__ should
have been used. Just because an earlier port screwed up and used it
in the wrong place does not mean you should do so too.
-
+
Writing something after
bsd.port.mk
@@ -3551,7 +3551,7 @@ post-install:
pre.mk/post.mk pair or
bsd.port.mk only; do not mix these two.
-
+
bsd.port.pre.mk only defines a few
variables, which can be used in tests in the
Makefile, bsd.port.post.mk
@@ -3570,53 +3570,53 @@ post-install:
Description
-
+
ARCHThe architecture as returned by uname
-m (e.g., i386)
-
+
OPSYSThe operating system type, as returned by
uname -s (e.g.,
FreeBSD)
-
+
OSRELThe release version of the operating system (e.g.,
2.1.5 or
2.2.7)
-
+
OSVERSIONThe numeric version of the operating system, same as
__FreeBSD_version.
-
+
PORTOBJFORMATThe object format of the system
(aout or elf
-
+
LOCALBASEThe base of the “local” tree (e.g.,
/usr/local/)
-
+
X11BASEThe base of the “X11” tree (e.g.,
/usr/X11R6)
-
+
PREFIXWhere the port installs itself (see
-
+
If you have to define the variables
USE_IMAKE, USE_X_PREFIX, or
MASTERDIR, do so before including
bsd.port.pre.mk.
-
+
Here are some examples of things you can write after
bsd.port.pre.mk;
-
+
# no need to compile lang/perl5 if perl5 is already in system
.if ${OSVERSION} > 300003
@@ -3656,23 +3656,23 @@ post-install:
${LN} -sf liblinpack.so.1.0 ${PREFIX}/lib/liblinpack.so
.endif
-
+
Install additional documentation
-
+
If your software has some documentation other than the standard
man and info pages that you think is useful for the user, install it
under PREFIX/share/doc.
This can be done, like the previous item, in the
post-install target.
-
+
Create a new directory for your port. The directory name should
reflect what the port is. This usually means
PKGNAME minus the version part. However, if you
think the user might want different versions of the port to be
installed at the same time, you can use the whole
PKGNAME.
-
+
Make the installation dependent to the variable
NOPORTDOCS so that users can disable it in
/etc/make.conf, like this:
@@ -3683,12 +3683,12 @@ post-install:
${MKDIR}${PREFIX}/share/doc/xv
${INSTALL_MAN} ${WRKSRC}/docs/xvdocs.ps ${PREFIX}/share/doc/xv
.endif
-
+
Do not forget to add them to pkg/PLIST too!
(Do not worry about NOPORTDOCS here; there is
currently no way for the packages to read variables from
/etc/make.conf.)
-
+
Also you can use the pkg/MESSAGE file to
display messages upon installation. See the using
@@ -3700,10 +3700,10 @@ post-install:
pkg/PLIST).
-
+
DIST_SUBDIR
-
+
Do not let your port clutter
/usr/ports/distfiles. If your port requires a
lot of files to be fetched, or contains a file that has a name that
@@ -3716,22 +3716,22 @@ post-install:
/usr/ports/distfiles/DIST_SUBDIR,
and in effect puts everything that is required for your port into
that subdirectory.
-
+
It will also look at the subdirectory with the same name on the
backup master site at ftp.FreeBSD.org.
(Setting DISTDIR explicitly in your
Makefile will not accomplish this, so please use
DIST_SUBDIR.)
-
+
This does not affect the MASTER_SITES you
define in your Makefile.
-
+
Package information
-
+
Do include package information, i.e.
COMMENT, DESCR, and
PLIST, in pkg.
@@ -3742,10 +3742,10 @@ post-install:
NO_PACKAGE is set.
-
+
RCS strings
-
+
Do not put RCS strings in patches. CVS will mangle them when we
put the files into the ports tree, and when we check them out again,
they will come out different and the patch will fail. RCS strings
@@ -3753,10 +3753,10 @@ post-install:
typically start with $Id or
$RCS.
-
+
Recursive diff
-
+
Using the recurse () option to
diff to generate patches is fine, but please take
a look at the resulting patches to make sure you do not have any
@@ -3776,10 +3776,10 @@ post-install:
the patch. Once you are happy with the resulting diff, please split
it up into one source file per patch file.
-
+
PREFIX
-
+
Do try to make your port install relative to
PREFIX. (The value of this variable will be set
to LOCALBASE (default
@@ -3787,7 +3787,7 @@ post-install:
USE_X_PREFIX or USE_IMAKE is
set, in which case it will be X11BASE (default
/usr/X11R6).)
-
+
Not hard-coding /usr/local or
/usr/X11R6 anywhere in the source will make the
port much more flexible and able to cater to the needs of other
@@ -3802,12 +3802,12 @@ post-install:
Do not set USE_X_PREFIX unless your port
truly require it (i.e., it links against X libs or it needs to
reference files in X11BASE).
-
+
The variable PREFIX can be reassigned in your
Makefile or in the user's environment.
However, it is strongly discouraged for individual ports to set this
variable explicitly in the Makefiles.
-
+
Also, refer to programs/files from other ports with the
variables mentioned above, not explicit pathnames. For instance, if
your port requires a macro PAGER to be the full
@@ -3820,16 +3820,16 @@ post-install:
-DPAGER=\"${LOCALBASE}/bin/less\"
-
+
if this is an X port, instead of
-DPAGER=\"/usr/local/bin/less\". This way it will
have a better chance of working if the system administrator has
moved the whole `/usr/local' tree somewhere else.
-
+
Subdirectories
-
+
Try to let the port put things in the right subdirectories of
PREFIX. Some ports lump everything and put it in
the subdirectory with the port's name, which is incorrect. Also,
@@ -3849,10 +3849,10 @@ post-install:
PREFIX/news as a destination
for their files.
-
+
Cleaning up empty directories
-
+
Do make your ports clean up after themselves when they are
deinstalled. This is usually accomplished by adding
@dirrm lines for all directories that are
@@ -3860,7 +3860,7 @@ post-install:
before you can delete parent directories.
- :
+ :
lib/X11/oneko/pixmaps/cat.xpm
lib/X11/oneko/sounds/cat.au
:
@@ -3881,10 +3881,10 @@ lib/X11/oneko/sounds/cat.au
PREFIX/share/doc/gimp is not
empty due to other ports installing some files in there.
-
+
UIDs
-
+
If your port requires a certain user to be on the installed
system, let the pkg/INSTALL script call
pw to create it automatically. Look at
@@ -3894,11 +3894,11 @@ lib/X11/oneko/sounds/cat.au
installed a binary package as when it was compiled, then you must
choose a free UID from 50 to 99 and register it below. Look at
japanese/Wnn for an example.
-
+
Make sure you do not use a UID already used by the system or
other ports. This is the current list of UIDs between 50 and
99.
-
+
majordom:*:54:54:Majordomo Pseudo User:/usr/local/majordomo:/nonexistent
cyrus:*:60:60:the cyrus mail server:/nonexistent:/nonexistent
@@ -3919,15 +3919,15 @@ qmailp:*:84:81:QMail user:/var/qmail:/nonexistent
qmailr:*:86:82:QMail user:/var/qmail:/nonexistent
msql:*:87:87:mSQL-2 pseudo-user:/var/db/msqldb:/bin/sh
mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
-
+
Please include a notice when you submit a port (or an upgrade)
that reserves a new UID or GID in this range. This allows us to
keep the list of reserved IDs up to date.
-
+
Do things rationally
-
+
The Makefile should do things simply and
reasonably. If you can make it a couple of lines shorter or more
readable, then do so. Examples include using a make
@@ -3938,18 +3938,18 @@ mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
GNU_CONFIGURE instead of CONFIGURE_ARGS
+= --prefix=${PREFIX}.
-
+
Respect CFLAGS
-
+
The port should respect the CFLAGS variable.
If it does not, please add NO_PACKAGE=ignores
cflags to the Makefile.
-
+
Configuration files
-
+
If your port requires some configuration files in
PREFIX/etc, do
not just install them and list them in
@@ -3964,27 +3964,27 @@ mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
user has to copy and edit the file before the software can be made
to work.
-
+
Portlint
-
+
Do check your work with portlint
before you submit or commit it.
-
+
Feedback
-
+
Do send applicable changes/patches to the original
author/maintainer for inclusion in next release of the code. This
will only make your job that much easier for the next
release.
-
+
Miscellanea
-
+
The files pkg/DESCR,
pkg/COMMENT, and pkg/PLIST
should each be double-checked. If you are reviewing a port and feel
@@ -3992,44 +3992,44 @@ mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
Do not copy more copies of the GNU General Public License into
our system, please.
-
+
Please be careful to note any legal issues! Do not let us
illegally distribute software!
-
+
If you are stuck…
-
+
Do look at existing examples and the
bsd.port.mk file before asking us questions!
;)
-
+
Do ask us questions if you have any trouble! Do not just beat
your head against a wall! :)
-
+
A Sample Makefile
-
+
Here is a sample Makefile that you can use to
create a new port. Make sure you remove all the extra comments (ones
between brackets)!
-
+
It is recommended that you follow this format (ordering of
variables, empty lines between sections, etc.). This format is
designed so that the most important information is easy to locate. We
recommend that you use portlint to check the
Makefile.
-
+
[the header...just to make it easier for us to identify the ports.]
# New ports collection makefile for: xdvi
[the version required header should updated when upgrading a port.]
# Version required: pl18 [things like "1.5alpha" are fine here too]
-[this is the date when the first version of this Makefile was created.
+[this is the date when the first version of this Makefile was created.
Never change this when doing an update of the port.]
# Date created: 26 May 1995
[this is the person who did the original port to FreeBSD, in particular, the
@@ -4105,7 +4105,7 @@ pre-install:
.include <bsd.port.mk>
-
+ Automated package list creationFirst, make sure your port is almost complete, with only
@@ -4148,18 +4148,18 @@ pre-install:
Package Names
-
+
The following are the conventions you should follow in naming your
packages. This is to have our package directory easy to scan, as
there are already lots and lots of packages and users are going to
turn away if they hurt their eyes!
-
+
The package name should look like
language-name-compiled.specifics-version.numbers.
-
+
If your DISTNAME does not look like that, set
PKGNAME to something in that format.
-
+
FreeBSD strives to support the native language of its users.
@@ -4171,7 +4171,7 @@ pre-install:
zh for Chinese, ko for
Korean and de for German.
-
+
The name part should be all lowercases,
except for a really large package (with lots of programs in it).
@@ -4189,7 +4189,7 @@ pre-install:
has numbers, hyphens, or underscores in its name, you may include
them as well (like kinput2).
-
+
If the port can be built with different hardcoded defaults (usually
@@ -4198,7 +4198,7 @@ pre-install:
the compiled-in defaults (the hyphen is optional). Examples are
papersize and font units.
-
+
The version string should be a period-separated list of
integers and single lowercase alphabetics. The only exception is
@@ -4207,7 +4207,7 @@ pre-install:
minor version numbers in the software.
-
+
Here are some (real) examples on how to convert a
DISTNAME into a suitable
PKGNAME:
@@ -4221,89 +4221,89 @@ pre-install:
Reason
-
+
mule-2.2.2.mule-2.2.2No changes required
-
+
XFree86-3.1.2XFree86-3.1.2No changes required
-
+
EmiClock-1.0.2emiclock-1.0.2No uppercase names for single programs
-
+
gmod1.4gmod-1.4Need a hyphen before version numbers
-
+
xmris.4.0.2xmris-4.0.2Need a hyphen before version numbers
-
+
rdist-1.3alphardist-1.3aNo strings like alpha
allowed
-
+
es-0.9-beta1es-0.9b1No strings like beta
allowed
-
+
v3.3beta021.srctiff-3.3What the heck was that anyway?
-
+
tvtwmtvtwm-pl11Version string always required
-
+
piewmpiewm-1.0Version string always required
-
+
xvgr-2.10pl1xvgr-2.10.1pl allowed only when no
major/minor version numbers
-
+
gawk-2.15.6ja-gawk-2.15.6Japanese language version
-
+
psutils-1.13psutils-letter-1.13Papersize hardcoded at package build time
-
+
pkfontspkfonts300-1.0
@@ -4312,7 +4312,7 @@ pre-install:
-
+
If there is absolutely no trace of version information in the
original source and it is unlikely that the original author will ever
release another version, just set the version string to
@@ -4320,10 +4320,10 @@ pre-install:
the original author or use the date string
(yy.mm.dd) as the version.
-
+
Categories
-
+
As you already know, ports are classified in several categories.
But for this to work, it is important that porters and users understand
what each category and how we decide what to put in each
@@ -4331,19 +4331,19 @@ pre-install:
Current list of categories
-
+
First, this is the current list of port categories. Those
marked with an asterisk (*) are
virtual categories—those that do not have
a corresponding subdirectory in the ports tree.
-
+
For non-virtual categories, you will find a one-line
description in the pkg/COMMENT file in that
subdirectory (e.g.,
archivers/pkg/COMMENT).
-
+
@@ -4352,70 +4352,70 @@ pre-install:
Description
-
+
afterstep*Ports to support AfterStep window manager
-
+
archiversArchiving tools.
-
+
astroAstronomical ports.
-
+
audioSound support.
-
+
benchmarksBenchmarking utilities.
-
+
biologyBiology-related software.
-
+
cadComputer aided design tools.
-
+
chineseChinese language support.
-
+
commsCommunication software. Mostly software to talk to
your serial port.
-
+
convertersCharacter code converters.
-
+
databasesDatabases.
-
+
deskutilsThings that used to be on the desktop before
computers were invented.
-
+
develDevelopment utilities. Do not put libraries here just
@@ -4423,19 +4423,19 @@ pre-install:
belong to anywhere else, they should not be in this
category.
-
+
editorsGeneral editors. Specialized editors go in the section
for those tools (e.g., a mathematical-formula editor will go
in math).
-
+
elispEmacs-lisp ports.
-
+
emulatorsEmulators for other operating systems. Terminal
@@ -4445,7 +4445,7 @@ pre-install:
comms or misc,
depending on the exact functionality.
-
+
ftpFTP client and server utilities. If your
@@ -4453,28 +4453,28 @@ pre-install:
ftp with a secondary
category of www.
-
+
gamesGames.
-
+
germanGerman language support.
-
- gnome*
- Ports from the GNU Object Model Environment (GNOME)
- Project.
-
-
+
+ gnome*
+ Ports from the GNU Object Model Environment (GNOME)
+ Project.
+
+
graphicsGraphics utilities.
-
+
ircInternet Chat Relay utilities.
@@ -4484,7 +4484,7 @@ pre-install:
japaneseJapanese language support.
-
+
javaJava language support.
@@ -4493,14 +4493,14 @@ pre-install:
kde*Ports from the K Desktop Environment (KDE)
- Project.
+ Project.
-
+
koreanKorean language support.
-
+
langProgramming languages.
@@ -4516,12 +4516,12 @@ pre-install:
Numerical computation software and other utilities
for mathematics.
-
+
mboneMBone applications.
-
+
miscMiscellaneous utilities—basically things that
@@ -4532,136 +4532,136 @@ pre-install:
safely delete misc and just put the port
in that other subdirectory!
-
+
netMiscellaneous networking software.
-
+
newsUSENET news software.
-
+
offix*Ports from the OffiX suite.
-
+
palmSoftware support for the 3Com Palm(tm) series.
-
+
perl5*Ports that require perl version 5 to run.
-
+
plan9*Various programs from Plan9.
-
+
printPrinting software. Desktop publishing tools
(previewers, etc.) belong here too.
-
+
python*Software written in python.
-
+
russianRussian language support.
-
+
securitySecurity utilities.
-
+
shellsCommand line shells.
-
+
sysutilsSystem utilities.
-
+
tcl75*Ports that use Tcl version 7.5 to run.
-
+
tcl76*Ports that use Tcl version 7.6 to run.
-
+
tcl80*Ports that use Tcl version 8.0 to run.
-
+
tcl81*Ports that use Tcl version 8.1 to run.
-
+
textprocText processing utilities. It does not include
desktop publishing tools, which go to print/.
-
+
tk41*Ports that use Tk version 4.1 to run.
-
+
tk42*Ports that use Tk version 4.2 to run.
-
+
tk80*Ports that use Tk version 8.0 to run.
-
+
tk81*Ports that use Tk version 8.1 to run.
-
- tkstep80*
- Ports that use TkSTEP version 8.0 to run.
-
-
+
+ tkstep80*
+ Ports that use TkSTEP version 8.0 to run.
+
+
vietnameseVietnamese language support.
-
+
windowmaker*Ports to support the WindowMaker window
manager
-
+
wwwSoftware related to the World Wide Web. HTML language
support belong here too.
-
+
x11The X window system and friends. This category is only
@@ -4672,22 +4672,22 @@ pre-install:
categories. Also, many of them go into other
x11-* categories (see below).
-
+
x11-clocksX11 clocks.
-
+
x11-fmX11 file managers.
-
+
x11-fontsX11 fonts and font utilities.
-
+
x11-serversX11 servers.
@@ -4697,7 +4697,7 @@ pre-install:
x11-toolkitsX11 toolkits.
-
+
x11-wmX11 window managers.
@@ -4706,15 +4706,15 @@ pre-install:
-
+
Choosing the right category
-
+
As many of the categories overlap, you often have to choose
which of the categories should be the primary category of your port.
There are several rules that govern this issue. Here is the list of
priorities, in decreasing order of precedence.
-
+
Language specific categories always come first. For
@@ -4722,17 +4722,17 @@ pre-install:
CATEGORIES line would read japanese
x11-fonts.
-
+
Specific categories win over less-specific ones. For
instance, an HTML editor should be listed as www
editors, not the other way around. Also, you do not
need to list net when the port belongs to
- either of irc, mail,
- mbone, news,
+ either of irc, mail,
+ mbone, news,
security, or www.
-
+
x11 is used as a secondary category only
when the primary category is a natural language. In particular,
@@ -4745,7 +4745,7 @@ pre-install:
misc.
-
+
If you are not sure about the category, please put a comment to
that effect in your send-pr submission so we can
discuss it before import it. (If you are a committer, send a note
@@ -4753,10 +4753,10 @@ pre-install:
imported to a wrong category only to be moved right away.)
-
+
Changes to this document and the ports system
-
+
If you maintain a lot of ports, you should consider following the
&a.ports;. Important changes to the way ports work will be announced
there. You can always find more detailed information on the latest
@@ -4764,10 +4764,10 @@ pre-install:
url="http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/Mk/bsd.port.mk"> the
bsd.port.mk CVS log.
-
+
That is It, Folks!
-
+
Boy, this sure was a long tutorial, wasn't it? Thanks for
following us to here, really. Now that you know how to do a port,
have at it and convert everything in the world into ports! That
diff --git a/en_US.ISO8859-1/books/porters-handbook/book.sgml b/en_US.ISO8859-1/books/porters-handbook/book.sgml
index d8754a9169..f1d732b29d 100644
--- a/en_US.ISO8859-1/books/porters-handbook/book.sgml
+++ b/en_US.ISO8859-1/books/porters-handbook/book.sgml
@@ -1,17 +1,17 @@
-
+
Installing Applications: The Ports collection
-
+
Contributed by &a.jraynard;.
-
+
The FreeBSD Ports collection allows you to compile and install a very
wide range of applications with a minimum of effort.
-
+
For all the hype about open standards, getting a program to work on
different versions of Unix in the real world can be a tedious and tricky
business, as anyone who has tried it will know. You may be lucky enough
@@ -21,7 +21,7 @@
programs, you will find yourself doing a fair bit of head-scratching, and
there are quite a few programs that will result in premature greying, or
even chronic alopecia...
-
+
Some software distributions have attacked this problem by providing
configuration scripts. Some of these are very clever, but they have an
unfortunate tendency to triumphantly announce that your system is
@@ -30,72 +30,72 @@
your system's gethitlist function return a const pointer to a fromboz or
a pointer to a const fromboz? Do you have Foonix style unacceptable
exception handling? And if not, why not?).
-
+
Fortunately, with the Ports collection, all the hard work involved has
already been done, and you can just type make install
and get a working program.
-
+
Why Have a Ports Collection?
-
+
The base FreeBSD system comes with a very wide range of tools and
system utilities, but a lot of popular programs are not in the base
system, for good reasons:-
-
+
Programs that some people cannot live without and other people
cannot stand, such as a certain Lisp-based editor.
-
+
Programs which are too specialised to put in the base system
(CAD, databases).
-
+
Programs which fall into the “I must have a look at that
when I get a spare minute” category, rather than
system-critical ones (some languages, perhaps).
-
+
Programs that are far too much fun to be supplied with a serious
operating system like FreeBSD ;-)
-
+
However many programs you put in the base system, people will
always want more, and a line has to be drawn somewhere (otherwise
FreeBSD distributions would become absolutely enormous).
-
+
Obviously it would be unreasonable to expect everyone to port their
favourite programs by hand (not to mention a tremendous amount of
duplicated work), so the FreeBSD Project came up with an ingenious way
of using standard tools that would automate the process.
-
+
Incidentally, this is an excellent illustration of how “the
Unix way” works in practice by combining a set of simple but very
flexible tools into something very powerful.
-
+
How Does the Ports Collection Work?
-
+
Programs are typically distributed on the Internet as a tarball consisting of a Makefile and
the source code for the program and usually some instructions (which are
unfortunately not always as instructive as they could be), with perhaps
a configuration script.
-
+
The standard scenario is that you FTP down the tarball, extract it
somewhere, glance through the instructions, make any changes that seem
necessary, run the configure script to set things up and use the
standard make program to compile and install the
program from the source.
-
+
FreeBSD ports still use the tarball mechanism, but use a skeleton to hold the
"knowledge" of how to get the program working on FreeBSD,
@@ -103,7 +103,7 @@
supply their own customised Makefile, so that almost every port
can be built in the same way.
-
+
If you look at a port skeleton (either on your FreeBSD
system or Getting a port).
-
+
“How on earth can this do anything?” I hear you cry.
“There is no source code there!”
-
+
Fear not, gentle reader, all will become clear (hopefully). Let us
see what happens if we try and install a port. I have chosen
ElectricFence, a useful tool for developers,
as the skeleton is more straightforward than most.
-
+
If you are trying this at home, you will need to be root.
-
+
&prompt.root; cd /usr/ports/devel/ElectricFence
&prompt.root; make install
>> Checksum OK for ElectricFence-2.0.5.tar.gz.
@@ -142,57 +142,57 @@ install -c -o root -g wheel -m 444 /usr/ports/devel/ElectricFence/work/ElectricF
install -c -o root -g wheel -m 444 /usr/ports/devel/ElectricFence/work/ElectricFence-2.0.5/libefence.3 /usr/local/man/man3
===> Compressing manual pages for ElectricFence-2.0.5
===> Registering installation for ElectricFence-2.0.5
-
+
To avoid confusing the issue, I have completely removed the build
output.
-
+
If you tried this yourself, you may well have got something like
this at the start:-
-
+
&prompt.root; make install
>> ElectricFence-2.0.5.tar.gz doesn't seem to exist on this system.
>> Attempting to fetch from ftp://ftp.doc.ic.ac.uk/Mirrors/sunsite.unc.edu/pub/Linux/devel/lang/c/.
-
+
The make program has noticed that you did not
have a local copy of the source code and tried to FTP it down so it
could get the job done. I already had the source handy in my example,
so it did not need to fetch it.
-
+
Let's go through this and see what the make
program was doing.
-
+
Locate the source code tarball. If it is not available
locally, try to grab it from an FTP site.
-
+
Run a checksum test on the
tarball to make sure it has not been tampered with, accidentally
truncated, downloaded in ASCII mode, struck by neutrinos while in
transit, etc.
-
+
Extract the tarball into a temporary work directory.
-
+
Apply any patches needed to
get the source to compile and run under FreeBSD.
-
+
Run any configuration script required by the build process and
correctly answer any questions it asks.
-
+
(Finally!) Compile the code.
-
+
Install the program executable and other supporting files, man
pages, etc. under the /usr/local hierarchy
@@ -202,7 +202,7 @@ install -c -o root -g wheel -m 444 /usr/ports/devel/ElectricFence/work/ElectricF
makes sure that all the ports you install will go in the same place,
instead of being flung all over your system.
-
+
Register the installation in a database. This means that, if
you do not like the program, you can cleanly
-
+
Scroll up to the make output and see if you can
match these steps to it. And if you were not impressed before, you
should be by now!
-
+
Getting a FreeBSD Port
-
+
There are two ways of getting hold of the FreeBSD port for a
program. One requires a FreeBSD CDROM,
the other involves using an Internet
Connection.
-
+
Compiling ports from CDROM
-
+
Assuming that your FreeBSD CDROM is in the drive and mounted on
/cdrom (and the mount point
must be /cdrom), you should
@@ -252,7 +252,7 @@ WRKDIRPREFIX= /tmp
/tmp/cdrom/ports; for instance,
games/oneko will be built under
/tmp/cdrom/ports/games/oneko.
-
+
There are some ports for which we cannot provide the original
source in the CDROM due to licensing limitations. In that case, you
@@ -261,10 +261,10 @@ WRKDIRPREFIX= /tmp
connection.
-
+
Compiling ports from the Internet
-
+
If you do not have a CDROM, or you want to make sure you get the
very latest version of the port you want, you will need to download
the skeleton for the port. Now
@@ -276,13 +276,13 @@ WRKDIRPREFIX= /tmp
from the ports web
page. These packages include files that have been updated
since the release that you may need to compile new ports.
-
+
The key to the skeletons is that the FreeBSD FTP server can create
on-the-fly tarballs for you.
Here is how it works, with the gnats program in the databases
directory as an example (the bits in square brackets are comments. Do
not type them in if you are trying this yourself!):-
-
+
&prompt.root; cd /usr/ports
&prompt.root; mkdir databases
&prompt.root; cd databases
@@ -298,24 +298,24 @@ password. Remember to use binary (also known as image) mode!]
&prompt.root; cd gnats
&prompt.root; make install
[build and install gnats]
-
+
What happened here? We connected to the FTP server in the usual
way and went to its databases sub-directory.
When we gave it the command get gnats.tar, the FTP
server tarred up the gnats
directory for us.
-
+
We then extracted the gnats skeleton and went into the gnats
directory to build the port. As we explained earlier, the make process noticed we
did not have a copy of the source locally, so it fetched one before
extracting, patching and building it.
-
+
Let us try something more ambitious now. Instead of getting a
single port skeleton, we will get a whole sub-directory, for example all
the database skeletons in the ports collection. It looks almost the
same:-
-
+
&prompt.root; cd /usr/ports
&prompt.root; ftp ftp.FreeBSD.org
[log in as `ftp' and give your email address when asked for a
@@ -329,34 +329,34 @@ password. Remember to use binary (also known as image) mode!]
&prompt.root; cd databases
&prompt.root; make install
[build and install all the database ports]
-
+
With half a dozen straightforward commands, we have now got a set
of database programs on our FreeBSD machine! All we did that was
different from getting a single port skeleton and building it was that
we got a whole directory at once, and compiled everything in it at
once. Pretty impressive, no?
-
+
If you expect to be installing many ports, it is probably worth
downloading all the ports directories.
-
+
Skeletons
-
+
A team of compulsive hackers who have forgotten to eat in a frantic
attempt to make a deadline? Something unpleasant lurking in the FreeBSD
attic? No, a skeleton here is a minimal framework that supplies
everything needed to make the ports magic work.
-
+
Makefile
-
+
The most important component of a skeleton is the Makefile. This
contains various statements that specify how the port should be
compiled and installed. Here is the Makefile for
ElectricFence:-
-
+
# New ports collection makefile for: Electric Fence
# Version required: 2.0.5
@@ -380,19 +380,19 @@ do-install:
${INSTALL_MAN} ${WRKSRC}/libefence.3 ${PREFIX}/man/man3
.include <bsd.port.mk>
-
+
The lines beginning with a "#" sign are comments for the
benefit of human readers (as in most Unix script files).
-
+
DISTNAME specifies the name of the tarball, but without the
extension.
-
+
CATEGORIES states what kind of program this is.
In this case, a utility for developers. See the categories section of this
handbook for a complete list.
-
+
MASTER_SITES is the URL(s) of the master FTP
site, which is used to retrieve the tarball if it is not available on the
@@ -400,18 +400,18 @@ do-install:
normally the one from which the program is officially distributed (in
so far as any software is "officially" distributed on the
Internet).
-
+
MAINTAINER is the email address of the person
who is responsible for updating the skeleton if, for example a new
version of the program comes out.
-
+
Skipping over the next few lines for a minute, the line
.include <bsd.port.mk> says that the other
statements and commands needed for this port are in a standard file
called bsd.port.mk. As these are the same for
all ports, there is no point in duplicating them all over the place,
so they are kept in a single standard file.
-
+
This is probably not the place to go into a detailed examination
of how Makefiles work; suffice it to say that the line starting with
MAN3 ensures that the ElectricFence man page is
@@ -421,31 +421,31 @@ do-install:
do-install ensure that the files produced by
this port are placed in the correct destination.
-
+
The files directory
-
+
The file containing the checksum for the port is called
md5, after the MD5 algorithm used for ports
checksums. It lives in a directory with the slightly confusing name
of files.
-
+
This directory can also contain other miscellaneous files that are
required by the port and do not belong anywhere else.
-
+
The patches directory
-
+
This directory contains the patches needed to make everything work
properly under FreeBSD.
-
+
The pkg directory
-
+
This program contains three quite useful files:-
@@ -453,12 +453,12 @@ do-install:
COMMENT — a one-line description of
the program.
-
+
DESCR — a more detailed
description.
-
+
PLIST — a list of all the files
that will be created when the program is installed.
@@ -466,18 +466,18 @@ do-install:
-
+
What to do when a port does not work.
-
+
Oh. You can do one of four (4) things :
-
+
Fix it yourself. Technical details on how ports work can be
found in Porting applications.
-
+
Gripe. This is done by e-mail only! Send
such e-mail to the maintainer of the port, first. Type
@@ -490,12 +490,12 @@ do-install:
you can try filing a bug report with send-pr.
-
+
Forget it. This is the easiest for most — very few of the
programs in ports can be classified as essential!
-
+
Grab the pre-compiled package from a ftp server. The
“master” package collection is on FreeBSD's FTP server
@@ -509,10 +509,10 @@ do-install:
-
+
Some Questions and Answers
-
+
@@ -529,7 +529,7 @@ do-install:
things).
-
+
I thought you were supposed to use packages to install extra
@@ -541,7 +541,7 @@ do-install:
it.
-
+
So why bother with ports then?
@@ -549,25 +549,25 @@ do-install:
Several reasons:-
-
+
The licensing conditions on some software distributions
require that they be distributed as source code, not
binaries.
-
+
Some people do not trust binary distributions. At least
with source code you can (in theory) read through it and look
for potential problems yourself.
-
+
If you have some local patches, you will need the source to
add them yourself.
-
+
You might have opinions on how a program should be compiled
that differ from the person who did the package — some
@@ -575,13 +575,13 @@ do-install:
used, whether to build debug versions and then strip them or
not, etc. etc.
-
+
Some people like having code around, so they can read it if
they get bored, hack around with it, borrow from it (licence
terms permitting, of course!) and so on.
-
+
If you ain't got the source, it ain't software! ;-)
@@ -589,7 +589,7 @@ do-install:
-
+
What is a patch?
@@ -604,7 +604,7 @@ do-install:
generated by a program of that name.
-
+
What is all this about
@@ -616,25 +616,25 @@ do-install:
.tar.gz (with variations like
.tar.Z, or even .tgz if
you are trying to squeeze the names into a DOS filesystem).
-
+
Basically, it is a directory tree that has been archived into a
single file (.tar) and optionally compressed
(.gz). This technique was originally used for
Tape ARchives (hence the
name tar), but it is 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:-
-
- &prompt.user; tar tvzf foobar.tar.gz
+
+ &prompt.user; tar tvzf foobar.tar.gz
&prompt.user; tar xzvf foobar.tar.gz
&prompt.user; tar tvf foobar.tar
&prompt.user; tar xvf foobar.tar
-
+
And a checksum?
@@ -650,7 +650,7 @@ do-install:
addition).
-
+
I did what you said for compiling ports from a CDROM and it
@@ -659,7 +659,7 @@ do-install:
&prompt.root; 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 it not be found? Have I got a dud CDROM?
@@ -676,7 +676,7 @@ do-install:
bandwidth).
-
+
I did that, but when I tried to put it into
@@ -690,11 +690,11 @@ do-install:
to copy anything there because it is sym-linked to the CDROM, which
is read-only. You can tell it to look somewhere else by
doing
-
+
&prompt.root; make DISTDIR=/where/you/put/it install
-
+
Does the ports scheme only work if you have everything in
@@ -708,31 +708,31 @@ do-install:
You can use the PORTSDIR and
PREFIX variables to tell the ports mechanism to
use different directories. For instance,
-
+
&prompt.root; make PORTSDIR=/u/people/guests/wurzburger/ports install
-
+
will compile the port in
/u/people/guests/wurzburger/ports and install
everything under /usr/local.
-
+
&prompt.root; make PREFIX=/u/people/guests/wurzburger/local install
-
+
will compile it in /usr/ports and install
it in /u/people/guests/wurzburger/local.
-
+
And of course
-
+
&prompt.root; make PORTSDIR=.../ports PREFIX=.../local install
-
+
will combine the two (it is too long to fit on the page if I
write it in full, but I am sure you get the idea).
-
+
If you do not fancy typing all that in every time you install a
port (and to be honest, who would?), it is a good idea to put these
variables into your environment.
-
+
I do not have a FreeBSD CDROM, but I would like to have all
@@ -744,20 +744,20 @@ do-install:
To get every single tarball for the ports collection,
do
-
+
&prompt.root; cd /usr/ports
&prompt.root; make fetch
-
+
For all the tarballs for a single ports directory, do
-
+
&prompt.root; cd /usr/ports/directory
&prompt.root; make fetch
-
+
and for just one port — well, I think you have guessed
already.
-
+
I know it is probably faster to fetch the tarballs from one
@@ -776,7 +776,7 @@ do-install:
&prompt.root; make MASTER_SITE_OVERRIDE=ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch
-
+
I want to know what files make is going to need before it
@@ -788,7 +788,7 @@ do-install:
the files needed for a port.
-
+
Is there any way to stop the port from compiling? I want to
@@ -801,7 +801,7 @@ do-install:
has fetched and extracted the source code.
-
+
I am trying to make my own port and I want to be able to
@@ -816,7 +816,7 @@ do-install:
as well. And by the way, thank you for your efforts!
-
+
I have heard that some compiler options can cause bugs. Is
@@ -832,9 +832,9 @@ do-install:
(Most of the ports do not use ). You
should be able to specify the compiler options
used by something like
-
+
&prompt.root; make CFLAGS='-O2 -fno-strength-reduce' install
-
+
or by editing /etc/make.conf, but
unfortunately not all ports respect this. The surest way is to do
make configure, then go into the source directory
@@ -843,7 +843,7 @@ do-install:
Makefiles.
-
+
There are so many ports it is hard to find the one I want.
@@ -861,7 +861,7 @@ do-install:
&prompt.user; make search key=lisp
-
+
I went to install the foo port but the
@@ -878,7 +878,7 @@ do-install:
foo port.
-
+
I installed the
@@ -889,7 +889,7 @@ do-install:
No problem, just do
-
+
&prompt.root; pkg_delete grizzle-6.5Alternatively, you can do
@@ -898,7 +898,7 @@ do-install:
&prompt.root; make deinstall
-
+
@@ -909,13 +909,13 @@ do-install:
Not at all, you can find it out by doing
-
+
&prompt.root; pkg_info -a | grep grizzle
Information for grizzle-6.5:
grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arcade game.
-
+
Talking of disk space, the ports directory seems to be
@@ -927,15 +927,15 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
Yes, if you have installed the program and are fairly
certain you will not need the source again, there is no point in
keeping it hanging around. The best way to do this is
-
+
&prompt.root; cd /usr/ports
&prompt.root; make clean
-
+
which will go through all the ports subdirectories and delete
everything except the skeletons for each port.
-
+
I tried that and it still left all those tarballs or
@@ -948,7 +948,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
go as well.
-
+
I like having lots and lots of programs to play with. Is
@@ -957,12 +957,12 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
Just do
-
+
&prompt.root; cd /usr/ports
&prompt.root; make install
-
+
OK, I tried that, but I thought it would take a very long
@@ -978,7 +978,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
someone on hand to answer them.
-
+
I really do not want to spend all day staring at the
@@ -988,20 +988,20 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
OK, do this before you go to bed/work/the local
park:-
-
+
&prompt.root cd /usr/ports
&prompt.root; make -DBATCH install
-
+
This will install every port that does not
require user input. Then, when you come back, do
-
+
&prompt.root; cd /usr/ports
&prompt.root; make -DIS_INTERACTIVE install
-
+
to finish the job.
-
+
At work, we are using frobble, which is
@@ -1013,7 +1013,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
No problem, assuming you know how to make patches for your
changes:-
-
+
&prompt.root; cd /usr/ports/somewhere/frobble
&prompt.root; make extract
&prompt.root; cd work/frobble-2.8
@@ -1022,7 +1022,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
&prompt.root; make package
-
+
This ports stuff is really clever. I am desperate to find
@@ -1042,16 +1042,16 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
-
+
Making a port yourself
-
+
Contributed by &a.jkh;, &a.gpalmer;, &a.asami;, &a.obrien;,
and &a.hoek;. 28 August 1996.So, now you are interested in making your own port or upgrading
an existing one? Great!
-
+
What follows are some guidelines for creating a new port for
FreeBSD. If you want to upgrade an existing port, you should read this
and then read .
@@ -1061,7 +1061,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
include. Even if you do not hack Makefiles daily, it is well
commented, and you will still gain much knowledge from it.
Additionally, you may send specific questions to &a.ports;.
-
+
Only a fraction of the overridable variables
(VAR) are mentioned in
@@ -1073,30 +1073,30 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
set to use the correct value by typing :set tabstop=4
once the file has been loaded.
-
+
Quick Porting
-
+
This section tells you how to do a quick port. In many cases, it
is not enough, but we will see.
-
+
First, get the original tarball and put it into
DISTDIR, which defaults to
/usr/ports/distfiles.
-
+
The following assumes that the software compiled out-of-the-box,
i.e., there was absolutely no change required for the port to work
on your FreeBSD box. If you needed to change something, you will
have to refer to the next section too.
-
+
Writing the Makefile
-
+
The minimal Makefile would look something
like this:
-
+
# New ports collection makefile for: oneko
# Version required: 1.1b
@@ -1124,19 +1124,19 @@ USE_IMAKE= yes
tree. You can find a more detailed example in the sample Makefile section.
-
+
Writing the description files
-
+
There are three description files that are required for any
port, whether they actually package or not. They are
COMMENT, DESCR, and
PLIST, and reside in the
pkg subdirectory.
-
+
COMMENT
-
+
This is the one-line description of the port.
Please do not include the package name (or
version number of the software) in the comment. The comment
@@ -1146,10 +1146,10 @@ USE_IMAKE= yes
A cat chasing a mouse all over the screen
-
+
DESCR
-
+
This is a longer description of the port. One to a few
paragraphs concisely explaining what the port does is
sufficient.
@@ -1166,10 +1166,10 @@ A cat chasing a mouse all over the screen
WWW: so that automated tools will work
correctly.
-
+
It is recommended that you sign your name at the end of this
file, as in:
-
+
This is a port of oneko, in which a cat chases a poor mouse all over
the screen.
@@ -1181,10 +1181,10 @@ WWW: http://www.oneko.org/
- Satoshi
asami@cs.berkeley.edu
-
+
PLIST
-
+
This file lists all the files installed by the port. It is
also called the “packing list” because the package is
generated by packing the files listed here. The pathnames are
@@ -1193,9 +1193,9 @@ asami@cs.berkeley.edu
/usr/X11R6). If you are using the
MANn variables (as
you should be), do not list any manpages here.
-
+
Here is a small example:
-
+
bin/oneko
lib/X11/app-defaults/Oneko
@@ -1203,7 +1203,7 @@ lib/X11/oneko/cat1.xpm
lib/X11/oneko/cat2.xpm
lib/X11/oneko/mouse.xpm
@dirrm lib/X11/oneko
-
+
Refer to the &man.pkg.create.1; man page for details on the
packing list.
@@ -1225,18 +1225,18 @@ lib/X11/oneko/mouse.xpm
-
+
Creating the checksum file
-
+
Just type make makesum. The ports make rules
will automatically generate the file
files/md5.
-
+
Testing the port
-
+
You should make sure that the port rules do exactly what you
want it to do, including packaging up the port. These are the
important points you need to verify.
@@ -1246,56 +1246,56 @@ lib/X11/oneko/mouse.xpm
PLIST does not contain anything not
installed by your port
-
+
PLIST contains everything that is
installed by your port
-
+
Your port can be installed multiple times using the
reinstall target
-
+
Your port cleans up
after itself upon deinstall
-
+
Recommended test ordering
-
+
make install
-
+
make package
-
+
make deinstall
-
+
pkg_add package-name
-
+
make deinstall
-
+
make reinstall
-
+
make package
-
+
Make sure that there are not any warnings issued in any of the
package and
deinstall stages, After step 3, check to
@@ -1303,10 +1303,10 @@ lib/X11/oneko/mouse.xpm
using the software after step 4, to ensure that is works correctly
when installed from a package.
-
+
Checking your port with portlint
-
+
Please use portlint to see if your port
conforms to our guidelines. The portlint program
is part of the ports collection. In particular, your may want to
@@ -1315,13 +1315,13 @@ lib/X11/oneko/mouse.xpm
linkend="porting-pkgname">package is named
appropriately.
-
+
Submitting the port
-
+
First, make sure you have read the Do's and Dont's section.
-
+
Now that you are happy with your port, the only thing remaining
is to put it in the main FreeBSD ports tree and make everybody else
happy about it too. We do not need your work
@@ -1342,7 +1342,7 @@ lib/X11/oneko/mouse.xpm
One more time, do not include the original source
distfile, the work directory, or the package
you built with make package.
-
+
In the past, we asked you to upload new port submissions in
our ftp site (ftp.FreeBSD.org). This
@@ -1350,7 +1350,7 @@ lib/X11/oneko/mouse.xpm
incoming/ directory of that site due to the
large amount of pirated software showing up there.
-
+
We will look at your port, get back to you if necessary, and put
it in the tree. Your name will also appear in the list of
“Additional FreeBSD contributors” on the FreeBSD
@@ -1358,29 +1358,29 @@ lib/X11/oneko/mouse.xpm
-->:)
-
+
Slow Porting
-
+
Ok, so it was not that simple, and the port required some
modifications to get it to work. In this section, we will explain,
step by step, how to modify it to get it to work with the ports
paradigm.
-
+
How things work
-
+
First, this is the sequence of events which occurs when the user
first types make in your port's directory, and
you may find that having bsd.port.mk in another
window while you read this really helps to understand it.
-
+
But do not worry if you do not really understand what
bsd.port.mk is doing, not many people do...
:>
-
+
-
+
The fetch target is run. The
fetch target is responsible for making
@@ -1397,7 +1397,7 @@ lib/X11/oneko/mouse.xpm
the file in DISTDIR for future use and
proceed.
-
+
The extract target is run. It
looks for your port's distribution file (typically a gzip'd
@@ -1405,7 +1405,7 @@ lib/X11/oneko/mouse.xpm
temporary subdirectory specified by WRKDIR
(defaults to work).
-
+
The patch target is run. First,
any patches defined in PATCHFILES are
@@ -1414,24 +1414,24 @@ lib/X11/oneko/mouse.xpm
patches subdirectory), they are applied at
this time in alphabetical order.
-
+
The configure target is run. This
can do any one of many different things.
-
+
If it exists, scripts/configure is
run.
-
+
If HAS_CONFIGURE or
GNU_CONFIGURE is set,
WRKSRC/configure is
run.
-
+
If USE_IMAKE is set,
XMKMF (default: xmkmf
@@ -1439,7 +1439,7 @@ lib/X11/oneko/mouse.xpm
-
+
The build target is run. This is
responsible for descending into the port's private working
@@ -1449,7 +1449,7 @@ lib/X11/oneko/mouse.xpm
be used.
-
+
The above are the default actions. In addition, you can define
targets
pre-something or
@@ -1457,7 +1457,7 @@ lib/X11/oneko/mouse.xpm
or put scripts with those names, in the scripts
subdirectory, and they will be run before or after the default
actions are done.
-
+
For example, if you have a post-extract
target defined in your Makefile, and a file
pre-build in the scripts
@@ -1468,7 +1468,7 @@ lib/X11/oneko/mouse.xpm
Makefile targets if the actions are simple
enough, because it will be easier for someone to figure out what
kind of non-default action the port requires.
-
+
The default actions are done by the
bsd.port.mk targets
do-something.
@@ -1488,22 +1488,22 @@ lib/X11/oneko/mouse.xpm
do-extract, but never ever touch
extract!
-
+
Now that you understand what goes on when the user types
make, let us go through the recommended steps to
create the perfect port.
-
+
Getting the original sources
-
+
Get the original sources (normally) as a compressed tarball
(foo.tar.gz or
foo.tar.Z) and copy
it into DISTDIR. Always use
mainstream sources when and where you
can.
-
+
If you cannot find a ftp/http site that is well-connected to the
net, or can only find sites that have irritatingly non-standard
formats, you might want to put a copy on a reliable ftp or http
@@ -1519,7 +1519,7 @@ lib/X11/oneko/mouse.xpm
as the last resort. Please refer to this location as
MASTER_SITE_LOCAL. Send mail to the &a.ports;if
you are not sure what to do.
-
+
If your port's distfile changes all the time for no good reason,
consider putting the distfile in your home page and listing it as
the first MASTER_SITES. This will prevent users
@@ -1528,7 +1528,7 @@ lib/X11/oneko/mouse.xpm
there is only one master site for the port, it is recommended that
you house a backup at your site and list it as the second
MASTER_SITES.
-
+
If your port requires some additional `patches' that are
available on the Internet, fetch them too and put them in
DISTDIR. Do not worry if they come from a site
@@ -1536,10 +1536,10 @@ lib/X11/oneko/mouse.xpm
handle these situations (see the description of PATCHFILES below).
-
+
Modifying the port
-
+
Unpack a copy of the tarball in a private directory and make
whatever changes are necessary to get the port to compile properly
under the current version of FreeBSD. Keep careful
@@ -1547,14 +1547,14 @@ lib/X11/oneko/mouse.xpm
the process shortly. Everything, including the deletion, addition
or modification of files should be doable using an automated script
or patch file when your port is finished.
-
+
If your port requires significant user interaction/customization
to compile or install, you should take a look at one of Larry Wall's
classic Configure scripts and perhaps do
something similar yourself. The goal of the new ports collection is
to make each port as “plug-and-play” as possible for the
end-user while using a minimum of disk space.
-
+
Unless explicitly stated, patch files, scripts, and other
files you have created and contributed to the FreeBSD ports
@@ -1562,10 +1562,10 @@ lib/X11/oneko/mouse.xpm
conditions.
-
+
Patching
-
+
In the preparation of the port, files that have been added or
changed can be picked up with a recursive diff for later feeding to
patch. Each set of patches you wish to apply should be collected
@@ -1584,10 +1584,10 @@ lib/X11/oneko/mouse.xpm
patch-ab both changing
WRKSRC/foobar.c).
-
+
Configuring
-
+
Include any additional customization commands to your
configure script and save it in the
scripts subdirectory. As mentioned above, you
@@ -1595,10 +1595,10 @@ lib/X11/oneko/mouse.xpm
scripts with the name pre-configure or
post-configure.
-
+
Handling user input
-
+
If your port requires user input to build, configure or install,
then set IS_INTERACTIVE in your Makefile. This
will allow “overnight builds” to skip your port if the
@@ -1614,23 +1614,23 @@ lib/X11/oneko/mouse.xpm
packages for CD-ROMs and ftp.
-
+
Configuring the Makefile
-
+
Configuring the Makefile is pretty simple, and again we suggest
that you look at existing examples before starting. Also, there is a
sample Makefile in this
handbook, so take a look and please follow the ordering of variables
and sections in that template to make your port easier for others to
read.
-
+
Now, consider the following problems in sequence as you design
your new Makefile:
-
+
The original source
-
+
Does it live in DISTDIR as a standard gzip'd
tarball? If so, you can go on to the next step. If not, you should
look at overriding any of the EXTRACT_CMD,
@@ -1641,15 +1641,15 @@ lib/X11/oneko/mouse.xpm
file is. (The most common case is
EXTRACT_SUFX=.tar.Z, when the tarball is
condensed by regular compress, not gzip.)
-
+
In the worst case, you can simply create your own
do-extract target to override the default,
though this should be rarely, if ever, necessary.
-
+
DISTNAME
-
+
You should set DISTNAME to be the base name
of your port. The default rules expect the distribution file list
(DISTFILES) to be named
@@ -1657,12 +1657,12 @@ lib/X11/oneko/mouse.xpm
it is a normal tarball, is going to be something like
foozolix-1.0.tar.gz for a setting of
DISTNAME=foozolix-1.0.
-
+
The default rules also expect the tarball(s) to extract into a
subdirectory called
work/DISTNAME, e.g.
work/foozolix-1.0/.
-
+
All this behavior can be overridden, of course; it simply
represents the most common time-saving defaults. For a port
requiring multiple distribution files, simply set
@@ -1673,20 +1673,20 @@ lib/X11/oneko/mouse.xpm
and the rest will be just left in DISTDIR for
later use.
-
+
PKGNAME
-
+
If DISTNAME does not conform to our guidelines for a good package
name, you should set the PKGNAME
variable to something better. See the abovementioned guidelines for
more details.
-
+
CATEGORIES
-
+
When a package is created, it is put under
/usr/ports/packages/All and links are made from
one or more subdirectories of
@@ -1716,25 +1716,25 @@ lib/X11/oneko/mouse.xpm
mistype the category name, so be careful!
-
+
MASTER_SITES
-
+
Record the directory part of the ftp/http-URL pointing at the
original tarball in MASTER_SITES. Do not forget
the trailing slash (/)!
-
+
The make macros will try to use this
specification for grabbing the distribution file with
FETCH if they cannot find it already on the
system.
-
+
It is recommended that you put multiple sites on this list,
preferably from different continents. This will safeguard against
wide-area network problems, and we are even planning to add support
for automatically determining the closest master site and fetching
from there!
-
+
If the original tarball is part of one of the following popular
archives: X-contrib, GNU, Perl CPAN, TeX CTAN, or Linux Sunsite, you
refer to those sites in an easy compact form using
@@ -1749,33 +1749,33 @@ lib/X11/oneko/mouse.xpm
MASTER_SITES= ${MASTER_SITE_XCONTRIB}
MASTER_SITE_SUBDIR= applications
-
+
The user can also set the MASTER_SITE_*
variables in /etc/make.conf to override our
choices, and use their favorite mirrors of these popular archives
instead.
-
+
PATCHFILES
-
+
If your port requires some additional patches that are available
by ftp or http, set PATCHFILES to the names of
the files and PATCH_SITES to the URL of the
directory that contains them (the format is the same as
MASTER_SITES).
-
+
If the patch is not relative to the top of the source tree
(i.e., WKRSRC) because it contains some extra
pathnames, set PATCH_DIST_STRIP accordingly. For
instance, if all the pathnames in the patch have an extra
foozolix-1.0/ in front of the filenames, then set
PATCH_DIST_STRIP=-p1.
-
+
Do not worry if the patches are compressed, they will be
decompressed automatically if the filenames end with
.gz or .Z.
-
+
If the patch is distributed with some other files, such as
documentation, in a gzip'd tarball, you cannot just use
PATCHFILES. If that is the case, add the name
@@ -1797,30 +1797,30 @@ MASTER_SITE_SUBDIR= applications
target.
-
+
MAINTAINER
-
+
Set your mail-address here. Please. :)
-
+
For detailed description of the responsibility of maintainers,
refer to MAINTAINER on
Makefiles section.
-
+
Dependencies
-
+
Many ports depend on other ports. There are five variables that
you can use to ensure that all the required bits will be on the
user's machine. There are also some pre-supported dependency
variables for common cases, plus a few more to control the behaviour
of dependencies.
-
+
LIB_DEPENDS
-
+
This variable specifies the shared libraries this port depends
on. It is a list of
lib:dir:target
@@ -1842,7 +1842,7 @@ MASTER_SITE_SUBDIR= applications
to ldconfig -r | grep -wF. There shall be no
regular expressions in this variable.
-
+
The dependency is checked twice, once from within the
extract target and then from within the
install target. Also, the name of the
@@ -1850,10 +1850,10 @@ MASTER_SITE_SUBDIR= applications
pkg_add will automatically install it if it is
not on the user's system.
-
+
RUN_DEPENDS
-
+
This variable specifies executables or files this port depends
on during run-time. It is a list of
path:dir:target
@@ -1869,11 +1869,11 @@ MASTER_SITE_SUBDIR= applications
path.For example,
-
+
RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
wish8.0:${PORTSDIR}/x11-toolkits/tk80
-
+
will check if the file or directory
/usr/local/etc/innd exists, and build and
install it from the news/inn subdirectory of
@@ -1882,14 +1882,14 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
path, and descend into the x11-toolkits/tk80
subdirectory of your ports tree to build and install it if it is
not found.
-
+
In this case, innd is actually an
executable; if an executable is in a place that is not expected
to be in a normal user's search path, you should use the full
pathname.
-
+
The dependency is checked from within the
install target. Also, the name of the
dependency is put in to the package so that
@@ -1898,10 +1898,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
part can be omitted if it is the same
DEPENDS_TARGET.
-
+
BUILD_DEPENDS
-
+
This variable specifies executables or files this port
requires to build. Like RUN_DEPENDS, it is a
list of
@@ -1920,10 +1920,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
the same as DEPENDS_TARGET
-
+
FETCH_DEPENDS
-
+
This variable specifies executables or files this port
requires to fetch. Like the previous two, it is a list of
path:dir:target
@@ -1932,16 +1932,16 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
executable called ncftp2, and descend into the
net/ncftp2 subdirectory of your ports tree to
build and install it if it is not found.
-
+
The dependency is checked from within the
fetch target. The
target part can be omitted if it is the
same as DEPENDS_TARGET.
-
+
DEPENDS
-
+
If there is a dependency that does not fall into either of the
above four categories, or your port requires to have the source of
the other port extracted in addition to having them installed,
@@ -1951,10 +1951,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
target part can be omitted if it is the
same as DEPENDS_TARGET.
-
+
Common dependency variables
-
+
Define USE_XLIB=yes if your port requires
the X Window System to be installed (it is implied by
USE_IMAKE). Define
@@ -1968,10 +1968,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
some versions of FreeBSD has perl5 as part of the base system
while others do not.)
-
+
Notes on dependencies
-
+
As mentioned above, the default target to call when a
dependency is required is DEPENDS_TARGET.
It defaults to install. This is a user
@@ -2009,10 +2009,10 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
intention will be clear.
-
+
Building mechanisms
-
+
If your package uses GNU make, set
USE_GMAKE=yes. If your package uses
configure, set
@@ -2030,7 +2030,7 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
GNU_CONFIGURE, and will cause
autoconf to be run before
configure.
-
+
If your package is an X application that creates
Makefiles from Imakefiles
using imake, then set
@@ -2043,7 +2043,7 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
NO_INSTALL_MANPAGES=yes should be set. In
addition, the author of the original port should be shot. :>
-
+
If your port's source Makefile has
something else than all as the main build
target, set ALL_TARGET accordingly. Same goes
@@ -2051,23 +2051,23 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
INSTALL_TARGET.
-
+
Special considerations
-
+
There are some more things you have to take into account when you
create a port. This section explains the most common of those.ldconfig
-
+
If your port installs a shared library, add a
post-install target to your
Makefile that runs ${LDCONFIG}
-m on the directory where the new library is installed
(usually PREFIX/lib) to
register it into the shared library cache.
-
+
Also, add a matching @exec /sbin/ldconfig -m
and @unexec /sbin/ldconfig -R pair to your
pkg/PLIST file so that a user who installed the
@@ -2080,7 +2080,7 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
lib/libtvl80.so.1
@exec /sbin/ldconfig -m %D/lib
@unexec /sbin/ldconfig -R
-
+
Never, ever, ever add a line that says
ldconfig without any arguments to your
Makefile or pkg/PLIST.
@@ -2093,10 +2093,10 @@ lib/libtvl80.so.1
(not necessarily in that order…)
-
+
ELF support
-
+
Since FreeBSD is moving to ELF shortly after 3.0-RELEASE, we need
to convert many ports that build shared libraries to support ELF.
Complicating this task is that a 3.0 system can run as both ELF and
@@ -2110,7 +2110,7 @@ lib/libtvl80.so.1
Moving a.out libraries out of the way
-
+
A.out libraries should be moved out of
/usr/local/lib and similar to an
aout subdirectory. (If you do not move them out
@@ -2121,10 +2121,10 @@ lib/libtvl80.so.1
only move a.out libs so it is safe to call it on a system with both
ELF and a.out libs in the standard directories.
-
+
Format
-
+
The ports tree will build packages in the format the machine is
in. This means a.out for 2.2 and a.out or ELF for 3.0 depending on
what `objformat` returns. Also, once users move
@@ -2139,10 +2139,10 @@ lib/libtvl80.so.1
system.
-
+
PORTOBJFORMAT
-
+
bsd.port.mk will set
PORTOBJFORMAT to aout or
elf and export it in the environments
@@ -2155,26 +2155,26 @@ lib/libtvl80.so.1
The variable is set using this line in
bsd.port.mk:
-
+
PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
-
+
Ports' make processes should use this variable to decide what to
do. However, if the port's configure script
already automatically detects an ELF system, it is not necessary to
refer to PORTOBJFORMAT.
-
+
Building shared libraries
-
+
The following are differences in handling shared libraries for
a.out and ELF.
-
+
Shared library versions
-
+
An ELF shared library should be called
libfoo.so.M
where M is the single version number,
@@ -2188,10 +2188,10 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aoutlibfoo.so.N.
-
+
Linker command lines
-
+
Assuming cc -shared is used rather than
ld directly, the only difference is that you
need to add
@@ -2199,7 +2199,7 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
-
+
You need to install a symlink from
libfoo.so to
libfoo.so.N to make
@@ -2209,20 +2209,20 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aoutPORTOBJFORMAT.
-
+
LIB_DEPENDS
-
+
All port Makefiles are edited to remove minor numbers from
LIB_DEPENDS, and also to have the regexp support
removed. (E.g., foo\\.1\\.\\(33|40\\) becomes
foo.2.) They will be matched using grep
-wF.
-
+
PLIST
-
+
PLIST should contain the short (ELF) shlib
names if the a.out minor number is zero, and the long (a.out) names
otherwise. bsd.port.mk will automatically add
@@ -2240,18 +2240,18 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aoutPLIST mentioned in the previous
paragraph.
-
+
ldconfig
-
+
The ldconfig line in Makefiles should
read:
-
+
${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ....In PLIST it should read;
-
+
@exec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -m ...
@unexec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -R
@@ -2261,10 +2261,10 @@ ${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ....
default format of the system.
-
+
MASTERDIR
-
+
If your port needs to build slightly different versions of
packages by having a variable (for instance, resolution, or paper
size) take different values, create one subdirectory per package to
@@ -2279,7 +2279,7 @@ ${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ....
This will be best demonstrated by an example. This is part of
japanese/xdvi300/Makefile;
-
+
PKGNAME= ja-xdvi${RESOLUTION}-17
:
@@ -2287,8 +2287,8 @@ PKGNAME= ja-xdvi${RESOLUTION}-17
RESOLUTION?= 300
.if ${RESOLUTION} != 118 && ${RESOLUTION} != 240 && \
${RESOLUTION} != 300 && ${RESOLUTION} != 400
- @${ECHO} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\""
- @${ECHO} "Possible values are: 118, 240, 300 (default) and 400."
+ @${ECHO} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\""
+ @${ECHO} "Possible values are: 118, 240, 300 (default) and 400."
@${FALSE}
.endif
@@ -2317,10 +2317,10 @@ MASTERDIR= ${.CURDIR}/../xdvi300
xdvi300/Makefile and the port will be built with
resolution set to 118.
-
+
Shared library versions
-
+
First, please read our policy on
shared library versioning to understand what to do with
shared library versions in general. Do not blindly assume software
@@ -2351,10 +2351,10 @@ MASTERDIR= ${.CURDIR}/../xdvi300
libfoo4.so.1.0 so both version 3.2 and 4.0 can be
linked from other ports.
-
+
Manpages
-
+
The MAN[1-9LN] variables will automatically add
any manpages to pkg/PLIST (this means you must
not list manpages in the
@@ -2363,7 +2363,7 @@ MASTERDIR= ${.CURDIR}/../xdvi300
makes the install stage automatically compress or uncompress manpages
depending on the setting of NOMANCOMPRESS in
/etc/make.conf.
-
+
If your port tries to install multiple names for manpages using
symlinks or hardlinks, you must use the MLINKS
variable to identify these. The link installed by your port will
@@ -2371,7 +2371,7 @@ MASTERDIR= ${.CURDIR}/../xdvi300
to make sure it points to the correct file. Any manpages
listed in MLINKS must not be listed in the
PLIST.
-
+
To specify whether the manpages are compressed upon installation,
use the MANCOMPRESSED variable. This variable can
take three values, yes, no and
@@ -2401,9 +2401,9 @@ MASTERDIR= ${.CURDIR}/../xdvi300
name of the languages to MANLANG. The value of
this variable defaults to "" (i.e., English
only).
-
+
Here is an example that puts it all together.
-
+
MAN1= foo.1
MAN3= bar.3
@@ -2414,7 +2414,7 @@ MAN3PREFIX= ${PREFIX}/share/foobar
MANCOMPRESSED= yesThis states that six files are installed by this port;
-
+
${PREFIX}/man/man1/foo.1.gz
${PREFIX}/man/ja/man1/foo.1.gz
@@ -2427,12 +2427,12 @@ ${PREFIX}/man/ja/man4/baz.4.gz
may or may-not be installed by your port. Regardless, a
symlink will be made to join the foo(1) manpage and
alt-name(8) manpage.
-
+
Ports that require Motif
-
+
There are many programs that require a Motif library (available
from several commercial vendors, while there is a free clone reported
to be able to run many applications in
@@ -2442,18 +2442,18 @@ ${PREFIX}/man/ja/man4/baz.4.gz
handling ports that require Motif in a way that we can easily compile
binaries linked either dynamically (for people who are compiling from
the port) or statically (for people who distribute packages).
-
+
REQUIRES_MOTIF
-
+
If your port requires Motif, define this variable in the
Makefile. This will prevent people who do not own a copy of Motif
from even attempting to build it.
-
+
MOTIFLIB
-
+
This variable will be set by bsd.port.mk to
be the appropriate reference to the Motif library. Please patch the
source to use this wherever the Motif library is referenced in the
@@ -2461,7 +2461,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz
Imakefile.There are two common cases:
-
+
If the port refers to the Motif library as
@@ -2469,7 +2469,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz
Imakefile, simply substitute
${MOTIFLIB} for it.
-
+
If the port uses XmClientLibs in its
Imakefile, change it to
@@ -2477,17 +2477,17 @@ ${PREFIX}/man/ja/man4/baz.4.gz
${XLIB}.
-
+
Note that MOTIFLIB (usually) expands to
-L/usr/X11R6/lib -lXm or
/usr/X11R6/lib/libXm.a, so there is no need to
add -L or -l in front.
-
+
X11 fonts
-
+
If your port installs fonts for the X Window system, put them in
X11BASE/lib/X11/fonts/local.
This directory is new to XFree86 release 3.3.3. If it does not exist,
@@ -2495,10 +2495,10 @@ ${PREFIX}/man/ja/man4/baz.4.gz
their XFree86 to 3.3.3 or newer, or at least add this directory to the
font path in /etc/XF86Config.
-
+
Info files
-
+
The new version of texinfo (included in 2.2.2-RELEASE and onwards)
contains a utility called install-info to add and
delete entries to the dir file. If your port
@@ -2510,7 +2510,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz
beautiful listing, so please bear with me!First, this is what you (as a porter) need to know
-
+
&prompt.user; install-info --help
install-info [OPTION]... [INFO-FILE [DIR-FILE]]
Install INFO-FILE in the Info directory file DIR-FILE.
@@ -2522,24 +2522,24 @@ Options:
--entry=TEXT Insert TEXT as an Info directory entry.
:
--section=SEC Put this file's entries in section SEC of the directory. :
-
+
This program will not actually install info
files; it merely inserts or deletes entries in the
dir file.
-
+
Here's a seven-step procedure to convert ports to use
install-info. I will use
editors/emacs as an example.
-
+
Look at the texinfo sources and make a patch to insert
@dircategory and @direntry
statements to files that do not have them. This is part of my
patch:
-
+
--- ./man/vip.texi.org Fri Jun 16 15:31:11 1995
+++ ./man/vip.texi Tue May 20 01:28:33 1997
@@ -2555,21 +2555,21 @@ Options:
@iftex
@finalout
:
-
+
The format should be self-explanatory. Many authors leave a
dir file in the source tree that contains all
the entries you need, so look around before you try to write your
own. Also, make sure you look into related ports and make the
section names and entry indentations consistent (we recommend that
all entry text start at the 4th tab stop).
-
+
Note that you can put only one info entry per file because
of a bug in install-info --delete that
deletes only the first entry if you specify multiple entries in
the @direntry section.
-
+
You can give the dir entries to
install-info as arguments
( and ) instead
@@ -2586,7 +2586,7 @@ Options:
PLIST of japanese/skk
for examples on how to do this).
-
+
Go back to the port directory and do a make clean;
make and verify that the info files are regenerated
@@ -2598,7 +2598,7 @@ Options:
Makefile.in so it will descend into the
man subdirectory to rebuild the info
pages.
-
+
--- ./Makefile.in.org Mon Aug 19 21:12:19 1996
+++ ./Makefile.in Tue Apr 15 00:15:28 1997
@@ -2608,7 +2608,7 @@ Options:
# and you cannot remake them without installing Emacs first.
-SUBDIR = lib-src src
+SUBDIR = lib-src src man
-
+
# The makefiles of the directories in $SUBDIR.
SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile
--- ./man/Makefile.in.org Thu Jun 27 15:27:19 1996
@@ -2621,7 +2621,7 @@ Options:
info: $(INFO_TARGETS)
dvi: $(DVI_TARGETS)
-
+
The second hunk was necessary because the default target in
the man subdir is called
info, while the main
@@ -2631,14 +2631,14 @@ Options:
one with the same name in /usr/share/info
(that patch is not shown here).
-
+
If there is a place in the Makefile that
is installing the dir file, delete it. Your
port may not be doing it. Also, remove any commands that are
otherwise mucking around with the dir
file.
-
+
--- ./Makefile.in.org Mon Aug 19 21:12:19 1996
+++ ./Makefile.in Mon Apr 14 23:38:07 1997
@@ -2658,14 +2658,14 @@ Options:
${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \
chmod a+r ${infodir}/$$f); \
-
+
(This step is only necessary if you are modifying an existing
port.) Take a look at pkg/PLIST and delete
anything that is trying to patch up info/dir.
They may be in pkg/INSTALL or some other
file, so search extensively.
-
+
Index: pkg/PLIST
===================================================================
@@ -2685,7 +2685,7 @@ diff -u -r1.15 PLIST
info/cl-1
info/cl-2
-
+
Add a post-install target to the
Makefile to call
@@ -2694,7 +2694,7 @@ diff -u -r1.15 PLIST
dir file yourself;
install-info automatically creates this
file if it does not exist.)
-
+
Index: Makefile
===================================================================
@@ -2714,13 +2714,13 @@ diff -u -r1.26 Makefile
.include <bsd.port.mk>
-
+
Edit PLIST and add equivalent
@exec statements and also
@unexec for
pkg_delete.
-
+
Index: pkg/PLIST
===================================================================
@@ -2755,7 +2755,7 @@ diff -u -r1.15 PLIST
the dir file.
-
+
Test and admire your
work. :). Check the
@@ -2763,17 +2763,17 @@ diff -u -r1.15 PLIST
-
+
The pkg/ subdirectory
-
+
There are some tricks we have not mentioned yet about the
pkg/ subdirectory that come in handy
sometimes.
-
+
MESSAGE
-
+
If you need to display a message to the installer, you may place
the message in pkg/MESSAGE. This capability is
often useful to display additional installation steps to be taken
@@ -2788,10 +2788,10 @@ diff -u -r1.15 PLIST
post-install target yourself.
-
+
INSTALL
-
+
If your port needs to execute commands when the binary package
is installed with pkg_add you can do this via the
pkg/INSTALL script. This script will
@@ -2804,7 +2804,7 @@ diff -u -r1.15 PLIST
environmental variable will be set to the package installation
directory. See &man.pkg.add.1; for
additional information.
-
+
This script is not run automatically if you install the port
with make install. If you are depending on it
@@ -2812,17 +2812,17 @@ diff -u -r1.15 PLIST
Makefile.
-
+
REQ
-
+
If your port needs to determine if it should install or not, you
can create a pkg/REQ “requirements”
script. It will be invoked automatically at
installation/deinstallation time to determine whether or not
installation/deinstallation should proceed.
-
+
Changing PLIST based on make
variables
@@ -2847,7 +2847,7 @@ diff -u -r1.15 PLIST
%%VAR%%' will be
substituted with VALUE in the
PLIST.
-
+
For instance, if you have a port that installs many files in a
version-specific subdirectory, you can put something like
@@ -2860,7 +2860,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
in PLIST. That way, when you upgrade the port,
you will not have to change dozens (or in some cases, hundreds) of
lines in the PLIST.
-
+
This substitution (as well as addition of any man pages) will be done between
the do-install and
@@ -2874,11 +2874,11 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
post-install to a file named
TMPPLIST.
-
+
Changing the names of files in the
pkg subdirectory
-
+
All the filenames in the pkg subdirectory
are defined using variables so you can change them in your
Makefile if need be. This is especially useful
@@ -2899,38 +2899,38 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
Default value
-
+
COMMENT${PKGDIR}/DESCR
-
+
DESCR${PKGDIR}/DESCR
-
+
PLIST${PKGDIR}/PLIST
-
+
PKGINSTALL${PKGDIR}/PKGINSTALL
-
+
PKGDEINSTALL${PKGDIR}/PKGDEINSTALL
-
+
PKGREQ${PKGDIR}/REQ
-
+
PKGMESSAGE${PKGDIR}/MESSAGE
@@ -2938,7 +2938,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
-
+
Please change these variables rather than overriding
PKG_ARGS. If you change
PKG_ARGS, those files will not correctly be
@@ -2946,10 +2946,10 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
port.
-
+
Licensing Problems
-
+
Some software packages have restrictive licenses or can be in
violation to the law (PKP's patent on public key crypto, ITAR (export
of crypto software) to name just two of them). What we can do with
@@ -2963,10 +2963,10 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
source or compiled binaries either via ftp or CD-ROM. If in doubt,
please contact the &a.ports;.
-
+
There are two variables you can set in the Makefile to handle the
situations that arise frequently:
-
+
If the port has a “do not sell for profit” type of
@@ -2975,7 +2975,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
into the CD-ROM come release time. The distfile and package will
still be available via ftp.
-
+
If the resulting package needs to be built uniquely for each
site, or the resulting binary package cannot be distributed due to
@@ -2984,7 +2984,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
will not go on the ftp site, nor into the CD-ROM come release time.
The distfile will still be included on both however.
-
+
If the port has legal restrictions on who can use it (e.g.,
crypto stuff) or has a “no commercial use” license,
@@ -2993,34 +2993,34 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
will not be available even from our ftp sites.
-
+
The GNU General Public License (GPL), both version 1 and 2,
should not be a problem for ports.
-
+
If you are a committer, make sure you update the
ports/LEGAL file too.
-
+
Upgrading
-
+
When you notice that a port is out of date compared to the latest
version from the original authors, first make sure you have the latest
port. You can find them in the
ports/ports-current directory of the ftp mirror
sites. You may also use CVSup to keep your whole ports collection
up-to-date, as described in .
-
+
The next step is to send a mail to the maintainer, if one is
listed in the port's Makefile. That person may
already be working on an upgrade, or have a reason to not upgrade the
port right now (because of, for example, stability problems of the new
version).
-
+
If the maintainer asks you to do the upgrade or there is not any
such person to begin with, please make the upgrade and send the
recursive diff (either unified or context diff is fine, but port
@@ -3037,14 +3037,14 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
and uuencode it; otherwise, just include it in as is in the PR.
- Once again, please use &man.diff.1; and not &man.shar.1; to send
+ Once again, please use &man.diff.1; and not &man.shar.1; to send
updates to existing ports!
-
+
Do's and Dont's
-
+
Here is a list of common do's and dont's that you encounter during
the porting process.You should check your own port against this list,
but you can also check ports in the PR database that others have
@@ -3053,10 +3053,10 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
Commentary. Checking ports in the PR database will both make
it faster for us to commit them, and prove that you know what you are
doing.
-
+
Strip Binaries
-
+
Do strip binaries. If the original source already strips the
binaries, fine; otherwise you should add a
post-install rule to to it yourself. Here is an
@@ -3070,45 +3070,45 @@ post-install:
check whether the binary is stripped or not. If it does not say
not stripped, it is stripped.
-
+
INSTALL_* macros
-
+
Do use the macros provided in bsd.port.mk
to ensure correct modes and ownership of files in your own
*-install targets. They are:
-
+
INSTALL_PROGRAM is a command to install
binary executables.
-
+
INSTALL_SCRIPT is a command to install
executable scripts.
-
+
INSTALL_DATA is a command to install
sharable data.
-
+
INSTALL_MAN is a command to install
manpages and other documentation (it does not compress
anything).
-
+
These are basically the install command with
all the appropriate flags. See below for an example on how to use
them.
-
+
WRKDIR
-
+
Do not write anything to files outside
WRKDIR. WRKDIR is the only
place that is guaranteed to be writable during the port build (see
@@ -3118,25 +3118,25 @@ post-install:
linkend="porting-pkgsubdir">redefining a variable, not by
writing over it.
-
+
WRKDIRPREFIX
-
+
Make sure your port honors WRKDIRPREFIX.
Most ports do not have to worry about this. In particular, if you
are referring to a WRKDIR of another port, note
that the correct location is
WRKDIRPREFIXPORTSDIR/subdir/name/work not PORTSDIR/subdir/name/work or .CURDIR/../../subdir/name/work or some such.
-
+
Also, if you are defining WRKDIR yourself,
make sure you prepend
${WKRDIRPREFIX}${.CURDIR} in the
front.
-
+
Differentiating operating systems and OS versions
-
+
You may come across code that needs modifications or conditional
compilation based upon what version of UNIX it is running under. If
you need to make such changes to the code for conditional
@@ -3144,63 +3144,63 @@ post-install:
so that we can back-port code to FreeBSD 1.x systems and cross-port
to other BSD systems such as 4.4BSD from CSRG, BSD/386, 386BSD,
NetBSD, and OpenBSD.
-
+
The preferred way to tell 4.3BSD/Reno (1990) and newer versions
of the BSD code apart is by using the BSD macro
defined in <sys/param.h>. Hopefully that
file is already included; if not, add the code:
-
+
#if (defined(__unix__) || defined(unix)) && !defined(USG)
#include <sys/param.h>
#endif
-
+
to the proper place in the .c file. We
believe that every system that defines these two symbols has
sys/param.h. If you find a system that
does not, we would like to know. Please send mail to the
&a.ports;.
-
+
Another way is to use the GNU Autoconf style of doing
this:
-
+
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
-
+
Do not forget to add -DHAVE_SYS_PARAM_H to the
CFLAGS in the Makefile for
this method.
-
+
Once you have sys/param.h included, you may
use:
-
+
#if (defined(BSD) && (BSD >= 199103))
-
+
to detect if the code is being compiled on a 4.3 Net2 code base
or newer (e.g. FreeBSD 1.x, 4.3/Reno, NetBSD 0.9, 386BSD, BSD/386
1.1 and below).
-
+
Use:
-
+
#if (defined(BSD) && (BSD >= 199306))
-
+
to detect if the code is being compiled on a 4.4 code base or
newer (e.g. FreeBSD 2.x, 4.4, NetBSD 1.0, BSD/386 2.0 or
above).
-
+
The value of the BSD macro is
199506 for the 4.4BSD-Lite2 code base. This is
stated for informational purposes only. It should not be used to
distinguish between versions of FreeBSD based only on 4.4-Lite vs.
versions that have merged in changes from 4.4-Lite2. The
__FreeBSD__ macro should be used instead.
-
+
Use sparingly:
-
+
__FreeBSD__ is defined in all versions of
@@ -3210,14 +3210,14 @@ post-install:
strerror() are Berkeleyisms, not FreeBSD
changes.
-
+
In FreeBSD 2.x, __FreeBSD__ is defined to
be 2. In earlier versions, it is
1. Later versions will bump it to match
their major version number.
-
+
If you need to tell the difference between a FreeBSD 1.x
system and a FreeBSD 2.x or 3.x system, usually the right answer
@@ -3228,7 +3228,7 @@ post-install:
__FreeBSD__ > 1 to detect a FreeBSD 2.x and later
system. If you need more granularity in detecting FreeBSD
systems since 2.0-RELEASE you can use the following:
-
+
#if __FreeBSD__ >= 2
#include <osreldate.h>
@@ -3245,83 +3245,83 @@ post-install:
__FreeBSD_version
-
+
2.0-RELEASE119411
-
+
2.1-CURRENTs199501, 199503
-
+
2.0.5-RELEASE199504
-
+
2.2-CURRENT before 2.1199508
-
+
2.1.0-RELEASE199511
-
+
2.2-CURRENT before 2.1.5199512
-
+
2.1.5-RELEASE199607
-
+
2.2-CURRENT before 2.1.6199608
-
+
2.1.6-RELEASE199612
-
+
2.1.7-RELEASE199612
-
+
2.2-RELEASE220000
-
+
2.2.1-RELEASE220000 (no change)
-
+
2.2-STABLE after 2.2.1-RELEASE220000 (no change)
-
+
2.2-STABLE after texinfo-3.9221001
-
+
2.2-STABLE after top221002
-
+
2.2.2-RELEASE222000
@@ -3331,105 +3331,105 @@ post-install:
2.2-STABLE after 2.2.2-RELEASE222001
-
+
2.2.5-RELEASE225000
-
+
2.2-STABLE after 2.2.5-RELEASE225001
-
+
2.2-STABLE after ldconfig -R merge225002
-
+
2.2.6-RELEASE226000
-
+
2.2.7-RELEASE227000
-
+
2.2-STABLE after 2.2.7-RELEASE227001
-
+
2.2-STABLE after semctl(2) change227002
-
+
2.2.8-RELEASE228000
-
+
2.2-STABLE after 2.2.8-RELEASE228001
-
+
3.0-CURRENT before mount(2) change300000
-
+
3.0-CURRENT after mount(2) change300001
-
+
3.0-CURRENT after semctl(2) change300002
-
+
3.0-CURRENT after ioctl arg changes300003
-
+
3.0-CURRENT after ELF conversion300004
-
+
3.0-RELEASE300005
-
+
3.0-CURRENT after 3.0-RELEASE300006
-
+
3.0-STABLE after 3/4 branch300007
-
+
3.1-RELEASE310000
-
+
3.1-STABLE after 3.1-RELEASE310001
- 3.1-STABLE after C++ constructor/destructor order
- change
+ 3.1-STABLE after C++ constructor/destructor order
+ change310002
@@ -3445,7 +3445,7 @@ post-install:
3.2-STABLE after binary-incompatible IPFW and
- socket changes
+ socket changes
320002
@@ -3453,21 +3453,21 @@ post-install:
3.3-RELEASE330000
-
+
4.0-CURRENT after 3/4 branch400000
- 4.0-CURRENT after change in dynamic linker
- handling
+ 4.0-CURRENT after change in dynamic linker
+ handling400001
- 4.0-CURRENT after C++ constructor/destructor
- order change
+ 4.0-CURRENT after C++ constructor/destructor
+ order change400002
@@ -3478,14 +3478,14 @@ post-install:
4.0-CURRENT after __deregister_frame_info dynamic linker
- bug fix
- (also 4.0-CURRENT after EGCS 1.1.2 integration)
+ bug fix (also 4.0-CURRENT after EGCS 1.1.2 integration)
+
4000044.0-CURRENT after suser(9) API change
- (also 4.0-CURRENT after newbus)
+ (also 4.0-CURRENT after newbus)
400005
@@ -3495,21 +3495,21 @@ post-install:
- 4.0-CURRENT after the addition of so_cred for
- socket level credentials
+ 4.0-CURRENT after the addition of so_cred for
+ socket level credentials400007
- 4.0-CURRENT after the addition of a poll syscall
- wrapper to libc_r
+ 4.0-CURRENT after the addition of a poll syscall
+ wrapper to libc_r4000084.0-CURRENT after the change of the kernel's
dev_t type to struct
- spacinfo pointer
+ specinfo pointer
400009
@@ -3517,7 +3517,7 @@ post-install:
-
+
Note that 2.2-STABLE sometimes identifies itself as
“2.2.5-STABLE” after the 2.2.5-RELEASE. The pattern
@@ -3529,13 +3529,13 @@ post-install:
worry about old -CURRENTs; they are listed here just for your
reference.
-
+
In the hundreds of ports that have been done, there have only
been one or two cases where __FreeBSD__ should
have been used. Just because an earlier port screwed up and used it
in the wrong place does not mean you should do so too.
-
+
Writing something after
bsd.port.mk
@@ -3551,7 +3551,7 @@ post-install:
pre.mk/post.mk pair or
bsd.port.mk only; do not mix these two.
-
+
bsd.port.pre.mk only defines a few
variables, which can be used in tests in the
Makefile, bsd.port.post.mk
@@ -3570,53 +3570,53 @@ post-install:
Description
-
+
ARCHThe architecture as returned by uname
-m (e.g., i386)
-
+
OPSYSThe operating system type, as returned by
uname -s (e.g.,
FreeBSD)
-
+
OSRELThe release version of the operating system (e.g.,
2.1.5 or
2.2.7)
-
+
OSVERSIONThe numeric version of the operating system, same as
__FreeBSD_version.
-
+
PORTOBJFORMATThe object format of the system
(aout or elf
-
+
LOCALBASEThe base of the “local” tree (e.g.,
/usr/local/)
-
+
X11BASEThe base of the “X11” tree (e.g.,
/usr/X11R6)
-
+
PREFIXWhere the port installs itself (see
-
+
If you have to define the variables
USE_IMAKE, USE_X_PREFIX, or
MASTERDIR, do so before including
bsd.port.pre.mk.
-
+
Here are some examples of things you can write after
bsd.port.pre.mk;
-
+
# no need to compile lang/perl5 if perl5 is already in system
.if ${OSVERSION} > 300003
@@ -3656,23 +3656,23 @@ post-install:
${LN} -sf liblinpack.so.1.0 ${PREFIX}/lib/liblinpack.so
.endif
-
+
Install additional documentation
-
+
If your software has some documentation other than the standard
man and info pages that you think is useful for the user, install it
under PREFIX/share/doc.
This can be done, like the previous item, in the
post-install target.
-
+
Create a new directory for your port. The directory name should
reflect what the port is. This usually means
PKGNAME minus the version part. However, if you
think the user might want different versions of the port to be
installed at the same time, you can use the whole
PKGNAME.
-
+
Make the installation dependent to the variable
NOPORTDOCS so that users can disable it in
/etc/make.conf, like this:
@@ -3683,12 +3683,12 @@ post-install:
${MKDIR}${PREFIX}/share/doc/xv
${INSTALL_MAN} ${WRKSRC}/docs/xvdocs.ps ${PREFIX}/share/doc/xv
.endif
-
+
Do not forget to add them to pkg/PLIST too!
(Do not worry about NOPORTDOCS here; there is
currently no way for the packages to read variables from
/etc/make.conf.)
-
+
Also you can use the pkg/MESSAGE file to
display messages upon installation. See the using
@@ -3700,10 +3700,10 @@ post-install:
pkg/PLIST).
-
+
DIST_SUBDIR
-
+
Do not let your port clutter
/usr/ports/distfiles. If your port requires a
lot of files to be fetched, or contains a file that has a name that
@@ -3716,22 +3716,22 @@ post-install:
/usr/ports/distfiles/DIST_SUBDIR,
and in effect puts everything that is required for your port into
that subdirectory.
-
+
It will also look at the subdirectory with the same name on the
backup master site at ftp.FreeBSD.org.
(Setting DISTDIR explicitly in your
Makefile will not accomplish this, so please use
DIST_SUBDIR.)
-
+
This does not affect the MASTER_SITES you
define in your Makefile.
-
+
Package information
-
+
Do include package information, i.e.
COMMENT, DESCR, and
PLIST, in pkg.
@@ -3742,10 +3742,10 @@ post-install:
NO_PACKAGE is set.
-
+
RCS strings
-
+
Do not put RCS strings in patches. CVS will mangle them when we
put the files into the ports tree, and when we check them out again,
they will come out different and the patch will fail. RCS strings
@@ -3753,10 +3753,10 @@ post-install:
typically start with $Id or
$RCS.
-
+
Recursive diff
-
+
Using the recurse () option to
diff to generate patches is fine, but please take
a look at the resulting patches to make sure you do not have any
@@ -3776,10 +3776,10 @@ post-install:
the patch. Once you are happy with the resulting diff, please split
it up into one source file per patch file.
-
+
PREFIX
-
+
Do try to make your port install relative to
PREFIX. (The value of this variable will be set
to LOCALBASE (default
@@ -3787,7 +3787,7 @@ post-install:
USE_X_PREFIX or USE_IMAKE is
set, in which case it will be X11BASE (default
/usr/X11R6).)
-
+
Not hard-coding /usr/local or
/usr/X11R6 anywhere in the source will make the
port much more flexible and able to cater to the needs of other
@@ -3802,12 +3802,12 @@ post-install:
Do not set USE_X_PREFIX unless your port
truly require it (i.e., it links against X libs or it needs to
reference files in X11BASE).
-
+
The variable PREFIX can be reassigned in your
Makefile or in the user's environment.
However, it is strongly discouraged for individual ports to set this
variable explicitly in the Makefiles.
-
+
Also, refer to programs/files from other ports with the
variables mentioned above, not explicit pathnames. For instance, if
your port requires a macro PAGER to be the full
@@ -3820,16 +3820,16 @@ post-install:
-DPAGER=\"${LOCALBASE}/bin/less\"
-
+
if this is an X port, instead of
-DPAGER=\"/usr/local/bin/less\". This way it will
have a better chance of working if the system administrator has
moved the whole `/usr/local' tree somewhere else.
-
+
Subdirectories
-
+
Try to let the port put things in the right subdirectories of
PREFIX. Some ports lump everything and put it in
the subdirectory with the port's name, which is incorrect. Also,
@@ -3849,10 +3849,10 @@ post-install:
PREFIX/news as a destination
for their files.
-
+
Cleaning up empty directories
-
+
Do make your ports clean up after themselves when they are
deinstalled. This is usually accomplished by adding
@dirrm lines for all directories that are
@@ -3860,7 +3860,7 @@ post-install:
before you can delete parent directories.
- :
+ :
lib/X11/oneko/pixmaps/cat.xpm
lib/X11/oneko/sounds/cat.au
:
@@ -3881,10 +3881,10 @@ lib/X11/oneko/sounds/cat.au
PREFIX/share/doc/gimp is not
empty due to other ports installing some files in there.
-
+
UIDs
-
+
If your port requires a certain user to be on the installed
system, let the pkg/INSTALL script call
pw to create it automatically. Look at
@@ -3894,11 +3894,11 @@ lib/X11/oneko/sounds/cat.au
installed a binary package as when it was compiled, then you must
choose a free UID from 50 to 99 and register it below. Look at
japanese/Wnn for an example.
-
+
Make sure you do not use a UID already used by the system or
other ports. This is the current list of UIDs between 50 and
99.
-
+
majordom:*:54:54:Majordomo Pseudo User:/usr/local/majordomo:/nonexistent
cyrus:*:60:60:the cyrus mail server:/nonexistent:/nonexistent
@@ -3919,15 +3919,15 @@ qmailp:*:84:81:QMail user:/var/qmail:/nonexistent
qmailr:*:86:82:QMail user:/var/qmail:/nonexistent
msql:*:87:87:mSQL-2 pseudo-user:/var/db/msqldb:/bin/sh
mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
-
+
Please include a notice when you submit a port (or an upgrade)
that reserves a new UID or GID in this range. This allows us to
keep the list of reserved IDs up to date.
-
+
Do things rationally
-
+
The Makefile should do things simply and
reasonably. If you can make it a couple of lines shorter or more
readable, then do so. Examples include using a make
@@ -3938,18 +3938,18 @@ mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
GNU_CONFIGURE instead of CONFIGURE_ARGS
+= --prefix=${PREFIX}.
-
+
Respect CFLAGS
-
+
The port should respect the CFLAGS variable.
If it does not, please add NO_PACKAGE=ignores
cflags to the Makefile.
-
+
Configuration files
-
+
If your port requires some configuration files in
PREFIX/etc, do
not just install them and list them in
@@ -3964,27 +3964,27 @@ mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
user has to copy and edit the file before the software can be made
to work.
-
+
Portlint
-
+
Do check your work with portlint
before you submit or commit it.
-
+
Feedback
-
+
Do send applicable changes/patches to the original
author/maintainer for inclusion in next release of the code. This
will only make your job that much easier for the next
release.
-
+
Miscellanea
-
+
The files pkg/DESCR,
pkg/COMMENT, and pkg/PLIST
should each be double-checked. If you are reviewing a port and feel
@@ -3992,44 +3992,44 @@ mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
Do not copy more copies of the GNU General Public License into
our system, please.
-
+
Please be careful to note any legal issues! Do not let us
illegally distribute software!
-
+
If you are stuck…
-
+
Do look at existing examples and the
bsd.port.mk file before asking us questions!
;)
-
+
Do ask us questions if you have any trouble! Do not just beat
your head against a wall! :)
-
+
A Sample Makefile
-
+
Here is a sample Makefile that you can use to
create a new port. Make sure you remove all the extra comments (ones
between brackets)!
-
+
It is recommended that you follow this format (ordering of
variables, empty lines between sections, etc.). This format is
designed so that the most important information is easy to locate. We
recommend that you use portlint to check the
Makefile.
-
+
[the header...just to make it easier for us to identify the ports.]
# New ports collection makefile for: xdvi
[the version required header should updated when upgrading a port.]
# Version required: pl18 [things like "1.5alpha" are fine here too]
-[this is the date when the first version of this Makefile was created.
+[this is the date when the first version of this Makefile was created.
Never change this when doing an update of the port.]
# Date created: 26 May 1995
[this is the person who did the original port to FreeBSD, in particular, the
@@ -4105,7 +4105,7 @@ pre-install:
.include <bsd.port.mk>
-
+ Automated package list creationFirst, make sure your port is almost complete, with only
@@ -4148,18 +4148,18 @@ pre-install:
Package Names
-
+
The following are the conventions you should follow in naming your
packages. This is to have our package directory easy to scan, as
there are already lots and lots of packages and users are going to
turn away if they hurt their eyes!
-
+
The package name should look like
language-name-compiled.specifics-version.numbers.
-
+
If your DISTNAME does not look like that, set
PKGNAME to something in that format.
-
+
FreeBSD strives to support the native language of its users.
@@ -4171,7 +4171,7 @@ pre-install:
zh for Chinese, ko for
Korean and de for German.
-
+
The name part should be all lowercases,
except for a really large package (with lots of programs in it).
@@ -4189,7 +4189,7 @@ pre-install:
has numbers, hyphens, or underscores in its name, you may include
them as well (like kinput2).
-
+
If the port can be built with different hardcoded defaults (usually
@@ -4198,7 +4198,7 @@ pre-install:
the compiled-in defaults (the hyphen is optional). Examples are
papersize and font units.
-
+
The version string should be a period-separated list of
integers and single lowercase alphabetics. The only exception is
@@ -4207,7 +4207,7 @@ pre-install:
minor version numbers in the software.
-
+
Here are some (real) examples on how to convert a
DISTNAME into a suitable
PKGNAME:
@@ -4221,89 +4221,89 @@ pre-install:
Reason
-
+
mule-2.2.2.mule-2.2.2No changes required
-
+
XFree86-3.1.2XFree86-3.1.2No changes required
-
+
EmiClock-1.0.2emiclock-1.0.2No uppercase names for single programs
-
+
gmod1.4gmod-1.4Need a hyphen before version numbers
-
+
xmris.4.0.2xmris-4.0.2Need a hyphen before version numbers
-
+
rdist-1.3alphardist-1.3aNo strings like alpha
allowed
-
+
es-0.9-beta1es-0.9b1No strings like beta
allowed
-
+
v3.3beta021.srctiff-3.3What the heck was that anyway?
-
+
tvtwmtvtwm-pl11Version string always required
-
+
piewmpiewm-1.0Version string always required
-
+
xvgr-2.10pl1xvgr-2.10.1pl allowed only when no
major/minor version numbers
-
+
gawk-2.15.6ja-gawk-2.15.6Japanese language version
-
+
psutils-1.13psutils-letter-1.13Papersize hardcoded at package build time
-
+
pkfontspkfonts300-1.0
@@ -4312,7 +4312,7 @@ pre-install:
-
+
If there is absolutely no trace of version information in the
original source and it is unlikely that the original author will ever
release another version, just set the version string to
@@ -4320,10 +4320,10 @@ pre-install:
the original author or use the date string
(yy.mm.dd) as the version.
-
+
Categories
-
+
As you already know, ports are classified in several categories.
But for this to work, it is important that porters and users understand
what each category and how we decide what to put in each
@@ -4331,19 +4331,19 @@ pre-install:
Current list of categories
-
+
First, this is the current list of port categories. Those
marked with an asterisk (*) are
virtual categories—those that do not have
a corresponding subdirectory in the ports tree.
-
+
For non-virtual categories, you will find a one-line
description in the pkg/COMMENT file in that
subdirectory (e.g.,
archivers/pkg/COMMENT).
-
+
@@ -4352,70 +4352,70 @@ pre-install:
Description
-
+
afterstep*Ports to support AfterStep window manager
-
+
archiversArchiving tools.
-
+
astroAstronomical ports.
-
+
audioSound support.
-
+
benchmarksBenchmarking utilities.
-
+
biologyBiology-related software.
-
+
cadComputer aided design tools.
-
+
chineseChinese language support.
-
+
commsCommunication software. Mostly software to talk to
your serial port.
-
+
convertersCharacter code converters.
-
+
databasesDatabases.
-
+
deskutilsThings that used to be on the desktop before
computers were invented.
-
+
develDevelopment utilities. Do not put libraries here just
@@ -4423,19 +4423,19 @@ pre-install:
belong to anywhere else, they should not be in this
category.
-
+
editorsGeneral editors. Specialized editors go in the section
for those tools (e.g., a mathematical-formula editor will go
in math).
-
+
elispEmacs-lisp ports.
-
+
emulatorsEmulators for other operating systems. Terminal
@@ -4445,7 +4445,7 @@ pre-install:
comms or misc,
depending on the exact functionality.
-
+
ftpFTP client and server utilities. If your
@@ -4453,28 +4453,28 @@ pre-install:
ftp with a secondary
category of www.
-
+
gamesGames.
-
+
germanGerman language support.
-
- gnome*
- Ports from the GNU Object Model Environment (GNOME)
- Project.
-
-
+
+ gnome*
+ Ports from the GNU Object Model Environment (GNOME)
+ Project.
+
+
graphicsGraphics utilities.
-
+
ircInternet Chat Relay utilities.
@@ -4484,7 +4484,7 @@ pre-install:
japaneseJapanese language support.
-
+
javaJava language support.
@@ -4493,14 +4493,14 @@ pre-install:
kde*Ports from the K Desktop Environment (KDE)
- Project.
+ Project.
-
+
koreanKorean language support.
-
+
langProgramming languages.
@@ -4516,12 +4516,12 @@ pre-install:
Numerical computation software and other utilities
for mathematics.
-
+
mboneMBone applications.
-
+
miscMiscellaneous utilities—basically things that
@@ -4532,136 +4532,136 @@ pre-install:
safely delete misc and just put the port
in that other subdirectory!
-
+
netMiscellaneous networking software.
-
+
newsUSENET news software.
-
+
offix*Ports from the OffiX suite.
-
+
palmSoftware support for the 3Com Palm(tm) series.
-
+
perl5*Ports that require perl version 5 to run.
-
+
plan9*Various programs from Plan9.
-
+
printPrinting software. Desktop publishing tools
(previewers, etc.) belong here too.
-
+
python*Software written in python.
-
+
russianRussian language support.
-
+
securitySecurity utilities.
-
+
shellsCommand line shells.
-
+
sysutilsSystem utilities.
-
+
tcl75*Ports that use Tcl version 7.5 to run.
-
+
tcl76*Ports that use Tcl version 7.6 to run.
-
+
tcl80*Ports that use Tcl version 8.0 to run.
-
+
tcl81*Ports that use Tcl version 8.1 to run.
-
+
textprocText processing utilities. It does not include
desktop publishing tools, which go to print/.
-
+
tk41*Ports that use Tk version 4.1 to run.
-
+
tk42*Ports that use Tk version 4.2 to run.
-
+
tk80*Ports that use Tk version 8.0 to run.
-
+
tk81*Ports that use Tk version 8.1 to run.
-
- tkstep80*
- Ports that use TkSTEP version 8.0 to run.
-
-
+
+ tkstep80*
+ Ports that use TkSTEP version 8.0 to run.
+
+
vietnameseVietnamese language support.
-
+
windowmaker*Ports to support the WindowMaker window
manager
-
+
wwwSoftware related to the World Wide Web. HTML language
support belong here too.
-
+
x11The X window system and friends. This category is only
@@ -4672,22 +4672,22 @@ pre-install:
categories. Also, many of them go into other
x11-* categories (see below).
-
+
x11-clocksX11 clocks.
-
+
x11-fmX11 file managers.
-
+
x11-fontsX11 fonts and font utilities.
-
+
x11-serversX11 servers.
@@ -4697,7 +4697,7 @@ pre-install:
x11-toolkitsX11 toolkits.
-
+
x11-wmX11 window managers.
@@ -4706,15 +4706,15 @@ pre-install:
-
+
Choosing the right category
-
+
As many of the categories overlap, you often have to choose
which of the categories should be the primary category of your port.
There are several rules that govern this issue. Here is the list of
priorities, in decreasing order of precedence.
-
+
Language specific categories always come first. For
@@ -4722,17 +4722,17 @@ pre-install:
CATEGORIES line would read japanese
x11-fonts.
-
+
Specific categories win over less-specific ones. For
instance, an HTML editor should be listed as www
editors, not the other way around. Also, you do not
need to list net when the port belongs to
- either of irc, mail,
- mbone, news,
+ either of irc, mail,
+ mbone, news,
security, or www.
-
+
x11 is used as a secondary category only
when the primary category is a natural language. In particular,
@@ -4745,7 +4745,7 @@ pre-install:
misc.
-
+
If you are not sure about the category, please put a comment to
that effect in your send-pr submission so we can
discuss it before import it. (If you are a committer, send a note
@@ -4753,10 +4753,10 @@ pre-install:
imported to a wrong category only to be moved right away.)
-
+
Changes to this document and the ports system
-
+
If you maintain a lot of ports, you should consider following the
&a.ports;. Important changes to the way ports work will be announced
there. You can always find more detailed information on the latest
@@ -4764,10 +4764,10 @@ pre-install:
url="http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/Mk/bsd.port.mk"> the
bsd.port.mk CVS log.
-
+
That is It, Folks!
-
+
Boy, this sure was a long tutorial, wasn't it? Thanks for
following us to here, really. Now that you know how to do a port,
have at it and convert everything in the world into ports! That
diff --git a/en_US.ISO_8859-1/books/handbook/ports/chapter.sgml b/en_US.ISO_8859-1/books/handbook/ports/chapter.sgml
index d8754a9169..f1d732b29d 100644
--- a/en_US.ISO_8859-1/books/handbook/ports/chapter.sgml
+++ b/en_US.ISO_8859-1/books/handbook/ports/chapter.sgml
@@ -1,17 +1,17 @@
-
+
Installing Applications: The Ports collection
-
+
Contributed by &a.jraynard;.
-
+
The FreeBSD Ports collection allows you to compile and install a very
wide range of applications with a minimum of effort.
-
+
For all the hype about open standards, getting a program to work on
different versions of Unix in the real world can be a tedious and tricky
business, as anyone who has tried it will know. You may be lucky enough
@@ -21,7 +21,7 @@
programs, you will find yourself doing a fair bit of head-scratching, and
there are quite a few programs that will result in premature greying, or
even chronic alopecia...
-
+
Some software distributions have attacked this problem by providing
configuration scripts. Some of these are very clever, but they have an
unfortunate tendency to triumphantly announce that your system is
@@ -30,72 +30,72 @@
your system's gethitlist function return a const pointer to a fromboz or
a pointer to a const fromboz? Do you have Foonix style unacceptable
exception handling? And if not, why not?).
-
+
Fortunately, with the Ports collection, all the hard work involved has
already been done, and you can just type make install
and get a working program.
-
+
Why Have a Ports Collection?
-
+
The base FreeBSD system comes with a very wide range of tools and
system utilities, but a lot of popular programs are not in the base
system, for good reasons:-
-
+
Programs that some people cannot live without and other people
cannot stand, such as a certain Lisp-based editor.
-
+
Programs which are too specialised to put in the base system
(CAD, databases).
-
+
Programs which fall into the “I must have a look at that
when I get a spare minute” category, rather than
system-critical ones (some languages, perhaps).
-
+
Programs that are far too much fun to be supplied with a serious
operating system like FreeBSD ;-)
-
+
However many programs you put in the base system, people will
always want more, and a line has to be drawn somewhere (otherwise
FreeBSD distributions would become absolutely enormous).
-
+
Obviously it would be unreasonable to expect everyone to port their
favourite programs by hand (not to mention a tremendous amount of
duplicated work), so the FreeBSD Project came up with an ingenious way
of using standard tools that would automate the process.
-
+
Incidentally, this is an excellent illustration of how “the
Unix way” works in practice by combining a set of simple but very
flexible tools into something very powerful.
-
+
How Does the Ports Collection Work?
-
+
Programs are typically distributed on the Internet as a tarball consisting of a Makefile and
the source code for the program and usually some instructions (which are
unfortunately not always as instructive as they could be), with perhaps
a configuration script.
-
+
The standard scenario is that you FTP down the tarball, extract it
somewhere, glance through the instructions, make any changes that seem
necessary, run the configure script to set things up and use the
standard make program to compile and install the
program from the source.
-
+
FreeBSD ports still use the tarball mechanism, but use a skeleton to hold the
"knowledge" of how to get the program working on FreeBSD,
@@ -103,7 +103,7 @@
supply their own customised Makefile, so that almost every port
can be built in the same way.
-
+
If you look at a port skeleton (either on your FreeBSD
system or Getting a port).
-
+
“How on earth can this do anything?” I hear you cry.
“There is no source code there!”
-
+
Fear not, gentle reader, all will become clear (hopefully). Let us
see what happens if we try and install a port. I have chosen
ElectricFence, a useful tool for developers,
as the skeleton is more straightforward than most.
-
+
If you are trying this at home, you will need to be root.
-
+
&prompt.root; cd /usr/ports/devel/ElectricFence
&prompt.root; make install
>> Checksum OK for ElectricFence-2.0.5.tar.gz.
@@ -142,57 +142,57 @@ install -c -o root -g wheel -m 444 /usr/ports/devel/ElectricFence/work/ElectricF
install -c -o root -g wheel -m 444 /usr/ports/devel/ElectricFence/work/ElectricFence-2.0.5/libefence.3 /usr/local/man/man3
===> Compressing manual pages for ElectricFence-2.0.5
===> Registering installation for ElectricFence-2.0.5
-
+
To avoid confusing the issue, I have completely removed the build
output.
-
+
If you tried this yourself, you may well have got something like
this at the start:-
-
+
&prompt.root; make install
>> ElectricFence-2.0.5.tar.gz doesn't seem to exist on this system.
>> Attempting to fetch from ftp://ftp.doc.ic.ac.uk/Mirrors/sunsite.unc.edu/pub/Linux/devel/lang/c/.
-
+
The make program has noticed that you did not
have a local copy of the source code and tried to FTP it down so it
could get the job done. I already had the source handy in my example,
so it did not need to fetch it.
-
+
Let's go through this and see what the make
program was doing.
-
+
Locate the source code tarball. If it is not available
locally, try to grab it from an FTP site.
-
+
Run a checksum test on the
tarball to make sure it has not been tampered with, accidentally
truncated, downloaded in ASCII mode, struck by neutrinos while in
transit, etc.
-
+
Extract the tarball into a temporary work directory.
-
+
Apply any patches needed to
get the source to compile and run under FreeBSD.
-
+
Run any configuration script required by the build process and
correctly answer any questions it asks.
-
+
(Finally!) Compile the code.
-
+
Install the program executable and other supporting files, man
pages, etc. under the /usr/local hierarchy
@@ -202,7 +202,7 @@ install -c -o root -g wheel -m 444 /usr/ports/devel/ElectricFence/work/ElectricF
makes sure that all the ports you install will go in the same place,
instead of being flung all over your system.
-
+
Register the installation in a database. This means that, if
you do not like the program, you can cleanly
-
+
Scroll up to the make output and see if you can
match these steps to it. And if you were not impressed before, you
should be by now!
-
+
Getting a FreeBSD Port
-
+
There are two ways of getting hold of the FreeBSD port for a
program. One requires a FreeBSD CDROM,
the other involves using an Internet
Connection.
-
+
Compiling ports from CDROM
-
+
Assuming that your FreeBSD CDROM is in the drive and mounted on
/cdrom (and the mount point
must be /cdrom), you should
@@ -252,7 +252,7 @@ WRKDIRPREFIX= /tmp
/tmp/cdrom/ports; for instance,
games/oneko will be built under
/tmp/cdrom/ports/games/oneko.
-
+
There are some ports for which we cannot provide the original
source in the CDROM due to licensing limitations. In that case, you
@@ -261,10 +261,10 @@ WRKDIRPREFIX= /tmp
connection.
-
+
Compiling ports from the Internet
-
+
If you do not have a CDROM, or you want to make sure you get the
very latest version of the port you want, you will need to download
the skeleton for the port. Now
@@ -276,13 +276,13 @@ WRKDIRPREFIX= /tmp
from the ports web
page. These packages include files that have been updated
since the release that you may need to compile new ports.
-
+
The key to the skeletons is that the FreeBSD FTP server can create
on-the-fly tarballs for you.
Here is how it works, with the gnats program in the databases
directory as an example (the bits in square brackets are comments. Do
not type them in if you are trying this yourself!):-
-
+
&prompt.root; cd /usr/ports
&prompt.root; mkdir databases
&prompt.root; cd databases
@@ -298,24 +298,24 @@ password. Remember to use binary (also known as image) mode!]
&prompt.root; cd gnats
&prompt.root; make install
[build and install gnats]
-
+
What happened here? We connected to the FTP server in the usual
way and went to its databases sub-directory.
When we gave it the command get gnats.tar, the FTP
server tarred up the gnats
directory for us.
-
+
We then extracted the gnats skeleton and went into the gnats
directory to build the port. As we explained earlier, the make process noticed we
did not have a copy of the source locally, so it fetched one before
extracting, patching and building it.
-
+
Let us try something more ambitious now. Instead of getting a
single port skeleton, we will get a whole sub-directory, for example all
the database skeletons in the ports collection. It looks almost the
same:-
-
+
&prompt.root; cd /usr/ports
&prompt.root; ftp ftp.FreeBSD.org
[log in as `ftp' and give your email address when asked for a
@@ -329,34 +329,34 @@ password. Remember to use binary (also known as image) mode!]
&prompt.root; cd databases
&prompt.root; make install
[build and install all the database ports]
-
+
With half a dozen straightforward commands, we have now got a set
of database programs on our FreeBSD machine! All we did that was
different from getting a single port skeleton and building it was that
we got a whole directory at once, and compiled everything in it at
once. Pretty impressive, no?
-
+
If you expect to be installing many ports, it is probably worth
downloading all the ports directories.
-
+
Skeletons
-
+
A team of compulsive hackers who have forgotten to eat in a frantic
attempt to make a deadline? Something unpleasant lurking in the FreeBSD
attic? No, a skeleton here is a minimal framework that supplies
everything needed to make the ports magic work.
-
+
Makefile
-
+
The most important component of a skeleton is the Makefile. This
contains various statements that specify how the port should be
compiled and installed. Here is the Makefile for
ElectricFence:-
-
+
# New ports collection makefile for: Electric Fence
# Version required: 2.0.5
@@ -380,19 +380,19 @@ do-install:
${INSTALL_MAN} ${WRKSRC}/libefence.3 ${PREFIX}/man/man3
.include <bsd.port.mk>
-
+
The lines beginning with a "#" sign are comments for the
benefit of human readers (as in most Unix script files).
-
+
DISTNAME specifies the name of the tarball, but without the
extension.
-
+
CATEGORIES states what kind of program this is.
In this case, a utility for developers. See the categories section of this
handbook for a complete list.
-
+
MASTER_SITES is the URL(s) of the master FTP
site, which is used to retrieve the tarball if it is not available on the
@@ -400,18 +400,18 @@ do-install:
normally the one from which the program is officially distributed (in
so far as any software is "officially" distributed on the
Internet).
-
+
MAINTAINER is the email address of the person
who is responsible for updating the skeleton if, for example a new
version of the program comes out.
-
+
Skipping over the next few lines for a minute, the line
.include <bsd.port.mk> says that the other
statements and commands needed for this port are in a standard file
called bsd.port.mk. As these are the same for
all ports, there is no point in duplicating them all over the place,
so they are kept in a single standard file.
-
+
This is probably not the place to go into a detailed examination
of how Makefiles work; suffice it to say that the line starting with
MAN3 ensures that the ElectricFence man page is
@@ -421,31 +421,31 @@ do-install:
do-install ensure that the files produced by
this port are placed in the correct destination.
-
+
The files directory
-
+
The file containing the checksum for the port is called
md5, after the MD5 algorithm used for ports
checksums. It lives in a directory with the slightly confusing name
of files.
-
+
This directory can also contain other miscellaneous files that are
required by the port and do not belong anywhere else.
-
+
The patches directory
-
+
This directory contains the patches needed to make everything work
properly under FreeBSD.
-
+
The pkg directory
-
+
This program contains three quite useful files:-
@@ -453,12 +453,12 @@ do-install:
COMMENT — a one-line description of
the program.
-
+
DESCR — a more detailed
description.
-
+
PLIST — a list of all the files
that will be created when the program is installed.
@@ -466,18 +466,18 @@ do-install:
-
+
What to do when a port does not work.
-
+
Oh. You can do one of four (4) things :
-
+
Fix it yourself. Technical details on how ports work can be
found in Porting applications.
-
+
Gripe. This is done by e-mail only! Send
such e-mail to the maintainer of the port, first. Type
@@ -490,12 +490,12 @@ do-install:
you can try filing a bug report with send-pr.
-
+
Forget it. This is the easiest for most — very few of the
programs in ports can be classified as essential!
-
+
Grab the pre-compiled package from a ftp server. The
“master” package collection is on FreeBSD's FTP server
@@ -509,10 +509,10 @@ do-install:
-
+
Some Questions and Answers
-
+
@@ -529,7 +529,7 @@ do-install:
things).
-
+
I thought you were supposed to use packages to install extra
@@ -541,7 +541,7 @@ do-install:
it.
-
+
So why bother with ports then?
@@ -549,25 +549,25 @@ do-install:
Several reasons:-
-
+
The licensing conditions on some software distributions
require that they be distributed as source code, not
binaries.
-
+
Some people do not trust binary distributions. At least
with source code you can (in theory) read through it and look
for potential problems yourself.
-
+
If you have some local patches, you will need the source to
add them yourself.
-
+
You might have opinions on how a program should be compiled
that differ from the person who did the package — some
@@ -575,13 +575,13 @@ do-install:
used, whether to build debug versions and then strip them or
not, etc. etc.
-
+
Some people like having code around, so they can read it if
they get bored, hack around with it, borrow from it (licence
terms permitting, of course!) and so on.
-
+
If you ain't got the source, it ain't software! ;-)
@@ -589,7 +589,7 @@ do-install:
-
+
What is a patch?
@@ -604,7 +604,7 @@ do-install:
generated by a program of that name.
-
+
What is all this about
@@ -616,25 +616,25 @@ do-install:
.tar.gz (with variations like
.tar.Z, or even .tgz if
you are trying to squeeze the names into a DOS filesystem).
-
+
Basically, it is a directory tree that has been archived into a
single file (.tar) and optionally compressed
(.gz). This technique was originally used for
Tape ARchives (hence the
name tar), but it is 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:-
-
- &prompt.user; tar tvzf foobar.tar.gz
+
+ &prompt.user; tar tvzf foobar.tar.gz
&prompt.user; tar xzvf foobar.tar.gz
&prompt.user; tar tvf foobar.tar
&prompt.user; tar xvf foobar.tar
-
+
And a checksum?
@@ -650,7 +650,7 @@ do-install:
addition).
-
+
I did what you said for compiling ports from a CDROM and it
@@ -659,7 +659,7 @@ do-install:
&prompt.root; 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 it not be found? Have I got a dud CDROM?
@@ -676,7 +676,7 @@ do-install:
bandwidth).
-
+
I did that, but when I tried to put it into
@@ -690,11 +690,11 @@ do-install:
to copy anything there because it is sym-linked to the CDROM, which
is read-only. You can tell it to look somewhere else by
doing
-
+
&prompt.root; make DISTDIR=/where/you/put/it install
-
+
Does the ports scheme only work if you have everything in
@@ -708,31 +708,31 @@ do-install:
You can use the PORTSDIR and
PREFIX variables to tell the ports mechanism to
use different directories. For instance,
-
+
&prompt.root; make PORTSDIR=/u/people/guests/wurzburger/ports install
-
+
will compile the port in
/u/people/guests/wurzburger/ports and install
everything under /usr/local.
-
+
&prompt.root; make PREFIX=/u/people/guests/wurzburger/local install
-
+
will compile it in /usr/ports and install
it in /u/people/guests/wurzburger/local.
-
+
And of course
-
+
&prompt.root; make PORTSDIR=.../ports PREFIX=.../local install
-
+
will combine the two (it is too long to fit on the page if I
write it in full, but I am sure you get the idea).
-
+
If you do not fancy typing all that in every time you install a
port (and to be honest, who would?), it is a good idea to put these
variables into your environment.
-
+
I do not have a FreeBSD CDROM, but I would like to have all
@@ -744,20 +744,20 @@ do-install:
To get every single tarball for the ports collection,
do
-
+
&prompt.root; cd /usr/ports
&prompt.root; make fetch
-
+
For all the tarballs for a single ports directory, do
-
+
&prompt.root; cd /usr/ports/directory
&prompt.root; make fetch
-
+
and for just one port — well, I think you have guessed
already.
-
+
I know it is probably faster to fetch the tarballs from one
@@ -776,7 +776,7 @@ do-install:
&prompt.root; make MASTER_SITE_OVERRIDE=ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch
-
+
I want to know what files make is going to need before it
@@ -788,7 +788,7 @@ do-install:
the files needed for a port.
-
+
Is there any way to stop the port from compiling? I want to
@@ -801,7 +801,7 @@ do-install:
has fetched and extracted the source code.
-
+
I am trying to make my own port and I want to be able to
@@ -816,7 +816,7 @@ do-install:
as well. And by the way, thank you for your efforts!
-
+
I have heard that some compiler options can cause bugs. Is
@@ -832,9 +832,9 @@ do-install:
(Most of the ports do not use ). You
should be able to specify the compiler options
used by something like
-
+
&prompt.root; make CFLAGS='-O2 -fno-strength-reduce' install
-
+
or by editing /etc/make.conf, but
unfortunately not all ports respect this. The surest way is to do
make configure, then go into the source directory
@@ -843,7 +843,7 @@ do-install:
Makefiles.
-
+
There are so many ports it is hard to find the one I want.
@@ -861,7 +861,7 @@ do-install:
&prompt.user; make search key=lisp
-
+
I went to install the foo port but the
@@ -878,7 +878,7 @@ do-install:
foo port.
-
+
I installed the
@@ -889,7 +889,7 @@ do-install:
No problem, just do
-
+
&prompt.root; pkg_delete grizzle-6.5Alternatively, you can do
@@ -898,7 +898,7 @@ do-install:
&prompt.root; make deinstall
-
+
@@ -909,13 +909,13 @@ do-install:
Not at all, you can find it out by doing
-
+
&prompt.root; pkg_info -a | grep grizzle
Information for grizzle-6.5:
grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arcade game.
-
+
Talking of disk space, the ports directory seems to be
@@ -927,15 +927,15 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
Yes, if you have installed the program and are fairly
certain you will not need the source again, there is no point in
keeping it hanging around. The best way to do this is
-
+
&prompt.root; cd /usr/ports
&prompt.root; make clean
-
+
which will go through all the ports subdirectories and delete
everything except the skeletons for each port.
-
+
I tried that and it still left all those tarballs or
@@ -948,7 +948,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
go as well.
-
+
I like having lots and lots of programs to play with. Is
@@ -957,12 +957,12 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
Just do
-
+
&prompt.root; cd /usr/ports
&prompt.root; make install
-
+
OK, I tried that, but I thought it would take a very long
@@ -978,7 +978,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
someone on hand to answer them.
-
+
I really do not want to spend all day staring at the
@@ -988,20 +988,20 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
OK, do this before you go to bed/work/the local
park:-
-
+
&prompt.root cd /usr/ports
&prompt.root; make -DBATCH install
-
+
This will install every port that does not
require user input. Then, when you come back, do
-
+
&prompt.root; cd /usr/ports
&prompt.root; make -DIS_INTERACTIVE install
-
+
to finish the job.
-
+
At work, we are using frobble, which is
@@ -1013,7 +1013,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
No problem, assuming you know how to make patches for your
changes:-
-
+
&prompt.root; cd /usr/ports/somewhere/frobble
&prompt.root; make extract
&prompt.root; cd work/frobble-2.8
@@ -1022,7 +1022,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
&prompt.root; make package
-
+
This ports stuff is really clever. I am desperate to find
@@ -1042,16 +1042,16 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
-
+
Making a port yourself
-
+
Contributed by &a.jkh;, &a.gpalmer;, &a.asami;, &a.obrien;,
and &a.hoek;. 28 August 1996.So, now you are interested in making your own port or upgrading
an existing one? Great!
-
+
What follows are some guidelines for creating a new port for
FreeBSD. If you want to upgrade an existing port, you should read this
and then read .
@@ -1061,7 +1061,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
include. Even if you do not hack Makefiles daily, it is well
commented, and you will still gain much knowledge from it.
Additionally, you may send specific questions to &a.ports;.
-
+
Only a fraction of the overridable variables
(VAR) are mentioned in
@@ -1073,30 +1073,30 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
set to use the correct value by typing :set tabstop=4
once the file has been loaded.
-
+
Quick Porting
-
+
This section tells you how to do a quick port. In many cases, it
is not enough, but we will see.
-
+
First, get the original tarball and put it into
DISTDIR, which defaults to
/usr/ports/distfiles.
-
+
The following assumes that the software compiled out-of-the-box,
i.e., there was absolutely no change required for the port to work
on your FreeBSD box. If you needed to change something, you will
have to refer to the next section too.
-
+
Writing the Makefile
-
+
The minimal Makefile would look something
like this:
-
+
# New ports collection makefile for: oneko
# Version required: 1.1b
@@ -1124,19 +1124,19 @@ USE_IMAKE= yes
tree. You can find a more detailed example in the sample Makefile section.
-
+
Writing the description files
-
+
There are three description files that are required for any
port, whether they actually package or not. They are
COMMENT, DESCR, and
PLIST, and reside in the
pkg subdirectory.
-
+
COMMENT
-
+
This is the one-line description of the port.
Please do not include the package name (or
version number of the software) in the comment. The comment
@@ -1146,10 +1146,10 @@ USE_IMAKE= yes
A cat chasing a mouse all over the screen
-
+
DESCR
-
+
This is a longer description of the port. One to a few
paragraphs concisely explaining what the port does is
sufficient.
@@ -1166,10 +1166,10 @@ A cat chasing a mouse all over the screen
WWW: so that automated tools will work
correctly.
-
+
It is recommended that you sign your name at the end of this
file, as in:
-
+
This is a port of oneko, in which a cat chases a poor mouse all over
the screen.
@@ -1181,10 +1181,10 @@ WWW: http://www.oneko.org/
- Satoshi
asami@cs.berkeley.edu
-
+
PLIST
-
+
This file lists all the files installed by the port. It is
also called the “packing list” because the package is
generated by packing the files listed here. The pathnames are
@@ -1193,9 +1193,9 @@ asami@cs.berkeley.edu
/usr/X11R6). If you are using the
MANn variables (as
you should be), do not list any manpages here.
-
+
Here is a small example:
-
+
bin/oneko
lib/X11/app-defaults/Oneko
@@ -1203,7 +1203,7 @@ lib/X11/oneko/cat1.xpm
lib/X11/oneko/cat2.xpm
lib/X11/oneko/mouse.xpm
@dirrm lib/X11/oneko
-
+
Refer to the &man.pkg.create.1; man page for details on the
packing list.
@@ -1225,18 +1225,18 @@ lib/X11/oneko/mouse.xpm
-
+
Creating the checksum file
-
+
Just type make makesum. The ports make rules
will automatically generate the file
files/md5.
-
+
Testing the port
-
+
You should make sure that the port rules do exactly what you
want it to do, including packaging up the port. These are the
important points you need to verify.
@@ -1246,56 +1246,56 @@ lib/X11/oneko/mouse.xpm
PLIST does not contain anything not
installed by your port
-
+
PLIST contains everything that is
installed by your port
-
+
Your port can be installed multiple times using the
reinstall target
-
+
Your port cleans up
after itself upon deinstall
-
+
Recommended test ordering
-
+
make install
-
+
make package
-
+
make deinstall
-
+
pkg_add package-name
-
+
make deinstall
-
+
make reinstall
-
+
make package
-
+
Make sure that there are not any warnings issued in any of the
package and
deinstall stages, After step 3, check to
@@ -1303,10 +1303,10 @@ lib/X11/oneko/mouse.xpm
using the software after step 4, to ensure that is works correctly
when installed from a package.
-
+
Checking your port with portlint
-
+
Please use portlint to see if your port
conforms to our guidelines. The portlint program
is part of the ports collection. In particular, your may want to
@@ -1315,13 +1315,13 @@ lib/X11/oneko/mouse.xpm
linkend="porting-pkgname">package is named
appropriately.
-
+
Submitting the port
-
+
First, make sure you have read the Do's and Dont's section.
-
+
Now that you are happy with your port, the only thing remaining
is to put it in the main FreeBSD ports tree and make everybody else
happy about it too. We do not need your work
@@ -1342,7 +1342,7 @@ lib/X11/oneko/mouse.xpm
One more time, do not include the original source
distfile, the work directory, or the package
you built with make package.
-
+
In the past, we asked you to upload new port submissions in
our ftp site (ftp.FreeBSD.org). This
@@ -1350,7 +1350,7 @@ lib/X11/oneko/mouse.xpm
incoming/ directory of that site due to the
large amount of pirated software showing up there.
-
+
We will look at your port, get back to you if necessary, and put
it in the tree. Your name will also appear in the list of
“Additional FreeBSD contributors” on the FreeBSD
@@ -1358,29 +1358,29 @@ lib/X11/oneko/mouse.xpm
-->:)
-
+
Slow Porting
-
+
Ok, so it was not that simple, and the port required some
modifications to get it to work. In this section, we will explain,
step by step, how to modify it to get it to work with the ports
paradigm.
-
+
How things work
-
+
First, this is the sequence of events which occurs when the user
first types make in your port's directory, and
you may find that having bsd.port.mk in another
window while you read this really helps to understand it.
-
+
But do not worry if you do not really understand what
bsd.port.mk is doing, not many people do...
:>
-
+
-
+
The fetch target is run. The
fetch target is responsible for making
@@ -1397,7 +1397,7 @@ lib/X11/oneko/mouse.xpm
the file in DISTDIR for future use and
proceed.
-
+
The extract target is run. It
looks for your port's distribution file (typically a gzip'd
@@ -1405,7 +1405,7 @@ lib/X11/oneko/mouse.xpm
temporary subdirectory specified by WRKDIR
(defaults to work).
-
+
The patch target is run. First,
any patches defined in PATCHFILES are
@@ -1414,24 +1414,24 @@ lib/X11/oneko/mouse.xpm
patches subdirectory), they are applied at
this time in alphabetical order.
-
+
The configure target is run. This
can do any one of many different things.
-
+
If it exists, scripts/configure is
run.
-
+
If HAS_CONFIGURE or
GNU_CONFIGURE is set,
WRKSRC/configure is
run.
-
+
If USE_IMAKE is set,
XMKMF (default: xmkmf
@@ -1439,7 +1439,7 @@ lib/X11/oneko/mouse.xpm
-
+
The build target is run. This is
responsible for descending into the port's private working
@@ -1449,7 +1449,7 @@ lib/X11/oneko/mouse.xpm
be used.
-
+
The above are the default actions. In addition, you can define
targets
pre-something or
@@ -1457,7 +1457,7 @@ lib/X11/oneko/mouse.xpm
or put scripts with those names, in the scripts
subdirectory, and they will be run before or after the default
actions are done.
-
+
For example, if you have a post-extract
target defined in your Makefile, and a file
pre-build in the scripts
@@ -1468,7 +1468,7 @@ lib/X11/oneko/mouse.xpm
Makefile targets if the actions are simple
enough, because it will be easier for someone to figure out what
kind of non-default action the port requires.
-
+
The default actions are done by the
bsd.port.mk targets
do-something.
@@ -1488,22 +1488,22 @@ lib/X11/oneko/mouse.xpm
do-extract, but never ever touch
extract!
-
+
Now that you understand what goes on when the user types
make, let us go through the recommended steps to
create the perfect port.
-
+
Getting the original sources
-
+
Get the original sources (normally) as a compressed tarball
(foo.tar.gz or
foo.tar.Z) and copy
it into DISTDIR. Always use
mainstream sources when and where you
can.
-
+
If you cannot find a ftp/http site that is well-connected to the
net, or can only find sites that have irritatingly non-standard
formats, you might want to put a copy on a reliable ftp or http
@@ -1519,7 +1519,7 @@ lib/X11/oneko/mouse.xpm
as the last resort. Please refer to this location as
MASTER_SITE_LOCAL. Send mail to the &a.ports;if
you are not sure what to do.
-
+
If your port's distfile changes all the time for no good reason,
consider putting the distfile in your home page and listing it as
the first MASTER_SITES. This will prevent users
@@ -1528,7 +1528,7 @@ lib/X11/oneko/mouse.xpm
there is only one master site for the port, it is recommended that
you house a backup at your site and list it as the second
MASTER_SITES.
-
+
If your port requires some additional `patches' that are
available on the Internet, fetch them too and put them in
DISTDIR. Do not worry if they come from a site
@@ -1536,10 +1536,10 @@ lib/X11/oneko/mouse.xpm
handle these situations (see the description of PATCHFILES below).
-
+
Modifying the port
-
+
Unpack a copy of the tarball in a private directory and make
whatever changes are necessary to get the port to compile properly
under the current version of FreeBSD. Keep careful
@@ -1547,14 +1547,14 @@ lib/X11/oneko/mouse.xpm
the process shortly. Everything, including the deletion, addition
or modification of files should be doable using an automated script
or patch file when your port is finished.
-
+
If your port requires significant user interaction/customization
to compile or install, you should take a look at one of Larry Wall's
classic Configure scripts and perhaps do
something similar yourself. The goal of the new ports collection is
to make each port as “plug-and-play” as possible for the
end-user while using a minimum of disk space.
-
+
Unless explicitly stated, patch files, scripts, and other
files you have created and contributed to the FreeBSD ports
@@ -1562,10 +1562,10 @@ lib/X11/oneko/mouse.xpm
conditions.
-
+
Patching
-
+
In the preparation of the port, files that have been added or
changed can be picked up with a recursive diff for later feeding to
patch. Each set of patches you wish to apply should be collected
@@ -1584,10 +1584,10 @@ lib/X11/oneko/mouse.xpm
patch-ab both changing
WRKSRC/foobar.c).
-
+
Configuring
-
+
Include any additional customization commands to your
configure script and save it in the
scripts subdirectory. As mentioned above, you
@@ -1595,10 +1595,10 @@ lib/X11/oneko/mouse.xpm
scripts with the name pre-configure or
post-configure.
-
+
Handling user input
-
+
If your port requires user input to build, configure or install,
then set IS_INTERACTIVE in your Makefile. This
will allow “overnight builds” to skip your port if the
@@ -1614,23 +1614,23 @@ lib/X11/oneko/mouse.xpm
packages for CD-ROMs and ftp.
-
+
Configuring the Makefile
-
+
Configuring the Makefile is pretty simple, and again we suggest
that you look at existing examples before starting. Also, there is a
sample Makefile in this
handbook, so take a look and please follow the ordering of variables
and sections in that template to make your port easier for others to
read.
-
+
Now, consider the following problems in sequence as you design
your new Makefile:
-
+
The original source
-
+
Does it live in DISTDIR as a standard gzip'd
tarball? If so, you can go on to the next step. If not, you should
look at overriding any of the EXTRACT_CMD,
@@ -1641,15 +1641,15 @@ lib/X11/oneko/mouse.xpm
file is. (The most common case is
EXTRACT_SUFX=.tar.Z, when the tarball is
condensed by regular compress, not gzip.)
-
+
In the worst case, you can simply create your own
do-extract target to override the default,
though this should be rarely, if ever, necessary.
-
+
DISTNAME
-
+
You should set DISTNAME to be the base name
of your port. The default rules expect the distribution file list
(DISTFILES) to be named
@@ -1657,12 +1657,12 @@ lib/X11/oneko/mouse.xpm
it is a normal tarball, is going to be something like
foozolix-1.0.tar.gz for a setting of
DISTNAME=foozolix-1.0.
-
+
The default rules also expect the tarball(s) to extract into a
subdirectory called
work/DISTNAME, e.g.
work/foozolix-1.0/.
-
+
All this behavior can be overridden, of course; it simply
represents the most common time-saving defaults. For a port
requiring multiple distribution files, simply set
@@ -1673,20 +1673,20 @@ lib/X11/oneko/mouse.xpm
and the rest will be just left in DISTDIR for
later use.
-
+
PKGNAME
-
+
If DISTNAME does not conform to our guidelines for a good package
name, you should set the PKGNAME
variable to something better. See the abovementioned guidelines for
more details.
-
+
CATEGORIES
-
+
When a package is created, it is put under
/usr/ports/packages/All and links are made from
one or more subdirectories of
@@ -1716,25 +1716,25 @@ lib/X11/oneko/mouse.xpm
mistype the category name, so be careful!
-
+
MASTER_SITES
-
+
Record the directory part of the ftp/http-URL pointing at the
original tarball in MASTER_SITES. Do not forget
the trailing slash (/)!
-
+
The make macros will try to use this
specification for grabbing the distribution file with
FETCH if they cannot find it already on the
system.
-
+
It is recommended that you put multiple sites on this list,
preferably from different continents. This will safeguard against
wide-area network problems, and we are even planning to add support
for automatically determining the closest master site and fetching
from there!
-
+
If the original tarball is part of one of the following popular
archives: X-contrib, GNU, Perl CPAN, TeX CTAN, or Linux Sunsite, you
refer to those sites in an easy compact form using
@@ -1749,33 +1749,33 @@ lib/X11/oneko/mouse.xpm
MASTER_SITES= ${MASTER_SITE_XCONTRIB}
MASTER_SITE_SUBDIR= applications
-
+
The user can also set the MASTER_SITE_*
variables in /etc/make.conf to override our
choices, and use their favorite mirrors of these popular archives
instead.
-
+
PATCHFILES
-
+
If your port requires some additional patches that are available
by ftp or http, set PATCHFILES to the names of
the files and PATCH_SITES to the URL of the
directory that contains them (the format is the same as
MASTER_SITES).
-
+
If the patch is not relative to the top of the source tree
(i.e., WKRSRC) because it contains some extra
pathnames, set PATCH_DIST_STRIP accordingly. For
instance, if all the pathnames in the patch have an extra
foozolix-1.0/ in front of the filenames, then set
PATCH_DIST_STRIP=-p1.
-
+
Do not worry if the patches are compressed, they will be
decompressed automatically if the filenames end with
.gz or .Z.
-
+
If the patch is distributed with some other files, such as
documentation, in a gzip'd tarball, you cannot just use
PATCHFILES. If that is the case, add the name
@@ -1797,30 +1797,30 @@ MASTER_SITE_SUBDIR= applications
target.
-
+
MAINTAINER
-
+
Set your mail-address here. Please. :)
-
+
For detailed description of the responsibility of maintainers,
refer to MAINTAINER on
Makefiles section.
-
+
Dependencies
-
+
Many ports depend on other ports. There are five variables that
you can use to ensure that all the required bits will be on the
user's machine. There are also some pre-supported dependency
variables for common cases, plus a few more to control the behaviour
of dependencies.
-
+
LIB_DEPENDS
-
+
This variable specifies the shared libraries this port depends
on. It is a list of
lib:dir:target
@@ -1842,7 +1842,7 @@ MASTER_SITE_SUBDIR= applications
to ldconfig -r | grep -wF. There shall be no
regular expressions in this variable.
-
+
The dependency is checked twice, once from within the
extract target and then from within the
install target. Also, the name of the
@@ -1850,10 +1850,10 @@ MASTER_SITE_SUBDIR= applications
pkg_add will automatically install it if it is
not on the user's system.
-
+
RUN_DEPENDS
-
+
This variable specifies executables or files this port depends
on during run-time. It is a list of
path:dir:target
@@ -1869,11 +1869,11 @@ MASTER_SITE_SUBDIR= applications
path.For example,
-
+
RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
wish8.0:${PORTSDIR}/x11-toolkits/tk80
-
+
will check if the file or directory
/usr/local/etc/innd exists, and build and
install it from the news/inn subdirectory of
@@ -1882,14 +1882,14 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
path, and descend into the x11-toolkits/tk80
subdirectory of your ports tree to build and install it if it is
not found.
-
+
In this case, innd is actually an
executable; if an executable is in a place that is not expected
to be in a normal user's search path, you should use the full
pathname.
-
+
The dependency is checked from within the
install target. Also, the name of the
dependency is put in to the package so that
@@ -1898,10 +1898,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
part can be omitted if it is the same
DEPENDS_TARGET.
-
+
BUILD_DEPENDS
-
+
This variable specifies executables or files this port
requires to build. Like RUN_DEPENDS, it is a
list of
@@ -1920,10 +1920,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
the same as DEPENDS_TARGET
-
+
FETCH_DEPENDS
-
+
This variable specifies executables or files this port
requires to fetch. Like the previous two, it is a list of
path:dir:target
@@ -1932,16 +1932,16 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
executable called ncftp2, and descend into the
net/ncftp2 subdirectory of your ports tree to
build and install it if it is not found.
-
+
The dependency is checked from within the
fetch target. The
target part can be omitted if it is the
same as DEPENDS_TARGET.
-
+
DEPENDS
-
+
If there is a dependency that does not fall into either of the
above four categories, or your port requires to have the source of
the other port extracted in addition to having them installed,
@@ -1951,10 +1951,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
target part can be omitted if it is the
same as DEPENDS_TARGET.
-
+
Common dependency variables
-
+
Define USE_XLIB=yes if your port requires
the X Window System to be installed (it is implied by
USE_IMAKE). Define
@@ -1968,10 +1968,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
some versions of FreeBSD has perl5 as part of the base system
while others do not.)
-
+
Notes on dependencies
-
+
As mentioned above, the default target to call when a
dependency is required is DEPENDS_TARGET.
It defaults to install. This is a user
@@ -2009,10 +2009,10 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
intention will be clear.
-
+
Building mechanisms
-
+
If your package uses GNU make, set
USE_GMAKE=yes. If your package uses
configure, set
@@ -2030,7 +2030,7 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
GNU_CONFIGURE, and will cause
autoconf to be run before
configure.
-
+
If your package is an X application that creates
Makefiles from Imakefiles
using imake, then set
@@ -2043,7 +2043,7 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
NO_INSTALL_MANPAGES=yes should be set. In
addition, the author of the original port should be shot. :>
-
+
If your port's source Makefile has
something else than all as the main build
target, set ALL_TARGET accordingly. Same goes
@@ -2051,23 +2051,23 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
INSTALL_TARGET.
-
+
Special considerations
-
+
There are some more things you have to take into account when you
create a port. This section explains the most common of those.ldconfig
-
+
If your port installs a shared library, add a
post-install target to your
Makefile that runs ${LDCONFIG}
-m on the directory where the new library is installed
(usually PREFIX/lib) to
register it into the shared library cache.
-
+
Also, add a matching @exec /sbin/ldconfig -m
and @unexec /sbin/ldconfig -R pair to your
pkg/PLIST file so that a user who installed the
@@ -2080,7 +2080,7 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
lib/libtvl80.so.1
@exec /sbin/ldconfig -m %D/lib
@unexec /sbin/ldconfig -R
-
+
Never, ever, ever add a line that says
ldconfig without any arguments to your
Makefile or pkg/PLIST.
@@ -2093,10 +2093,10 @@ lib/libtvl80.so.1
(not necessarily in that order…)
-
+
ELF support
-
+
Since FreeBSD is moving to ELF shortly after 3.0-RELEASE, we need
to convert many ports that build shared libraries to support ELF.
Complicating this task is that a 3.0 system can run as both ELF and
@@ -2110,7 +2110,7 @@ lib/libtvl80.so.1
Moving a.out libraries out of the way
-
+
A.out libraries should be moved out of
/usr/local/lib and similar to an
aout subdirectory. (If you do not move them out
@@ -2121,10 +2121,10 @@ lib/libtvl80.so.1
only move a.out libs so it is safe to call it on a system with both
ELF and a.out libs in the standard directories.
-
+
Format
-
+
The ports tree will build packages in the format the machine is
in. This means a.out for 2.2 and a.out or ELF for 3.0 depending on
what `objformat` returns. Also, once users move
@@ -2139,10 +2139,10 @@ lib/libtvl80.so.1
system.
-
+
PORTOBJFORMAT
-
+
bsd.port.mk will set
PORTOBJFORMAT to aout or
elf and export it in the environments
@@ -2155,26 +2155,26 @@ lib/libtvl80.so.1
The variable is set using this line in
bsd.port.mk:
-
+
PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
-
+
Ports' make processes should use this variable to decide what to
do. However, if the port's configure script
already automatically detects an ELF system, it is not necessary to
refer to PORTOBJFORMAT.
-
+
Building shared libraries
-
+
The following are differences in handling shared libraries for
a.out and ELF.
-
+
Shared library versions
-
+
An ELF shared library should be called
libfoo.so.M
where M is the single version number,
@@ -2188,10 +2188,10 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aoutlibfoo.so.N.
-
+
Linker command lines
-
+
Assuming cc -shared is used rather than
ld directly, the only difference is that you
need to add
@@ -2199,7 +2199,7 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
-
+
You need to install a symlink from
libfoo.so to
libfoo.so.N to make
@@ -2209,20 +2209,20 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aoutPORTOBJFORMAT.
-
+
LIB_DEPENDS
-
+
All port Makefiles are edited to remove minor numbers from
LIB_DEPENDS, and also to have the regexp support
removed. (E.g., foo\\.1\\.\\(33|40\\) becomes
foo.2.) They will be matched using grep
-wF.
-
+
PLIST
-
+
PLIST should contain the short (ELF) shlib
names if the a.out minor number is zero, and the long (a.out) names
otherwise. bsd.port.mk will automatically add
@@ -2240,18 +2240,18 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aoutPLIST mentioned in the previous
paragraph.
-
+
ldconfig
-
+
The ldconfig line in Makefiles should
read:
-
+
${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ....In PLIST it should read;
-
+
@exec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -m ...
@unexec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -R
@@ -2261,10 +2261,10 @@ ${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ....
default format of the system.
-
+
MASTERDIR
-
+
If your port needs to build slightly different versions of
packages by having a variable (for instance, resolution, or paper
size) take different values, create one subdirectory per package to
@@ -2279,7 +2279,7 @@ ${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ....
This will be best demonstrated by an example. This is part of
japanese/xdvi300/Makefile;
-
+
PKGNAME= ja-xdvi${RESOLUTION}-17
:
@@ -2287,8 +2287,8 @@ PKGNAME= ja-xdvi${RESOLUTION}-17
RESOLUTION?= 300
.if ${RESOLUTION} != 118 && ${RESOLUTION} != 240 && \
${RESOLUTION} != 300 && ${RESOLUTION} != 400
- @${ECHO} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\""
- @${ECHO} "Possible values are: 118, 240, 300 (default) and 400."
+ @${ECHO} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\""
+ @${ECHO} "Possible values are: 118, 240, 300 (default) and 400."
@${FALSE}
.endif
@@ -2317,10 +2317,10 @@ MASTERDIR= ${.CURDIR}/../xdvi300
xdvi300/Makefile and the port will be built with
resolution set to 118.
-
+
Shared library versions
-
+
First, please read our policy on
shared library versioning to understand what to do with
shared library versions in general. Do not blindly assume software
@@ -2351,10 +2351,10 @@ MASTERDIR= ${.CURDIR}/../xdvi300
libfoo4.so.1.0 so both version 3.2 and 4.0 can be
linked from other ports.
-
+
Manpages
-
+
The MAN[1-9LN] variables will automatically add
any manpages to pkg/PLIST (this means you must
not list manpages in the
@@ -2363,7 +2363,7 @@ MASTERDIR= ${.CURDIR}/../xdvi300
makes the install stage automatically compress or uncompress manpages
depending on the setting of NOMANCOMPRESS in
/etc/make.conf.
-
+
If your port tries to install multiple names for manpages using
symlinks or hardlinks, you must use the MLINKS
variable to identify these. The link installed by your port will
@@ -2371,7 +2371,7 @@ MASTERDIR= ${.CURDIR}/../xdvi300
to make sure it points to the correct file. Any manpages
listed in MLINKS must not be listed in the
PLIST.
-
+
To specify whether the manpages are compressed upon installation,
use the MANCOMPRESSED variable. This variable can
take three values, yes, no and
@@ -2401,9 +2401,9 @@ MASTERDIR= ${.CURDIR}/../xdvi300
name of the languages to MANLANG. The value of
this variable defaults to "" (i.e., English
only).
-
+
Here is an example that puts it all together.
-
+
MAN1= foo.1
MAN3= bar.3
@@ -2414,7 +2414,7 @@ MAN3PREFIX= ${PREFIX}/share/foobar
MANCOMPRESSED= yesThis states that six files are installed by this port;
-
+
${PREFIX}/man/man1/foo.1.gz
${PREFIX}/man/ja/man1/foo.1.gz
@@ -2427,12 +2427,12 @@ ${PREFIX}/man/ja/man4/baz.4.gz
may or may-not be installed by your port. Regardless, a
symlink will be made to join the foo(1) manpage and
alt-name(8) manpage.
-
+
Ports that require Motif
-
+
There are many programs that require a Motif library (available
from several commercial vendors, while there is a free clone reported
to be able to run many applications in
@@ -2442,18 +2442,18 @@ ${PREFIX}/man/ja/man4/baz.4.gz
handling ports that require Motif in a way that we can easily compile
binaries linked either dynamically (for people who are compiling from
the port) or statically (for people who distribute packages).
-
+
REQUIRES_MOTIF
-
+
If your port requires Motif, define this variable in the
Makefile. This will prevent people who do not own a copy of Motif
from even attempting to build it.
-
+
MOTIFLIB
-
+
This variable will be set by bsd.port.mk to
be the appropriate reference to the Motif library. Please patch the
source to use this wherever the Motif library is referenced in the
@@ -2461,7 +2461,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz
Imakefile.There are two common cases:
-
+
If the port refers to the Motif library as
@@ -2469,7 +2469,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz
Imakefile, simply substitute
${MOTIFLIB} for it.
-
+
If the port uses XmClientLibs in its
Imakefile, change it to
@@ -2477,17 +2477,17 @@ ${PREFIX}/man/ja/man4/baz.4.gz
${XLIB}.
-
+
Note that MOTIFLIB (usually) expands to
-L/usr/X11R6/lib -lXm or
/usr/X11R6/lib/libXm.a, so there is no need to
add -L or -l in front.
-
+
X11 fonts
-
+
If your port installs fonts for the X Window system, put them in
X11BASE/lib/X11/fonts/local.
This directory is new to XFree86 release 3.3.3. If it does not exist,
@@ -2495,10 +2495,10 @@ ${PREFIX}/man/ja/man4/baz.4.gz
their XFree86 to 3.3.3 or newer, or at least add this directory to the
font path in /etc/XF86Config.
-
+
Info files
-
+
The new version of texinfo (included in 2.2.2-RELEASE and onwards)
contains a utility called install-info to add and
delete entries to the dir file. If your port
@@ -2510,7 +2510,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz
beautiful listing, so please bear with me!First, this is what you (as a porter) need to know
-
+
&prompt.user; install-info --help
install-info [OPTION]... [INFO-FILE [DIR-FILE]]
Install INFO-FILE in the Info directory file DIR-FILE.
@@ -2522,24 +2522,24 @@ Options:
--entry=TEXT Insert TEXT as an Info directory entry.
:
--section=SEC Put this file's entries in section SEC of the directory. :
-
+
This program will not actually install info
files; it merely inserts or deletes entries in the
dir file.
-
+
Here's a seven-step procedure to convert ports to use
install-info. I will use
editors/emacs as an example.
-
+
Look at the texinfo sources and make a patch to insert
@dircategory and @direntry
statements to files that do not have them. This is part of my
patch:
-
+
--- ./man/vip.texi.org Fri Jun 16 15:31:11 1995
+++ ./man/vip.texi Tue May 20 01:28:33 1997
@@ -2555,21 +2555,21 @@ Options:
@iftex
@finalout
:
-
+
The format should be self-explanatory. Many authors leave a
dir file in the source tree that contains all
the entries you need, so look around before you try to write your
own. Also, make sure you look into related ports and make the
section names and entry indentations consistent (we recommend that
all entry text start at the 4th tab stop).
-
+
Note that you can put only one info entry per file because
of a bug in install-info --delete that
deletes only the first entry if you specify multiple entries in
the @direntry section.
-
+
You can give the dir entries to
install-info as arguments
( and ) instead
@@ -2586,7 +2586,7 @@ Options:
PLIST of japanese/skk
for examples on how to do this).
-
+
Go back to the port directory and do a make clean;
make and verify that the info files are regenerated
@@ -2598,7 +2598,7 @@ Options:
Makefile.in so it will descend into the
man subdirectory to rebuild the info
pages.
-
+
--- ./Makefile.in.org Mon Aug 19 21:12:19 1996
+++ ./Makefile.in Tue Apr 15 00:15:28 1997
@@ -2608,7 +2608,7 @@ Options:
# and you cannot remake them without installing Emacs first.
-SUBDIR = lib-src src
+SUBDIR = lib-src src man
-
+
# The makefiles of the directories in $SUBDIR.
SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile
--- ./man/Makefile.in.org Thu Jun 27 15:27:19 1996
@@ -2621,7 +2621,7 @@ Options:
info: $(INFO_TARGETS)
dvi: $(DVI_TARGETS)
-
+
The second hunk was necessary because the default target in
the man subdir is called
info, while the main
@@ -2631,14 +2631,14 @@ Options:
one with the same name in /usr/share/info
(that patch is not shown here).
-
+
If there is a place in the Makefile that
is installing the dir file, delete it. Your
port may not be doing it. Also, remove any commands that are
otherwise mucking around with the dir
file.
-
+
--- ./Makefile.in.org Mon Aug 19 21:12:19 1996
+++ ./Makefile.in Mon Apr 14 23:38:07 1997
@@ -2658,14 +2658,14 @@ Options:
${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \
chmod a+r ${infodir}/$$f); \
-
+
(This step is only necessary if you are modifying an existing
port.) Take a look at pkg/PLIST and delete
anything that is trying to patch up info/dir.
They may be in pkg/INSTALL or some other
file, so search extensively.
-
+
Index: pkg/PLIST
===================================================================
@@ -2685,7 +2685,7 @@ diff -u -r1.15 PLIST
info/cl-1
info/cl-2
-
+
Add a post-install target to the
Makefile to call
@@ -2694,7 +2694,7 @@ diff -u -r1.15 PLIST
dir file yourself;
install-info automatically creates this
file if it does not exist.)
-
+
Index: Makefile
===================================================================
@@ -2714,13 +2714,13 @@ diff -u -r1.26 Makefile
.include <bsd.port.mk>
-
+
Edit PLIST and add equivalent
@exec statements and also
@unexec for
pkg_delete.
-
+
Index: pkg/PLIST
===================================================================
@@ -2755,7 +2755,7 @@ diff -u -r1.15 PLIST
the dir file.
-
+
Test and admire your
work. :). Check the
@@ -2763,17 +2763,17 @@ diff -u -r1.15 PLIST
-
+
The pkg/ subdirectory
-
+
There are some tricks we have not mentioned yet about the
pkg/ subdirectory that come in handy
sometimes.
-
+
MESSAGE
-
+
If you need to display a message to the installer, you may place
the message in pkg/MESSAGE. This capability is
often useful to display additional installation steps to be taken
@@ -2788,10 +2788,10 @@ diff -u -r1.15 PLIST
post-install target yourself.
-
+
INSTALL
-
+
If your port needs to execute commands when the binary package
is installed with pkg_add you can do this via the
pkg/INSTALL script. This script will
@@ -2804,7 +2804,7 @@ diff -u -r1.15 PLIST
environmental variable will be set to the package installation
directory. See &man.pkg.add.1; for
additional information.
-
+
This script is not run automatically if you install the port
with make install. If you are depending on it
@@ -2812,17 +2812,17 @@ diff -u -r1.15 PLIST
Makefile.
-
+
REQ
-
+
If your port needs to determine if it should install or not, you
can create a pkg/REQ “requirements”
script. It will be invoked automatically at
installation/deinstallation time to determine whether or not
installation/deinstallation should proceed.
-
+
Changing PLIST based on make
variables
@@ -2847,7 +2847,7 @@ diff -u -r1.15 PLIST
%%VAR%%' will be
substituted with VALUE in the
PLIST.
-
+
For instance, if you have a port that installs many files in a
version-specific subdirectory, you can put something like
@@ -2860,7 +2860,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
in PLIST. That way, when you upgrade the port,
you will not have to change dozens (or in some cases, hundreds) of
lines in the PLIST.
-
+
This substitution (as well as addition of any man pages) will be done between
the do-install and
@@ -2874,11 +2874,11 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
post-install to a file named
TMPPLIST.
-
+
Changing the names of files in the
pkg subdirectory
-
+
All the filenames in the pkg subdirectory
are defined using variables so you can change them in your
Makefile if need be. This is especially useful
@@ -2899,38 +2899,38 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
Default value
-
+
COMMENT${PKGDIR}/DESCR
-
+
DESCR${PKGDIR}/DESCR
-
+
PLIST${PKGDIR}/PLIST
-
+
PKGINSTALL${PKGDIR}/PKGINSTALL
-
+
PKGDEINSTALL${PKGDIR}/PKGDEINSTALL
-
+
PKGREQ${PKGDIR}/REQ
-
+
PKGMESSAGE${PKGDIR}/MESSAGE
@@ -2938,7 +2938,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
-
+
Please change these variables rather than overriding
PKG_ARGS. If you change
PKG_ARGS, those files will not correctly be
@@ -2946,10 +2946,10 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
port.
-
+
Licensing Problems
-
+
Some software packages have restrictive licenses or can be in
violation to the law (PKP's patent on public key crypto, ITAR (export
of crypto software) to name just two of them). What we can do with
@@ -2963,10 +2963,10 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
source or compiled binaries either via ftp or CD-ROM. If in doubt,
please contact the &a.ports;.
-
+
There are two variables you can set in the Makefile to handle the
situations that arise frequently:
-
+
If the port has a “do not sell for profit” type of
@@ -2975,7 +2975,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
into the CD-ROM come release time. The distfile and package will
still be available via ftp.
-
+
If the resulting package needs to be built uniquely for each
site, or the resulting binary package cannot be distributed due to
@@ -2984,7 +2984,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
will not go on the ftp site, nor into the CD-ROM come release time.
The distfile will still be included on both however.
-
+
If the port has legal restrictions on who can use it (e.g.,
crypto stuff) or has a “no commercial use” license,
@@ -2993,34 +2993,34 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
will not be available even from our ftp sites.
-
+
The GNU General Public License (GPL), both version 1 and 2,
should not be a problem for ports.
-
+
If you are a committer, make sure you update the
ports/LEGAL file too.
-
+
Upgrading
-
+
When you notice that a port is out of date compared to the latest
version from the original authors, first make sure you have the latest
port. You can find them in the
ports/ports-current directory of the ftp mirror
sites. You may also use CVSup to keep your whole ports collection
up-to-date, as described in .
-
+
The next step is to send a mail to the maintainer, if one is
listed in the port's Makefile. That person may
already be working on an upgrade, or have a reason to not upgrade the
port right now (because of, for example, stability problems of the new
version).
-
+
If the maintainer asks you to do the upgrade or there is not any
such person to begin with, please make the upgrade and send the
recursive diff (either unified or context diff is fine, but port
@@ -3037,14 +3037,14 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
and uuencode it; otherwise, just include it in as is in the PR.
- Once again, please use &man.diff.1; and not &man.shar.1; to send
+ Once again, please use &man.diff.1; and not &man.shar.1; to send
updates to existing ports!
-
+
Do's and Dont's
-
+
Here is a list of common do's and dont's that you encounter during
the porting process.You should check your own port against this list,
but you can also check ports in the PR database that others have
@@ -3053,10 +3053,10 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
Commentary. Checking ports in the PR database will both make
it faster for us to commit them, and prove that you know what you are
doing.
-
+
Strip Binaries
-
+
Do strip binaries. If the original source already strips the
binaries, fine; otherwise you should add a
post-install rule to to it yourself. Here is an
@@ -3070,45 +3070,45 @@ post-install:
check whether the binary is stripped or not. If it does not say
not stripped, it is stripped.
-
+
INSTALL_* macros
-
+
Do use the macros provided in bsd.port.mk
to ensure correct modes and ownership of files in your own
*-install targets. They are:
-
+
INSTALL_PROGRAM is a command to install
binary executables.
-
+
INSTALL_SCRIPT is a command to install
executable scripts.
-
+
INSTALL_DATA is a command to install
sharable data.
-
+
INSTALL_MAN is a command to install
manpages and other documentation (it does not compress
anything).
-
+
These are basically the install command with
all the appropriate flags. See below for an example on how to use
them.
-
+
WRKDIR
-
+
Do not write anything to files outside
WRKDIR. WRKDIR is the only
place that is guaranteed to be writable during the port build (see
@@ -3118,25 +3118,25 @@ post-install:
linkend="porting-pkgsubdir">redefining a variable, not by
writing over it.
-
+
WRKDIRPREFIX
-
+
Make sure your port honors WRKDIRPREFIX.
Most ports do not have to worry about this. In particular, if you
are referring to a WRKDIR of another port, note
that the correct location is
WRKDIRPREFIXPORTSDIR/subdir/name/work not PORTSDIR/subdir/name/work or .CURDIR/../../subdir/name/work or some such.
-
+
Also, if you are defining WRKDIR yourself,
make sure you prepend
${WKRDIRPREFIX}${.CURDIR} in the
front.
-
+
Differentiating operating systems and OS versions
-
+
You may come across code that needs modifications or conditional
compilation based upon what version of UNIX it is running under. If
you need to make such changes to the code for conditional
@@ -3144,63 +3144,63 @@ post-install:
so that we can back-port code to FreeBSD 1.x systems and cross-port
to other BSD systems such as 4.4BSD from CSRG, BSD/386, 386BSD,
NetBSD, and OpenBSD.
-
+
The preferred way to tell 4.3BSD/Reno (1990) and newer versions
of the BSD code apart is by using the BSD macro
defined in <sys/param.h>. Hopefully that
file is already included; if not, add the code:
-
+
#if (defined(__unix__) || defined(unix)) && !defined(USG)
#include <sys/param.h>
#endif
-
+
to the proper place in the .c file. We
believe that every system that defines these two symbols has
sys/param.h. If you find a system that
does not, we would like to know. Please send mail to the
&a.ports;.
-
+
Another way is to use the GNU Autoconf style of doing
this:
-
+
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
-
+
Do not forget to add -DHAVE_SYS_PARAM_H to the
CFLAGS in the Makefile for
this method.
-
+
Once you have sys/param.h included, you may
use:
-
+
#if (defined(BSD) && (BSD >= 199103))
-
+
to detect if the code is being compiled on a 4.3 Net2 code base
or newer (e.g. FreeBSD 1.x, 4.3/Reno, NetBSD 0.9, 386BSD, BSD/386
1.1 and below).
-
+
Use:
-
+
#if (defined(BSD) && (BSD >= 199306))
-
+
to detect if the code is being compiled on a 4.4 code base or
newer (e.g. FreeBSD 2.x, 4.4, NetBSD 1.0, BSD/386 2.0 or
above).
-
+
The value of the BSD macro is
199506 for the 4.4BSD-Lite2 code base. This is
stated for informational purposes only. It should not be used to
distinguish between versions of FreeBSD based only on 4.4-Lite vs.
versions that have merged in changes from 4.4-Lite2. The
__FreeBSD__ macro should be used instead.
-
+
Use sparingly:
-
+
__FreeBSD__ is defined in all versions of
@@ -3210,14 +3210,14 @@ post-install:
strerror() are Berkeleyisms, not FreeBSD
changes.
-
+
In FreeBSD 2.x, __FreeBSD__ is defined to
be 2. In earlier versions, it is
1. Later versions will bump it to match
their major version number.
-
+
If you need to tell the difference between a FreeBSD 1.x
system and a FreeBSD 2.x or 3.x system, usually the right answer
@@ -3228,7 +3228,7 @@ post-install:
__FreeBSD__ > 1 to detect a FreeBSD 2.x and later
system. If you need more granularity in detecting FreeBSD
systems since 2.0-RELEASE you can use the following:
-
+
#if __FreeBSD__ >= 2
#include <osreldate.h>
@@ -3245,83 +3245,83 @@ post-install:
__FreeBSD_version
-
+
2.0-RELEASE119411
-
+
2.1-CURRENTs199501, 199503
-
+
2.0.5-RELEASE199504
-
+
2.2-CURRENT before 2.1199508
-
+
2.1.0-RELEASE199511
-
+
2.2-CURRENT before 2.1.5199512
-
+
2.1.5-RELEASE199607
-
+
2.2-CURRENT before 2.1.6199608
-
+
2.1.6-RELEASE199612
-
+
2.1.7-RELEASE199612
-
+
2.2-RELEASE220000
-
+
2.2.1-RELEASE220000 (no change)
-
+
2.2-STABLE after 2.2.1-RELEASE220000 (no change)
-
+
2.2-STABLE after texinfo-3.9221001
-
+
2.2-STABLE after top221002
-
+
2.2.2-RELEASE222000
@@ -3331,105 +3331,105 @@ post-install:
2.2-STABLE after 2.2.2-RELEASE222001
-
+
2.2.5-RELEASE225000
-
+
2.2-STABLE after 2.2.5-RELEASE225001
-
+
2.2-STABLE after ldconfig -R merge225002
-
+
2.2.6-RELEASE226000
-
+
2.2.7-RELEASE227000
-
+
2.2-STABLE after 2.2.7-RELEASE227001
-
+
2.2-STABLE after semctl(2) change227002
-
+
2.2.8-RELEASE228000
-
+
2.2-STABLE after 2.2.8-RELEASE228001
-
+
3.0-CURRENT before mount(2) change300000
-
+
3.0-CURRENT after mount(2) change300001
-
+
3.0-CURRENT after semctl(2) change300002
-
+
3.0-CURRENT after ioctl arg changes300003
-
+
3.0-CURRENT after ELF conversion300004
-
+
3.0-RELEASE300005
-
+
3.0-CURRENT after 3.0-RELEASE300006
-
+
3.0-STABLE after 3/4 branch300007
-
+
3.1-RELEASE310000
-
+
3.1-STABLE after 3.1-RELEASE310001
- 3.1-STABLE after C++ constructor/destructor order
- change
+ 3.1-STABLE after C++ constructor/destructor order
+ change310002
@@ -3445,7 +3445,7 @@ post-install:
3.2-STABLE after binary-incompatible IPFW and
- socket changes
+ socket changes
320002
@@ -3453,21 +3453,21 @@ post-install:
3.3-RELEASE330000
-
+
4.0-CURRENT after 3/4 branch400000
- 4.0-CURRENT after change in dynamic linker
- handling
+ 4.0-CURRENT after change in dynamic linker
+ handling400001
- 4.0-CURRENT after C++ constructor/destructor
- order change
+ 4.0-CURRENT after C++ constructor/destructor
+ order change400002
@@ -3478,14 +3478,14 @@ post-install:
4.0-CURRENT after __deregister_frame_info dynamic linker
- bug fix
- (also 4.0-CURRENT after EGCS 1.1.2 integration)
+ bug fix (also 4.0-CURRENT after EGCS 1.1.2 integration)
+
4000044.0-CURRENT after suser(9) API change
- (also 4.0-CURRENT after newbus)
+ (also 4.0-CURRENT after newbus)
400005
@@ -3495,21 +3495,21 @@ post-install:
- 4.0-CURRENT after the addition of so_cred for
- socket level credentials
+ 4.0-CURRENT after the addition of so_cred for
+ socket level credentials400007
- 4.0-CURRENT after the addition of a poll syscall
- wrapper to libc_r
+ 4.0-CURRENT after the addition of a poll syscall
+ wrapper to libc_r4000084.0-CURRENT after the change of the kernel's
dev_t type to struct
- spacinfo pointer
+ specinfo pointer
400009
@@ -3517,7 +3517,7 @@ post-install:
-
+
Note that 2.2-STABLE sometimes identifies itself as
“2.2.5-STABLE” after the 2.2.5-RELEASE. The pattern
@@ -3529,13 +3529,13 @@ post-install:
worry about old -CURRENTs; they are listed here just for your
reference.
-
+
In the hundreds of ports that have been done, there have only
been one or two cases where __FreeBSD__ should
have been used. Just because an earlier port screwed up and used it
in the wrong place does not mean you should do so too.
-
+
Writing something after
bsd.port.mk
@@ -3551,7 +3551,7 @@ post-install:
pre.mk/post.mk pair or
bsd.port.mk only; do not mix these two.
-
+
bsd.port.pre.mk only defines a few
variables, which can be used in tests in the
Makefile, bsd.port.post.mk
@@ -3570,53 +3570,53 @@ post-install:
Description
-
+
ARCHThe architecture as returned by uname
-m (e.g., i386)
-
+
OPSYSThe operating system type, as returned by
uname -s (e.g.,
FreeBSD)
-
+
OSRELThe release version of the operating system (e.g.,
2.1.5 or
2.2.7)
-
+
OSVERSIONThe numeric version of the operating system, same as
__FreeBSD_version.
-
+
PORTOBJFORMATThe object format of the system
(aout or elf
-
+
LOCALBASEThe base of the “local” tree (e.g.,
/usr/local/)
-
+
X11BASEThe base of the “X11” tree (e.g.,
/usr/X11R6)
-
+
PREFIXWhere the port installs itself (see
-
+
If you have to define the variables
USE_IMAKE, USE_X_PREFIX, or
MASTERDIR, do so before including
bsd.port.pre.mk.
-
+
Here are some examples of things you can write after
bsd.port.pre.mk;
-
+
# no need to compile lang/perl5 if perl5 is already in system
.if ${OSVERSION} > 300003
@@ -3656,23 +3656,23 @@ post-install:
${LN} -sf liblinpack.so.1.0 ${PREFIX}/lib/liblinpack.so
.endif
-
+
Install additional documentation
-
+
If your software has some documentation other than the standard
man and info pages that you think is useful for the user, install it
under PREFIX/share/doc.
This can be done, like the previous item, in the
post-install target.
-
+
Create a new directory for your port. The directory name should
reflect what the port is. This usually means
PKGNAME minus the version part. However, if you
think the user might want different versions of the port to be
installed at the same time, you can use the whole
PKGNAME.
-
+
Make the installation dependent to the variable
NOPORTDOCS so that users can disable it in
/etc/make.conf, like this:
@@ -3683,12 +3683,12 @@ post-install:
${MKDIR}${PREFIX}/share/doc/xv
${INSTALL_MAN} ${WRKSRC}/docs/xvdocs.ps ${PREFIX}/share/doc/xv
.endif
-
+
Do not forget to add them to pkg/PLIST too!
(Do not worry about NOPORTDOCS here; there is
currently no way for the packages to read variables from
/etc/make.conf.)
-
+
Also you can use the pkg/MESSAGE file to
display messages upon installation. See the using
@@ -3700,10 +3700,10 @@ post-install:
pkg/PLIST).
-
+
DIST_SUBDIR
-
+
Do not let your port clutter
/usr/ports/distfiles. If your port requires a
lot of files to be fetched, or contains a file that has a name that
@@ -3716,22 +3716,22 @@ post-install:
/usr/ports/distfiles/DIST_SUBDIR,
and in effect puts everything that is required for your port into
that subdirectory.
-
+
It will also look at the subdirectory with the same name on the
backup master site at ftp.FreeBSD.org.
(Setting DISTDIR explicitly in your
Makefile will not accomplish this, so please use
DIST_SUBDIR.)
-
+
This does not affect the MASTER_SITES you
define in your Makefile.
-
+
Package information
-
+
Do include package information, i.e.
COMMENT, DESCR, and
PLIST, in pkg.
@@ -3742,10 +3742,10 @@ post-install:
NO_PACKAGE is set.
-
+
RCS strings
-
+
Do not put RCS strings in patches. CVS will mangle them when we
put the files into the ports tree, and when we check them out again,
they will come out different and the patch will fail. RCS strings
@@ -3753,10 +3753,10 @@ post-install:
typically start with $Id or
$RCS.
-
+
Recursive diff
-
+
Using the recurse () option to
diff to generate patches is fine, but please take
a look at the resulting patches to make sure you do not have any
@@ -3776,10 +3776,10 @@ post-install:
the patch. Once you are happy with the resulting diff, please split
it up into one source file per patch file.
-
+
PREFIX
-
+
Do try to make your port install relative to
PREFIX. (The value of this variable will be set
to LOCALBASE (default
@@ -3787,7 +3787,7 @@ post-install:
USE_X_PREFIX or USE_IMAKE is
set, in which case it will be X11BASE (default
/usr/X11R6).)
-
+
Not hard-coding /usr/local or
/usr/X11R6 anywhere in the source will make the
port much more flexible and able to cater to the needs of other
@@ -3802,12 +3802,12 @@ post-install:
Do not set USE_X_PREFIX unless your port
truly require it (i.e., it links against X libs or it needs to
reference files in X11BASE).
-
+
The variable PREFIX can be reassigned in your
Makefile or in the user's environment.
However, it is strongly discouraged for individual ports to set this
variable explicitly in the Makefiles.
-
+
Also, refer to programs/files from other ports with the
variables mentioned above, not explicit pathnames. For instance, if
your port requires a macro PAGER to be the full
@@ -3820,16 +3820,16 @@ post-install:
-DPAGER=\"${LOCALBASE}/bin/less\"
-
+
if this is an X port, instead of
-DPAGER=\"/usr/local/bin/less\". This way it will
have a better chance of working if the system administrator has
moved the whole `/usr/local' tree somewhere else.
-
+
Subdirectories
-
+
Try to let the port put things in the right subdirectories of
PREFIX. Some ports lump everything and put it in
the subdirectory with the port's name, which is incorrect. Also,
@@ -3849,10 +3849,10 @@ post-install:
PREFIX/news as a destination
for their files.
-
+
Cleaning up empty directories
-
+
Do make your ports clean up after themselves when they are
deinstalled. This is usually accomplished by adding
@dirrm lines for all directories that are
@@ -3860,7 +3860,7 @@ post-install:
before you can delete parent directories.
- :
+ :
lib/X11/oneko/pixmaps/cat.xpm
lib/X11/oneko/sounds/cat.au
:
@@ -3881,10 +3881,10 @@ lib/X11/oneko/sounds/cat.au
PREFIX/share/doc/gimp is not
empty due to other ports installing some files in there.
-
+
UIDs
-
+
If your port requires a certain user to be on the installed
system, let the pkg/INSTALL script call
pw to create it automatically. Look at
@@ -3894,11 +3894,11 @@ lib/X11/oneko/sounds/cat.au
installed a binary package as when it was compiled, then you must
choose a free UID from 50 to 99 and register it below. Look at
japanese/Wnn for an example.
-
+
Make sure you do not use a UID already used by the system or
other ports. This is the current list of UIDs between 50 and
99.
-
+
majordom:*:54:54:Majordomo Pseudo User:/usr/local/majordomo:/nonexistent
cyrus:*:60:60:the cyrus mail server:/nonexistent:/nonexistent
@@ -3919,15 +3919,15 @@ qmailp:*:84:81:QMail user:/var/qmail:/nonexistent
qmailr:*:86:82:QMail user:/var/qmail:/nonexistent
msql:*:87:87:mSQL-2 pseudo-user:/var/db/msqldb:/bin/sh
mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
-
+
Please include a notice when you submit a port (or an upgrade)
that reserves a new UID or GID in this range. This allows us to
keep the list of reserved IDs up to date.
-
+
Do things rationally
-
+
The Makefile should do things simply and
reasonably. If you can make it a couple of lines shorter or more
readable, then do so. Examples include using a make
@@ -3938,18 +3938,18 @@ mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
GNU_CONFIGURE instead of CONFIGURE_ARGS
+= --prefix=${PREFIX}.
-
+
Respect CFLAGS
-
+
The port should respect the CFLAGS variable.
If it does not, please add NO_PACKAGE=ignores
cflags to the Makefile.
-
+
Configuration files
-
+
If your port requires some configuration files in
PREFIX/etc, do
not just install them and list them in
@@ -3964,27 +3964,27 @@ mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
user has to copy and edit the file before the software can be made
to work.
-
+
Portlint
-
+
Do check your work with portlint
before you submit or commit it.
-
+
Feedback
-
+
Do send applicable changes/patches to the original
author/maintainer for inclusion in next release of the code. This
will only make your job that much easier for the next
release.
-
+
Miscellanea
-
+
The files pkg/DESCR,
pkg/COMMENT, and pkg/PLIST
should each be double-checked. If you are reviewing a port and feel
@@ -3992,44 +3992,44 @@ mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
Do not copy more copies of the GNU General Public License into
our system, please.
-
+
Please be careful to note any legal issues! Do not let us
illegally distribute software!
-
+
If you are stuck…
-
+
Do look at existing examples and the
bsd.port.mk file before asking us questions!
;)
-
+
Do ask us questions if you have any trouble! Do not just beat
your head against a wall! :)
-
+
A Sample Makefile
-
+
Here is a sample Makefile that you can use to
create a new port. Make sure you remove all the extra comments (ones
between brackets)!
-
+
It is recommended that you follow this format (ordering of
variables, empty lines between sections, etc.). This format is
designed so that the most important information is easy to locate. We
recommend that you use portlint to check the
Makefile.
-
+
[the header...just to make it easier for us to identify the ports.]
# New ports collection makefile for: xdvi
[the version required header should updated when upgrading a port.]
# Version required: pl18 [things like "1.5alpha" are fine here too]
-[this is the date when the first version of this Makefile was created.
+[this is the date when the first version of this Makefile was created.
Never change this when doing an update of the port.]
# Date created: 26 May 1995
[this is the person who did the original port to FreeBSD, in particular, the
@@ -4105,7 +4105,7 @@ pre-install:
.include <bsd.port.mk>
-
+ Automated package list creationFirst, make sure your port is almost complete, with only
@@ -4148,18 +4148,18 @@ pre-install:
Package Names
-
+
The following are the conventions you should follow in naming your
packages. This is to have our package directory easy to scan, as
there are already lots and lots of packages and users are going to
turn away if they hurt their eyes!
-
+
The package name should look like
language-name-compiled.specifics-version.numbers.
-
+
If your DISTNAME does not look like that, set
PKGNAME to something in that format.
-
+
FreeBSD strives to support the native language of its users.
@@ -4171,7 +4171,7 @@ pre-install:
zh for Chinese, ko for
Korean and de for German.
-
+
The name part should be all lowercases,
except for a really large package (with lots of programs in it).
@@ -4189,7 +4189,7 @@ pre-install:
has numbers, hyphens, or underscores in its name, you may include
them as well (like kinput2).
-
+
If the port can be built with different hardcoded defaults (usually
@@ -4198,7 +4198,7 @@ pre-install:
the compiled-in defaults (the hyphen is optional). Examples are
papersize and font units.
-
+
The version string should be a period-separated list of
integers and single lowercase alphabetics. The only exception is
@@ -4207,7 +4207,7 @@ pre-install:
minor version numbers in the software.
-
+
Here are some (real) examples on how to convert a
DISTNAME into a suitable
PKGNAME:
@@ -4221,89 +4221,89 @@ pre-install:
Reason
-
+
mule-2.2.2.mule-2.2.2No changes required
-
+
XFree86-3.1.2XFree86-3.1.2No changes required
-
+
EmiClock-1.0.2emiclock-1.0.2No uppercase names for single programs
-
+
gmod1.4gmod-1.4Need a hyphen before version numbers
-
+
xmris.4.0.2xmris-4.0.2Need a hyphen before version numbers
-
+
rdist-1.3alphardist-1.3aNo strings like alpha
allowed
-
+
es-0.9-beta1es-0.9b1No strings like beta
allowed
-
+
v3.3beta021.srctiff-3.3What the heck was that anyway?
-
+
tvtwmtvtwm-pl11Version string always required
-
+
piewmpiewm-1.0Version string always required
-
+
xvgr-2.10pl1xvgr-2.10.1pl allowed only when no
major/minor version numbers
-
+
gawk-2.15.6ja-gawk-2.15.6Japanese language version
-
+
psutils-1.13psutils-letter-1.13Papersize hardcoded at package build time
-
+
pkfontspkfonts300-1.0
@@ -4312,7 +4312,7 @@ pre-install:
-
+
If there is absolutely no trace of version information in the
original source and it is unlikely that the original author will ever
release another version, just set the version string to
@@ -4320,10 +4320,10 @@ pre-install:
the original author or use the date string
(yy.mm.dd) as the version.
-
+
Categories
-
+
As you already know, ports are classified in several categories.
But for this to work, it is important that porters and users understand
what each category and how we decide what to put in each
@@ -4331,19 +4331,19 @@ pre-install:
Current list of categories
-
+
First, this is the current list of port categories. Those
marked with an asterisk (*) are
virtual categories—those that do not have
a corresponding subdirectory in the ports tree.
-
+
For non-virtual categories, you will find a one-line
description in the pkg/COMMENT file in that
subdirectory (e.g.,
archivers/pkg/COMMENT).
-
+
@@ -4352,70 +4352,70 @@ pre-install:
Description
-
+
afterstep*Ports to support AfterStep window manager
-
+
archiversArchiving tools.
-
+
astroAstronomical ports.
-
+
audioSound support.
-
+
benchmarksBenchmarking utilities.
-
+
biologyBiology-related software.
-
+
cadComputer aided design tools.
-
+
chineseChinese language support.
-
+
commsCommunication software. Mostly software to talk to
your serial port.
-
+
convertersCharacter code converters.
-
+
databasesDatabases.
-
+
deskutilsThings that used to be on the desktop before
computers were invented.
-
+
develDevelopment utilities. Do not put libraries here just
@@ -4423,19 +4423,19 @@ pre-install:
belong to anywhere else, they should not be in this
category.
-
+
editorsGeneral editors. Specialized editors go in the section
for those tools (e.g., a mathematical-formula editor will go
in math).
-
+
elispEmacs-lisp ports.
-
+
emulatorsEmulators for other operating systems. Terminal
@@ -4445,7 +4445,7 @@ pre-install:
comms or misc,
depending on the exact functionality.
-
+
ftpFTP client and server utilities. If your
@@ -4453,28 +4453,28 @@ pre-install:
ftp with a secondary
category of www.
-
+
gamesGames.
-
+
germanGerman language support.
-
- gnome*
- Ports from the GNU Object Model Environment (GNOME)
- Project.
-
-
+
+ gnome*
+ Ports from the GNU Object Model Environment (GNOME)
+ Project.
+
+
graphicsGraphics utilities.
-
+
ircInternet Chat Relay utilities.
@@ -4484,7 +4484,7 @@ pre-install:
japaneseJapanese language support.
-
+
javaJava language support.
@@ -4493,14 +4493,14 @@ pre-install:
kde*Ports from the K Desktop Environment (KDE)
- Project.
+ Project.
-
+
koreanKorean language support.
-
+
langProgramming languages.
@@ -4516,12 +4516,12 @@ pre-install:
Numerical computation software and other utilities
for mathematics.
-
+
mboneMBone applications.
-
+
miscMiscellaneous utilities—basically things that
@@ -4532,136 +4532,136 @@ pre-install:
safely delete misc and just put the port
in that other subdirectory!
-
+
netMiscellaneous networking software.
-
+
newsUSENET news software.
-
+
offix*Ports from the OffiX suite.
-
+
palmSoftware support for the 3Com Palm(tm) series.
-
+
perl5*Ports that require perl version 5 to run.
-
+
plan9*Various programs from Plan9.
-
+
printPrinting software. Desktop publishing tools
(previewers, etc.) belong here too.
-
+
python*Software written in python.
-
+
russianRussian language support.
-
+
securitySecurity utilities.
-
+
shellsCommand line shells.
-
+
sysutilsSystem utilities.
-
+
tcl75*Ports that use Tcl version 7.5 to run.
-
+
tcl76*Ports that use Tcl version 7.6 to run.
-
+
tcl80*Ports that use Tcl version 8.0 to run.
-
+
tcl81*Ports that use Tcl version 8.1 to run.
-
+
textprocText processing utilities. It does not include
desktop publishing tools, which go to print/.
-
+
tk41*Ports that use Tk version 4.1 to run.
-
+
tk42*Ports that use Tk version 4.2 to run.
-
+
tk80*Ports that use Tk version 8.0 to run.
-
+
tk81*Ports that use Tk version 8.1 to run.
-
- tkstep80*
- Ports that use TkSTEP version 8.0 to run.
-
-
+
+ tkstep80*
+ Ports that use TkSTEP version 8.0 to run.
+
+
vietnameseVietnamese language support.
-
+
windowmaker*Ports to support the WindowMaker window
manager
-
+
wwwSoftware related to the World Wide Web. HTML language
support belong here too.
-
+
x11The X window system and friends. This category is only
@@ -4672,22 +4672,22 @@ pre-install:
categories. Also, many of them go into other
x11-* categories (see below).
-
+
x11-clocksX11 clocks.
-
+
x11-fmX11 file managers.
-
+
x11-fontsX11 fonts and font utilities.
-
+
x11-serversX11 servers.
@@ -4697,7 +4697,7 @@ pre-install:
x11-toolkitsX11 toolkits.
-
+
x11-wmX11 window managers.
@@ -4706,15 +4706,15 @@ pre-install:
-
+
Choosing the right category
-
+
As many of the categories overlap, you often have to choose
which of the categories should be the primary category of your port.
There are several rules that govern this issue. Here is the list of
priorities, in decreasing order of precedence.
-
+
Language specific categories always come first. For
@@ -4722,17 +4722,17 @@ pre-install:
CATEGORIES line would read japanese
x11-fonts.
-
+
Specific categories win over less-specific ones. For
instance, an HTML editor should be listed as www
editors, not the other way around. Also, you do not
need to list net when the port belongs to
- either of irc, mail,
- mbone, news,
+ either of irc, mail,
+ mbone, news,
security, or www.
-
+
x11 is used as a secondary category only
when the primary category is a natural language. In particular,
@@ -4745,7 +4745,7 @@ pre-install:
misc.
-
+
If you are not sure about the category, please put a comment to
that effect in your send-pr submission so we can
discuss it before import it. (If you are a committer, send a note
@@ -4753,10 +4753,10 @@ pre-install:
imported to a wrong category only to be moved right away.)
-
+
Changes to this document and the ports system
-
+
If you maintain a lot of ports, you should consider following the
&a.ports;. Important changes to the way ports work will be announced
there. You can always find more detailed information on the latest
@@ -4764,10 +4764,10 @@ pre-install:
url="http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/Mk/bsd.port.mk"> the
bsd.port.mk CVS log.
-
+
That is It, Folks!
-
+
Boy, this sure was a long tutorial, wasn't it? Thanks for
following us to here, really. Now that you know how to do a port,
have at it and convert everything in the world into ports! That
diff --git a/en_US.ISO_8859-1/books/porters-handbook/book.sgml b/en_US.ISO_8859-1/books/porters-handbook/book.sgml
index d8754a9169..f1d732b29d 100644
--- a/en_US.ISO_8859-1/books/porters-handbook/book.sgml
+++ b/en_US.ISO_8859-1/books/porters-handbook/book.sgml
@@ -1,17 +1,17 @@
-
+
Installing Applications: The Ports collection
-
+
Contributed by &a.jraynard;.
-
+
The FreeBSD Ports collection allows you to compile and install a very
wide range of applications with a minimum of effort.
-
+
For all the hype about open standards, getting a program to work on
different versions of Unix in the real world can be a tedious and tricky
business, as anyone who has tried it will know. You may be lucky enough
@@ -21,7 +21,7 @@
programs, you will find yourself doing a fair bit of head-scratching, and
there are quite a few programs that will result in premature greying, or
even chronic alopecia...
-
+
Some software distributions have attacked this problem by providing
configuration scripts. Some of these are very clever, but they have an
unfortunate tendency to triumphantly announce that your system is
@@ -30,72 +30,72 @@
your system's gethitlist function return a const pointer to a fromboz or
a pointer to a const fromboz? Do you have Foonix style unacceptable
exception handling? And if not, why not?).
-
+
Fortunately, with the Ports collection, all the hard work involved has
already been done, and you can just type make install
and get a working program.
-
+
Why Have a Ports Collection?
-
+
The base FreeBSD system comes with a very wide range of tools and
system utilities, but a lot of popular programs are not in the base
system, for good reasons:-
-
+
Programs that some people cannot live without and other people
cannot stand, such as a certain Lisp-based editor.
-
+
Programs which are too specialised to put in the base system
(CAD, databases).
-
+
Programs which fall into the “I must have a look at that
when I get a spare minute” category, rather than
system-critical ones (some languages, perhaps).
-
+
Programs that are far too much fun to be supplied with a serious
operating system like FreeBSD ;-)
-
+
However many programs you put in the base system, people will
always want more, and a line has to be drawn somewhere (otherwise
FreeBSD distributions would become absolutely enormous).
-
+
Obviously it would be unreasonable to expect everyone to port their
favourite programs by hand (not to mention a tremendous amount of
duplicated work), so the FreeBSD Project came up with an ingenious way
of using standard tools that would automate the process.
-
+
Incidentally, this is an excellent illustration of how “the
Unix way” works in practice by combining a set of simple but very
flexible tools into something very powerful.
-
+
How Does the Ports Collection Work?
-
+
Programs are typically distributed on the Internet as a tarball consisting of a Makefile and
the source code for the program and usually some instructions (which are
unfortunately not always as instructive as they could be), with perhaps
a configuration script.
-
+
The standard scenario is that you FTP down the tarball, extract it
somewhere, glance through the instructions, make any changes that seem
necessary, run the configure script to set things up and use the
standard make program to compile and install the
program from the source.
-
+
FreeBSD ports still use the tarball mechanism, but use a skeleton to hold the
"knowledge" of how to get the program working on FreeBSD,
@@ -103,7 +103,7 @@
supply their own customised Makefile, so that almost every port
can be built in the same way.
-
+
If you look at a port skeleton (either on your FreeBSD
system or Getting a port).
-
+
“How on earth can this do anything?” I hear you cry.
“There is no source code there!”
-
+
Fear not, gentle reader, all will become clear (hopefully). Let us
see what happens if we try and install a port. I have chosen
ElectricFence, a useful tool for developers,
as the skeleton is more straightforward than most.
-
+
If you are trying this at home, you will need to be root.
-
+
&prompt.root; cd /usr/ports/devel/ElectricFence
&prompt.root; make install
>> Checksum OK for ElectricFence-2.0.5.tar.gz.
@@ -142,57 +142,57 @@ install -c -o root -g wheel -m 444 /usr/ports/devel/ElectricFence/work/ElectricF
install -c -o root -g wheel -m 444 /usr/ports/devel/ElectricFence/work/ElectricFence-2.0.5/libefence.3 /usr/local/man/man3
===> Compressing manual pages for ElectricFence-2.0.5
===> Registering installation for ElectricFence-2.0.5
-
+
To avoid confusing the issue, I have completely removed the build
output.
-
+
If you tried this yourself, you may well have got something like
this at the start:-
-
+
&prompt.root; make install
>> ElectricFence-2.0.5.tar.gz doesn't seem to exist on this system.
>> Attempting to fetch from ftp://ftp.doc.ic.ac.uk/Mirrors/sunsite.unc.edu/pub/Linux/devel/lang/c/.
-
+
The make program has noticed that you did not
have a local copy of the source code and tried to FTP it down so it
could get the job done. I already had the source handy in my example,
so it did not need to fetch it.
-
+
Let's go through this and see what the make
program was doing.
-
+
Locate the source code tarball. If it is not available
locally, try to grab it from an FTP site.
-
+
Run a checksum test on the
tarball to make sure it has not been tampered with, accidentally
truncated, downloaded in ASCII mode, struck by neutrinos while in
transit, etc.
-
+
Extract the tarball into a temporary work directory.
-
+
Apply any patches needed to
get the source to compile and run under FreeBSD.
-
+
Run any configuration script required by the build process and
correctly answer any questions it asks.
-
+
(Finally!) Compile the code.
-
+
Install the program executable and other supporting files, man
pages, etc. under the /usr/local hierarchy
@@ -202,7 +202,7 @@ install -c -o root -g wheel -m 444 /usr/ports/devel/ElectricFence/work/ElectricF
makes sure that all the ports you install will go in the same place,
instead of being flung all over your system.
-
+
Register the installation in a database. This means that, if
you do not like the program, you can cleanly
-
+
Scroll up to the make output and see if you can
match these steps to it. And if you were not impressed before, you
should be by now!
-
+
Getting a FreeBSD Port
-
+
There are two ways of getting hold of the FreeBSD port for a
program. One requires a FreeBSD CDROM,
the other involves using an Internet
Connection.
-
+
Compiling ports from CDROM
-
+
Assuming that your FreeBSD CDROM is in the drive and mounted on
/cdrom (and the mount point
must be /cdrom), you should
@@ -252,7 +252,7 @@ WRKDIRPREFIX= /tmp
/tmp/cdrom/ports; for instance,
games/oneko will be built under
/tmp/cdrom/ports/games/oneko.
-
+
There are some ports for which we cannot provide the original
source in the CDROM due to licensing limitations. In that case, you
@@ -261,10 +261,10 @@ WRKDIRPREFIX= /tmp
connection.
-
+
Compiling ports from the Internet
-
+
If you do not have a CDROM, or you want to make sure you get the
very latest version of the port you want, you will need to download
the skeleton for the port. Now
@@ -276,13 +276,13 @@ WRKDIRPREFIX= /tmp
from the ports web
page. These packages include files that have been updated
since the release that you may need to compile new ports.
-
+
The key to the skeletons is that the FreeBSD FTP server can create
on-the-fly tarballs for you.
Here is how it works, with the gnats program in the databases
directory as an example (the bits in square brackets are comments. Do
not type them in if you are trying this yourself!):-
-
+
&prompt.root; cd /usr/ports
&prompt.root; mkdir databases
&prompt.root; cd databases
@@ -298,24 +298,24 @@ password. Remember to use binary (also known as image) mode!]
&prompt.root; cd gnats
&prompt.root; make install
[build and install gnats]
-
+
What happened here? We connected to the FTP server in the usual
way and went to its databases sub-directory.
When we gave it the command get gnats.tar, the FTP
server tarred up the gnats
directory for us.
-
+
We then extracted the gnats skeleton and went into the gnats
directory to build the port. As we explained earlier, the make process noticed we
did not have a copy of the source locally, so it fetched one before
extracting, patching and building it.
-
+
Let us try something more ambitious now. Instead of getting a
single port skeleton, we will get a whole sub-directory, for example all
the database skeletons in the ports collection. It looks almost the
same:-
-
+
&prompt.root; cd /usr/ports
&prompt.root; ftp ftp.FreeBSD.org
[log in as `ftp' and give your email address when asked for a
@@ -329,34 +329,34 @@ password. Remember to use binary (also known as image) mode!]
&prompt.root; cd databases
&prompt.root; make install
[build and install all the database ports]
-
+
With half a dozen straightforward commands, we have now got a set
of database programs on our FreeBSD machine! All we did that was
different from getting a single port skeleton and building it was that
we got a whole directory at once, and compiled everything in it at
once. Pretty impressive, no?
-
+
If you expect to be installing many ports, it is probably worth
downloading all the ports directories.
-
+
Skeletons
-
+
A team of compulsive hackers who have forgotten to eat in a frantic
attempt to make a deadline? Something unpleasant lurking in the FreeBSD
attic? No, a skeleton here is a minimal framework that supplies
everything needed to make the ports magic work.
-
+
Makefile
-
+
The most important component of a skeleton is the Makefile. This
contains various statements that specify how the port should be
compiled and installed. Here is the Makefile for
ElectricFence:-
-
+
# New ports collection makefile for: Electric Fence
# Version required: 2.0.5
@@ -380,19 +380,19 @@ do-install:
${INSTALL_MAN} ${WRKSRC}/libefence.3 ${PREFIX}/man/man3
.include <bsd.port.mk>
-
+
The lines beginning with a "#" sign are comments for the
benefit of human readers (as in most Unix script files).
-
+
DISTNAME specifies the name of the tarball, but without the
extension.
-
+
CATEGORIES states what kind of program this is.
In this case, a utility for developers. See the categories section of this
handbook for a complete list.
-
+
MASTER_SITES is the URL(s) of the master FTP
site, which is used to retrieve the tarball if it is not available on the
@@ -400,18 +400,18 @@ do-install:
normally the one from which the program is officially distributed (in
so far as any software is "officially" distributed on the
Internet).
-
+
MAINTAINER is the email address of the person
who is responsible for updating the skeleton if, for example a new
version of the program comes out.
-
+
Skipping over the next few lines for a minute, the line
.include <bsd.port.mk> says that the other
statements and commands needed for this port are in a standard file
called bsd.port.mk. As these are the same for
all ports, there is no point in duplicating them all over the place,
so they are kept in a single standard file.
-
+
This is probably not the place to go into a detailed examination
of how Makefiles work; suffice it to say that the line starting with
MAN3 ensures that the ElectricFence man page is
@@ -421,31 +421,31 @@ do-install:
do-install ensure that the files produced by
this port are placed in the correct destination.
-
+
The files directory
-
+
The file containing the checksum for the port is called
md5, after the MD5 algorithm used for ports
checksums. It lives in a directory with the slightly confusing name
of files.
-
+
This directory can also contain other miscellaneous files that are
required by the port and do not belong anywhere else.
-
+
The patches directory
-
+
This directory contains the patches needed to make everything work
properly under FreeBSD.
-
+
The pkg directory
-
+
This program contains three quite useful files:-
@@ -453,12 +453,12 @@ do-install:
COMMENT — a one-line description of
the program.
-
+
DESCR — a more detailed
description.
-
+
PLIST — a list of all the files
that will be created when the program is installed.
@@ -466,18 +466,18 @@ do-install:
-
+
What to do when a port does not work.
-
+
Oh. You can do one of four (4) things :
-
+
Fix it yourself. Technical details on how ports work can be
found in Porting applications.
-
+
Gripe. This is done by e-mail only! Send
such e-mail to the maintainer of the port, first. Type
@@ -490,12 +490,12 @@ do-install:
you can try filing a bug report with send-pr.
-
+
Forget it. This is the easiest for most — very few of the
programs in ports can be classified as essential!
-
+
Grab the pre-compiled package from a ftp server. The
“master” package collection is on FreeBSD's FTP server
@@ -509,10 +509,10 @@ do-install:
-
+
Some Questions and Answers
-
+
@@ -529,7 +529,7 @@ do-install:
things).
-
+
I thought you were supposed to use packages to install extra
@@ -541,7 +541,7 @@ do-install:
it.
-
+
So why bother with ports then?
@@ -549,25 +549,25 @@ do-install:
Several reasons:-
-
+
The licensing conditions on some software distributions
require that they be distributed as source code, not
binaries.
-
+
Some people do not trust binary distributions. At least
with source code you can (in theory) read through it and look
for potential problems yourself.
-
+
If you have some local patches, you will need the source to
add them yourself.
-
+
You might have opinions on how a program should be compiled
that differ from the person who did the package — some
@@ -575,13 +575,13 @@ do-install:
used, whether to build debug versions and then strip them or
not, etc. etc.
-
+
Some people like having code around, so they can read it if
they get bored, hack around with it, borrow from it (licence
terms permitting, of course!) and so on.
-
+
If you ain't got the source, it ain't software! ;-)
@@ -589,7 +589,7 @@ do-install:
-
+
What is a patch?
@@ -604,7 +604,7 @@ do-install:
generated by a program of that name.
-
+
What is all this about
@@ -616,25 +616,25 @@ do-install:
.tar.gz (with variations like
.tar.Z, or even .tgz if
you are trying to squeeze the names into a DOS filesystem).
-
+
Basically, it is a directory tree that has been archived into a
single file (.tar) and optionally compressed
(.gz). This technique was originally used for
Tape ARchives (hence the
name tar), but it is 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:-
-
- &prompt.user; tar tvzf foobar.tar.gz
+
+ &prompt.user; tar tvzf foobar.tar.gz
&prompt.user; tar xzvf foobar.tar.gz
&prompt.user; tar tvf foobar.tar
&prompt.user; tar xvf foobar.tar
-
+
And a checksum?
@@ -650,7 +650,7 @@ do-install:
addition).
-
+
I did what you said for compiling ports from a CDROM and it
@@ -659,7 +659,7 @@ do-install:
&prompt.root; 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 it not be found? Have I got a dud CDROM?
@@ -676,7 +676,7 @@ do-install:
bandwidth).
-
+
I did that, but when I tried to put it into
@@ -690,11 +690,11 @@ do-install:
to copy anything there because it is sym-linked to the CDROM, which
is read-only. You can tell it to look somewhere else by
doing
-
+
&prompt.root; make DISTDIR=/where/you/put/it install
-
+
Does the ports scheme only work if you have everything in
@@ -708,31 +708,31 @@ do-install:
You can use the PORTSDIR and
PREFIX variables to tell the ports mechanism to
use different directories. For instance,
-
+
&prompt.root; make PORTSDIR=/u/people/guests/wurzburger/ports install
-
+
will compile the port in
/u/people/guests/wurzburger/ports and install
everything under /usr/local.
-
+
&prompt.root; make PREFIX=/u/people/guests/wurzburger/local install
-
+
will compile it in /usr/ports and install
it in /u/people/guests/wurzburger/local.
-
+
And of course
-
+
&prompt.root; make PORTSDIR=.../ports PREFIX=.../local install
-
+
will combine the two (it is too long to fit on the page if I
write it in full, but I am sure you get the idea).
-
+
If you do not fancy typing all that in every time you install a
port (and to be honest, who would?), it is a good idea to put these
variables into your environment.
-
+
I do not have a FreeBSD CDROM, but I would like to have all
@@ -744,20 +744,20 @@ do-install:
To get every single tarball for the ports collection,
do
-
+
&prompt.root; cd /usr/ports
&prompt.root; make fetch
-
+
For all the tarballs for a single ports directory, do
-
+
&prompt.root; cd /usr/ports/directory
&prompt.root; make fetch
-
+
and for just one port — well, I think you have guessed
already.
-
+
I know it is probably faster to fetch the tarballs from one
@@ -776,7 +776,7 @@ do-install:
&prompt.root; make MASTER_SITE_OVERRIDE=ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/ fetch
-
+
I want to know what files make is going to need before it
@@ -788,7 +788,7 @@ do-install:
the files needed for a port.
-
+
Is there any way to stop the port from compiling? I want to
@@ -801,7 +801,7 @@ do-install:
has fetched and extracted the source code.
-
+
I am trying to make my own port and I want to be able to
@@ -816,7 +816,7 @@ do-install:
as well. And by the way, thank you for your efforts!
-
+
I have heard that some compiler options can cause bugs. Is
@@ -832,9 +832,9 @@ do-install:
(Most of the ports do not use ). You
should be able to specify the compiler options
used by something like
-
+
&prompt.root; make CFLAGS='-O2 -fno-strength-reduce' install
-
+
or by editing /etc/make.conf, but
unfortunately not all ports respect this. The surest way is to do
make configure, then go into the source directory
@@ -843,7 +843,7 @@ do-install:
Makefiles.
-
+
There are so many ports it is hard to find the one I want.
@@ -861,7 +861,7 @@ do-install:
&prompt.user; make search key=lisp
-
+
I went to install the foo port but the
@@ -878,7 +878,7 @@ do-install:
foo port.
-
+
I installed the
@@ -889,7 +889,7 @@ do-install:
No problem, just do
-
+
&prompt.root; pkg_delete grizzle-6.5Alternatively, you can do
@@ -898,7 +898,7 @@ do-install:
&prompt.root; make deinstall
-
+
@@ -909,13 +909,13 @@ do-install:
Not at all, you can find it out by doing
-
+
&prompt.root; pkg_info -a | grep grizzle
Information for grizzle-6.5:
grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arcade game.
-
+
Talking of disk space, the ports directory seems to be
@@ -927,15 +927,15 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
Yes, if you have installed the program and are fairly
certain you will not need the source again, there is no point in
keeping it hanging around. The best way to do this is
-
+
&prompt.root; cd /usr/ports
&prompt.root; make clean
-
+
which will go through all the ports subdirectories and delete
everything except the skeletons for each port.
-
+
I tried that and it still left all those tarballs or
@@ -948,7 +948,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
go as well.
-
+
I like having lots and lots of programs to play with. Is
@@ -957,12 +957,12 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
Just do
-
+
&prompt.root; cd /usr/ports
&prompt.root; make install
-
+
OK, I tried that, but I thought it would take a very long
@@ -978,7 +978,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
someone on hand to answer them.
-
+
I really do not want to spend all day staring at the
@@ -988,20 +988,20 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
OK, do this before you go to bed/work/the local
park:-
-
+
&prompt.root cd /usr/ports
&prompt.root; make -DBATCH install
-
+
This will install every port that does not
require user input. Then, when you come back, do
-
+
&prompt.root; cd /usr/ports
&prompt.root; make -DIS_INTERACTIVE install
-
+
to finish the job.
-
+
At work, we are using frobble, which is
@@ -1013,7 +1013,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
No problem, assuming you know how to make patches for your
changes:-
-
+
&prompt.root; cd /usr/ports/somewhere/frobble
&prompt.root; make extract
&prompt.root; cd work/frobble-2.8
@@ -1022,7 +1022,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
&prompt.root; make package
-
+
This ports stuff is really clever. I am desperate to find
@@ -1042,16 +1042,16 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
-
+
Making a port yourself
-
+
Contributed by &a.jkh;, &a.gpalmer;, &a.asami;, &a.obrien;,
and &a.hoek;. 28 August 1996.So, now you are interested in making your own port or upgrading
an existing one? Great!
-
+
What follows are some guidelines for creating a new port for
FreeBSD. If you want to upgrade an existing port, you should read this
and then read .
@@ -1061,7 +1061,7 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
include. Even if you do not hack Makefiles daily, it is well
commented, and you will still gain much knowledge from it.
Additionally, you may send specific questions to &a.ports;.
-
+
Only a fraction of the overridable variables
(VAR) are mentioned in
@@ -1073,30 +1073,30 @@ grizzle-6.5 - the combined piano tutorial, LOGO interpreter and shoot 'em up arc
set to use the correct value by typing :set tabstop=4
once the file has been loaded.
-
+
Quick Porting
-
+
This section tells you how to do a quick port. In many cases, it
is not enough, but we will see.
-
+
First, get the original tarball and put it into
DISTDIR, which defaults to
/usr/ports/distfiles.
-
+
The following assumes that the software compiled out-of-the-box,
i.e., there was absolutely no change required for the port to work
on your FreeBSD box. If you needed to change something, you will
have to refer to the next section too.
-
+
Writing the Makefile
-
+
The minimal Makefile would look something
like this:
-
+
# New ports collection makefile for: oneko
# Version required: 1.1b
@@ -1124,19 +1124,19 @@ USE_IMAKE= yes
tree. You can find a more detailed example in the sample Makefile section.
-
+
Writing the description files
-
+
There are three description files that are required for any
port, whether they actually package or not. They are
COMMENT, DESCR, and
PLIST, and reside in the
pkg subdirectory.
-
+
COMMENT
-
+
This is the one-line description of the port.
Please do not include the package name (or
version number of the software) in the comment. The comment
@@ -1146,10 +1146,10 @@ USE_IMAKE= yes
A cat chasing a mouse all over the screen
-
+
DESCR
-
+
This is a longer description of the port. One to a few
paragraphs concisely explaining what the port does is
sufficient.
@@ -1166,10 +1166,10 @@ A cat chasing a mouse all over the screen
WWW: so that automated tools will work
correctly.
-
+
It is recommended that you sign your name at the end of this
file, as in:
-
+
This is a port of oneko, in which a cat chases a poor mouse all over
the screen.
@@ -1181,10 +1181,10 @@ WWW: http://www.oneko.org/
- Satoshi
asami@cs.berkeley.edu
-
+
PLIST
-
+
This file lists all the files installed by the port. It is
also called the “packing list” because the package is
generated by packing the files listed here. The pathnames are
@@ -1193,9 +1193,9 @@ asami@cs.berkeley.edu
/usr/X11R6). If you are using the
MANn variables (as
you should be), do not list any manpages here.
-
+
Here is a small example:
-
+
bin/oneko
lib/X11/app-defaults/Oneko
@@ -1203,7 +1203,7 @@ lib/X11/oneko/cat1.xpm
lib/X11/oneko/cat2.xpm
lib/X11/oneko/mouse.xpm
@dirrm lib/X11/oneko
-
+
Refer to the &man.pkg.create.1; man page for details on the
packing list.
@@ -1225,18 +1225,18 @@ lib/X11/oneko/mouse.xpm
-
+
Creating the checksum file
-
+
Just type make makesum. The ports make rules
will automatically generate the file
files/md5.
-
+
Testing the port
-
+
You should make sure that the port rules do exactly what you
want it to do, including packaging up the port. These are the
important points you need to verify.
@@ -1246,56 +1246,56 @@ lib/X11/oneko/mouse.xpm
PLIST does not contain anything not
installed by your port
-
+
PLIST contains everything that is
installed by your port
-
+
Your port can be installed multiple times using the
reinstall target
-
+
Your port cleans up
after itself upon deinstall
-
+
Recommended test ordering
-
+
make install
-
+
make package
-
+
make deinstall
-
+
pkg_add package-name
-
+
make deinstall
-
+
make reinstall
-
+
make package
-
+
Make sure that there are not any warnings issued in any of the
package and
deinstall stages, After step 3, check to
@@ -1303,10 +1303,10 @@ lib/X11/oneko/mouse.xpm
using the software after step 4, to ensure that is works correctly
when installed from a package.
-
+
Checking your port with portlint
-
+
Please use portlint to see if your port
conforms to our guidelines. The portlint program
is part of the ports collection. In particular, your may want to
@@ -1315,13 +1315,13 @@ lib/X11/oneko/mouse.xpm
linkend="porting-pkgname">package is named
appropriately.
-
+
Submitting the port
-
+
First, make sure you have read the Do's and Dont's section.
-
+
Now that you are happy with your port, the only thing remaining
is to put it in the main FreeBSD ports tree and make everybody else
happy about it too. We do not need your work
@@ -1342,7 +1342,7 @@ lib/X11/oneko/mouse.xpm
One more time, do not include the original source
distfile, the work directory, or the package
you built with make package.
-
+
In the past, we asked you to upload new port submissions in
our ftp site (ftp.FreeBSD.org). This
@@ -1350,7 +1350,7 @@ lib/X11/oneko/mouse.xpm
incoming/ directory of that site due to the
large amount of pirated software showing up there.
-
+
We will look at your port, get back to you if necessary, and put
it in the tree. Your name will also appear in the list of
“Additional FreeBSD contributors” on the FreeBSD
@@ -1358,29 +1358,29 @@ lib/X11/oneko/mouse.xpm
-->:)
-
+
Slow Porting
-
+
Ok, so it was not that simple, and the port required some
modifications to get it to work. In this section, we will explain,
step by step, how to modify it to get it to work with the ports
paradigm.
-
+
How things work
-
+
First, this is the sequence of events which occurs when the user
first types make in your port's directory, and
you may find that having bsd.port.mk in another
window while you read this really helps to understand it.
-
+
But do not worry if you do not really understand what
bsd.port.mk is doing, not many people do...
:>
-
+
-
+
The fetch target is run. The
fetch target is responsible for making
@@ -1397,7 +1397,7 @@ lib/X11/oneko/mouse.xpm
the file in DISTDIR for future use and
proceed.
-
+
The extract target is run. It
looks for your port's distribution file (typically a gzip'd
@@ -1405,7 +1405,7 @@ lib/X11/oneko/mouse.xpm
temporary subdirectory specified by WRKDIR
(defaults to work).
-
+
The patch target is run. First,
any patches defined in PATCHFILES are
@@ -1414,24 +1414,24 @@ lib/X11/oneko/mouse.xpm
patches subdirectory), they are applied at
this time in alphabetical order.
-
+
The configure target is run. This
can do any one of many different things.
-
+
If it exists, scripts/configure is
run.
-
+
If HAS_CONFIGURE or
GNU_CONFIGURE is set,
WRKSRC/configure is
run.
-
+
If USE_IMAKE is set,
XMKMF (default: xmkmf
@@ -1439,7 +1439,7 @@ lib/X11/oneko/mouse.xpm
-
+
The build target is run. This is
responsible for descending into the port's private working
@@ -1449,7 +1449,7 @@ lib/X11/oneko/mouse.xpm
be used.
-
+
The above are the default actions. In addition, you can define
targets
pre-something or
@@ -1457,7 +1457,7 @@ lib/X11/oneko/mouse.xpm
or put scripts with those names, in the scripts
subdirectory, and they will be run before or after the default
actions are done.
-
+
For example, if you have a post-extract
target defined in your Makefile, and a file
pre-build in the scripts
@@ -1468,7 +1468,7 @@ lib/X11/oneko/mouse.xpm
Makefile targets if the actions are simple
enough, because it will be easier for someone to figure out what
kind of non-default action the port requires.
-
+
The default actions are done by the
bsd.port.mk targets
do-something.
@@ -1488,22 +1488,22 @@ lib/X11/oneko/mouse.xpm
do-extract, but never ever touch
extract!
-
+
Now that you understand what goes on when the user types
make, let us go through the recommended steps to
create the perfect port.
-
+
Getting the original sources
-
+
Get the original sources (normally) as a compressed tarball
(foo.tar.gz or
foo.tar.Z) and copy
it into DISTDIR. Always use
mainstream sources when and where you
can.
-
+
If you cannot find a ftp/http site that is well-connected to the
net, or can only find sites that have irritatingly non-standard
formats, you might want to put a copy on a reliable ftp or http
@@ -1519,7 +1519,7 @@ lib/X11/oneko/mouse.xpm
as the last resort. Please refer to this location as
MASTER_SITE_LOCAL. Send mail to the &a.ports;if
you are not sure what to do.
-
+
If your port's distfile changes all the time for no good reason,
consider putting the distfile in your home page and listing it as
the first MASTER_SITES. This will prevent users
@@ -1528,7 +1528,7 @@ lib/X11/oneko/mouse.xpm
there is only one master site for the port, it is recommended that
you house a backup at your site and list it as the second
MASTER_SITES.
-
+
If your port requires some additional `patches' that are
available on the Internet, fetch them too and put them in
DISTDIR. Do not worry if they come from a site
@@ -1536,10 +1536,10 @@ lib/X11/oneko/mouse.xpm
handle these situations (see the description of PATCHFILES below).
-
+
Modifying the port
-
+
Unpack a copy of the tarball in a private directory and make
whatever changes are necessary to get the port to compile properly
under the current version of FreeBSD. Keep careful
@@ -1547,14 +1547,14 @@ lib/X11/oneko/mouse.xpm
the process shortly. Everything, including the deletion, addition
or modification of files should be doable using an automated script
or patch file when your port is finished.
-
+
If your port requires significant user interaction/customization
to compile or install, you should take a look at one of Larry Wall's
classic Configure scripts and perhaps do
something similar yourself. The goal of the new ports collection is
to make each port as “plug-and-play” as possible for the
end-user while using a minimum of disk space.
-
+
Unless explicitly stated, patch files, scripts, and other
files you have created and contributed to the FreeBSD ports
@@ -1562,10 +1562,10 @@ lib/X11/oneko/mouse.xpm
conditions.
-
+
Patching
-
+
In the preparation of the port, files that have been added or
changed can be picked up with a recursive diff for later feeding to
patch. Each set of patches you wish to apply should be collected
@@ -1584,10 +1584,10 @@ lib/X11/oneko/mouse.xpm
patch-ab both changing
WRKSRC/foobar.c).
-
+
Configuring
-
+
Include any additional customization commands to your
configure script and save it in the
scripts subdirectory. As mentioned above, you
@@ -1595,10 +1595,10 @@ lib/X11/oneko/mouse.xpm
scripts with the name pre-configure or
post-configure.
-
+
Handling user input
-
+
If your port requires user input to build, configure or install,
then set IS_INTERACTIVE in your Makefile. This
will allow “overnight builds” to skip your port if the
@@ -1614,23 +1614,23 @@ lib/X11/oneko/mouse.xpm
packages for CD-ROMs and ftp.
-
+
Configuring the Makefile
-
+
Configuring the Makefile is pretty simple, and again we suggest
that you look at existing examples before starting. Also, there is a
sample Makefile in this
handbook, so take a look and please follow the ordering of variables
and sections in that template to make your port easier for others to
read.
-
+
Now, consider the following problems in sequence as you design
your new Makefile:
-
+
The original source
-
+
Does it live in DISTDIR as a standard gzip'd
tarball? If so, you can go on to the next step. If not, you should
look at overriding any of the EXTRACT_CMD,
@@ -1641,15 +1641,15 @@ lib/X11/oneko/mouse.xpm
file is. (The most common case is
EXTRACT_SUFX=.tar.Z, when the tarball is
condensed by regular compress, not gzip.)
-
+
In the worst case, you can simply create your own
do-extract target to override the default,
though this should be rarely, if ever, necessary.
-
+
DISTNAME
-
+
You should set DISTNAME to be the base name
of your port. The default rules expect the distribution file list
(DISTFILES) to be named
@@ -1657,12 +1657,12 @@ lib/X11/oneko/mouse.xpm
it is a normal tarball, is going to be something like
foozolix-1.0.tar.gz for a setting of
DISTNAME=foozolix-1.0.
-
+
The default rules also expect the tarball(s) to extract into a
subdirectory called
work/DISTNAME, e.g.
work/foozolix-1.0/.
-
+
All this behavior can be overridden, of course; it simply
represents the most common time-saving defaults. For a port
requiring multiple distribution files, simply set
@@ -1673,20 +1673,20 @@ lib/X11/oneko/mouse.xpm
and the rest will be just left in DISTDIR for
later use.
-
+
PKGNAME
-
+
If DISTNAME does not conform to our guidelines for a good package
name, you should set the PKGNAME
variable to something better. See the abovementioned guidelines for
more details.
-
+
CATEGORIES
-
+
When a package is created, it is put under
/usr/ports/packages/All and links are made from
one or more subdirectories of
@@ -1716,25 +1716,25 @@ lib/X11/oneko/mouse.xpm
mistype the category name, so be careful!
-
+
MASTER_SITES
-
+
Record the directory part of the ftp/http-URL pointing at the
original tarball in MASTER_SITES. Do not forget
the trailing slash (/)!
-
+
The make macros will try to use this
specification for grabbing the distribution file with
FETCH if they cannot find it already on the
system.
-
+
It is recommended that you put multiple sites on this list,
preferably from different continents. This will safeguard against
wide-area network problems, and we are even planning to add support
for automatically determining the closest master site and fetching
from there!
-
+
If the original tarball is part of one of the following popular
archives: X-contrib, GNU, Perl CPAN, TeX CTAN, or Linux Sunsite, you
refer to those sites in an easy compact form using
@@ -1749,33 +1749,33 @@ lib/X11/oneko/mouse.xpm
MASTER_SITES= ${MASTER_SITE_XCONTRIB}
MASTER_SITE_SUBDIR= applications
-
+
The user can also set the MASTER_SITE_*
variables in /etc/make.conf to override our
choices, and use their favorite mirrors of these popular archives
instead.
-
+
PATCHFILES
-
+
If your port requires some additional patches that are available
by ftp or http, set PATCHFILES to the names of
the files and PATCH_SITES to the URL of the
directory that contains them (the format is the same as
MASTER_SITES).
-
+
If the patch is not relative to the top of the source tree
(i.e., WKRSRC) because it contains some extra
pathnames, set PATCH_DIST_STRIP accordingly. For
instance, if all the pathnames in the patch have an extra
foozolix-1.0/ in front of the filenames, then set
PATCH_DIST_STRIP=-p1.
-
+
Do not worry if the patches are compressed, they will be
decompressed automatically if the filenames end with
.gz or .Z.
-
+
If the patch is distributed with some other files, such as
documentation, in a gzip'd tarball, you cannot just use
PATCHFILES. If that is the case, add the name
@@ -1797,30 +1797,30 @@ MASTER_SITE_SUBDIR= applications
target.
-
+
MAINTAINER
-
+
Set your mail-address here. Please. :)
-
+
For detailed description of the responsibility of maintainers,
refer to MAINTAINER on
Makefiles section.
-
+
Dependencies
-
+
Many ports depend on other ports. There are five variables that
you can use to ensure that all the required bits will be on the
user's machine. There are also some pre-supported dependency
variables for common cases, plus a few more to control the behaviour
of dependencies.
-
+
LIB_DEPENDS
-
+
This variable specifies the shared libraries this port depends
on. It is a list of
lib:dir:target
@@ -1842,7 +1842,7 @@ MASTER_SITE_SUBDIR= applications
to ldconfig -r | grep -wF. There shall be no
regular expressions in this variable.
-
+
The dependency is checked twice, once from within the
extract target and then from within the
install target. Also, the name of the
@@ -1850,10 +1850,10 @@ MASTER_SITE_SUBDIR= applications
pkg_add will automatically install it if it is
not on the user's system.
-
+
RUN_DEPENDS
-
+
This variable specifies executables or files this port depends
on during run-time. It is a list of
path:dir:target
@@ -1869,11 +1869,11 @@ MASTER_SITE_SUBDIR= applications
path.For example,
-
+
RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
wish8.0:${PORTSDIR}/x11-toolkits/tk80
-
+
will check if the file or directory
/usr/local/etc/innd exists, and build and
install it from the news/inn subdirectory of
@@ -1882,14 +1882,14 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
path, and descend into the x11-toolkits/tk80
subdirectory of your ports tree to build and install it if it is
not found.
-
+
In this case, innd is actually an
executable; if an executable is in a place that is not expected
to be in a normal user's search path, you should use the full
pathname.
-
+
The dependency is checked from within the
install target. Also, the name of the
dependency is put in to the package so that
@@ -1898,10 +1898,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
part can be omitted if it is the same
DEPENDS_TARGET.
-
+
BUILD_DEPENDS
-
+
This variable specifies executables or files this port
requires to build. Like RUN_DEPENDS, it is a
list of
@@ -1920,10 +1920,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
the same as DEPENDS_TARGET
-
+
FETCH_DEPENDS
-
+
This variable specifies executables or files this port
requires to fetch. Like the previous two, it is a list of
path:dir:target
@@ -1932,16 +1932,16 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
executable called ncftp2, and descend into the
net/ncftp2 subdirectory of your ports tree to
build and install it if it is not found.
-
+
The dependency is checked from within the
fetch target. The
target part can be omitted if it is the
same as DEPENDS_TARGET.
-
+
DEPENDS
-
+
If there is a dependency that does not fall into either of the
above four categories, or your port requires to have the source of
the other port extracted in addition to having them installed,
@@ -1951,10 +1951,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
target part can be omitted if it is the
same as DEPENDS_TARGET.
-
+
Common dependency variables
-
+
Define USE_XLIB=yes if your port requires
the X Window System to be installed (it is implied by
USE_IMAKE). Define
@@ -1968,10 +1968,10 @@ RUN_DEPENDS= ${PREFIX}/etc/innd:${PORTSDIR}/news/inn \
some versions of FreeBSD has perl5 as part of the base system
while others do not.)
-
+
Notes on dependencies
-
+
As mentioned above, the default target to call when a
dependency is required is DEPENDS_TARGET.
It defaults to install. This is a user
@@ -2009,10 +2009,10 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
intention will be clear.
-
+
Building mechanisms
-
+
If your package uses GNU make, set
USE_GMAKE=yes. If your package uses
configure, set
@@ -2030,7 +2030,7 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
GNU_CONFIGURE, and will cause
autoconf to be run before
configure.
-
+
If your package is an X application that creates
Makefiles from Imakefiles
using imake, then set
@@ -2043,7 +2043,7 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
NO_INSTALL_MANPAGES=yes should be set. In
addition, the author of the original port should be shot. :>
-
+
If your port's source Makefile has
something else than all as the main build
target, set ALL_TARGET accordingly. Same goes
@@ -2051,23 +2051,23 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
INSTALL_TARGET.
-
+
Special considerations
-
+
There are some more things you have to take into account when you
create a port. This section explains the most common of those.ldconfig
-
+
If your port installs a shared library, add a
post-install target to your
Makefile that runs ${LDCONFIG}
-m on the directory where the new library is installed
(usually PREFIX/lib) to
register it into the shared library cache.
-
+
Also, add a matching @exec /sbin/ldconfig -m
and @unexec /sbin/ldconfig -R pair to your
pkg/PLIST file so that a user who installed the
@@ -2080,7 +2080,7 @@ BUILD_DEPENDS= /nonexistent:${PORTSDIR}/graphics/jpeg:extract
lib/libtvl80.so.1
@exec /sbin/ldconfig -m %D/lib
@unexec /sbin/ldconfig -R
-
+
Never, ever, ever add a line that says
ldconfig without any arguments to your
Makefile or pkg/PLIST.
@@ -2093,10 +2093,10 @@ lib/libtvl80.so.1
(not necessarily in that order…)
-
+
ELF support
-
+
Since FreeBSD is moving to ELF shortly after 3.0-RELEASE, we need
to convert many ports that build shared libraries to support ELF.
Complicating this task is that a 3.0 system can run as both ELF and
@@ -2110,7 +2110,7 @@ lib/libtvl80.so.1
Moving a.out libraries out of the way
-
+
A.out libraries should be moved out of
/usr/local/lib and similar to an
aout subdirectory. (If you do not move them out
@@ -2121,10 +2121,10 @@ lib/libtvl80.so.1
only move a.out libs so it is safe to call it on a system with both
ELF and a.out libs in the standard directories.
-
+
Format
-
+
The ports tree will build packages in the format the machine is
in. This means a.out for 2.2 and a.out or ELF for 3.0 depending on
what `objformat` returns. Also, once users move
@@ -2139,10 +2139,10 @@ lib/libtvl80.so.1
system.
-
+
PORTOBJFORMAT
-
+
bsd.port.mk will set
PORTOBJFORMAT to aout or
elf and export it in the environments
@@ -2155,26 +2155,26 @@ lib/libtvl80.so.1
The variable is set using this line in
bsd.port.mk:
-
+
PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
-
+
Ports' make processes should use this variable to decide what to
do. However, if the port's configure script
already automatically detects an ELF system, it is not necessary to
refer to PORTOBJFORMAT.
-
+
Building shared libraries
-
+
The following are differences in handling shared libraries for
a.out and ELF.
-
+
Shared library versions
-
+
An ELF shared library should be called
libfoo.so.M
where M is the single version number,
@@ -2188,10 +2188,10 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aoutlibfoo.so.N.
-
+
Linker command lines
-
+
Assuming cc -shared is used rather than
ld directly, the only difference is that you
need to add
@@ -2199,7 +2199,7 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
-
+
You need to install a symlink from
libfoo.so to
libfoo.so.N to make
@@ -2209,20 +2209,20 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aoutPORTOBJFORMAT.
-
+
LIB_DEPENDS
-
+
All port Makefiles are edited to remove minor numbers from
LIB_DEPENDS, and also to have the regexp support
removed. (E.g., foo\\.1\\.\\(33|40\\) becomes
foo.2.) They will be matched using grep
-wF.
-
+
PLIST
-
+
PLIST should contain the short (ELF) shlib
names if the a.out minor number is zero, and the long (a.out) names
otherwise. bsd.port.mk will automatically add
@@ -2240,18 +2240,18 @@ PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aoutPLIST mentioned in the previous
paragraph.
-
+
ldconfig
-
+
The ldconfig line in Makefiles should
read:
-
+
${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ....In PLIST it should read;
-
+
@exec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -m ...
@unexec /usr/bin/env OBJFORMAT=%%PORTOBJFORMAT%% /sbin/ldconfig -R
@@ -2261,10 +2261,10 @@ ${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ....
default format of the system.
-
+
MASTERDIR
-
+
If your port needs to build slightly different versions of
packages by having a variable (for instance, resolution, or paper
size) take different values, create one subdirectory per package to
@@ -2279,7 +2279,7 @@ ${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ....
This will be best demonstrated by an example. This is part of
japanese/xdvi300/Makefile;
-
+
PKGNAME= ja-xdvi${RESOLUTION}-17
:
@@ -2287,8 +2287,8 @@ PKGNAME= ja-xdvi${RESOLUTION}-17
RESOLUTION?= 300
.if ${RESOLUTION} != 118 && ${RESOLUTION} != 240 && \
${RESOLUTION} != 300 && ${RESOLUTION} != 400
- @${ECHO} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\""
- @${ECHO} "Possible values are: 118, 240, 300 (default) and 400."
+ @${ECHO} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\""
+ @${ECHO} "Possible values are: 118, 240, 300 (default) and 400."
@${FALSE}
.endif
@@ -2317,10 +2317,10 @@ MASTERDIR= ${.CURDIR}/../xdvi300
xdvi300/Makefile and the port will be built with
resolution set to 118.
-
+
Shared library versions
-
+
First, please read our policy on
shared library versioning to understand what to do with
shared library versions in general. Do not blindly assume software
@@ -2351,10 +2351,10 @@ MASTERDIR= ${.CURDIR}/../xdvi300
libfoo4.so.1.0 so both version 3.2 and 4.0 can be
linked from other ports.
-
+
Manpages
-
+
The MAN[1-9LN] variables will automatically add
any manpages to pkg/PLIST (this means you must
not list manpages in the
@@ -2363,7 +2363,7 @@ MASTERDIR= ${.CURDIR}/../xdvi300
makes the install stage automatically compress or uncompress manpages
depending on the setting of NOMANCOMPRESS in
/etc/make.conf.
-
+
If your port tries to install multiple names for manpages using
symlinks or hardlinks, you must use the MLINKS
variable to identify these. The link installed by your port will
@@ -2371,7 +2371,7 @@ MASTERDIR= ${.CURDIR}/../xdvi300
to make sure it points to the correct file. Any manpages
listed in MLINKS must not be listed in the
PLIST.
-
+
To specify whether the manpages are compressed upon installation,
use the MANCOMPRESSED variable. This variable can
take three values, yes, no and
@@ -2401,9 +2401,9 @@ MASTERDIR= ${.CURDIR}/../xdvi300
name of the languages to MANLANG. The value of
this variable defaults to "" (i.e., English
only).
-
+
Here is an example that puts it all together.
-
+
MAN1= foo.1
MAN3= bar.3
@@ -2414,7 +2414,7 @@ MAN3PREFIX= ${PREFIX}/share/foobar
MANCOMPRESSED= yesThis states that six files are installed by this port;
-
+
${PREFIX}/man/man1/foo.1.gz
${PREFIX}/man/ja/man1/foo.1.gz
@@ -2427,12 +2427,12 @@ ${PREFIX}/man/ja/man4/baz.4.gz
may or may-not be installed by your port. Regardless, a
symlink will be made to join the foo(1) manpage and
alt-name(8) manpage.
-
+
Ports that require Motif
-
+
There are many programs that require a Motif library (available
from several commercial vendors, while there is a free clone reported
to be able to run many applications in
@@ -2442,18 +2442,18 @@ ${PREFIX}/man/ja/man4/baz.4.gz
handling ports that require Motif in a way that we can easily compile
binaries linked either dynamically (for people who are compiling from
the port) or statically (for people who distribute packages).
-
+
REQUIRES_MOTIF
-
+
If your port requires Motif, define this variable in the
Makefile. This will prevent people who do not own a copy of Motif
from even attempting to build it.
-
+
MOTIFLIB
-
+
This variable will be set by bsd.port.mk to
be the appropriate reference to the Motif library. Please patch the
source to use this wherever the Motif library is referenced in the
@@ -2461,7 +2461,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz
Imakefile.There are two common cases:
-
+
If the port refers to the Motif library as
@@ -2469,7 +2469,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz
Imakefile, simply substitute
${MOTIFLIB} for it.
-
+
If the port uses XmClientLibs in its
Imakefile, change it to
@@ -2477,17 +2477,17 @@ ${PREFIX}/man/ja/man4/baz.4.gz
${XLIB}.
-
+
Note that MOTIFLIB (usually) expands to
-L/usr/X11R6/lib -lXm or
/usr/X11R6/lib/libXm.a, so there is no need to
add -L or -l in front.
-
+
X11 fonts
-
+
If your port installs fonts for the X Window system, put them in
X11BASE/lib/X11/fonts/local.
This directory is new to XFree86 release 3.3.3. If it does not exist,
@@ -2495,10 +2495,10 @@ ${PREFIX}/man/ja/man4/baz.4.gz
their XFree86 to 3.3.3 or newer, or at least add this directory to the
font path in /etc/XF86Config.
-
+
Info files
-
+
The new version of texinfo (included in 2.2.2-RELEASE and onwards)
contains a utility called install-info to add and
delete entries to the dir file. If your port
@@ -2510,7 +2510,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz
beautiful listing, so please bear with me!First, this is what you (as a porter) need to know
-
+
&prompt.user; install-info --help
install-info [OPTION]... [INFO-FILE [DIR-FILE]]
Install INFO-FILE in the Info directory file DIR-FILE.
@@ -2522,24 +2522,24 @@ Options:
--entry=TEXT Insert TEXT as an Info directory entry.
:
--section=SEC Put this file's entries in section SEC of the directory. :
-
+
This program will not actually install info
files; it merely inserts or deletes entries in the
dir file.
-
+
Here's a seven-step procedure to convert ports to use
install-info. I will use
editors/emacs as an example.
-
+
Look at the texinfo sources and make a patch to insert
@dircategory and @direntry
statements to files that do not have them. This is part of my
patch:
-
+
--- ./man/vip.texi.org Fri Jun 16 15:31:11 1995
+++ ./man/vip.texi Tue May 20 01:28:33 1997
@@ -2555,21 +2555,21 @@ Options:
@iftex
@finalout
:
-
+
The format should be self-explanatory. Many authors leave a
dir file in the source tree that contains all
the entries you need, so look around before you try to write your
own. Also, make sure you look into related ports and make the
section names and entry indentations consistent (we recommend that
all entry text start at the 4th tab stop).
-
+
Note that you can put only one info entry per file because
of a bug in install-info --delete that
deletes only the first entry if you specify multiple entries in
the @direntry section.
-
+
You can give the dir entries to
install-info as arguments
( and ) instead
@@ -2586,7 +2586,7 @@ Options:
PLIST of japanese/skk
for examples on how to do this).
-
+
Go back to the port directory and do a make clean;
make and verify that the info files are regenerated
@@ -2598,7 +2598,7 @@ Options:
Makefile.in so it will descend into the
man subdirectory to rebuild the info
pages.
-
+
--- ./Makefile.in.org Mon Aug 19 21:12:19 1996
+++ ./Makefile.in Tue Apr 15 00:15:28 1997
@@ -2608,7 +2608,7 @@ Options:
# and you cannot remake them without installing Emacs first.
-SUBDIR = lib-src src
+SUBDIR = lib-src src man
-
+
# The makefiles of the directories in $SUBDIR.
SUBDIR_MAKEFILES = lib-src/Makefile man/Makefile src/Makefile oldXMenu/Makefile lwlib/Makefile
--- ./man/Makefile.in.org Thu Jun 27 15:27:19 1996
@@ -2621,7 +2621,7 @@ Options:
info: $(INFO_TARGETS)
dvi: $(DVI_TARGETS)
-
+
The second hunk was necessary because the default target in
the man subdir is called
info, while the main
@@ -2631,14 +2631,14 @@ Options:
one with the same name in /usr/share/info
(that patch is not shown here).
-
+
If there is a place in the Makefile that
is installing the dir file, delete it. Your
port may not be doing it. Also, remove any commands that are
otherwise mucking around with the dir
file.
-
+
--- ./Makefile.in.org Mon Aug 19 21:12:19 1996
+++ ./Makefile.in Mon Apr 14 23:38:07 1997
@@ -2658,14 +2658,14 @@ Options:
${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \
chmod a+r ${infodir}/$$f); \
-
+
(This step is only necessary if you are modifying an existing
port.) Take a look at pkg/PLIST and delete
anything that is trying to patch up info/dir.
They may be in pkg/INSTALL or some other
file, so search extensively.
-
+
Index: pkg/PLIST
===================================================================
@@ -2685,7 +2685,7 @@ diff -u -r1.15 PLIST
info/cl-1
info/cl-2
-
+
Add a post-install target to the
Makefile to call
@@ -2694,7 +2694,7 @@ diff -u -r1.15 PLIST
dir file yourself;
install-info automatically creates this
file if it does not exist.)
-
+
Index: Makefile
===================================================================
@@ -2714,13 +2714,13 @@ diff -u -r1.26 Makefile
.include <bsd.port.mk>
-
+
Edit PLIST and add equivalent
@exec statements and also
@unexec for
pkg_delete.
-
+
Index: pkg/PLIST
===================================================================
@@ -2755,7 +2755,7 @@ diff -u -r1.15 PLIST
the dir file.
-
+
Test and admire your
work. :). Check the
@@ -2763,17 +2763,17 @@ diff -u -r1.15 PLIST
-
+
The pkg/ subdirectory
-
+
There are some tricks we have not mentioned yet about the
pkg/ subdirectory that come in handy
sometimes.
-
+
MESSAGE
-
+
If you need to display a message to the installer, you may place
the message in pkg/MESSAGE. This capability is
often useful to display additional installation steps to be taken
@@ -2788,10 +2788,10 @@ diff -u -r1.15 PLIST
post-install target yourself.
-
+
INSTALL
-
+
If your port needs to execute commands when the binary package
is installed with pkg_add you can do this via the
pkg/INSTALL script. This script will
@@ -2804,7 +2804,7 @@ diff -u -r1.15 PLIST
environmental variable will be set to the package installation
directory. See &man.pkg.add.1; for
additional information.
-
+
This script is not run automatically if you install the port
with make install. If you are depending on it
@@ -2812,17 +2812,17 @@ diff -u -r1.15 PLIST
Makefile.
-
+
REQ
-
+
If your port needs to determine if it should install or not, you
can create a pkg/REQ “requirements”
script. It will be invoked automatically at
installation/deinstallation time to determine whether or not
installation/deinstallation should proceed.
-
+
Changing PLIST based on make
variables
@@ -2847,7 +2847,7 @@ diff -u -r1.15 PLIST
%%VAR%%' will be
substituted with VALUE in the
PLIST.
-
+
For instance, if you have a port that installs many files in a
version-specific subdirectory, you can put something like
@@ -2860,7 +2860,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
in PLIST. That way, when you upgrade the port,
you will not have to change dozens (or in some cases, hundreds) of
lines in the PLIST.
-
+
This substitution (as well as addition of any man pages) will be done between
the do-install and
@@ -2874,11 +2874,11 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
post-install to a file named
TMPPLIST.
-
+
Changing the names of files in the
pkg subdirectory
-
+
All the filenames in the pkg subdirectory
are defined using variables so you can change them in your
Makefile if need be. This is especially useful
@@ -2899,38 +2899,38 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
Default value
-
+
COMMENT${PKGDIR}/DESCR
-
+
DESCR${PKGDIR}/DESCR
-
+
PLIST${PKGDIR}/PLIST
-
+
PKGINSTALL${PKGDIR}/PKGINSTALL
-
+
PKGDEINSTALL${PKGDIR}/PKGDEINSTALL
-
+
PKGREQ${PKGDIR}/REQ
-
+
PKGMESSAGE${PKGDIR}/MESSAGE
@@ -2938,7 +2938,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
-
+
Please change these variables rather than overriding
PKG_ARGS. If you change
PKG_ARGS, those files will not correctly be
@@ -2946,10 +2946,10 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
port.
-
+
Licensing Problems
-
+
Some software packages have restrictive licenses or can be in
violation to the law (PKP's patent on public key crypto, ITAR (export
of crypto software) to name just two of them). What we can do with
@@ -2963,10 +2963,10 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
source or compiled binaries either via ftp or CD-ROM. If in doubt,
please contact the &a.ports;.
-
+
There are two variables you can set in the Makefile to handle the
situations that arise frequently:
-
+
If the port has a “do not sell for profit” type of
@@ -2975,7 +2975,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
into the CD-ROM come release time. The distfile and package will
still be available via ftp.
-
+
If the resulting package needs to be built uniquely for each
site, or the resulting binary package cannot be distributed due to
@@ -2984,7 +2984,7 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
will not go on the ftp site, nor into the CD-ROM come release time.
The distfile will still be included on both however.
-
+
If the port has legal restrictions on who can use it (e.g.,
crypto stuff) or has a “no commercial use” license,
@@ -2993,34 +2993,34 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
will not be available even from our ftp sites.
-
+
The GNU General Public License (GPL), both version 1 and 2,
should not be a problem for ports.
-
+
If you are a committer, make sure you update the
ports/LEGAL file too.
-
+
Upgrading
-
+
When you notice that a port is out of date compared to the latest
version from the original authors, first make sure you have the latest
port. You can find them in the
ports/ports-current directory of the ftp mirror
sites. You may also use CVSup to keep your whole ports collection
up-to-date, as described in .
-
+
The next step is to send a mail to the maintainer, if one is
listed in the port's Makefile. That person may
already be working on an upgrade, or have a reason to not upgrade the
port right now (because of, for example, stability problems of the new
version).
-
+
If the maintainer asks you to do the upgrade or there is not any
such person to begin with, please make the upgrade and send the
recursive diff (either unified or context diff is fine, but port
@@ -3037,14 +3037,14 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
and uuencode it; otherwise, just include it in as is in the PR.
- Once again, please use &man.diff.1; and not &man.shar.1; to send
+ Once again, please use &man.diff.1; and not &man.shar.1; to send
updates to existing ports!
-
+
Do's and Dont's
-
+
Here is a list of common do's and dont's that you encounter during
the porting process.You should check your own port against this list,
but you can also check ports in the PR database that others have
@@ -3053,10 +3053,10 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}
Commentary. Checking ports in the PR database will both make
it faster for us to commit them, and prove that you know what you are
doing.
-
+
Strip Binaries
-
+
Do strip binaries. If the original source already strips the
binaries, fine; otherwise you should add a
post-install rule to to it yourself. Here is an
@@ -3070,45 +3070,45 @@ post-install:
check whether the binary is stripped or not. If it does not say
not stripped, it is stripped.
-
+
INSTALL_* macros
-
+
Do use the macros provided in bsd.port.mk
to ensure correct modes and ownership of files in your own
*-install targets. They are:
-
+
INSTALL_PROGRAM is a command to install
binary executables.
-
+
INSTALL_SCRIPT is a command to install
executable scripts.
-
+
INSTALL_DATA is a command to install
sharable data.
-
+
INSTALL_MAN is a command to install
manpages and other documentation (it does not compress
anything).
-
+
These are basically the install command with
all the appropriate flags. See below for an example on how to use
them.
-
+
WRKDIR
-
+
Do not write anything to files outside
WRKDIR. WRKDIR is the only
place that is guaranteed to be writable during the port build (see
@@ -3118,25 +3118,25 @@ post-install:
linkend="porting-pkgsubdir">redefining a variable, not by
writing over it.
-
+
WRKDIRPREFIX
-
+
Make sure your port honors WRKDIRPREFIX.
Most ports do not have to worry about this. In particular, if you
are referring to a WRKDIR of another port, note
that the correct location is
WRKDIRPREFIXPORTSDIR/subdir/name/work not PORTSDIR/subdir/name/work or .CURDIR/../../subdir/name/work or some such.
-
+
Also, if you are defining WRKDIR yourself,
make sure you prepend
${WKRDIRPREFIX}${.CURDIR} in the
front.
-
+
Differentiating operating systems and OS versions
-
+
You may come across code that needs modifications or conditional
compilation based upon what version of UNIX it is running under. If
you need to make such changes to the code for conditional
@@ -3144,63 +3144,63 @@ post-install:
so that we can back-port code to FreeBSD 1.x systems and cross-port
to other BSD systems such as 4.4BSD from CSRG, BSD/386, 386BSD,
NetBSD, and OpenBSD.
-
+
The preferred way to tell 4.3BSD/Reno (1990) and newer versions
of the BSD code apart is by using the BSD macro
defined in <sys/param.h>. Hopefully that
file is already included; if not, add the code:
-
+
#if (defined(__unix__) || defined(unix)) && !defined(USG)
#include <sys/param.h>
#endif
-
+
to the proper place in the .c file. We
believe that every system that defines these two symbols has
sys/param.h. If you find a system that
does not, we would like to know. Please send mail to the
&a.ports;.
-
+
Another way is to use the GNU Autoconf style of doing
this:
-
+
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
-
+
Do not forget to add -DHAVE_SYS_PARAM_H to the
CFLAGS in the Makefile for
this method.
-
+
Once you have sys/param.h included, you may
use:
-
+
#if (defined(BSD) && (BSD >= 199103))
-
+
to detect if the code is being compiled on a 4.3 Net2 code base
or newer (e.g. FreeBSD 1.x, 4.3/Reno, NetBSD 0.9, 386BSD, BSD/386
1.1 and below).
-
+
Use:
-
+
#if (defined(BSD) && (BSD >= 199306))
-
+
to detect if the code is being compiled on a 4.4 code base or
newer (e.g. FreeBSD 2.x, 4.4, NetBSD 1.0, BSD/386 2.0 or
above).
-
+
The value of the BSD macro is
199506 for the 4.4BSD-Lite2 code base. This is
stated for informational purposes only. It should not be used to
distinguish between versions of FreeBSD based only on 4.4-Lite vs.
versions that have merged in changes from 4.4-Lite2. The
__FreeBSD__ macro should be used instead.
-
+
Use sparingly:
-
+
__FreeBSD__ is defined in all versions of
@@ -3210,14 +3210,14 @@ post-install:
strerror() are Berkeleyisms, not FreeBSD
changes.
-
+
In FreeBSD 2.x, __FreeBSD__ is defined to
be 2. In earlier versions, it is
1. Later versions will bump it to match
their major version number.
-
+
If you need to tell the difference between a FreeBSD 1.x
system and a FreeBSD 2.x or 3.x system, usually the right answer
@@ -3228,7 +3228,7 @@ post-install:
__FreeBSD__ > 1 to detect a FreeBSD 2.x and later
system. If you need more granularity in detecting FreeBSD
systems since 2.0-RELEASE you can use the following:
-
+
#if __FreeBSD__ >= 2
#include <osreldate.h>
@@ -3245,83 +3245,83 @@ post-install:
__FreeBSD_version
-
+
2.0-RELEASE119411
-
+
2.1-CURRENTs199501, 199503
-
+
2.0.5-RELEASE199504
-
+
2.2-CURRENT before 2.1199508
-
+
2.1.0-RELEASE199511
-
+
2.2-CURRENT before 2.1.5199512
-
+
2.1.5-RELEASE199607
-
+
2.2-CURRENT before 2.1.6199608
-
+
2.1.6-RELEASE199612
-
+
2.1.7-RELEASE199612
-
+
2.2-RELEASE220000
-
+
2.2.1-RELEASE220000 (no change)
-
+
2.2-STABLE after 2.2.1-RELEASE220000 (no change)
-
+
2.2-STABLE after texinfo-3.9221001
-
+
2.2-STABLE after top221002
-
+
2.2.2-RELEASE222000
@@ -3331,105 +3331,105 @@ post-install:
2.2-STABLE after 2.2.2-RELEASE222001
-
+
2.2.5-RELEASE225000
-
+
2.2-STABLE after 2.2.5-RELEASE225001
-
+
2.2-STABLE after ldconfig -R merge225002
-
+
2.2.6-RELEASE226000
-
+
2.2.7-RELEASE227000
-
+
2.2-STABLE after 2.2.7-RELEASE227001
-
+
2.2-STABLE after semctl(2) change227002
-
+
2.2.8-RELEASE228000
-
+
2.2-STABLE after 2.2.8-RELEASE228001
-
+
3.0-CURRENT before mount(2) change300000
-
+
3.0-CURRENT after mount(2) change300001
-
+
3.0-CURRENT after semctl(2) change300002
-
+
3.0-CURRENT after ioctl arg changes300003
-
+
3.0-CURRENT after ELF conversion300004
-
+
3.0-RELEASE300005
-
+
3.0-CURRENT after 3.0-RELEASE300006
-
+
3.0-STABLE after 3/4 branch300007
-
+
3.1-RELEASE310000
-
+
3.1-STABLE after 3.1-RELEASE310001
- 3.1-STABLE after C++ constructor/destructor order
- change
+ 3.1-STABLE after C++ constructor/destructor order
+ change310002
@@ -3445,7 +3445,7 @@ post-install:
3.2-STABLE after binary-incompatible IPFW and
- socket changes
+ socket changes
320002
@@ -3453,21 +3453,21 @@ post-install:
3.3-RELEASE330000
-
+
4.0-CURRENT after 3/4 branch400000
- 4.0-CURRENT after change in dynamic linker
- handling
+ 4.0-CURRENT after change in dynamic linker
+ handling400001
- 4.0-CURRENT after C++ constructor/destructor
- order change
+ 4.0-CURRENT after C++ constructor/destructor
+ order change400002
@@ -3478,14 +3478,14 @@ post-install:
4.0-CURRENT after __deregister_frame_info dynamic linker
- bug fix
- (also 4.0-CURRENT after EGCS 1.1.2 integration)
+ bug fix (also 4.0-CURRENT after EGCS 1.1.2 integration)
+
4000044.0-CURRENT after suser(9) API change
- (also 4.0-CURRENT after newbus)
+ (also 4.0-CURRENT after newbus)
400005
@@ -3495,21 +3495,21 @@ post-install:
- 4.0-CURRENT after the addition of so_cred for
- socket level credentials
+ 4.0-CURRENT after the addition of so_cred for
+ socket level credentials400007
- 4.0-CURRENT after the addition of a poll syscall
- wrapper to libc_r
+ 4.0-CURRENT after the addition of a poll syscall
+ wrapper to libc_r4000084.0-CURRENT after the change of the kernel's
dev_t type to struct
- spacinfo pointer
+ specinfo pointer
400009
@@ -3517,7 +3517,7 @@ post-install:
-
+
Note that 2.2-STABLE sometimes identifies itself as
“2.2.5-STABLE” after the 2.2.5-RELEASE. The pattern
@@ -3529,13 +3529,13 @@ post-install:
worry about old -CURRENTs; they are listed here just for your
reference.
-
+
In the hundreds of ports that have been done, there have only
been one or two cases where __FreeBSD__ should
have been used. Just because an earlier port screwed up and used it
in the wrong place does not mean you should do so too.
-
+
Writing something after
bsd.port.mk
@@ -3551,7 +3551,7 @@ post-install:
pre.mk/post.mk pair or
bsd.port.mk only; do not mix these two.
-
+
bsd.port.pre.mk only defines a few
variables, which can be used in tests in the
Makefile, bsd.port.post.mk
@@ -3570,53 +3570,53 @@ post-install:
Description
-
+
ARCHThe architecture as returned by uname
-m (e.g., i386)
-
+
OPSYSThe operating system type, as returned by
uname -s (e.g.,
FreeBSD)
-
+
OSRELThe release version of the operating system (e.g.,
2.1.5 or
2.2.7)
-
+
OSVERSIONThe numeric version of the operating system, same as
__FreeBSD_version.
-
+
PORTOBJFORMATThe object format of the system
(aout or elf
-
+
LOCALBASEThe base of the “local” tree (e.g.,
/usr/local/)
-
+
X11BASEThe base of the “X11” tree (e.g.,
/usr/X11R6)
-
+
PREFIXWhere the port installs itself (see
-
+
If you have to define the variables
USE_IMAKE, USE_X_PREFIX, or
MASTERDIR, do so before including
bsd.port.pre.mk.
-
+
Here are some examples of things you can write after
bsd.port.pre.mk;
-
+
# no need to compile lang/perl5 if perl5 is already in system
.if ${OSVERSION} > 300003
@@ -3656,23 +3656,23 @@ post-install:
${LN} -sf liblinpack.so.1.0 ${PREFIX}/lib/liblinpack.so
.endif
-
+
Install additional documentation
-
+
If your software has some documentation other than the standard
man and info pages that you think is useful for the user, install it
under PREFIX/share/doc.
This can be done, like the previous item, in the
post-install target.
-
+
Create a new directory for your port. The directory name should
reflect what the port is. This usually means
PKGNAME minus the version part. However, if you
think the user might want different versions of the port to be
installed at the same time, you can use the whole
PKGNAME.
-
+
Make the installation dependent to the variable
NOPORTDOCS so that users can disable it in
/etc/make.conf, like this:
@@ -3683,12 +3683,12 @@ post-install:
${MKDIR}${PREFIX}/share/doc/xv
${INSTALL_MAN} ${WRKSRC}/docs/xvdocs.ps ${PREFIX}/share/doc/xv
.endif
-
+
Do not forget to add them to pkg/PLIST too!
(Do not worry about NOPORTDOCS here; there is
currently no way for the packages to read variables from
/etc/make.conf.)
-
+
Also you can use the pkg/MESSAGE file to
display messages upon installation. See the using
@@ -3700,10 +3700,10 @@ post-install:
pkg/PLIST).
-
+
DIST_SUBDIR
-
+
Do not let your port clutter
/usr/ports/distfiles. If your port requires a
lot of files to be fetched, or contains a file that has a name that
@@ -3716,22 +3716,22 @@ post-install:
/usr/ports/distfiles/DIST_SUBDIR,
and in effect puts everything that is required for your port into
that subdirectory.
-
+
It will also look at the subdirectory with the same name on the
backup master site at ftp.FreeBSD.org.
(Setting DISTDIR explicitly in your
Makefile will not accomplish this, so please use
DIST_SUBDIR.)
-
+
This does not affect the MASTER_SITES you
define in your Makefile.
-
+
Package information
-
+
Do include package information, i.e.
COMMENT, DESCR, and
PLIST, in pkg.
@@ -3742,10 +3742,10 @@ post-install:
NO_PACKAGE is set.
-
+
RCS strings
-
+
Do not put RCS strings in patches. CVS will mangle them when we
put the files into the ports tree, and when we check them out again,
they will come out different and the patch will fail. RCS strings
@@ -3753,10 +3753,10 @@ post-install:
typically start with $Id or
$RCS.
-
+
Recursive diff
-
+
Using the recurse () option to
diff to generate patches is fine, but please take
a look at the resulting patches to make sure you do not have any
@@ -3776,10 +3776,10 @@ post-install:
the patch. Once you are happy with the resulting diff, please split
it up into one source file per patch file.
-
+
PREFIX
-
+
Do try to make your port install relative to
PREFIX. (The value of this variable will be set
to LOCALBASE (default
@@ -3787,7 +3787,7 @@ post-install:
USE_X_PREFIX or USE_IMAKE is
set, in which case it will be X11BASE (default
/usr/X11R6).)
-
+
Not hard-coding /usr/local or
/usr/X11R6 anywhere in the source will make the
port much more flexible and able to cater to the needs of other
@@ -3802,12 +3802,12 @@ post-install:
Do not set USE_X_PREFIX unless your port
truly require it (i.e., it links against X libs or it needs to
reference files in X11BASE).
-
+
The variable PREFIX can be reassigned in your
Makefile or in the user's environment.
However, it is strongly discouraged for individual ports to set this
variable explicitly in the Makefiles.
-
+
Also, refer to programs/files from other ports with the
variables mentioned above, not explicit pathnames. For instance, if
your port requires a macro PAGER to be the full
@@ -3820,16 +3820,16 @@ post-install:
-DPAGER=\"${LOCALBASE}/bin/less\"
-
+
if this is an X port, instead of
-DPAGER=\"/usr/local/bin/less\". This way it will
have a better chance of working if the system administrator has
moved the whole `/usr/local' tree somewhere else.
-
+
Subdirectories
-
+
Try to let the port put things in the right subdirectories of
PREFIX. Some ports lump everything and put it in
the subdirectory with the port's name, which is incorrect. Also,
@@ -3849,10 +3849,10 @@ post-install:
PREFIX/news as a destination
for their files.
-
+
Cleaning up empty directories
-
+
Do make your ports clean up after themselves when they are
deinstalled. This is usually accomplished by adding
@dirrm lines for all directories that are
@@ -3860,7 +3860,7 @@ post-install:
before you can delete parent directories.
- :
+ :
lib/X11/oneko/pixmaps/cat.xpm
lib/X11/oneko/sounds/cat.au
:
@@ -3881,10 +3881,10 @@ lib/X11/oneko/sounds/cat.au
PREFIX/share/doc/gimp is not
empty due to other ports installing some files in there.
-
+
UIDs
-
+
If your port requires a certain user to be on the installed
system, let the pkg/INSTALL script call
pw to create it automatically. Look at
@@ -3894,11 +3894,11 @@ lib/X11/oneko/sounds/cat.au
installed a binary package as when it was compiled, then you must
choose a free UID from 50 to 99 and register it below. Look at
japanese/Wnn for an example.
-
+
Make sure you do not use a UID already used by the system or
other ports. This is the current list of UIDs between 50 and
99.
-
+
majordom:*:54:54:Majordomo Pseudo User:/usr/local/majordomo:/nonexistent
cyrus:*:60:60:the cyrus mail server:/nonexistent:/nonexistent
@@ -3919,15 +3919,15 @@ qmailp:*:84:81:QMail user:/var/qmail:/nonexistent
qmailr:*:86:82:QMail user:/var/qmail:/nonexistent
msql:*:87:87:mSQL-2 pseudo-user:/var/db/msqldb:/bin/sh
mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
-
+
Please include a notice when you submit a port (or an upgrade)
that reserves a new UID or GID in this range. This allows us to
keep the list of reserved IDs up to date.
-
+
Do things rationally
-
+
The Makefile should do things simply and
reasonably. If you can make it a couple of lines shorter or more
readable, then do so. Examples include using a make
@@ -3938,18 +3938,18 @@ mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
GNU_CONFIGURE instead of CONFIGURE_ARGS
+= --prefix=${PREFIX}.
-
+
Respect CFLAGS
-
+
The port should respect the CFLAGS variable.
If it does not, please add NO_PACKAGE=ignores
cflags to the Makefile.
-
+
Configuration files
-
+
If your port requires some configuration files in
PREFIX/etc, do
not just install them and list them in
@@ -3964,27 +3964,27 @@ mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
user has to copy and edit the file before the software can be made
to work.
-
+
Portlint
-
+
Do check your work with portlint
before you submit or commit it.
-
+
Feedback
-
+
Do send applicable changes/patches to the original
author/maintainer for inclusion in next release of the code. This
will only make your job that much easier for the next
release.
-
+
Miscellanea
-
+
The files pkg/DESCR,
pkg/COMMENT, and pkg/PLIST
should each be double-checked. If you are reviewing a port and feel
@@ -3992,44 +3992,44 @@ mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
Do not copy more copies of the GNU General Public License into
our system, please.
-
+
Please be careful to note any legal issues! Do not let us
illegally distribute software!
-
+
If you are stuck…
-
+
Do look at existing examples and the
bsd.port.mk file before asking us questions!
;)
-
+
Do ask us questions if you have any trouble! Do not just beat
your head against a wall! :)
-
+
A Sample Makefile
-
+
Here is a sample Makefile that you can use to
create a new port. Make sure you remove all the extra comments (ones
between brackets)!
-
+
It is recommended that you follow this format (ordering of
variables, empty lines between sections, etc.). This format is
designed so that the most important information is easy to locate. We
recommend that you use portlint to check the
Makefile.
-
+
[the header...just to make it easier for us to identify the ports.]
# New ports collection makefile for: xdvi
[the version required header should updated when upgrading a port.]
# Version required: pl18 [things like "1.5alpha" are fine here too]
-[this is the date when the first version of this Makefile was created.
+[this is the date when the first version of this Makefile was created.
Never change this when doing an update of the port.]
# Date created: 26 May 1995
[this is the person who did the original port to FreeBSD, in particular, the
@@ -4105,7 +4105,7 @@ pre-install:
.include <bsd.port.mk>
-
+ Automated package list creationFirst, make sure your port is almost complete, with only
@@ -4148,18 +4148,18 @@ pre-install:
Package Names
-
+
The following are the conventions you should follow in naming your
packages. This is to have our package directory easy to scan, as
there are already lots and lots of packages and users are going to
turn away if they hurt their eyes!
-
+
The package name should look like
language-name-compiled.specifics-version.numbers.
-
+
If your DISTNAME does not look like that, set
PKGNAME to something in that format.
-
+
FreeBSD strives to support the native language of its users.
@@ -4171,7 +4171,7 @@ pre-install:
zh for Chinese, ko for
Korean and de for German.
-
+
The name part should be all lowercases,
except for a really large package (with lots of programs in it).
@@ -4189,7 +4189,7 @@ pre-install:
has numbers, hyphens, or underscores in its name, you may include
them as well (like kinput2).
-
+
If the port can be built with different hardcoded defaults (usually
@@ -4198,7 +4198,7 @@ pre-install:
the compiled-in defaults (the hyphen is optional). Examples are
papersize and font units.
-
+
The version string should be a period-separated list of
integers and single lowercase alphabetics. The only exception is
@@ -4207,7 +4207,7 @@ pre-install:
minor version numbers in the software.
-
+
Here are some (real) examples on how to convert a
DISTNAME into a suitable
PKGNAME:
@@ -4221,89 +4221,89 @@ pre-install:
Reason
-
+
mule-2.2.2.mule-2.2.2No changes required
-
+
XFree86-3.1.2XFree86-3.1.2No changes required
-
+
EmiClock-1.0.2emiclock-1.0.2No uppercase names for single programs
-
+
gmod1.4gmod-1.4Need a hyphen before version numbers
-
+
xmris.4.0.2xmris-4.0.2Need a hyphen before version numbers
-
+
rdist-1.3alphardist-1.3aNo strings like alpha
allowed
-
+
es-0.9-beta1es-0.9b1No strings like beta
allowed
-
+
v3.3beta021.srctiff-3.3What the heck was that anyway?
-
+
tvtwmtvtwm-pl11Version string always required
-
+
piewmpiewm-1.0Version string always required
-
+
xvgr-2.10pl1xvgr-2.10.1pl allowed only when no
major/minor version numbers
-
+
gawk-2.15.6ja-gawk-2.15.6Japanese language version
-
+
psutils-1.13psutils-letter-1.13Papersize hardcoded at package build time
-
+
pkfontspkfonts300-1.0
@@ -4312,7 +4312,7 @@ pre-install:
-
+
If there is absolutely no trace of version information in the
original source and it is unlikely that the original author will ever
release another version, just set the version string to
@@ -4320,10 +4320,10 @@ pre-install:
the original author or use the date string
(yy.mm.dd) as the version.
-
+
Categories
-
+
As you already know, ports are classified in several categories.
But for this to work, it is important that porters and users understand
what each category and how we decide what to put in each
@@ -4331,19 +4331,19 @@ pre-install:
Current list of categories
-
+
First, this is the current list of port categories. Those
marked with an asterisk (*) are
virtual categories—those that do not have
a corresponding subdirectory in the ports tree.
-
+
For non-virtual categories, you will find a one-line
description in the pkg/COMMENT file in that
subdirectory (e.g.,
archivers/pkg/COMMENT).
-
+
@@ -4352,70 +4352,70 @@ pre-install:
Description
-
+
afterstep*Ports to support AfterStep window manager
-
+
archiversArchiving tools.
-
+
astroAstronomical ports.
-
+
audioSound support.
-
+
benchmarksBenchmarking utilities.
-
+
biologyBiology-related software.
-
+
cadComputer aided design tools.
-
+
chineseChinese language support.
-
+
commsCommunication software. Mostly software to talk to
your serial port.
-
+
convertersCharacter code converters.
-
+
databasesDatabases.
-
+
deskutilsThings that used to be on the desktop before
computers were invented.
-
+
develDevelopment utilities. Do not put libraries here just
@@ -4423,19 +4423,19 @@ pre-install:
belong to anywhere else, they should not be in this
category.
-
+
editorsGeneral editors. Specialized editors go in the section
for those tools (e.g., a mathematical-formula editor will go
in math).
-
+
elispEmacs-lisp ports.
-
+
emulatorsEmulators for other operating systems. Terminal
@@ -4445,7 +4445,7 @@ pre-install:
comms or misc,
depending on the exact functionality.
-
+
ftpFTP client and server utilities. If your
@@ -4453,28 +4453,28 @@ pre-install:
ftp with a secondary
category of www.
-
+
gamesGames.
-
+
germanGerman language support.
-
- gnome*
- Ports from the GNU Object Model Environment (GNOME)
- Project.
-
-
+
+ gnome*
+ Ports from the GNU Object Model Environment (GNOME)
+ Project.
+
+
graphicsGraphics utilities.
-
+
ircInternet Chat Relay utilities.
@@ -4484,7 +4484,7 @@ pre-install:
japaneseJapanese language support.
-
+
javaJava language support.
@@ -4493,14 +4493,14 @@ pre-install:
kde*Ports from the K Desktop Environment (KDE)
- Project.
+ Project.
-
+
koreanKorean language support.
-
+
langProgramming languages.
@@ -4516,12 +4516,12 @@ pre-install:
Numerical computation software and other utilities
for mathematics.
-
+
mboneMBone applications.
-
+
miscMiscellaneous utilities—basically things that
@@ -4532,136 +4532,136 @@ pre-install:
safely delete misc and just put the port
in that other subdirectory!
-
+
netMiscellaneous networking software.
-
+
newsUSENET news software.
-
+
offix*Ports from the OffiX suite.
-
+
palmSoftware support for the 3Com Palm(tm) series.
-
+
perl5*Ports that require perl version 5 to run.
-
+
plan9*Various programs from Plan9.
-
+
printPrinting software. Desktop publishing tools
(previewers, etc.) belong here too.
-
+
python*Software written in python.
-
+
russianRussian language support.
-
+
securitySecurity utilities.
-
+
shellsCommand line shells.
-
+
sysutilsSystem utilities.
-
+
tcl75*Ports that use Tcl version 7.5 to run.
-
+
tcl76*Ports that use Tcl version 7.6 to run.
-
+
tcl80*Ports that use Tcl version 8.0 to run.
-
+
tcl81*Ports that use Tcl version 8.1 to run.
-
+
textprocText processing utilities. It does not include
desktop publishing tools, which go to print/.
-
+
tk41*Ports that use Tk version 4.1 to run.
-
+
tk42*Ports that use Tk version 4.2 to run.
-
+
tk80*Ports that use Tk version 8.0 to run.
-
+
tk81*Ports that use Tk version 8.1 to run.
-
- tkstep80*
- Ports that use TkSTEP version 8.0 to run.
-
-
+
+ tkstep80*
+ Ports that use TkSTEP version 8.0 to run.
+
+
vietnameseVietnamese language support.
-
+
windowmaker*Ports to support the WindowMaker window
manager
-
+
wwwSoftware related to the World Wide Web. HTML language
support belong here too.
-
+
x11The X window system and friends. This category is only
@@ -4672,22 +4672,22 @@ pre-install:
categories. Also, many of them go into other
x11-* categories (see below).
-
+
x11-clocksX11 clocks.
-
+
x11-fmX11 file managers.
-
+
x11-fontsX11 fonts and font utilities.
-
+
x11-serversX11 servers.
@@ -4697,7 +4697,7 @@ pre-install:
x11-toolkitsX11 toolkits.
-
+
x11-wmX11 window managers.
@@ -4706,15 +4706,15 @@ pre-install:
-
+
Choosing the right category
-
+
As many of the categories overlap, you often have to choose
which of the categories should be the primary category of your port.
There are several rules that govern this issue. Here is the list of
priorities, in decreasing order of precedence.
-
+
Language specific categories always come first. For
@@ -4722,17 +4722,17 @@ pre-install:
CATEGORIES line would read japanese
x11-fonts.
-
+
Specific categories win over less-specific ones. For
instance, an HTML editor should be listed as www
editors, not the other way around. Also, you do not
need to list net when the port belongs to
- either of irc, mail,
- mbone, news,
+ either of irc, mail,
+ mbone, news,
security, or www.
-
+
x11 is used as a secondary category only
when the primary category is a natural language. In particular,
@@ -4745,7 +4745,7 @@ pre-install:
misc.
-
+
If you are not sure about the category, please put a comment to
that effect in your send-pr submission so we can
discuss it before import it. (If you are a committer, send a note
@@ -4753,10 +4753,10 @@ pre-install:
imported to a wrong category only to be moved right away.)
-
+
Changes to this document and the ports system
-
+
If you maintain a lot of ports, you should consider following the
&a.ports;. Important changes to the way ports work will be announced
there. You can always find more detailed information on the latest
@@ -4764,10 +4764,10 @@ pre-install:
url="http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/Mk/bsd.port.mk"> the
bsd.port.mk CVS log.
-
+
That is It, Folks!
-
+
Boy, this sure was a long tutorial, wasn't it? Thanks for
following us to here, really. Now that you know how to do a port,
have at it and convert everything in the world into ports! That