The pkgsrc guide

Documentation on the NetBSD packages system

Alistair Crooks

Hubert Feyrer

The pkgsrc Developers

$NetBSD: pkgsrc.xml,v 1.7 2005/05/24 12:39:00 wiz Exp $

Abstract

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. Linux
3.2.6. OpenBSD
3.2.7. 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.3.8. Uploading results of a bulk build
5.4. Creating a multiple CD-ROM packages collection
5.4.1. Example of cdpack
6. Frequently Asked Questions
6.1. Are there any mailing lists 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 to resume transfers when fetching distfiles?
6.6. How can I install/use XFree86 from pkgsrc?
6.7. How can I install/use X.org from pkgsrc?
6.8. How to fetch files from behind a firewall
6.9. How do I tell make fetch to do passive FTP?
6.10. How to fetch all distfiles at once
6.11. What does “Don't know how to make /usr/share/tmac/tmac.andoc” mean?
6.12. What does “Could not find bsd.own.mk” mean?
6.13. Using 'sudo' with pkgsrc
6.14. Configuration files handling and placement
6.15. 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. Programming in Makefiles
8.1. Makefile variables
8.1.1. Naming conventions
8.2. Code snippets
8.2.1. Adding things to a list
8.2.2. Converting an internal list into an external list
8.2.3. Passing variables to a shell command
8.2.4. Quoting guideline
8.2.5. Workaround for a bug in BSD Make
9. PLIST issues
9.1. RCS ID
9.2. Semi-automatic PLIST generation
9.3. Tweaking output of make print-PLIST
9.4. Variable substitution in PLIST
9.5. Manpage-compression
9.6. Changing PLIST source with PLIST_SRC
9.7. Platform specific and differing PLISTs
9.8. Sharing directories between packages
10. Buildlink methodology
10.1. Converting packages to use buildlink3
10.2. Writing buildlink3.mk files
10.2.1. Anatomy of a buildlink3.mk file
10.2.2. Updating BUILDLINK_DEPENDS.pkg in buildlink3.mk files
10.3. Writing builtin.mk files
10.3.1. Anatomy of a builtin.mk file
10.3.2. Global preferences for native or pkgsrc software
11. Options handling
11.1. Global default options
11.2. Converting packages to use bsd.options.mk
12. The build process
12.1. Program location
12.2. Main targets
12.3. Other helpful targets
13. Notes on fixes for packages
13.1. General operation
13.1.1. How to pull in variables from /etc/mk.conf
13.1.2. Where to install documentation
13.1.3. Restricted packages
13.1.4. Handling dependencies
13.1.5. Handling conflicts with other packages
13.1.6. Packages that cannot or should not be built
13.1.7. Packages which should not be deleted, once installed
13.1.8. Handling packages with security problems
13.1.9. How to handle compiler bugs
13.1.10. How to handle incrementing versions when fixing an existing package
13.1.11. Portability of packages
13.2. Possible downloading issues
13.2.1. Packages whose distfiles aren't available for plain downloading
13.2.2. How to handle modified distfiles with the 'old' name
13.3. Configuration gotchas
13.3.1. Shared libraries - libtool
13.3.2. Using libtool on GNU packages that already support libtool
13.3.3. GNU Autoconf/Automake
13.4. Building considerations
13.4.1. CPP defines
13.5. Package specific actions
13.5.1. Package configuration files
13.5.2. User interaction
13.5.3. Handling licenses
13.5.4. Creating an account from a package
13.5.5. Installing score files
13.5.6. Packages providing login shells
13.5.7. Packages containing perl scripts
13.5.8. Packages with hardcoded paths to other interpreters
13.5.9. Packages installing perl modules
13.5.10. Packages installing info files
13.5.11. Packages installing GConf2 data files
13.5.12. Packages installing scrollkeeper data files
13.5.13. Packages installing X11 fonts
13.5.14. Packages installing GTK2 modules
13.5.15. Packages installing SGML or XML data
13.5.16. Packages installing extensions to the MIME database
13.5.17. Packages using intltool
13.5.18. Packages installing startup scripts
13.6. Feedback to the author
14. Debugging
15. Submitting and Committing
15.1. Submitting your packages
15.2. Committing: Importing a package into CVS
15.3. Updating a package to a newer version
15.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