Chapter 3. Quick Porting

Table of Contents
3.1. Writing the Makefile
3.2. Writing the Description Files
3.3. Creating the Checksum File
3.4. Testing the Port
3.5. Checking the Port with portlint
3.6. Submitting the New Port

This section describes how to quickly create a new port. For applications where this quick method is not adequate, the full Slow Porting process is described in Chapter 4, Slow Porting.

First, get the original tarball and put it into DISTDIR, which defaults to /usr/ports/distfiles.

Note:

The following 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 Chapter 4, Slow Porting.

Note:

It is recommended to set the DEVELOPER make(1) variable in /etc/make.conf before getting into porting.

# echo DEVELOPER=yes >> /etc/make.conf

This setting enables the developer mode that displays deprecation warnings and activates some further quality checks on calling make.

3.1. Writing the Makefile

The minimal Makefile would look something like this:

# $FreeBSD$

PORTNAME=	oneko
PORTVERSION=	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 <bsd.port.mk>

Note:

In some cases, the Makefile 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 $FreeBSD$ line, it will be filled in automatically by Subversion when the port is imported to our main ports tree. A more detailed example is shown in the sample Makefile section.

All FreeBSD documents are available for download at http://ftp.FreeBSD.org/pub/FreeBSD/doc/

Questions that are not answered by the documentation may be sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.