FreeBSD Porter's Handbook
The FreeBSD Documentation Project
Copyright
© 2000, 2001, 2002, 2003, 2004 The FreeBSD Documentation Project
Table of Contents
1
Introduction
2
Making a port yourself
3
Quick Porting
3.1
Writing the
Makefile
3.2
Writing the description files
3.2.1
pkg-descr
3.2.2
pkg-plist
3.3
Creating the checksum file
3.4
Testing the port
3.5
Checking your port with
portlint
3.6
Submitting the port
4
Slow Porting
4.1
How things work
4.2
Getting the original sources
4.3
Modifying the port
4.4
Patching
4.5
Configuring
4.6
Handling user input
5
Configuring the Makefile
5.1
The original source
5.2
Naming
5.2.1
PORTNAME
and
PORTVERSION
5.2.2
PORTREVISION
and
PORTEPOCH
5.2.3
PKGNAMEPREFIX
and
PKGNAMESUFFIX
5.2.4
Package Naming Conventions
5.3
Categorization
5.3.1
CATEGORIES
5.3.2
Current list of categories
5.3.3
Choosing the right category
5.4
The distribution files
5.4.1
DISTNAME
5.4.2
MASTER_SITES
5.4.3
EXTRACT_SUFX
5.4.4
DISTFILES
5.4.5
EXTRACT_ONLY
5.4.6
PATCHFILES
5.4.7
Multiple distribution files or patches from different sites and subdirectories (
MASTER_SITES:n
)
5.4.8
DIST_SUBDIR
5.5
MAINTAINER
5.6
COMMENT
5.7
Dependencies
5.7.1
LIB_DEPENDS
5.7.2
RUN_DEPENDS
5.7.3
BUILD_DEPENDS
5.7.4
FETCH_DEPENDS
5.7.5
EXTRACT_DEPENDS
5.7.6
PATCH_DEPENDS
5.7.7
DEPENDS
5.7.8
USE_
*
5.7.9
Notes on dependencies
5.7.10
Optional dependencies
5.7.11
Circular dependencies are fatal
5.8
Specifying the working directory
5.8.1
WRKSRC
5.8.2
NO_WRKSUBDIR
5.9
CONFLICTS
5.10
Building mechanisms
6
Special considerations
6.1
Shared Libraries
6.2
Ports with distribution restrictions
6.2.1
NO_PACKAGE
6.2.2
NO_CDROM
6.2.3
RESTRICTED
6.2.4
RESTRICTED_FILES
6.3
Using
perl
6.4
Using X11
6.5
Using
automake
,
autoconf
, and
libtool
6.6
Using GNOME
6.7
Using KDE
6.8
Using Bison
6.9
Using Java
6.10
Using Python
6.11
Using Emacs
6.12
Using Ruby
6.13
Using SDL
7
MASTERDIR
8
Shared library versions
9
Manpages
10
Ports that require Motif
10.1
USE_MOTIF
10.2
MOTIFLIB
11
X11 fonts
12
Info files
13
The
pkg-
*
files
13.1
pkg-message
13.2
pkg-install
13.3
pkg-deinstall
13.4
pkg-req
13.5
Changing
pkg-plist
based on make variables
13.6
Changing the names of
pkg-
*
files
14
Testing your port
14.1
Portlint
14.2
PREFIX
14.3
FreshPorts sanity tests
15
Upgrading
16
Dos and Don'ts
16.1
Introduction
16.2
Stripping Binaries
16.3
INSTALL_* macros
16.4
WRKDIR
16.5
WRKDIRPREFIX
16.6
Differentiating operating systems and OS versions
16.7
__FreeBSD_version values
16.8
Writing something after
bsd.port.mk
16.9
Install additional documentation
16.10
Subdirectories
16.11
Cleaning up empty directories
16.12
UIDs
16.13
Do things rationally
16.14
Respect both
CC
and
CXX
16.15
Respect
CFLAGS
16.16
Configuration files
16.17
Feedback
16.18
README.html
16.19
Marking a port
BROKEN
,
FORBIDDEN
, or otherwise
16.20
Necessary workarounds
16.21
Miscellanea
16.22
If you are stuck...
17
A Sample
Makefile
18
Automated package list creation
19
Changes to this document and the ports system
List of Tables
5-1.
The
USE_
*
variables
6-1.
Variables for ports that use
perl
6-2.
Variables for ports that use X
6-3.
Variables for ports that use automake, autoconf or libtool
6-4.
Variables for ports that use KDE
16-1.
__FreeBSD_version values
List of Examples
5-1.
Simplified use of
MASTER_SITES:n
with 1 file per site
5-2.
Simplified use of
MASTER_SITES:n
with more than 1 file per site
5-3.
Detailed use of
MASTER_SITES:n
in
MASTER_SITE_SUBDIR
5-4.
Detailed use of
MASTER_SITES:n
with comma operator, multiple files, multiple sites and multiple subdirectories
5-5.
Detailed use of
MASTER_SITES:n
with
MASTER_SITE_SOURCEFORGE
5-6.
Simplified use of
MASTER_SITES:n
with
PATCH_SITES
.
Next
Introduction
For questions about the FreeBSD ports system, e-mail <
ports@FreeBSD.org
>.
For questions about this documentation, e-mail <
doc@FreeBSD.org
>.