Source string Read only

(itstool) path: note/para
251/2510
Context English State
Interested in making a new port, or upgrading existing ports? Great!
What follows are some guidelines for creating a new port for FreeBSD. To upgrade an existing port, read this, then read <xref linkend="port-upgrading"/>.
When this document is not sufficiently detailed, refer to <filename>/usr/ports/Mk/bsd.port.mk</filename>, which is included by all port <filename>Makefile</filename>s. Even those not hacking <filename>Makefile</filename>s daily can gain much knowledge from it. Additionally, specific questions can be sent to the <link xlink:href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-ports">FreeBSD ports mailing list</link>.
Only a fraction of the variables (<varname><replaceable>VAR</replaceable></varname>) that can be overridden are mentioned in this document. Most (if not all) are documented at the start of <filename>/usr/ports/Mk/bsd.port.mk</filename>; the others probably ought to be. Note that this file uses a non-standard tab setting: <application>Emacs</application> and <application>Vim</application> will recognize the setting on loading the file. Both <citerefentry><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry> and <citerefentry><refentrytitle>ex</refentrytitle><manvolnum>1</manvolnum></citerefentry> can be set to use the correct value by typing <command>:set tabstop=4</command> once the file has been loaded.
Looking for something easy to start with? Take a look at the <link xlink:href="https://wiki.freebsd.org/WantedPorts">list of requested ports</link> and see if you can work on one (or more).
Quick Porting
This section describes how to quickly create a new port. For applications where this quick method is not adequate, the full <quote>Slow Porting</quote> process is described in <xref linkend="slow-porting"/>.
First, get the original tarball and put it into <varname>DISTDIR</varname>, which defaults to <filename>/usr/ports/distfiles</filename>.
These steps assume that the software compiled out-of-the-box. In other words, absolutely no changes were required for the application to work on a FreeBSD system. If anything had to be changed, refer to <xref linkend="slow-porting"/>.
It is recommended to set the <varname>DEVELOPER</varname> <citerefentry><refentrytitle>make</refentrytitle><manvolnum>1</manvolnum></citerefentry> variable in <filename>/etc/make.conf</filename> before getting into porting.
<prompt>#</prompt> <userinput>echo DEVELOPER=yes &gt;&gt; /etc/make.conf</userinput>
This setting enables the <quote>developer mode</quote> that displays deprecation warnings and activates some further quality checks on calling <command>make</command>.
Writing the <filename>Makefile</filename>
The minimal <filename>Makefile</filename> would look something like this:
# $FreeBSD$

PORTNAME= oneko
DISTVERSION= 1.1b
CATEGORIES= games
MASTER_SITES= ftp://ftp.cs.columbia.edu/archives/X11R5/contrib/

MAINTAINER= youremail@example.com
COMMENT= Cat chasing a mouse all over the screen

.include &lt;bsd.port.mk&gt;
In some cases, the <filename>Makefile</filename> of an existing port may contain additional lines in the header, such as the name of the port and the date it was created. This additional information has been declared obsolete, and is being phased out.
Try to figure it out. Do not worry about the contents of the <literal>$FreeBSD$</literal> line, it will be filled in automatically by <application>Subversion</application> when the port is imported to our main ports tree. A more detailed example is shown in the <link linkend="porting-samplem">sample Makefile</link> section.
Writing the Description Files
There are two description files that are required for any port, whether they actually package or not. They are <filename>pkg-descr</filename> and <filename>pkg-plist</filename>. Their <filename>pkg-</filename> prefix distinguishes them from other files.
<filename>pkg-descr</filename>
This is a longer description of the port. One to a few paragraphs concisely explaining what the port does is sufficient.
This is <emphasis>not</emphasis> a manual or an in-depth description on how to use or compile the port! <emphasis>Please be careful when copying from the <filename>README</filename> or manpage</emphasis>. Too often they are not a concise description of the port or are in an awkward format. For example, manpages have justified spacing, which looks particularly bad with monospaced fonts.
On the other hand, the content of <filename>pkg-descr</filename> must be longer than the <link linkend="makefile-comment"><varname>COMMENT</varname></link> line from the Makefile. It must explain in more depth what the port is all about.
A well-written <filename>pkg-descr</filename> describes the port completely enough that users would not have to consult the documentation or visit the website to understand what the software does, how it can be useful, or what particularly nice features it has. Mentioning certain requirements like a graphical toolkit, heavy dependencies, runtime environment, or implementation languages help users decide whether this port will work for them.
Include a URL to the official WWW homepage. Prepend <emphasis>one</emphasis> of the websites (pick the most common one) with <literal>WWW:</literal> (followed by single space) so that automated tools will work correctly. If the URI is the root of the website or directory, it must be terminated with a slash.
If the listed webpage for a port is not available, try to search the Internet first to see if the official site moved, was renamed, or is hosted elsewhere.
This example shows how <filename>pkg-descr</filename> looks:
This is a port of oneko, in which a cat chases a poor mouse all over
the screen.
:
(etc.)

WWW: http://www.oneko.org/
<filename>pkg-plist</filename>
This file lists all the files installed by the port. It is also called the <quote>packing list</quote> because the package is generated by packing the files listed here. The pathnames are relative to the installation prefix (usually <filename>/usr/local</filename>).
Here is a small example:

Loading…

No matching activity found.

Browse all component changes

Glossary

English English
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: note/para
Flags
read-only
Source string location
book.translate.xml:263
String age
a year ago
Source string age
a year ago
Translation file
books/porters-handbook.pot, string 34