Documentation on the NetBSD Packages System

Jul 2000

Table of Contents
I. Introduction
1. Intro
1.1. Overview
1.2. Terminology
II. User's Guide
2. Installing a precompiled binary package
2.1. Where to get
2.2. How to use
2.2.1. Local packages
2.2.2. Packages available via FTP
2.2.3. Tips & Tricks
2.3. A word of warning
3. Installing by Building
3.1. Where to get pkgsrc
3.2. Fetching distfiles
3.3. How to build and install
4. Making a precompiled package
III. Package Constructor's Guide
5. Package components - files, directories and contents
5.1. Makefile
5.2. files/*
5.3. patches/*
5.4. pkg/*
5.4.1. Mandatory files
5.4.2. Optional files
5.5. scripts/*
5.6. work/*
5.7. Importing the package into CVS
6. PLIST* issues
6.1. Miscellaneous
6.2. MD/MI vs. general PLIST
6.2.1. PLIST_SRC
6.2.2. PLIST-mi, PLIST-md.shared, PLIST-md.static
6.2.3. Order in the PLIST* file(s)
7. Notes on fixes for packages
7.1. CPP defines
7.2. Shared libraries - libtool
7.3. Using libtool on GNU packages that already support libtool
7.4. Gotchas of FreeBSD ports
7.5. Feedback to the author
8. The build process
8.1. Program locations
8.2. Main targets
8.3. Other helpful targets
9. Debugging
10. FAQs & features of the package system
10.1. Packages using GNU autoconfig
10.2. Other distrib methods than .tar.gz
10.3. Packages not creating their own subdirectory
10.4. Custom configuration process
10.5. Packages not building in their DISTNAME directory
10.6. How to fetch all distfiles at once
10.7. How to fetch files from behind a firewall
10.8. If your patch contains an RCS ID
10.9. How to pull in variables from /etc/mk.conf
10.10. Is there a mailing list for pkg-related discussion?
10.11. How do I tell ``make fetch'' to do passive FTP?
10.12. Dependencies on other packages
10.13. Conflicts with other packages
10.14. Software which has a WWW Home Page
10.15. How to handle modified distfiles with the 'old' name
10.16. What does Don't know how to make /usr/share/tmac/tmac.andoc mean?
10.17. How to handle incrementing versions when fixing an existing package
10.18. Could not find bsd.own.mk - what's wrong?
11. Submitting
11.1. Precompiled binary packages
11.2. packages
12. A simple example of a package: bison
12.1. Files
12.1.1. Makefile
12.1.2. pkg/COMMENT
12.1.3. pkg/DESCR
12.1.4. pkg/PLIST
12.2. Checking a package with ``pkglint''
12.3. Steps for building, installing, packaging
A. Build logs
A.1. Building top
A.2. Packaging top
B. Layout of the FTP server's package archive

I. Introduction

Chapter 1. Intro

There is a lot of software freely available for Unix based systems, which usually runs on NetBSD, too, sometimes with some modifications. The NetBSD Packages Collection incorporates any such changes necessary to make that software run on NetBSD, and makes the installation (and deinstallation) of the software package easy by means of a single command.

The NetBSD Package System is used to enable such freely available third-party software to be built easily on NetBSD hosts. Once the software has been built, it is manipulated with the pkg_* tools so that installation and de-installation, printing of an inventory of all installed packages and retrieval of one-line comments or more verbose descriptions are all simple.

The NetBSD Package System and parts of the NetBSD Packages Collection are derived from FreeBSD and it's ports collection.

1.1. Overview

This document is divided into two parts. The first, "User's Guide", describes how one can use one of the packages in the Package Collection, either by installing a precompiled binary package, or by building your own copy using the NetBSD package system. The second part, "Package Constructor's Guide", explains how to prepare a package so it can be easily built by other NetBSD users without knowing about the package's building details.