The pkgsrc guide

Documentation on the NetBSD packages system

Alistair Crooks

Hubert Feyrer

The pkgsrc Developers

$NetBSD: pkgsrc.xml,v 1.2 2004/10/21 15:07:47 grant Exp $


Information about using the NetBSD package system (pkgsrc) from both a user view for installing packages as well as from a pkgsrc developers' view for creating new packages.

Table of Contents

1. Introduction
1.1. Introduction
1.2. Overview
1.3. Terminology
1.4. Typography
I. The pkgsrc user's guide
2. Where to get pkgsrc
2.1. As tar file
2.2. Via SUP
2.3. Via CVS
3. Using pkgsrc on systems other than NetBSD
3.1. Bootstrapping pkgsrc
3.2. Platform specific notes
3.2.1. Darwin (Mac OS X)
3.2.2. FreeBSD
3.2.3. Interix
3.2.4. IRIX
3.2.5. OpenBSD
3.2.6. Solaris
4. Using pkgsrc
4.1. Working with binary packages
4.1.1. Where to get binary packages
4.1.2. How to use binary packages
4.1.3. A word of warning
4.2. Building packages from source
4.2.1. Requirements
4.2.2. Fetching distfiles
4.2.3. How to build and install
4.2.4. Selecting the compiler
5. Creating binary packages
5.1. Building a single binary package
5.2. Settings for creation of binary packages
5.3. Doing a bulk build of all packages
5.3.1. Configuration
5.3.2. Other environmental considerations
5.3.3. Operation
5.3.4. What it does
5.3.5. Disk space requirements
5.3.6. Setting up a sandbox for chroot'ed builds
5.3.7. Building a partial set of packages
5.4. Creating a multiple CD-ROM packages collection
5.4.1. Example of cdpack
6. Frequently Asked Questions
6.1. Is there a mailing list for pkg-related discussion?
6.2. Where's the pkgviews documentation?
6.3. Utilities for package management (pkgtools)
6.4. How to use pkgsrc as non-root
6.5. How can I install/use XFree86 from pkgsrc?
6.6. How can I install/use from pkgsrc?
6.7. How to fetch files from behind a firewall
6.8. How do I tell make fetch to do passive FTP?
6.9. How to fetch all distfiles at once
6.10. What does “Don't know how to make /usr/share/tmac/tmac.andoc” mean?
6.11. What does “Could not find” mean?
6.12. Using 'sudo' with pkgsrc
6.13. Configuration files handling and placement
6.14. Automated security checks
II. The pkgsrc developer's guide
7. Package components - files, directories and contents
7.1. Makefile
7.2. distinfo
7.3. patches/*
7.4. Other mandatory files
7.5. Optional files
7.6. work*
7.7. files/*
8. PLIST issues
8.1. RCS ID
8.2. Semi-automatic PLIST generation
8.3. Tweaking output of make print-PLIST
8.4. Variable substitution in PLIST
8.5. Manpage-compression
8.6. Changing PLIST source with PLIST_SRC
8.7. Platform specific and differing PLISTs
8.8. Sharing directories between packages
9. Buildlink methodology
9.1. Converting packages to use buildlink3
9.2. Writing files
9.2.1. Anatomy of a file
9.2.2. Updating BUILDLINK_DEPENDS.pkg in files
9.3. Writing files
9.3.1. Anatomy of a file
9.3.2. Global preferences for native or pkgsrc software
10. Options handling
10.1. Global default options
10.2. Converting packages to use
11. The build process
11.1. Program location
11.2. Main targets
11.3. Other helpful targets
12. Notes on fixes for packages
12.1. General operation
12.1.1. How to pull in variables from /etc/mk.conf
12.1.2. Restricted packages
12.1.3. Handling dependencies
12.1.4. Handling conflicts with other packages
12.1.5. Packages that cannot or should not be built
12.1.6. Packages which should not be deleted, once installed
12.1.7. Handling packages with security problems
12.1.8. How to handle compiler bugs
12.1.9. How to handle incrementing versions when fixing an existing package
12.1.10. Portability of packages
12.2. Possible downloading issues
12.2.1. Packages whose distfiles aren't available for plain downloading
12.2.2. How to handle modified distfiles with the 'old' name
12.3. Configuration gotchas
12.3.1. Shared libraries - libtool
12.3.2. Using libtool on GNU packages that already support libtool
12.3.3. GNU Autoconf/Automake
12.4. Building considerations
12.4.1. CPP defines
12.5. Package specific actions
12.5.1. Package configuration files
12.5.2. User interaction
12.5.3. Handling licenses
12.5.4. Creating an account from a package
12.5.5. Installing score files
12.5.6. Packages providing login shells
12.5.7. Packages containing perl scripts
12.5.8. Packages with hardcoded paths to other interpreters
12.5.9. Packages installing perl modules
12.5.10. Packages installing info files
12.5.11. Packages installing GConf2 data files
12.5.12. Packages installing scrollkeeper data files
12.5.13. Packages installing X11 fonts
12.5.14. Packages installing GTK2 modules
12.5.15. Packages installing SGML or XML data
12.5.16. Packages installing extensions to the MIME database
12.5.17. Packages using intltool
12.6. Feedback to the author
13. Debugging
14. Submitting and Committing
14.1. Submitting your packages
14.2. Committing: Importing a package into CVS
14.3. Updating a package to a newer version
14.4. Moving a package in pkgsrc
A. A simple example package: bison
A.1. files
A.1.1. Makefile
A.1.2. DESCR
A.1.3. PLIST
A.1.4. Checking a package with pkglint
A.2. Steps for building, installing, packaging
B. Build logs
B.1. Building figlet
B.2. Packaging figlet
C. Layout of the FTP server's package archive
D. Editing guidelines for the pkgsrc guide
D.1. Targets
D.2. Procedure