Part II. The pkgsrc developer's guide

This part of the book deals with creating and modifying packages. It starts with a “HOWTO”-like guide on creating a new package. The remaining chapters are more like a reference manual for pkgsrc.

Table of Contents

9. Creating a new pkgsrc package from scratch
9.1. Common types of packages
9.1.1. Perl modules
9.1.2. KDE applications
9.2. Examples
9.2.1. How the www/nvu package came into pkgsrc
10. Package components - files, directories and contents
10.1. Makefile
10.2. distinfo
10.3. patches/*
10.3.1. Structure of a single patch file
10.3.2. Creating patch files
10.3.3. Sources where the patch files come from
10.3.4. Patching guidelines
10.3.5. Feedback to the author
10.4. Other mandatory files
10.5. Optional files
10.5.1. Files affecting the binary package
10.5.2. Files affecting the build process
10.5.3. Files affecting nothing at all
10.6. work*
10.7. files/*
11. Programming in Makefiles
11.1. Caveats
11.2. Makefile variables
11.2.1. Naming conventions
11.3. Code snippets
11.3.1. Adding things to a list
11.3.2. Converting an internal list into an external list
11.3.3. Passing variables to a shell command
11.3.4. Quoting guideline
11.3.5. Workaround for a bug in BSD Make
12. PLIST issues
12.1. RCS ID
12.2. Semi-automatic PLIST generation
12.3. Tweaking output of make print-PLIST
12.4. Variable substitution in PLIST
12.5. Man page compression
12.6. Changing PLIST source with PLIST_SRC
12.7. Platform-specific and differing PLISTs
12.8. Sharing directories between packages
13. Buildlink methodology
13.1. Converting packages to use buildlink3
13.2. Writing buildlink3.mk files
13.2.1. Anatomy of a buildlink3.mk file
13.2.2. Updating BUILDLINK_API_DEPENDS.pkg in buildlink3.mk files
13.3. Writing builtin.mk files
13.3.1. Anatomy of a builtin.mk file
13.3.2. Global preferences for native or pkgsrc software
14. The pkginstall framework
14.1. Files and directories outside the installation prefix
14.1.1. Directory manipulation
14.1.2. File manipulation
14.2. Configuration files
14.2.1. How PKG_SYSCONFDIR is set
14.2.2. Telling the software where configuration files are
14.2.3. Patching installations
14.2.4. Disabling handling of configuration files
14.3. System startup scripts
14.3.1. Disabling handling of system startup scripts
14.4. System users and groups
14.5. System shells
14.5.1. Disabling shell registration
14.6. Fonts
14.6.1. Disabling automatic update of the fonts databases
15. Options handling
15.1. Global default options
15.2. Converting packages to use bsd.options.mk
15.3. Option Names
16. The build process
16.1. Introduction
16.2. Program location
16.3. Directories used during the build process
16.4. Running a phase
16.5. The fetch phase
16.5.1. What to fetch and where to get it from
16.5.2. How are the files fetched?
16.6. The checksum phase
16.7. The extract phase
16.8. The patch phase
16.9. The tools phase
16.10. The wrapper phase
16.11. The configure phase
16.12. The build phase
16.13. The test phase
16.14. The install phase
16.15. The package phase
16.16. Cleaning up
16.17. Other helpful targets
17. Tools needed for building or running
17.1. Tools for pkgsrc builds
17.2. Tools needed by packages
17.3. Tools provided by platforms
17.4. Questions regarding the tools
18. Making your package work
18.1. General operation
18.1.1. Portability of packages
18.1.2. How to pull in user-settable variables from mk.conf
18.1.3. User interaction
18.1.4. Handling licenses
18.1.5. Restricted packages
18.1.6. Handling dependencies
18.1.7. Handling conflicts with other packages
18.1.8. Packages that cannot or should not be built
18.1.9. Packages which should not be deleted, once installed
18.1.10. Handling packages with security problems
18.1.11. How to handle incrementing versions when fixing an existing package
18.1.12. Substituting variable text in the package files (the SUBST framework)
18.2. Fixing problems in the fetch phase
18.2.1. Packages whose distfiles aren't available for plain downloading
18.2.2. How to handle modified distfiles with the 'old' name
18.3. Fixing problems in the configure phase
18.3.1. Shared libraries - libtool
18.3.2. Using libtool on GNU packages that already support libtool
18.3.3. GNU Autoconf/Automake
18.4. Programming languages
18.4.1. C, C++, and Fortran
18.4.2. Java
18.4.3. Packages containing perl scripts
18.4.4. Other programming languages
18.5. Fixing problems in the build phase
18.5.1. Compiling C and C++ code conditionally
18.5.2. How to handle compiler bugs
18.5.3. Undefined reference to “...
18.5.4. Running out of memory
18.6. Fixing problems in the install phase
18.6.1. Creating needed directories
18.6.2. Where to install documentation
18.6.3. Installing highscore files
18.6.4. Packages with hardcoded paths to other interpreters
18.6.5. Packages installing perl modules
18.6.6. Packages installing info files
18.6.7. Packages installing man pages
18.6.8. Packages installing GConf2 data files
18.6.9. Packages installing scrollkeeper data files
18.6.10. Packages installing X11 fonts
18.6.11. Packages installing GTK2 modules
18.6.12. Packages installing SGML or XML data
18.6.13. Packages installing extensions to the MIME database
18.6.14. Packages using intltool
18.6.15. Packages installing startup scripts
18.6.16. Packages installing TeX modules
18.6.17. Packages supporting running binaries in emulation
18.6.18. Packages installing hicolor theme icons
18.6.19. Packages installing desktop files
18.7. Marking packages as having problems
19. Debugging
20. Submitting and Committing
20.1. Submitting binary packages
20.2. Submitting source packages (for non-NetBSD-developers)
20.3. General notes when adding, updating, or removing packages
20.4. Committing: Importing a package into CVS
20.5. Updating a package to a newer version
20.6. Moving a package in pkgsrc
21. Frequently Asked Questions
22. GNOME packaging and porting
22.1. Meta packages
22.2. Packaging a GNOME application
22.3. Updating GNOME to a newer version
22.4. Patching guidelines