From 11ecc803873687b05d13707f9d8d06cf0a2484f7 Mon Sep 17 00:00:00 2001
From: rillig Copyright © 1994-2019 The NetBSD Foundation, Inc $NetBSD: pkgsrc.xml,v 1.33 2019/01/01 02:50:23 jnemeth Exp $ $NetBSD: pkgsrc.xml,v 1.34 2019/04/28 13:41:18 rillig Exp $ Abstract pkgsrc is a centralized package management system for
@@ -60,359 +60,361 @@
-
-
-
-
-
+
CFLAGS
?CFLAGS
?
-
-
Makefile
distinfo
patches/*
Makefile
distinfo
patches/*
-
work*
files/*
work*
files/*
Makefile
sMakefile
s
-
Makefile
variablesMakefile
variables
-
CFLAGS
to GNU configure scriptsCFLAGS
to GNU configure scripts
-
PLIST
generationPLIST_SRC
PLIST
generationPLIST_SRC
-
-
PKG_SYSCONFDIR
is setPKG_SYSCONFDIR
is set
-
-
-
mk.conf
-
+
+
+
mk.conf
+
-
-
-
@@ -441,10 +443,11 @@ builds)
pkgsrc-20
:
source packages
xx
Qy
Table of Contents
CFLAGS
?CFLAGS
?+ To get help when using pkgsrc, the definitive source is this + document, the pkgsrc guide. If you don't find anything here, + there are alternatives: +
+
+ The built-in pkgsrc help, which is available after bootstrapping
+ pkgsrc. Run bmake help topic=… to get
+ help for any topic, such as a variable name like
+ BUILD_DEFS
, a make target like
+ do-build, a missing C or C++ function like
+ strcasecmp or any other topic.
The available help topics are listed in Appendix D, Help topics.
++ The pkgsrc-users mailing list, to which + you + can subscribe and then ask your + questions.
The #pkgsrc IRC channel, which is accessible + via a web browser + or by using a specialized chat program such as + XChat. + Pick any user name and join the channel #pkgsrc.
Before you download any pkgsrc files, you should decide whether you want the current branch or the stable branch. The latter is forked on a @@ -936,7 +971,7 @@ and dashes.
Thus you can switch to using CVS at any later time.The primary download location for all pkgsrc files is https://cdn.NetBSD.org/pub/pkgsrc/ or ftp://ftp.NetBSD.org/pub/pkgsrc/ @@ -971,7 +1006,7 @@ and dashes.
To fetch a specific pkgsrc stable branch, run:
@@ -1011,14 +1046,14 @@ release -d$
cd /usr && cvs -q -z2 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -r pkgsrc-2019Q1 -P pkgsrc
The preferred way to keep pkgsrc up-to-date is via CVS (which also works if you have first installed it via a tar file). It saves bandwidth and hard disk activity, compared to downloading the tar file again.
When updating from a tar file, you first need to
@@ -1034,7 +1069,7 @@ release -d
before updating. You can also configure pkgsrc to store distfiles
and packages in directories outside the pkgsrc tree by setting the
DISTDIR
and PACKAGES
- variables. See Chapter 5, Configuring pkgsrc for the details.
To update pkgsrc from a tar file, download the tar file as explained above. Then, make sure that you have not made any changes to the files in the pkgsrc directory. Remove the pkgsrc @@ -1042,7 +1077,7 @@ release -d
To update pkgsrc via CVS, change to the pkgsrc
directory and run cvs:
@@ -1051,7 +1086,7 @@ release -d$
cd /usr/pkgsrc && cvs update -dP
When updating pkgsrc, the CVS program keeps track of the branch you selected. But if you, for whatever reason, want to switch from the stable branch to the current one, you can do it @@ -1062,7 +1097,7 @@ release -d
When you update pkgsrc, the CVS program will only touch those files that are registered in the CVS repository. That means that any packages that you created on your own will stay @@ -1076,22 +1111,22 @@ release -d
Table of Contents
See Section 5.1, “Using binary packages”.
pkgsrc can be bootstrapped for use in two different modes: privileged and unprivileged one. In unprivileged mode in contrast to privileged one all programs are installed under one particular user @@ -1139,25 +1174,25 @@ release -d
Table of Contents
On the cdn.NetBSD.org site and mirrors, there are collections of binary packages, ready to be installed. These binary packages have been built using the @@ -1181,10 +1216,10 @@ and you can still use binary packages from someone else.
If you cannot use these directories for whatever reasons (maybe because you're not root), you cannot use these binary packages, but - have to build the packages yourself, which is explained in Section 3.2, “Bootstrapping pkgsrc”.
+ have to build the packages yourself, which is explained in Section 4.2, “Bootstrapping pkgsrc”.To install binary packages, you first need to know from where
to get them. The first place where you should look is on the main
pkgsrc FTP server in the directory /pub/pkgsrc/packages
.
In the directory from the last section, there is a
subdirectory called All/
, which contains all the
binary packages that are available for the platform, excluding those
@@ -1242,7 +1277,7 @@ and you can still use binary packages from someone else.
To deinstall a package, it does not matter whether it was installed from source code or from a binary package. The pkg_delete command does not know it anyway. @@ -1268,13 +1303,13 @@ and you can still use binary packages from someone else.
The pkg_info shows information about installed packages or binary package files.
The NetBSD Security-Officer and Packages Groups maintain a list of known security vulnerabilities to packages which are (or have been) @@ -1337,7 +1372,7 @@ check_pkg_vulnerabilities=YES
Install pkgtools/lintpkgsrc
and run
lintpkgsrc with the “-i”
@@ -1354,14 +1389,14 @@ Version mismatch: 'tcsh' 6.09.00 vs 6.10.00
The pkg_admin executes various administrative functions on the package system.
After obtaining pkgsrc, the pkgsrc
directory now contains a set of packages, organized into
categories. You can browse the online index of packages, or run
@@ -1379,7 +1414,7 @@ Version mismatch: 'tcsh' 6.09.00 vs 6.10.00
instructions how to create your own packages.
To build packages from source, you need a working C compiler. On NetBSD, you need to install the “comp” and the “text” distribution @@ -1389,7 +1424,7 @@ Version mismatch: 'tcsh' 6.09.00 vs 6.10.00
The first step for building a package is downloading the distfiles (i.e. the unmodified source). If they have not yet been downloaded, pkgsrc will fetch them automatically.
@@ -1439,7 +1474,7 @@ Version mismatch: 'tcsh' 6.09.00 vs 6.10.00Once the software has downloaded, any patches will be applied, then it will be compiled for you. This may take some time depending on your @@ -1570,21 +1605,21 @@ Version mismatch: 'tcsh' 6.09.00 vs 6.10.00
Table of Contents
The whole pkgsrc system is configured in a single file, usually @@ -1601,7 +1636,7 @@ kinds of variables, and no special error checking (for example for spelling mistakes) takes place.
The following variables apply to all pkgsrc packages. A complete list of the variables that can be configured by the user is available in @@ -1651,7 +1686,7 @@ spelling mistakes) takes place.
LOCALPATCHES
:
Directory for local patches that aren't part of pkgsrc.
- See Section 11.3, “patches/*
” for more
+ See Section 13.3, “patches/*
” for more
information.
PKGMAKECONF
: Location of
the mk.conf
file used by a package's
@@ -1684,7 +1719,7 @@ spelling mistakes) takes place.
PKGSRC_KEEP_BIN_PKGSRC
:
By default, binary packages of built packages are
preserved in ${PACKAGES}/All
. Setting
@@ -1752,10 +1787,10 @@ uid=1000(myusername) gid=100(users) groups=100(users),0(wheel)
By default, pkgsrc will use GCC to build packages. This may be overridden by setting the following variables in /etc/mk.conf:
If you wish to set the CFLAGS
variable,
please make sure to use the +=
operator
instead of the =
operator:
If you want to pass flags to the linker, both in the configure
step and the build step, you can do this in two ways. Either set
LDFLAGS
or LIBS
. The difference
@@ -1857,7 +1892,7 @@ LDFLAGS+= -your -linkerflags
Some packages have build time options, usually to select between different dependencies, enable optional support for big dependencies or enable experimental features.
@@ -1960,17 +1995,17 @@ PKG_OPTIONS.apache= suexecTable of Contents
Once you have built and installed a package, you can create
a binary package which can be installed on
another system with pkg_add(1). This saves having to build
@@ -1991,28 +2026,28 @@ PKG_OPTIONS.apache= suexec
/usr/pkgsrc/packages
, in the form of a
gzipped tar file. See Section B.2, “Packaging figlet” for a
continuation of the above misc/figlet
example.
See Chapter 21, Submitting and Committing for information on how to submit +
See Chapter 23, Submitting and Committing for information on how to submit such a binary package.
See Section 17.17, “Other helpful targets”.
+7.2. Settings for creation of binary packagesSee Section 19.17, “Other helpful targets”.
Table of Contents
For a number of reasons you may want to build binary packages @@ -2026,7 +2061,7 @@ The bulk build system, or pbulk ("p" stands for "parallel"). This chapter describes how to set it up.
First of all, you have to decide whether you build all packages or a limited set of them. Full bulk builds usually consume a lot more resources, both space and time, than builds for some practical sets of packages. @@ -2051,7 +2086,7 @@ certain packages tried to install files outside the
Running a pbulk-style bulk build works roughly as follows:
First, build the pbulk infrastructure in a fresh pkgsrc location.
To simplify configuration, we provide the helper script mk/pbulk/pbulk.sh
.
In order to use it, prepare a clear system (real one, chroot environment, jail, zone, virtual machine). Configure network access to fetch distribution files. @@ -2120,7 +2155,7 @@ unprivileged bulk build and helps configuring distributed bulk builds.
A complete bulk build requires lots of disk space. Some of the disk space can be read-only, some other must be writable. Some can be on remote filesystems (such as NFS) and some should be local. Some can be @@ -2136,7 +2171,7 @@ temporary filesystems, others must survive a sudden reboot.
After your pkgsrc bulk-build has completed, you may wish to create a CD-ROM set of the resulting binary packages to assist in installing packages on other machines. The @@ -2147,7 +2182,7 @@ temporary filesystems, others must survive a sudden reboot.
CD as that package.Complete documentation for cdpack is found in the cdpack(1) man page. The following short example assumes that the binary packages are left in @@ -2182,12 +2217,12 @@ temporary filesystems, others must survive a sudden reboot.
Table of Contents
The files that are installed by pkgsrc are organized in a way that @@ -2236,7 +2271,7 @@ itself.
The following directories exist in a typical pkgsrc installation
in ${LOCALBASE}
.
db/pkg
(the usual location of
@@ -2323,28 +2358,28 @@ currently running.
Table of Contents
CFLAGS
?CFLAGS
?This section contains hints, tips & tricks on special things in @@ -2352,7 +2387,7 @@ pkgsrc that we didn't find a better place for in the previous chapters, and it contains items for both pkgsrc users and developers.
The following mailing lists may be of interest to pkgsrc users:
pkgsrc-users: @@ -2383,7 +2418,7 @@ it contains items for both pkgsrc users and developers.
The directory pkgsrc/pkgtools
contains
a number of useful utilities for both users and developers of pkgsrc. This
section attempts only to make the reader aware of some of the utilities and when
@@ -2459,9 +2494,9 @@ utilities)
To install packages from source as a non-root user, download -pkgsrc as described in Chapter 2, Where to get pkgsrc and how to keep it up-to-date, cd into that +pkgsrc as described in Chapter 3, Where to get pkgsrc and how to keep it up-to-date, cd into that directory and run the command ./bootstrap/bootstrap --unprivileged.
This will install the binary part of pkgsrc to
@@ -2471,7 +2506,7 @@ into ~/pkg/etc
.
By default, resuming transfers in pkgsrc is disabled, but you can
enable this feature by adding the option
PKG_RESUME_TRANSFERS=YES
into
@@ -2495,7 +2530,7 @@ FETCH_USING= wget
If you want to use modular X.org from pkgsrc instead of your system's own X11
(/usr/X11R6
, /usr/openwin
, ...)
you will have to add the following line into
@@ -2506,7 +2541,7 @@ X11_TYPE=modular
If you are sitting behind a firewall which does not allow direct connections to Internet hosts (i.e. non-NAT), you may specify the relevant proxy hosts. This is done using an environment variable in the @@ -2521,7 +2556,7 @@ http_proxy=http://orpheus.amdahl.com:80/
Some fetch tools are not prepared to support HTTPS by default (for example, the one in NetBSD 6.0), or the one installed by the pkgsrc bootstrap (to avoid an openssl dependency that low in the @@ -2536,7 +2571,7 @@ installed before you can use them this way.
This depends on which utility is used to retrieve distfiles. From
bsd.pkg.mk
, FETCH_CMD
is assigned
the first available command from the following list:
You would like to download all the distfiles in a single batch from work or university, where you can't run a make fetch. There is an archive of distfiles on ftp.NetBSD.org, @@ -2588,7 +2623,7 @@ by running:
When compiling the pkgtools/pkg_install
package, you get the error from make that it doesn't know how to make
@@ -2602,7 +2637,7 @@ environment or in mk.conf
You didn't install the compiler set, comp.tgz
,
when you installed your NetBSD machine. Please get and install it, by
extracting it in /
:
When installing packages as non-root user and using the just-in-time su(1) feature of pkgsrc, it can become annoying to type in the root password for each required package installed. To avoid this, the sudo @@ -2632,7 +2667,7 @@ SU_CMD= ${LOCALBASE}/bin/sudo /bin/sh -c
As the system administrator, you can choose where configuration files
are installed. The default settings make all these files go into
${PREFIX}/etc
or some of its subdirectories; this may
@@ -2654,7 +2689,7 @@ reinstall any affected packages.
Please be aware that there can often be bugs in third-party software, and some of these bugs can leave a machine vulnerable to exploitation by attackers. In an effort to lessen the exposure, the NetBSD packages team @@ -2678,14 +2713,14 @@ do this, refer to the following two tools (installed as part of the containing more information.
Use of these tools is strongly recommended! -See Section 4.1.5, “Checking for security vulnerabilities in installed packages” for instructions on how to automate checking and +See Section 5.1.5, “Checking for security vulnerabilities in installed packages” for instructions on how to automate checking and reporting.
If this database is installed, pkgsrc builds will use it to perform a security check before building any package.
When you add your own preferences to the
CFLAGS
variable in your
mk.conf
, these flags are passed in
@@ -2707,7 +2742,7 @@ perform a security check before building any package.
Make sure that your copy of pkgsrc is consistent. A case that occurs often is that people only update pkgsrc in @@ -2723,14 +2758,14 @@ perform a security check before building any package.
extracted. Run make clean clean-depends to verify this.If you are a package developer who wants to invest - some work, have a look at Chapter 19, Making your package work.
If the problem still exists, write a mail to the
pkgsrc-users
mailing list.
You have modified a file from pkgsrc, and someone else has
modified that same file afterwards in the CVS repository. Both changes
are in the same region of the file, so when you updated pkgsrc, the
@@ -2755,245 +2790,277 @@ anymore, you can remove that file and run cvs -q u
Table of Contents
+ To get help when developing pkgsrc, the definitive source is this
+ document, the pkgsrc guide. If you don't find anything here,
+ there are alternatives:
+
+ The built-in pkgsrc help, which is available after bootstrapping
+ pkgsrc. Run bmake help topic=… to get
+ help for any topic, such as a variable name like
+ The available help topics are listed in Appendix D, Help topics.
+ The tech-pkg mailing list, to which
+ you
+ can subscribe and then ask your
+ questions. The #pkgsrc IRC channel, which is accessible
+ via a web browser
+ or by using a specialized chat program such as
+ XChat.
+ Pick any user name and join the channel #pkgsrc. Table of Contents When you find a package that is not yet in pkgsrc, you
@@ -3052,7 +3119,7 @@ know what pkglint's warnings want to tell you, try , which outputs additional
explanations. In many cases the package is not yet ready to build. You can
-find instructions for the most common cases in the next section, Section 10.1, “Common types of packages”. After you have followed the instructions
+find instructions for the most common cases in the next section, Section 12.1, “Common types of packages”. After you have followed the instructions
over there, you can hopefully continue here. Run bmake clean to clean the working
directory from the extracted files. Besides these files, a lot of cache
@@ -3060,7 +3127,7 @@ files and other system information has been saved in the working
directory, which may become wrong after you edited the
Now, run bmake to build the package. For
-the various things that can go wrong in this phase, consult Chapter 19, Making your package work. When the package builds fine, the next step is to install
the package. Run bmake install and hope that
everything works. Simple Perl modules are handled automatically by
url2pkg, including dependencies. Python modules and programs packages are easily created using a
set of predefined variables.
@@ -3156,13 +3223,13 @@ of supported packages. Looking at the file Now that the package has been extracted, let's see what's inside
it. The package has a
-
-
Makefile
distinfo
patches/*
Makefile
distinfo
patches/*
-
work*
files/*
work*
files/*
Makefile
sMakefile
s
-
Makefile
variablesMakefile
variables
-
CFLAGS
to GNU configure scriptsCFLAGS
to GNU configure scripts
-
PLIST
generationPLIST_SRC
PLIST
generationPLIST_SRC
-
-
PKG_SYSCONFDIR
is setPKG_SYSCONFDIR
is set
-
-
-
mk.conf
-
+
+
+
mk.conf
+
-
+
BUILD_DEFS
, a make target like
+ do-build, a missing C or C++ function like
+ strcasecmp or any other topic.Makefile
.pkgsrc/doc/TODO
, I saw
that the “nvu” package has not yet been imported into
pkgsrc. As the description says it has to do with the web, the obvious
@@ -3228,7 +3295,7 @@ Good luck! (See pkgsrc/doc/pkgsrc.txt for some more help :-)
README.txt
, but that only
says something about mozilla, so it's probably useless for seeing what
@@ -3364,7 +3431,7 @@ everything worked.
$
bmake CHECK_FILES=no install
[...]
@@ -3378,29 +3445,29 @@ everything worked.
Table of Contents
Makefile
distinfo
patches/*
Makefile
distinfo
patches/*
work*
files/*
work*
files/*
Whenever you're preparing a package, there are a number of @@ -3408,7 +3475,7 @@ files involved which are described in the following sections.
Building, installation and creation of a binary package are all
controlled by the package's Makefile
.
@@ -3457,7 +3524,7 @@ converters games mbone print x11
DYNAMIC_MASTER_SITES
,
DIST_SUBDIR
, EXTRACT_SUFX
and DISTFILES
are discussed in detail in
- Section 17.5, “The fetch phase”.
The second section contains information about separately downloaded patches, if any. @@ -3503,7 +3570,7 @@ converters games mbone print x11 description of the package (should not include the package name).
LICENSE
indicates the license(s)
- applicable for the package. See Section 19.1.3, “Handling licenses” for further details.
Other variables that affect the build:
@@ -3547,12 +3614,12 @@ converters games mbone print x11Replace /usr/local
with
“${PREFIX}” in all files (see patches,
below).
If the package installs any info files, see Section 19.6.7, “Packages installing info files”.
If the package installs any info files, see Section 21.6.7, “Packages installing info files”.
The distinfo
file contains the message
digest, or checksum, of each distfile needed for the package. This
@@ -3563,7 +3630,7 @@ converters games mbone print x11
RMD160, SHA512), as well as the file size.
The distinfo
file also contains the
checksums for all the patches found in the
- patches
directory (see Section 11.3, “patches/*
”). These checksums ensure that patches
+ patches
directory (see Section 13.3, “patches/*
”). These checksums ensure that patches
are only applied intentionally and that they don't accidentally change,
e.g. when merging different changes together. They also make sure that
new patches are actually added to CVS and old ones are removed.
@@ -3579,7 +3646,7 @@ converters games mbone print x11
Some packages don't work out-of-the box on the various platforms that are supported by pkgsrc. These packages need @@ -3590,7 +3657,7 @@ converters games mbone print x11 extracting them, in alphabetic order.
The patch-*
files should be in
diff -bu format, and apply without a fuzz to avoid
problems. (To force patches to apply with fuzz you can set
@@ -3618,7 +3685,7 @@ converters games mbone print x11
One important thing to mention is to pay attention that no RCS IDs get stored in the patch files, as these will cause problems when later checked into the NetBSD CVS tree. Use the @@ -3637,7 +3704,7 @@ converters games mbone print x11 the changes.
When you have finished a package, remember to generate
the checksums for the patch files by using the make
- makepatchsum command, see Section 11.2, “distinfo
”.
distinfo
”.
When adding a patch that corrects a problem in the distfile (rather than e.g. enforcing pkgsrc's view of where man pages should go), send the patch as a bug report to the @@ -3654,7 +3721,7 @@ converters games mbone print x11
If you want to share patches between multiple packages
in pkgsrc, e.g. because they use the same distfiles, set
PATCHDIR
to the path where the patch files
@@ -3681,7 +3748,7 @@ PATCHDIR= ${.CURDIR}/../xemacs/patches
When fixing a portability issue in the code do not use preprocessor magic to check for the current operating system nor platform. Doing so hurts portability to other platforms because @@ -3705,7 +3772,7 @@ PATCHDIR= ${.CURDIR}/../xemacs/patches It doesn't work unless it is right!
Some typical examples:
Table 11.1. Patching examples
+Table 13.1. Patching examples