The Pkgsrc Guide
Total Page:16
File Type:pdf, Size:1020Kb
The pkgsrc guide Documentation on the NetBSD packages system (2021/01/02) Alistair Crooks [email protected] Hubert Feyrer [email protected] The pkgsrc Developers The pkgsrc guide: Documentation on the NetBSD packages system by Alistair Crooks, Hubert Feyrer, The pkgsrc Developers Published 2021/01/02 08:32:15 Copyright © 1994-2021 The NetBSD Foundation, Inc pkgsrc is a centralized package management system for Unix-like operating systems. This guide provides information for users and developers of pkgsrc. It covers installation of binary and source packages, creation of binary and source packages and a high-level overview about the infrastructure. Table of Contents 1. What is pkgsrc?......................................................................................................................................1 1.1. Introduction.................................................................................................................................1 1.1.1. Why pkgsrc?...................................................................................................................1 1.1.2. Supported platforms.......................................................................................................2 1.2. Overview.....................................................................................................................................3 1.3. Terminology................................................................................................................................4 1.3.1. Roles involved in pkgsrc.................................................................................................4 1.4. Typography.................................................................................................................................5 I. The pkgsrc user’s guide.........................................................................................................................1 2. Getting help....................................................................................................................................2 3. Where to get pkgsrc and how to keep it up-to-date........................................................................3 3.1. Getting pkgsrc for the first time.........................................................................................3 3.1.1. As tar archive........................................................................................................3 3.1.2. Via anonymous CVS.............................................................................................4 3.2. Keeping pkgsrc up-to-date.................................................................................................4 3.2.1. Via tar files............................................................................................................5 3.2.2. Via CVS................................................................................................................5 3.2.2.1. Switching between different pkgsrc branches..........................................5 3.2.2.2. What happens to my changes when updating?.........................................5 4. Using pkgsrc on systems other than NetBSD................................................................................6 4.1. Binary distribution.............................................................................................................6 4.2. Bootstrapping pkgsrc.........................................................................................................6 5. Using pkgsrc..................................................................................................................................7 5.1. Using binary packages.......................................................................................................7 5.1.1. Finding binary packages.......................................................................................7 5.1.2. Installing binary packages.....................................................................................7 5.1.3. Updating packages................................................................................................8 5.1.4. Deinstalling packages...........................................................................................8 5.1.5. Getting information about installed packages.......................................................8 5.1.6. Checking for security vulnerabilities in installed packages..................................8 5.1.7. Finding if newer versions of your installed packages are in pkgsrc.....................9 5.1.8. Other administrative functions............................................................................10 5.2. Building packages from source.......................................................................................10 5.2.1. Requirements......................................................................................................10 5.2.2. Fetching distfiles.................................................................................................10 5.2.3. How to build and install......................................................................................11 6. Configuring pkgsrc.......................................................................................................................13 6.1. General configuration......................................................................................................13 6.2. Variables affecting the build process...............................................................................13 6.3. Variables affecting the installation process.....................................................................14 6.4. Selecting and configuring the compiler...........................................................................15 6.4.1. Selecting the compiler.........................................................................................15 6.4.2. Additional flags to the compiler (CFLAGS).........................................................16 6.4.3. Additional flags to the linker (LDFLAGS)............................................................16 6.5. Developer/advanced settings...........................................................................................16 iii 6.6. Selecting Build Options...................................................................................................17 7. Creating binary packages.............................................................................................................18 7.1. Building a single binary package....................................................................................18 7.2. Settings for creation of binary packages.........................................................................18 8. Creating binary packages for everything in pkgsrc (bulk builds)................................................19 8.1. Preparations.....................................................................................................................19 8.2. Running a bulk build.......................................................................................................19 8.2.1. Configuration......................................................................................................19 8.3. Requirements of a full bulk build....................................................................................21 8.4. Bulk build variants...........................................................................................................21 8.4.1. Detect unknown configure options.....................................................................21 8.4.2. Detect classes of bugs by forcing compiler warnings.........................................21 8.4.3. Force compiler options only in the build phase..................................................22 8.4.4. Use custom directories........................................................................................23 8.4.5. Turn warnings into errors....................................................................................23 8.4.6. Reject packages for which pkglint reports errors...............................................24 8.4.7. Reject packages that contain forbidden strings...................................................24 8.4.8. Reject packages whose self-test fails..................................................................24 8.4.9. Reject packages that use undefined shell variables.............................................24 8.4.10. Turn off verbose logging...................................................................................25 8.5. Creating a multiple CD-ROM packages collection.........................................................25 8.5.1. Example of cdpack..............................................................................................25 9. Directory layout of the installed files...........................................................................................27 9.1. File system layout in ${LOCALBASE}.............................................................................27 9.2. File system layout in ${VARBASE} .................................................................................29 10. Frequently Asked Questions......................................................................................................30 10.1. Are there any mailing lists for pkg-related discussion?................................................30 10.2.