From ca82f41a0c11b5d9f04495011c1f3aa325f20a90 Mon Sep 17 00:00:00 2001
From: wiz www/apache - The Apache web
+ target="_top">files/*
Makefile
s
9.1.
Makefile
variablesPLIST
- generationPLIST
generationbuildlink3.mk
+ buildlink3.mk
filesBUILDLINK_DEPENDS.
in
- pkg
buildlink3.mk
+ buildlink3.mk
files11.3. Writing
builtin.mk
fileswww/apache
www/mozilla - The Mozilla web
+ target="_top">www/mozilla
- The Mozilla web
browser
meta-pkgs/gnome - The GNOME
+ target="_top">meta-pkgs/gnome
- The GNOME
Desktop Environment
meta-pkgs/kde3 - The K Desktop
+ target="_top">meta-pkgs/kde3
- The K Desktop
Environment
This document is divided into two parts. The first, The pkgsrc + "Part 1. The pkgsrc user's guide">The pkgsrc user's guide, describes how one can use one of the packages in the Package Collection, either by installing a precompiled binary package, or by building one's own copy using the NetBSD package system. The second part, The - pkgsrc developer's guide, explains how to prepare a - package so it can be easily built by other NetBSD users - without knowing about the package's building details.
+ "Part 2. The pkgsrc developer's guide">The pkgsrc + developer's guide, explains how to prepare a package so + it can be easily built by other NetBSD users without + knowing about the package's building details.This document is available in various formats:
@@ -1178,7 +1209,8 @@ alink="#0000FF">A set of files and building instructions that
describe what's necessary to build a certain piece of
software using pkgsrc. Packages are traditionally
- stored under /usr/pkgsrc
.
/usr/pkgsrc/distfiles
.
@@ -1223,10 +1256,12 @@ alink="#0000FF">
A set of binaries built with pkgsrc from a
distfile and stuffed together in a single
- .tgz
file so it can be
+ .tgz
file so it can be
installed on machines of the same machine
architecture without the need to recompile. Packages
- are usually generated in /usr/pkgsrc/packages
; there is also
an archive on
@@ -1397,7 +1433,19 @@ alink="#0000FF">
/usr/pkgsrc
.
/usr/pkgsrc
.
in it, see the examples in in it, see the examples in
/usr/share/examples/supfiles
, and that
- the /usr/pkgsrc
directory
- exists. Then, simply run sup -v /path/to/your/supfile
.
/usr/pkgsrc
directory exists. Then,
+ simply run sup -v
+ /path/to/your/supfile
.
cvs checkout -P pkgsrc
- This will create the pkgsrc
directory in your This will create the
pkgsrc
directory in your /usr
, and all the package source will
- be stored under /usr/pkgsrc
. To update pkgsrc after the
initial checkout, make sure you have CVS_RSH
set as above, then do:
/usr/pkg
for the prefix where programs will be
- installed in, and /var/db/pkg
for the package database
directory where pkgsrc will do its internal bookkeeping.
However, these can also be set using command-line
@@ -1898,11 +1954,15 @@ release=pkgsrc
By default, If you created your partitions at the time of
installing Mac OS X and formatted the target
partition as UFS, it should automatically mount on
- /usr
- will be on your root file system, normally HFS+. It
- is possible to use the default prefix of /usr/pkg
by symlinking By default,
when
+ the machine boots. If you are (re)formatting a
+ partition as UFS, you need to ensure that the
+ partition map correctly reflects “Apple_UFS” and not
+ “Apple_HFS”./usr
will be on your root file
+ system, normally HFS+. It is possible to use the
+ default prefix
+ of /usr/pkg
by symlinking /usr/pkg
to a directory on a UFS
file system. Obviously, another symlink is required
if you want to place the package database directory
@@ -1916,12 +1976,14 @@ release=pkgsrc
/Volumes/<volume
- name>
when the machine boots. If you are
- (re)formatting a partition as UFS, you need to ensure
- that the partition map correctly reflects
- “Apple_UFS”
- and not “/Volumes/<volume name>
The problem is that none of the disk tools will @@ -1969,9 +2031,12 @@ release=pkgsrc
FreeBSD stores its ports pkg database in
- /var/db/pkg
. It is
- therefore recommended that you choose a different
- location (e.g. /var/db/pkg
. It is therefore
+ recommended that you choose a different location
+ (e.g. /usr/pkgdb
) by using the
--pkgdbdir option to the bootstrap script.
An example An example
/etc/mk.conf
file will be
- placed in /etc/mk.conf.example
file when
you use the bootstrap script.
Therefore, please make sure that you have no
conflicting CFLAGS
in your
- environment or the /etc/mk.conf
. Particularly, make sure
that you do not try to link n32 object files with lib64
- or vice versa. Check your /etc/compiler.defaults
!
If you have the actual pkgsrc tree mounted via NFS @@ -2242,7 +2311,8 @@ interix:kP=\E[S:kN=\E[T:kH=\E[U:dc@:DC@:tc=pcansi:
The bootstrapping process should set all the right
options for programs such as imake(1), but you may want
to set some options depending on your local setup.
- Please see pkgsrc/mk/defaults/mk.conf
and, of
course, your compiler's man pages for details.
in /etc/mk.conf
.
- Otherwise, pkgsrc will assume you are using gcc and may
- end up passing invalid flags to the compiler. Note that
- bootstrap should create an appropriate in
/etc/mk.conf
. Otherwise, pkgsrc will
+ assume you are using gcc and may end up passing invalid
+ flags to the compiler. Note that bootstrap should
+ create an appropriate mk.conf.example
by default.
If you have both the MIPSPro compiler chain
@@ -2263,7 +2336,8 @@ PKGSRC_COMPILER=mipspro
MIPRPro is used, please set your PATH
to not include the location of
- gcc (often /usr/freeware/bin
), and (important)
pass the '--preserve-path' flag.
After bootstrapping, you should set PKGSRC_COMPILER
in PKGSRC_COMPILER
in /etc/mk.conf
:
PKGSRC_COMPILER=icc
The default installation directory for icc is
- /opt/intel_cc_80
, which
- is also the pkgsrc default. If you have installed it
- into a different directory, set ICCBASE
in /opt/intel_cc_80
, which is also
+ the pkgsrc default. If you have installed it into a
+ different directory, set ICCBASE
in /etc/mk.conf
:
ICCBASE=/opt/icc @@ -2366,9 +2443,12 @@ ICCBASE=/opt/icc-
- @@ -2392,12 +2472,15 @@ ICCBASE=/opt/icc
OpenBSD stores its ports pkg database in -
/var/db/pkg
. It is - therefore recommended that you choose a different - location (e.g./var/db/pkg
. It is therefore + recommended that you choose a different location + (e.g./usr/pkgdb
) by using the --pkgdbdir option to the bootstrap script.- -
An example
@@ -2477,8 +2560,9 @@ ICCBASE=/opt/icc lang/gcc or install a binary gcc - package, then remove gcc used during + target="_top">An example
/etc/mk.conf
file will be - placed in/etc/mk.conf.example
file when you use the bootstrap script. OpenBSD's make - program uses/etc/mk.conf
as well. You can work around this by enclosing all the pkgsrc specific parts of the file with:lang/gcc
or install a binary + gcc package, then remove gcc used during bootstrapping.Binary packages of gcc can be found through @@ -2527,7 +2611,8 @@ ICCBASE=/opt/icc
You should set
CC
,CXX
and optionally, -CPP
inCPP
in/etc/mk.conf
, eg.CC= cc @@ -2544,8 +2629,11 @@ CFLAGS= -xtarget=ultra -xarch=v9Whichever compiler you use, please ensure the compiler tools and your $prefix are in your
@@ -2639,7 +2727,8 @@ CFLAGS= -xtarget=ultra -xarch=v9PATH
. This includes -/usr/ccs/{bin,lib}
and - eg./usr/ccs/{bin,lib}
and eg. +/usr/pkg/{bin,sbin}
.Precompiled packages are stored on ftp.NetBSD.org - and its mirrors in the directory
/pub/NetBSD/packages/<OSVERSION>/<ARCH>/
for anonymous FTP access.OSVERSION
is the NetBSD version @@ -2648,16 +2737,21 @@ CFLAGS= -xtarget=ultra -xarch=v9 is the architecture (uname -p). In that directory, there is a subdirectory for each category plus a - subdirectoryAll
which - includes the actual binaries inAll
which includes the actual + binaries in.tgz
files. The category subdirectories use symbolic links to those files (this - is the same directory layout as in/usr/pkgsrc/packages
).This same directory layout applies for CDROM distributions, only that the directory may be rooted - somewhere else, probably somewhere below
@@ -2702,32 +2796,40 @@ CFLAGS= -xtarget=ultra -xarch=v9 semicolon separated list of paths (including remote URLs); trailing slashes are not allowed. -/cdrom
. Please consult your CDROMs documentation for the exact location.Additionally to the
Additionally to the
directory to which + binary packages with known vulnerabilities are moved, + since removing them could cause missing dependencies. + To use these packages, add theAll
directory there exists a -vulnerable
directory to - which binary packages with known vulnerabilities are - moved, since removing them could cause missing - dependencies. To use these packages, add the -vulnerable
directory to - yourPKG_PATH
. However, - you should run vulnerablevulnerable
directory to your +PKG_PATH
. However, you + should run security/audit-packages regularly, - and especially after installing new packages, and - verify that the vulnerabilities are acceptable for your - configuration. An examplePKG_PATH
would be:
security/audit-packages
+ regularly, and especially after installing new + packages, and verify that the vulnerabilities are + acceptable for your configuration. An example +PKG_PATH
would be: +ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSVERSION>/<ARCH>/All;ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSVERSION>/<ARCH>/vulnerable
Please note that semicolon (';') is a shell meta-character, so you'll probably have to quote it.After you've installed packages, be sure to have -
+/usr/pkg/bin
and -/usr/pkg/sbin
in your -PATH
so you can actually - start the just installed program./usr/pkg/bin
and/usr/pkg/sbin
in yourPATH
so you can actually start the + just installed program.@@ -2767,7 +2869,7 @@ CFLAGS= -xtarget=ultra -xarch=v9@@ -2870,16 +2976,18 @@ CFLAGS= -xtarget=ultra -xarch=v9This assumes that the package is already in pkgsrc. If it is not, see Part II, + "Part 2. The pkgsrc developer's guide">Part 2, “The pkgsrc developer's guide” for instructions how to create your own packages.
@@ -2809,7 +2911,8 @@ CFLAGS= -xtarget=ultra -xarch=v9You can overwrite some of the major distribution sites to fit to sites that are close to your own. Have - a look at
+ editing thepkgsrc/mk/defaults/mk.conf
to find some examples — in particular, look for theMASTER_SORT
,You can change these settings either in your shell's environment, or, if you want to keep the settings, by - editing the
/etc/mk.conf
- file, and adding the definitions there./etc/mk.conf
file, and adding the + definitions there.If you don't have a permanent Internet connection and you want to know which files to download, make fetch-list will tell you what you'll - need. Put these distfiles into
/usr/pkgsrc/distfiles
.Taking the figlet utility as an example, we can install it on our system by building as shown in Appendix B, Build + "Appendix 2. Build logs">Appendix 2, Build logs.
The program is installed under the default root of - the packages tree -
-/usr/pkg
. Should this not conform to your tastes, set theLOCALBASE
variable in your environment, and it will use that value as the root of - your packages tree. So, to use/usr/local
, setLOCALBASE=/usr/local
in your environment. Please note that you should use a @@ -2887,23 +2995,28 @@ CFLAGS= -xtarget=ultra -xarch=v9 with other programs (ie, do not try and useLOCALBASE=/usr
). Also, you should not try to add any of your own files or - directories (such assrc/
,obj/
, orsrc/
,obj/
, orpkgsrc/
) below theLOCALBASE
tree. This is to prevent possible conflicts between programs and other files installed by the package system and whatever else may have been installed there.Some packages look in
@@ -2981,7 +3094,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 pkg_add(1) can be put intoSome packages look in
/etc/mk.conf
to alter some configuration options at build time. Have a look at -pkgsrc/mk/defaults/mk.conf
to get an - overview of what will be set there by default. +pkgsrc/mk/defaults/mk.conf
to + get an overview of what will be set there by default. Environment variables such asLOCALBASE
can be set inLOCALBASE
can be set in/etc/mk.conf
to save having to remember to set them each time you want to use pkgsrc.BIN_INSTALL_FLAGS
. - Seepkgsrc/mk/defaults/mk.conf
for more details. @@ -2994,9 +3108,10 @@ CFLAGS= -xtarget=ultra -xarch=v9 installed packages, and fail miserably. Note also that precompiled binary packages are usually built with the defaultLOCALBASE
of -/usr/pkg
, and that you - should not - install any if you use a non-standard/usr/pkg
, and that you should + not install any + if you use a non-standardLOCALBASE
. @@ -3107,7 +3222,19 @@ CFLAGS= -xtarget=ultra -xarch=v9@@ -3117,9 +3244,225 @@ CFLAGS= -xtarget=ultra -xarch=v9
- 5.1. Selecting Build + "#general-configuration">5.1. General + configuration
+ +- 5.2. Variables affecting + the build process
+ +- 5.3. Developer/advanced + settings
+ +- 5.4. Selecting Build Options
++ + +In this section you can find some variables that apply + all pkgsrc packages. The preferred method of setting them + is by setting them in
+ +/etc/mk.conf
.++ + ++
+- +
+ ++
LOCALBASE
: Where + packages will be installed. The default is +/usr/pkg
. Do not mix binary + packages with differentLOCALBASE
s!- +
+ ++
CROSSBASE
: Where + “cross” + category packages will be installed. The default is +${LOCALBASE}/cross
.- +
+ ++
X11BASE
: Where X11 + is installed on the system. The default is +/usr/X11R6
.- +
+ ++
DISTDIR
: Where to + store the downloaded copies of the original source + distributions used for building pkgsrc packages. + The default is${PKGSRCDIR}/distfiles
.- +
+ ++
MASTER_SITE_OVERRIDE
: If set, + override the packages'MASTER_SITES
with this value.- +
+ ++
MASTER_SITE_BACKUP
: + Backup location(s) for distribution files and patch + files if not found locally or in${MASTER_SITES}
or${PATCH_SITES}
respectively. The + defaults areftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/${DIST_SUBDIR}/
+ andftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
.- +
++
BINPKG_SITES
: List + of sites carrying binary pkgs.+ + ++ +XXX
+ ++++
+- +
+ ++
PACKAGES
: The top + level directory for the binary packages. The + default is${PKGSRCDIR}/packages
.- +
+ ++
WRKOBJDIR
: The top + level directory where, if defined, the separate + working directories will get created, and + symbolically linked to from${WRKDIR}
(see below). This is + useful for building packages on several + architectures, then${PKGSRCDIR}
can be NFS-mounted + while${WRKOBJDIR}
is local to every + architecture. (It should be noted thatPKGSRCDIR
should not be set by the + user — it is an internal definition which + refers to the root of the pkgsrc tree. It is + possible to have many pkgsrc tree instances.)- +
+ ++
LOCALPATCHES
: + Directory for local patches that aren't part of + pkgsrc. See Section 8.3, + “patches/*” for more information. +rel
and +arch
are + replaced with OS release (“2.0”, etc.) and architecture + (“mipsel”, + etc.).- +
++
PKGMAKECONF
: + Location of themk.conf
file used by a package's + BSD-style Makefile. If this is not set, +MAKECONF
is set to +/dev/null
to avoid picking up + settings used by builds in/usr/src
.+ + ++ +XXX
+ ++++
+- +
+ ++ +
PKG_DEVELOPER
: Run + some sanity checks that package developers + want:+++
+- +
+ +make sure patches apply with zero fuzz
+- +
+run check-shlibs to see that all binaries + will find their shared libs.
+- +
++
PKG_DEBUG_LEVEL
: + The level of debugging output which is displayed + whilst making and installing the package. The + default value for this is 0, which will not display + the commands as they are executed (normal, default, + quiet operation); the value 1 will display all + shell commands before their invocation, and the + value 2 will display both the shell commands before + their invocation, and their actual execution + progress with set + -x will be displayed.+ @@ -3148,7 +3491,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 --The following variables can be defined in
+ target="_top">The following variables can be defined in
/etc/mk.conf
to select which options to enable for a package:PKG_DEFAULT_OPTIONS
, which can be used @@ -3201,11 +3545,13 @@ CFLAGS= -xtarget=ultra -xarch=v9Before the options framework was introduced, build options were selected by setting a variable in -
@@ -3326,15 +3672,17 @@ CFLAGS= -xtarget=ultra -xarch=v9 already done), and then build a binary package from what was installed. You can then use the pkg_* tools to manipulate it. - Binary packages are created by default in/etc/mk.conf
for each - option. To ease transition to the options framework for - the user, these legacy variables are converted to the - appropriate options setting automatically. A warning is - issued to prompt the user to update/etc/mk.conf
for each option. To + ease transition to the options framework for the user, + these legacy variables are converted to the appropriate + options setting automatically. A warning is issued to + prompt the user to update/etc/mk.conf
to use the options framework directly. Support for these legacy variables will be removed eventually./usr/pkgsrc/packages
, in the form of a gzipped tar file. See Section B.2, + "2.2. Packaging figlet">Section 2.2, “Packaging figlet” for a continuation of the above misc/figlet example.misc/figlet
example.See Chapter @@ -3405,8 +3753,10 @@ CFLAGS= -xtarget=ultra -xarch=v9
You may want to set variables in
+ of/etc/mk.conf
. Look atYou may want to set variables in
/etc/mk.conf
. Look atpkgsrc/mk/defaults/mk.conf
for details of the default settings. You will want to ensure that-
, it will be + executed (as a sh(1) script) at the end of the usual pre-build stage. An example use - ofIn
pkgsrc/mk/bulk
, - copybuild.conf-example
- tobuild.conf
and edit - it, following the comments in that file. This is the - config file that determines where log files are - generated after the build, where to mail the build - report to, where your pkgsrc tree is located and the - user to which user to Inpkgsrc/mk/bulk
, copybuild.conf-example
tobuild.conf
and edit it, following + the comments in that file. This is the config file + that determines where log files are generated after + the build, where to mail the build report to, where + your pkgsrc tree is located and the user to which + user to su(8) to do a @@ -3457,24 +3812,29 @@ _ACCEPTABLE= yesIt is possible to configure the bulk build to perform certain site specific tasks at the end of the - pre-build stage. If the file
pre-build.local
exists in -/usr/pkgsrc/mk/bulk
, it - will be executed (as a /usr/pkgsrc/mk/bulkpre-build.local
is - to have the line:pre-build.local
is to have the + line:#
echo "I do not have enough disk space to build this pig." \ @@ -3499,24 +3859,28 @@ _ACCEPTABLE= yes -
As
/usr/pkg
will be - completely deleted at the start of bulk builds, make - sure your login shell is placed somewhere else. Either - drop it into/usr/local/bin
(and adjust your login - shell in the passwd file), or (re-)install it via +As
+/usr/pkg
will be completely deleted + at the start of bulk builds, make sure your login shell + is placed somewhere else. Either drop it into +/usr/local/bin
(and adjust your + login shell in the passwd file), or (re-)install it via pkg_add(1) from -/etc/rc.local
, so you can - login after a reboot (remember that your current - process won't die if the package is removed, you just - can't start any new instances of the shell any more). - Also, if you use NetBSD earlier than 1.5, or you still - want to use the pkgsrc version of ssh for some reason, - be sure to install ssh before starting it from -rc.local
:/etc/rc.local
, so you can login + after a reboot (remember that your current process + won't die if the package is removed, you just can't + start any new instances of the shell any more). Also, + if you use NetBSD earlier than 1.5, or you still want + to use the pkgsrc version of ssh for some reason, be + sure to install ssh before starting it from +rc.local
:( cd /usr/pkgsrc/security/ssh ; make bulk-install ) if [ -f /usr/pkg/etc/rc.d/sshd ]; then @@ -3554,8 +3918,9 @@ fiBe sure to remove all other things that might interfere with builds, like some libs installed in -
+/usr/local
, etc. then - become root and type:/usr/local
, etc. then become + root and type:#
cd /usr/pkgsrc
@@ -3574,7 +3939,8 @@ fiAt the end of the bulk build, you will get a summary via mail, and find build logs in the directory specified by
+FTP
in the -build.conf
file.build.conf
file.@@ -3615,18 +3981,23 @@ fiGenerates a report that's placed in the - directory specified in the
+build.conf
file named -broken.html
, a - short version of that report will also be mailed - to the build's admin.broken.html
, a short version of + that report will also be mailed to the build's + admin.During the build, a list of broken packages will be - compiled in
/usr/pkgsrc/.broken
(or/usr/pkgsrc/.broken
(or.../.broken.${MACHINE}
ifOBJMACHINE
is set), individual build logs of broken builds can be found in @@ -3697,13 +4068,16 @@ fi package bulk build inside a chroot environment.The first step is to set up a chroot sandbox, e.g. -
+/usr/sandbox
. This can be - done by using null mounts, or manually./usr/sandbox
. This can be done + by using null mounts, or manually. -There is a shell script called
@@ -3729,7 +4104,9 @@ fiThere is a shell script called
pkgsrc/mk/bulk/mksandbox
which will set up the sandbox environment using null mounts. It - will also create a script calledsandbox
in the root of the sandbox environment, which will allow the null mounts to be activated using the To set up a sandbox environment by hand, after extracting all the sets from a NetBSD installation or doing a make distribution - DESTDIR=/usr/sandbox inin
/usr/src/etc
, be sure the following items are present and properly configured:- -
+
/dev/*
/dev/*
#
cd /usr/sandbox/dev ; sh MAKEDEV all
@@ -3737,11 +4114,14 @@ fi- -
+ target="_top">
/etc/resolv.conf
- (for/etc/resolv.conf
(for security/smtpd and mail):security/smtpd
and + mail):#
cp /etc/resolv.conf /usr/sandbox/etc
@@ -3758,11 +4138,13 @@ fi- -
+ target="_top">
/etc/localtime
- (for/etc/localtime
(for security/smtpd):security/smtpd
):#
ln -sf /usr/share/zoneinfo/UTC /usr/sandbox/etc/localtime
@@ -3770,14 +4152,19 @@ fi- -
+ target="_top">
/usr/src
(system - sources, for/usr/src
(system sources, for + sysutils/aperture,sysutils/aperture
, + net/ppp-mppe):net/ppp-mppe
):#
ln -s ../disk1/cvs .
@@ -3787,7 +4174,8 @@ fi- -
Create
Create
/var/db/pkg
(not part of default install):@@ -3797,8 +4185,10 @@ fi- -
Create
+/usr/pkg
- (not part of default install):Create
/usr/pkg
(not part of default + install):#
mkdir /usr/sandbox/usr/pkg
@@ -3806,7 +4196,8 @@ fi- -
@@ -4363,7 +4785,8 @@ nbftp%Checkout pkgsrc via cvs into
Checkout pkgsrc via cvs into
/usr/sandbox/usr/pkgsrc
:#
- -
Make
+ andMake
/usr/sandbox/usr/pkgsrc/packages
- and.../distfiles
- point somewhere appropriate. NFS- and/or - nullfs-mounts may come in handy!.../distfiles
point somewhere + appropriate. NFS- and/or nullfs-mounts may come + in handy!- -
Edit
Edit
/etc/mk.conf
, see Section 6.3.1.1, @@ -3837,14 +4232,16 @@ fi- -
Adjust
Adjust
mk/bulk/build.conf
to suit your needs.- @@ -4355,7 +4776,8 @@ nbftp%
If you have set
CVS_USER
inCVS_USER
inbuild.conf
, make sure that account exists and can do a cvs ${CVS_FLAGS} update @@ -3865,7 +4262,8 @@ fiThis will just jump inside the sandbox and start building. At the end of the build, mail will be sent with the results of the build. Created binary pkgs will - be in
@@ -3883,11 +4281,13 @@ fi/usr/sandbox/usr/pkgsrc/packages
(wherever that points/mounts to/from).In addition to building a complete set of all - packages in pkgsrc, the
pkgsrc/mk/bulk/build
script may be used to build a subset of the packages contained in pkgsrc. By setting definingSPECIFIC_PKGS
inSPECIFIC_PKGS
in/etc/mk.conf
, the variables@@ -3941,21 +4341,23 @@ fi@@ -4308,7 +4725,8 @@ nbftp%If you would like to automatically create checksum files for the binary packages you intend to upload, remember to set
MKSUMS=yes
- in yourmk/bulk/build.conf
.If you would like to PGP sign the checksum files (highly recommended!), remember to set
SIGN_AS=username@NetBSD.org
in your -mk/bulk/build.conf
. This - will prompt you for your GPG password to sign the files +mk/bulk/build.conf
. This will + prompt you for your GPG password to sign the files before uploading everything.Then, make sure that you have
+RSYNC_DST
set properly in your -mk/bulk/build.conf
file, - i.e. adjust it to something like one of the - following:mk/bulk/build.conf
file, i.e. + adjust it to something like one of the following:RSYNC_DST=$CVS_USER@ftp.NetBSD.org:/pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch/upload@@ -3970,20 +4372,23 @@ RSYNC_DST=$CVS_USER@ftp.NetBSD.org:/pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b RSYNC_DST=hubertf@ftp.NetBSD.org:/pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch/upload -A separate
+upload
- directory is used here to allow "closing" the directory - during upload. To do so, run the following command on - ftp.NetBSD.org next:A separate
upload
directory is used here to + allow "closing" the directory during upload. To do so, + run the following command on ftp.NetBSD.org next:nbftp%-mkdir -p -m 750 /pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch/upload
Please note that
Please note that
/pub/NetBSD/packages
is only appropriate for packages for the NetBSD operating system. Binary packages for other operating systems - should go into/pub/pkgsrc
.Before uploading the binary pkgs, ssh authentication @@ -4002,11 +4407,13 @@ chroot-
#
cat $HOME/.ssh/id-dsa.pub
-Now take the output of
+Now take the output of
id-dsa.pub
and append it to your -~/.ssh/authorized_keys
- file on ftp.NetBSD.org. You can remove the key after - the upload is done!~/.ssh/authorized_keys
file on + ftp.NetBSD.org. You can remove the key after the upload + is done!Next, test if your ssh connection really works:
@@ -4038,8 +4445,8 @@ chroot--#
vulnerable - subdirectory. +vulnerable
subdirectory.After the upload has ended, first thing is to revoke ssh access:
@@ -4051,8 +4458,10 @@ Gdd:x!Use whatever is needed to remove the key you've entered before! Last, move the uploaded packages out of - the
+ theupload
directory to - have them accessible to everyone:upload
directory to have them + accessible to everyone:nbftp%cd /pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch
@@ -4082,7 +4491,8 @@ nbftp%chmod 755 .
machines. The pkgtools/cdpack package provides a + target="_top">pkgtools/cdpack
package provides a simple tool for creating the ISO 9660 images. cdpack arranges the packages on the CD-ROMs in a way that keeps @@ -4102,9 +4512,11 @@ nbftp%chmod 755 .
Complete documentation for cdpack is found in the cdpack(1) manpage. The following short example assumes - that the binary packages are left in
/usr/pkgsrc/packages/All
and that - sufficient disk space exists in/u2
to hold the ISO 9660 images.#
chmod 755 .
If you wish to include a common set of files - (
@@ -4143,9 +4557,12 @@ nbftp%COPYRIGHT
,COPYRIGHT
,README
, etc.) on each CD in the collection, then you need to create a directory which contains these files. e.g.chmod 755 .
"userinput">cdpack -x /tmp/common /usr/pkgsrc/packages/All /u2/images
Each image will contain
README
,COPYING
, andEach image will contain
README
,COPYING
, andbin/myscript
in their root directories.chmod 755 .
Pkgviews is tightly integrated with buildlink. You can - find a pkgviews User's guide in
@@ -4324,12 +4742,14 @@ nbftp%pkgsrc/mk/buildlink3/PKGVIEWS_UG
.chmod 755 .
-The
+pkgsrc/pkgtools
- directory pkgtools contains a number of useful utilities - for both users and developers of pkgsrc. This section - attempts only to make the reader aware of the utilities - and when they might be useful, and not to duplicate the - documentation that comes with each package.The
pkgsrc/pkgtools
directory pkgtools + contains a number of useful utilities for both users and + developers of pkgsrc. This section attempts only to make + the reader aware of the utilities and when they might be + useful, and not to duplicate the documentation that comes + with each package.Utilities used by pkgsrc (automatically installed when needed):
@@ -4340,7 +4760,8 @@ nbftp%chmod 755 .
pkgtools/x11-links: Symlinks + target="_top">
pkgtools/x11-links
: Symlinks for use by buildlink.chmod 755 .
pkgtools/digest: Calculates + target="_top">
pkgtools/digest
: Calculates various kinds of checksums (including SHA1).chmod 755 .
pkgtools/libnbcompat: + target="_top">
@@ -4371,7 +4794,8 @@ nbftp%pkgtools/libnbcompat
: Compatibility library for pkgsrc tools.chmod 755 .
pkgtools/mtree: Installed on + target="_top">
@@ -4379,8 +4803,10 @@ nbftp%pkgtools/mtree
: Installed on non-BSD systems due to lack of native mtree.chmod 755 .
pkgtools/pkg_install: - Up-to-date replacement for
@@ -4397,7 +4823,8 @@ nbftp%
pkgtools/pkg_install
: + Up-to-date replacement for/usr/sbin/pkg_install
, or for use on operating systems where pkg_install is not present.chmod 755 .
pkgtools/pkg_tarup: Create a + target="_top">
pkgtools/pkg_tarup
: Create a binary package from an already-installed package. Used by make replace to save the old @@ -4408,7 +4835,8 @@ nbftp%chmod 755 .
pkgtools/dfdisk: Adds extra + target="_top">
pkgtools/dfdisk
: Adds extra functionality to pkgsrc, allowing it to fetch distfiles from multiple locations. It currently supports the following methods: multiple CD-ROMs @@ -4419,7 +4847,8 @@ nbftp%chmod 755 .
pkgtools/xpkgwedge: Put X11 + target="_top">
@@ -4427,7 +4856,8 @@ nbftp%pkgtools/xpkgwedge
: Put X11 packages someplace else (enabled by default).chmod 755 .
devel/cpuflags: Determine the + target="_top">
@@ -4443,7 +4873,8 @@ nbftp%devel/cpuflags
: Determine the best compiler flags to optimise code for your current CPU and compiler.chmod 755 .
pkgtools/pkg_chk: Reports on + target="_top">
@@ -4452,7 +4883,8 @@ nbftp%pkgtools/pkg_chk
: Reports on packages whose installed versions do not match the latest pkgsrc entries.chmod 755 .
pkgtools/pkgdep: Makes + target="_top">
@@ -4461,11 +4893,13 @@ nbftp%pkgtools/pkgdep
: Makes dependency graphs of packages, to aid in choosing a strategy for updating.chmod 755 .
pkgtools/pkgdepgraph: Makes + target="_top">
@@ -4473,7 +4907,8 @@ nbftp%pkgtools/pkgdepgraph
: Makes graphs from the output of pkgtools/pkgdep (uses + target="_top">pkgtools/pkgdep
(uses graphviz).chmod 755 .
pkgtools/pkglint: The + target="_top">
@@ -4483,8 +4918,9 @@ nbftp%pkgtools/pkglint
: The pkglint(1) program checks a pkgsrc entry for errors, lintpkgsrc(1) does various checks on the complete pkgsrc system.chmod 755 .
pkgtools/pkgsurvey: Report what - packages you have installed.
+ target="_top">pkgtools/pkgsurvey
: Report + what packages you have installed. @@ -4498,7 +4934,8 @@ nbftp%chmod 755 .
pkgtools/pkgdiff: Automate + target="_top">
@@ -4507,10 +4944,12 @@ nbftp%pkgtools/pkgdiff
: Automate making and maintaining patches for a package (includes pkgdiff, pkgvi, mkpatches, etc.).chmod 755 .
pkgtools/rpm2pkg,
@@ -4518,7 +4957,8 @@ nbftp%pkgtools/rpm2pkg
, pkgtools/url2pkg: Aids in + target="_top">pkgtools/url2pkg
: Aids in converting to pkgsrc.chmod 755 .
pkgtools/gensolpkg: Convert + target="_top">
@@ -4533,7 +4973,8 @@ nbftp%pkgtools/gensolpkg
: Convert pkgsrc to a Solaris package.chmod 755 .
pkgtools/pkgconflict: Find + target="_top">
@@ -4542,7 +4983,8 @@ nbftp%pkgtools/pkgconflict
: Find packages that conflict but aren't marked as such.chmod 755 .
pkgtools/pkg_comp: Build + target="_top">
@@ -4550,8 +4992,9 @@ nbftp%pkgtools/pkg_comp
: Build packages in a chrooted area.chmod 755 .
pkgtools/libkver: Spoof kernel - version for chrooted cross builds.
+ target="_top">pkgtools/libkver
: Spoof + kernel version for chrooted cross builds. @@ -4592,7 +5035,8 @@ nbftp%chmod 755 .
“--ignore-user-check” flag, as it will choose and use multiple default directories under -~/pkg
as the installation +~/pkg
as the installation targets. These directories can be overriden by the “--prefix” flag provided by the script, as well as some others that allow @@ -4614,9 +5058,11 @@ nbftp%chmod 755 .
By default resuming transfers in pkgsrc is disabled, but you can enable this feature by adding the option
+ intoPKG_RESUME_TRANSFERS=YES
- into/etc/mk.conf
. If, - during a fetch step, an incomplete distfile is found, - pkgsrc will try to resume it./etc/mk.conf
. If, during a fetch step, + an incomplete distfile is found, pkgsrc will try to + resume it.You can also use a different program than the default
-chmod 755 .
"varname">FETCH_OUTPUT_ARGS if you are not using default values.For example, if you want to use
For example, if you want to use
wget
to resume downloads, you'll have to use something like:@@ -4653,10 +5100,13 @@ FETCH_OUTPUT_ARGS=-OIf you want to use XFree86 from pkgsrc instead of your - system's own X11 (
/usr/X11R6
,/usr/X11R6
,/usr/openwin
, ...), you will have to - add the following line into/etc/mk.conf
:X11_TYPE=XFree86 @@ -4676,10 +5126,13 @@ X11_TYPE=XFree86If you want to use X.org from pkgsrc instead of your - system's own X11 (
/usr/X11R6
,/usr/X11R6
,/usr/openwin
, ...) you will have to add - the following line into/etc/mk.conf
:X11_TYPE=xorg @@ -4725,32 +5178,40 @@ http_proxy=http://orpheus.amdahl.com:80/-This depends on which utility is used to retrieve - distfiles. From
+ distfiles. Frombsd.pkg.mk
, -FETCH_CMD
is assigned the - first available command from the following list:bsd.pkg.mk
,FETCH_CMD
is assigned the first + available command from the following list:
- -
${LOCALBASE}/bin/ftp
- -
+
/usr/bin/ftp
/usr/bin/ftp
On a default NetBSD installation, this will be -
- -/usr/bin/ftp
, which - automatically tries passive connections first, and falls - back to active connections if the server refuses to do - passive. For the other tools, add the following to your -/etc/mk.conf
file: -PASSIVE_FETCH=1
.Having that option present will prevent
+ +/usr/bin/ftp
, which automatically + tries passive connections first, and falls back to active + connections if the server refuses to do passive. For the + other tools, add the following to your/etc/mk.conf
file:PASSIVE_FETCH=1
.Having that option present will prevent
@@ -4777,7 +5238,8 @@ http_proxy=http://orpheus.amdahl.com:80/ entire directory may not be appropriate./usr/bin/ftp
from falling back to active transfers.The answer here is to do a make fetch-list in
make fetch-list in
/usr/pkgsrc
or one of it's subdirectories, carry the resulting list to your machine at work/school and use it there. If you don't have a @@ -4805,7 +5267,8 @@ http_proxy=http://orpheus.amdahl.com:80/ "userinput">sh /tmp/fetch.sh
then tar up
then tar up
/tmp/distfiles
and take it home.If you have a machine running NetBSD, and you want to @@ -4845,10 +5308,12 @@ http_proxy=http://orpheus.amdahl.com:80/
When compiling the pkgtools/pkg_install package, you get - the error from make that it doesn't know how to make -
@@ -4856,10 +5321,12 @@ http_proxy=http://orpheus.amdahl.com:80//usr/share/tmac/tmac.andoc
? - This indicates that you don't have installed the + target="_top">pkgtools/pkg_install
package, you + get the error from make that it doesn't know how to make +/usr/share/tmac/tmac.andoc
? This + indicates that you don't have installed the “text” set (nroff, ...) from the NetBSD base distribution on your machine. It is recommended to do that to format manpages.In the case of the pkgtools/pkg_install package, you can - get away with setting
+ in
pkgtools/pkg_install
package, you + can get away with settingNOMAN=YES
either in the environment or - in/etc/mk.conf
./etc/mk.conf
.@@ -4875,10 +5342,13 @@ http_proxy=http://orpheus.amdahl.com:80/-You didn't install the compiler set,
+ extracting it inYou didn't install the compiler set,
comp.tgz
, when you installed your NetBSD machine. Please get it and install it, by - extracting it in/
:/
:-#
cd /
@@ -4886,10 +5356,11 @@ http_proxy=http://orpheus.amdahl.com:80/ "userinput">tar --unlink -zxvpf .../comp.tgz
+
comp.tgz
is part of - every NetBSD release. Get the one that corresponds to - your release (determine via uname -r).
comp.tgz
is part of every NetBSD + release. Get the one that corresponds to your release + (determine via uname + -r).@@ -4916,8 +5387,10 @@ http_proxy=http://orpheus.amdahl.com:80/ (either as binary package or from security/sudo) and then put the - following into your@@ -5598,21 +6096,26 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -cin
security/sudo
) and then put the + following into your/etc/mk.conf
:.if exists(${LOCALBASE}/bin/sudo) @@ -4939,7 +5412,8 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -cAs 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 be suboptimal depending on your expectations (e.g., a read-only, NFS-exported @@ -4948,10 +5422,14 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -cIn order to change the defaults, you can modify the
+PKG_SYSCONFBASE
variable (in -/etc/mk.conf
) to point to - your preferred configuration directory; some common - examples include/etc
or -/etc/pkg
./etc/mk.conf
) to point to your + preferred configuration directory; some common examples + include/etc
or/etc/pkg
.Furthermore, you can change this value on a per-package basis by setting the
security/audit-packages package. It + target="_top">
security/audit-packages
package. It has two components:@@ -5024,7 +5503,8 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c@@ -5056,11 +5536,13 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -cUse of the security/audit-packages package is + target="_top">
security/audit-packages
package is strongly recommended! After “audit-packages” is installed, please read the package's message, which you can get by running @@ -5039,8 +5519,8 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c
- 8.1.
8.1.
Makefile
- 8.2.
8.2.
distinfo
- 8.6. -
+work*
work*
- 8.7. -
+files/*
files/*
- 9. - Programming in
Makefile
s
- 9.1.
9.1.
Makefile
variables- @@ -5140,8 +5628,9 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c
- 10.2. Semi-automatic -
+PLIST
- generationPLIST
generation- 10.3. Tweaking output of make @@ -5179,7 +5668,8 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c to use buildlink3
- 11.2. Writing
11.2. Writing
buildlink3.mk
files- @@ -5192,22 +5682,25 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c "#updating-buildlink-depends">11.2.2. Updating
BUILDLINK_DEPENDS. -
inpkg
pkg
buildlink3.mk
files- 11.3. Writing
11.3. Writing
builtin.mk
files- @@ -5562,11 +6056,13 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c
- 8.1.
8.1.
Makefile
- 8.2.
8.2.
distinfo
- 8.6. -
+work*
work*
- 8.7. -
+files/*
files/*
Building, installation and creation of a binary - package are all controlled by the package's
-Makefile
. TheMakefile
. TheMakefile
describes various things about a package, for example from where to get it, how to configure, build, and install it.A package
+Makefile
- contains several sections that describe the package.A package
Makefile
contains several sections that + describe the package.In the first section there are the following variables, which should appear exactly in the order given @@ -5644,26 +6147,159 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c list of categories which the package fits in. You can choose any of the top-level directories of pkgsrc for it.
+ +Currently the following values are available for +
+CATEGORIES
. If more + than one is used, they need to be separated by + spaces:+archivers cross geography meta-pkgs security +audio databases graphics misc shells +benchmarks devel ham multimedia sysutils +biology editors inputmethod net textproc +cad emulators lang news time +chat finance mail parallel wm +comms fonts math pkgtools www +converters games mbone print x11 +- + +
+ +
MASTER_SITES
is a list of URLs where the distribution files can be downloaded. Each URL must end with a slash.The
+MASTER_SITES
+ may make use of the following predefined sites:+ ${MASTER_SITE_APACHE} + ${MASTER_SITE_BACKUP} + ${MASTER_SITE_CYGWIN} + ${MASTER_SITE_DEBIAN} + ${MASTER_SITE_FREEBSD} + ${MASTER_SITE_FREEBSD_LOCAL} + ${MASTER_SITE_GNOME} + ${MASTER_SITE_GNU} + ${MASTER_SITE_GNUSTEP} + ${MASTER_SITE_IFARCHIVE} + ${MASTER_SITE_MOZILLA} + ${MASTER_SITE_OPENOFFICE} + ${MASTER_SITE_PERL_CPAN} + ${MASTER_SITE_R_CRAN} + ${MASTER_SITE_SOURCEFORGE} + ${MASTER_SITE_SUNSITE} + ${MASTER_SITE_SUSE} + ${MASTER_SITE_TEX_CTAN} + ${MASTER_SITE_XCONTRIB} + ${MASTER_SITE_XEMACS} + ++ +If one of these predefined sites is chosen, you + may want to specify a subdirectory of that site. + Since these macros may expand to more than one + actual site, you must use the following + construct to specify a subdirectory:
++ ${MASTER_SITE_GNU:=subdirectory/name/} + ${MASTER_SITE_SOURCEFORGE:=project_name/} ++ +Note the trailing slash after the subdirectory + name.
+ +If the package has multiple
+DISTFILES
or multiplePATCHFILES
from different sites, + setSITES_foo
to a + list of URI's where file “foo” may be found. + “foo” + includes the suffix, e.g.+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} +DISTFILES+= foo-file.tar.gz +SITES_foo-file.tar.gz=http://www.somewhere.com/somehow/ \ + http://www.somewhereelse.com/mirror/somehow/ ++- +
+ ++ +
DISTFILES
: Name(s) + of archive file(s) containing distribution. The + default is${DISTNAME}${EXTRACT_SUFX}
. + Should only be set if you have more than one + distfile.Note that the normal default setting of +
+DISTFILES
must be made + explicit if you want to add to it (rather than + replace it), as you usually would.- +
+ + + ++
EXTRACT_SUFX
: + Suffix of the distribution file, will be appended + toDISTNAME
. Defaults + to.tar.gz
.The second section contains information about + separately downloaded patches, if any.
+ ++-+
- +
+ ++
PATCHFILES
Name(s) + of additional files that contain distribution + patches. There is no default. pkgsrc will look for + them atPATCH_SITES
. + They will automatically be uncompressed before + patching if the names end with.gz
or.Z
.- +
PATCH_SITES
: + Primary location(s) for distribution patch files + (seePATCHFILES
below) + if not found locally.The second section contains the following +
The third section contains the following variables.
-
+ email address of the contact person for this + package. The person who feels responsible for this + package, and who is most likely to look at problems + or questions regarding this package which have been + reported with + send-pr(1). The + right person to contact before making major changes + to the package. When packaging a new program, set +
MAINTAINER
is the - mail address of the package's maintainer, which is - the person you can contact when the package does - not work.MAINTAINER
to + yourself. If you really can't maintain the package + for future updates, set it to<tech-pkg@NetBSD.org>
.- @@ -5674,94 +6310,33 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c
+ one-line description of the package (should not + include the package name).
COMMENT
is a - one-line comment about the purpose of the - package.The
-MASTER_SITES
may be - set to one of the predefined sites:- ${MASTER_SITE_APACHE} - ${MASTER_SITE_BACKUP} - ${MASTER_SITE_CYGWIN} - ${MASTER_SITE_DEBIAN} - ${MASTER_SITE_FREEBSD} - ${MASTER_SITE_FREEBSD_LOCAL} - ${MASTER_SITE_GNOME} - ${MASTER_SITE_GNU} - ${MASTER_SITE_GNUSTEP} - ${MASTER_SITE_IFARCHIVE} - ${MASTER_SITE_MOZILLA} - ${MASTER_SITE_OPENOFFICE} - ${MASTER_SITE_PERL_CPAN} - ${MASTER_SITE_R_CRAN} - ${MASTER_SITE_SOURCEFORGE} - ${MASTER_SITE_SUNSITE} - ${MASTER_SITE_SUSE} - ${MASTER_SITE_TEX_CTAN} - ${MASTER_SITE_XCONTRIB} - ${MASTER_SITE_XEMACS} - -+Other variables that affect the build:
-If one of these predefined sites is chosen, you may - require the ability to specify a subdirectory of that - site. Since these macros may expand to more than one - actual site, you must use the following - construct to specify a subdirectory:
-- ${MASTER_SITE_GNU:=subdirectory/name/} - ${MASTER_SITE_SOURCEFORGE:=project_name/} -- -Note the trailing slash after the subdirectory - name.
- --@@ -5820,7 +6374,8 @@ converters games mbone print x11 @@ -5841,7 +6396,8 @@ converters games mbone print x11 in new distinfo files. The pkgtools/digest utility calculates + target="_top">Note
- -+
MASTER_SITE_SUBDIR
has - been deprecated and should - no longer be used.+-+
- +
++
WRKSRC
: The + subdirectory of${WRKDIR}
to which the + distribution actually unpacks. The default is +${WRKDIR}/${DISTNAME}
. The value + ofWRKSRC
should be + set explicitly if the package does not follow + standard conventions and include the package's name + as a subdirectory.If the package has multiple
-DISTFILES
or multiplePATCHFILES
from different sites, set -SITES_foo
to a list of URI's - where file “foo” - may be found. “foo” includes the suffix, e.g.-DISTFILES= ${DISTNAME}${EXTRACT_SUFX} -DISTFILES+= foo-file.tar.gz -SITES_foo-file.tar.gz=http://www.somewhere.com/somehow/ \ - http://www.somewhereelse.com/mirror/somehow/ -- -Note that the normal default setting of
- -DISTFILES
must be made explicit if you - want to add to it (rather than replace it), as you - usually would.Currently the following values are available for -
-CATEGORIES
. If more than one - is used, they need to be separated by spaces:-archivers cross geography meta-pkgs security -audio databases graphics misc shells -benchmarks devel ham multimedia sysutils -biology editors inputmethod net textproc -cad emulators lang news time -chat finance mail parallel wm -comms fonts math pkgtools www -converters games mbone print x11 --Please pay attention to the following gotchas:
@@ -5769,47 +6344,26 @@ converters games mbone print x11Add
MANCOMPRESSED
if manpages are installed in compressed form by the - package; see comment inbsd.pkg.mk
.- -
Replace
+/usr/local
- with “${PREFIX}” in all files (see - patches, below).Replace
/usr/local
with + “${PREFIX}” + in all files (see patches, below).- - -
If the package installs any info files, see Section - 15.5.7, “Packages installing info + "15.5.7. Packages installing info files">Section 15.5.7, + “Packages installing info files”.
- -
- -Set
-MAINTAINER
to - be yourself. If you really can't maintain the - package for future updates, set it to<tech-pkg@NetBSD.org>
.- -
- -If a home page for the software in question - exists, add the variable
-HOMEPAGE
right afterMAINTAINER
. The value of this - variable should be the URL for the home page.- -
Be sure to set the
-COMMENT
variable to a short - description of the package, not containing the - pkg's name.pkgtools/digest
utility calculates all of the digests in the distinfo file, and it provides various different algorithms. At the current time, the algorithms provided are: www/navigator). These are kept in the - same distinfo file and care should be taken when + target="_top">www/navigator
). These are kept in + the same distinfo file and care should be taken when upgrading such a package to ensure distfile information is not lost.The message digest/checksum for all the official - patches found in the
@@ -5897,14 +6457,17 @@ converters games mbone print x11 NetBSD. The files are applied successively in alphabetic order (as returned by a shell “patches/patch-*” glob expansion), so -patches/
directory (see Section 8.3, “patches/*”) for the package is also - stored in thedistinfo
- file. This is a message digest/checksum of all lines in - the patch file except the NetBSD RCS Id. This file is - generated by invoking make + stored in thedistinfo
file. This is a message + digest/checksum of all lines in the patch file except the + NetBSD RCS Id. This file is generated by invoking + make makepatchsum (or make mps if you're in a hurry).patch-aa
is applied before -patch-ab
, etc. - -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 setpatch-aa
is applied before +patch-ab
, etc.The
from the pkgtools/pkgdiff package to avoid + target="_top">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 setPATCH_FUZZ_FACTOR=-F2
). Furthermore, do not put changes for more than one file into a single patch-file, as this will make future modifications more @@ -5922,14 +6485,16 @@ converters games mbone print x11 "command">pkgdiffpkgtools/pkgdiff
package to avoid these problems.For even more automation, we recommend using mkpatches from the same package to make a whole set of patches. You just have to backup files before you edit them to -
+ “filename.orig
, e.g. with +filename.orig
, e.g. with cp -p filename filename.orig or, easier, by using pkgvi again @@ -5944,7 +6509,8 @@ converters games mbone print x11 makepatchsum command, see Section 8.2, - “distinfo
”.distinfo
”.Patch files that are distributed by the author or other maintainers can be listed in
@@ -6183,7 +6776,9 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix @@ -6193,7 +6788,8 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unixIf it is desired to store any patches that should not be committed into pkgsrc, they can be kept outside the - pkgsrc tree in the
$LOCALPATCHES
directory. The directory tree there is expected to have the same “category/package” structure as pkgsrc, and patches are expected to be - stored inside these dirs (also known as$LOCALPATCHES/$PKGPATH
). For example if - you want to keep a private patch forpkgsrc/graphics/png
, keep it in -$LOCALPATCHES/graphics/png/mypatch
. All files in the named directory are expected to be patch files, and they are applied @@ -5982,7 +6552,8 @@ converters games mbone print x11@@ -6171,7 +6763,8 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix "quote">${CP}” command in the “pre-configure” target to achieve this. Alternatively, you could simply - diff the file against-
DESCR
- @@ -5994,7 +6565,8 @@ converters games mbone print x11 everything that you write here.
-
PLIST
- @@ -6025,7 +6597,8 @@ converters games mbone print x11
@@ -6159,7 +6750,8 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix-
@@ -6098,7 +6677,8 @@ MESSAGE_SUBST+= SOMEVAR="somevalue" @@ -6106,11 +6686,18 @@ MESSAGE_SUBST+= SOMEVAR="somevalue"
INSTALL
- @@ -6037,8 +6610,9 @@ converters games mbone print x11 moved in place, the second time after the files to install are moved in place. This can be used to do any custom procedures not possible with @exec - commands in
-PLIST
. - See PLIST. See pkg_add(1) and @@ -6049,7 +6623,8 @@ converters games mbone print x11 more information.
DEINSTALL
- @@ -6069,7 +6644,8 @@ converters games mbone print x11 more information.
-
MESSAGE
- @@ -6080,13 +6656,16 @@ converters games mbone print x11 Please note that you can modify variables in it easily by using
MESSAGE_SUBST
in the package's -Makefile
: +Makefile
:MESSAGE_SUBST+= SOMEVAR="somevalue"replaces "${SOMEVAR}" with “somevalue” in
somevalue” in
MESSAGE
.When you type make the distribution files are - unpacked into this directory. It can be removed by - running make - clean. Besides the sources, this - directory is also used to keep various timestamp - files.
+ unpacked into the directory denoted byWRKDIR
. It can be removed by running + make clean. + Besides the sources, this directory is also used to keep + various timestamp files. The directory gets removed completely on clean. + The default is${.CURDIR}/work
or${.CURDIR}/work.${MACHINE_ARCH}
if +OBJMACHINE
is set.If a package doesn't create a subdirectory for itself (like GNU software does, for instance), but extracts @@ -6118,38 +6705,42 @@ MESSAGE_SUBST+= SOMEVAR="somevalue"
WRKSRC
accordingly, e.g. editors/sam again, but the quick + target="_top">editors/sam
again, but the quick answer is:WRKSRC= ${WRKDIR}-Please note that the old
NO_WRKSUBDIR
has been deprecated and - should not be used. Also, if your package doesn't create - a subdir with the name ofDISTNAME
but some different name, set -WRKSRC
to point to the - proper name in${WRKDIR}
. - See If a package doesn't create a subdir with the name of +DISTNAME
but some different + name, setWRKSRC
to point to + the proper name in${WRKDIR}
. See lang/tcl andlang/tcl
and x11/tk for examples, and here is + target="_top">x11/tk
for examples, and here is another one:WRKSRC= ${WRKDIR}/${DISTNAME}/unixThe name of the working directory created by pkgsrc is -
work
by default. If the - same pkgsrc tree should be used on several different +work
by default. If the same + pkgsrc tree should be used on several different platforms, the variableOBJMACHINE
can be set in /etc/mk.conf to attach the platform to the directory name, e.g. -work.i386
orwork.i386
orwork.sparc
./dev/null
and use the patch mechanism to manage the creation of this file.-
- 9.1.
9.1.
Makefile
variables- @@ -6234,7 +6830,8 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix
Pkgsrc consists of many
-Pkgsrc consists of many
Makefile
fragments, each of which forms a well-defined part of the pkgsrc system. Using the @@ -6244,7 +6841,8 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix some discipline to keep the code correct and understandable.The basic ingredients for
-The basic ingredients for
Makefile
programming are variables (which are actually macros) and shell commands. Among these shell commands may even be more complex ones likeThis chapter describes some patterns, that appear quite - often in
+ often inMakefile
s, including - the pitfalls that come along with them.Makefile
s, including the pitfalls that + come along with them.-
Makefile
variables - contain strings that can be processed using the five - operators ``='', ``+='', ``?='', ``:='', and ``!='', - which are described in theMakefile
variables contain + strings that can be processed using the five operators + ``='', ``+='', ``?='', ``:='', and ``!='', which are + described in the make(1) man page.When a variable's value is parsed from a
When a variable's value is parsed from a
Makefile
, the hash character ``#'' and the backslash character ``\'' are handled specially. If a backslash is followed by a newline, any whitespace @@ -6383,7 +6986,9 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unixAll variable names starting with an underscore are reserved for use by the pkgsrc infrastructure. They shall not be used by package -
+Makefile
s.Makefile
s.- @@ -6695,7 +7300,8 @@ for_test: see the package regress/make-quoting, testcase + target="_top">
@@ -7287,7 +7932,8 @@ PLIST_SUBST+= SOMEVAR="somevalue"regress/make-quoting
, testcasebug1
. @@ -6720,7 +7326,8 @@ for_test:- 10.2. Semi-automatic -
PLIST
+PLIST
generation- 10.3. @@ -6748,17 +7355,21 @@ for_test: -
The
PLIST
file contains a - package's “packing - list”, i.e. a list of files that belong to the - package (relative to the${PREFIX}
directory it's been installed - in) plus some additional statements - see the ThePLIST
file contains a package's + “packing list”, i.e. + a list of files that belong to the package (relative to the +${PREFIX}
directory it's been + installed in) plus some additional statements - see the + pkg_create(1) manpage for a full list. This chapter addresses some issues that need - attention when dealing with thePLIST
file (or files, see below!).@@ -6772,7 +7383,8 @@ for_test:Be sure to add a RCS ID line as the first thing in any -
+PLIST
file you write:PLIST
file you write:@comment $NetBSD$@@ -6785,7 +7397,9 @@ for_test:10.2. Semi-automatic -
+PLIST
generationPLIST
generation @@ -6832,7 +7446,8 @@ for_test: of AWK scripting you like to it, but be careful with quoting. -For example, to get all files inside the
For example, to get all files inside the
libdata/foo
directory removed from the resulting PLIST:@@ -6907,7 +7522,8 @@ for_test:Some packages want to embed the OS name and version into some paths. To do this, use these - variables in the
PLIST
:@@ -6947,14 +7563,18 @@ for_test: "quote">share/locale/de/LC_MESSAGES/...”. This properly handles the fact that different operating systems expect locale files to be either - inshare
or -lib
by default. + inshare
orlib
by default.For a complete list of values which are replaced by - default, please look in
@@ -6986,17 +7606,21 @@ PLIST_SUBST+= SOMEVAR="somevalue"bsd.pkg.mk
(and search for PLIST_SUBST).Manpages should be installed in compressed form if -
+MANZ
is set (inMANZ
is set (inbsd.own.mk
), and uncompressed - otherwise. To handle this in thePLIST
file, the suffix “.gz” is appended/removed automatically for manpages according toMANZ
andMANCOMPRESSED
being set or not, see - above for details. This modification of thePLIST
file is done on a copy of it, not -PLIST
itself.PLIST
itself.@@ -7013,8 +7637,9 @@ PLIST_SUBST+= SOMEVAR="somevalue"To use one or more files as source for the -
PLIST
used in generating - the binary package, set the variablePLIST
used in generating the + binary package, set the variablePLIST_SRC
to the names of that file(s). The files are later concatenated using @@ -7043,25 +7668,32 @@ PLIST_SUBST+= SOMEVAR="somevalue"@@ -7179,7 +7816,8 @@ PLIST_SUBST+= SOMEVAR="somevalue" to use buildlink3@@ -7110,8 +7742,10 @@ PLIST_SUBST+= SOMEVAR="somevalue" textproc/scrollkeeper, which - removes the shared directory
- -
+
PLIST.common
PLIST.common
- -
+
PLIST.${OPSYS}
PLIST.${OPSYS}
- -
PLIST.${MACHINE_ARCH}
- -
PLIST.${OPSYS}-${MACHINE_ARCH}
- -
PLIST.common_end
textproc/scrollkeeper
, which + removes the shared directoryshare/omf
. @@ -7139,8 +7773,9 @@ PLIST_SUBST+= SOMEVAR="somevalue" writing new packages).For example, if a package installs files under -
+share/applications
, it - should have the following line in it:share/applications
, it should + have the following line in it:USE_DIRS+= xdg-1.1 @@ -7151,10 +7786,12 @@ PLIST_SUBST+= SOMEVAR="somevalue" print-PLIST, you should get the right (commented out) lines. -Note that, even if your package is using
Note that, even if your package is using
$X11BASE
, it must not depend on the *-x11-dirs packages. Just specify the name without that - part and pkgsrc (in particular,mk/dirs.mk
) will take care of it.- 11.2. Writing
11.2. Writing
buildlink3.mk
files- @@ -7192,21 +7830,25 @@ PLIST_SUBST+= SOMEVAR="somevalue" "#updating-buildlink-depends">11.2.2. Updating
BUILDLINK_DEPENDS.
in -pkg
buildlink3.mk
+buildlink3.mk
files- 11.3. Writing
11.3. Writing
builtin.mk
files
- 11.3.1. Anatomy of a -
+builtin.mk
- filebuiltin.mk
file- 11.3.2. Global @@ -7249,8 +7891,10 @@ PLIST_SUBST+= SOMEVAR="somevalue"
This normalizes the environment in which a package is built so that the package may be built consistently despite what other software may be installed. Please note that the - normal system header and library paths, e.g.
@@ -7278,7 +7922,8 @@ PLIST_SUBST+= SOMEVAR="somevalue"/usr/include
,/usr/include
,/usr/lib
, etc., are always searched -- buildlink3 is designed to insulate the package build from non-system-supplied software.Ensure that the build always calls the wrapper scripts instead of the actual toolchain. Some packages are tricky, and the only way to know for - sure is the check
${WRKDIR}/.work.log
to see if the wrappers are being invoked.Don't override
@@ -7315,88 +7962,104 @@ DEPENDS+= foo>=1.1.0:../../category/foo .include "../../category/foo/buildlink3.mk"PREFIX
from within the package Makefile, e.g. Java VMs, standalone shells, etc., - because the code to symlink files into${BUILDLINK_DIR}
looks for files relative to “pkg_info -qpRemember that only the
theonly
buildlink3.mk
files that you list in a package's Makefile are added as dependencies for that package.
There are several buildlink3.mk
files in There are several
buildlink3.mk
files in pkgsrc/mk
that handle special package
issues:
bdb.buildlink3.mk
- chooses either the native or a pkgsrc Berkeley DB
- implementation based on the values of bdb.buildlink3.mk
chooses either
+ the native or a pkgsrc Berkeley DB implementation
+ based on the values of BDB_ACCEPTED
and BDB_DEFAULT
.
curses.buildlink3.mk
If the
system comes with neither Curses nor NCurses, this
will take care to install the devel/ncurses package.
devel/ncurses
package.
krb5.buildlink3.mk
- uses the value of KRB5_ACCEPTED
to choose between
- adding a dependency on Heimdal or MIT-krb5 for
- packages that require a Kerberos 5
+
krb5.buildlink3.mk
uses the value
+ of KRB5_ACCEPTED
to
+ choose between adding a dependency on Heimdal or
+ MIT-krb5 for packages that require a Kerberos 5
implementation.
motif.buildlink3.mk
checks for a
system-provided Motif installation or adds a
dependency on x11/lesstif or x11/lesstif
or x11/openmotif;
x11/openmotif
;
ossaudio.buildlink3.mk
defines
several variables that may be used by packages that
use the Open Sound System (OSS) API;
pgsql.buildlink3.mk
will accept
either Postgres 7.3 or 7.4, whichever is found
installed. See the file for more information.
pthread.buildlink3.mk
uses the
value of PTHREAD_OPTS
and checks for native pthreads or adds a dependency
on devel/pth as needed;
devel/pth
as needed;
xaw.buildlink3.mk
- uses the value of XAW_TYPE
to choose a particular
- Athena widgets library.
xaw.buildlink3.mk
uses the value
+ of XAW_TYPE
to choose
+ a particular Athena widgets library.
The comments in those The comments in those
buildlink3.mk
files provide a more
complete description of how to use them properly.
buildlink3.mk
- filesbuildlink3.mk
files
- A package's A package's
buildlink3.mk
file is included by
Makefiles to indicate the need to compile and link
against header files and libraries provided by the
- package. A buildlink3.mk
- file should always provide enough information to add the
- correct type of dependency relationship and include any
- other buildlink3.mk
files
- that it needs to find headers and libraries that it needs
- in turn.
To generate an initial buildlink3.mk
file should always
+ provide enough information to add the correct type of
+ dependency relationship and include any other
+ buildlink3.mk
files that it needs
+ to find headers and libraries that it needs in turn.
To generate an initial buildlink3.mk
file for further editing,
Rene Hexel's pkgtools/createbuildlink package is
+ target="_top">pkgtools/createbuildlink
package is
highly recommended. For most packages, the following
command will generate a good starting point for
- buildlink3.mk
files:
buildlink3.mk
files:
%
cd pkgsrc/ -
(not shown above) - are lists of subdirectories ofThe following real-life example
+The following real-life example
buildlink3.mk
is taken from -pkgsrc/graphics/tiff
:pkgsrc/graphics/tiff
:# $NetBSD: buildlink3.mk,v 1.7 2004/03/18 09:12:12 jlam Exp $ @@ -7483,10 +8155,12 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}The header and footer manipulate
+ across allBUILDLINK_DEPTH
, which is common - across allbuildlink3.mk
- files and is used to track at what depth we are - includingbuildlink3.mk
- files.buildlink3.mk
files and is used to + track at what depth we are includingbuildlink3.mk
files.The first section controls if the dependency on
pkg
is added. @@ -7495,15 +8169,19 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} added by buildlink3.The second section advises pkgsrc that the -
+ abuildlink3.mk
file for +buildlink3.mk
file forpkg
has been included at some point.BUILDLINK_PACKAGES
is the global list - of packages for whichbuildlink3.mk
files have been included. It must always be appended to within - abuildlink3.mk
file.buildlink3.mk
file.The third section is protected from multiple inclusion and controls how the dependency on BUILDLINK_LIBDIRS.
pkg
${BUILDLINK_PREFIX.
to add to the header and library search paths. These @@ -7589,7 +8268,8 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}pkg
}The following variables are all optionally defined within this second section (protected against multiple inclusion) and control which package files are - symlinked into
@@ -7600,12 +8280,16 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} "varname">BUILDLINK_FILES.${BUILDLINK_DIR}
and how their names are transformed during the symlinking:pkg
(not shown above) is a shell glob pattern relative to -${BUILDLINK_PREFIX.
to be - symlinked intopkg
}${BUILDLINK_DIR}
, e.g. -include/*.h
. +include/*.h
.- @@ -7613,12 +8297,16 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} "varname">BUILDLINK_FILES_CMD.
pkg
(not shown above) is a shell pipeline that outputs to - stdout a list of files relative to${BUILDLINK_PREFIX.
. The resulting files are to be symlinked into -pkg
}${BUILDLINK_DIR}
. - By default, this takes the${BUILDLINK_DIR}
. By default, + this takes the+CONTENTS
of apkg
and filters it throughBUILDLINK_CONTENTS_FILTER.
(not shown above) is a filter command that filters -pkg
+CONTENTS
input - into a list of files relative to+CONTENTS
input into a list of + files relative to${BUILDLINK_PREFIX.
on stdout. By default for overwrite packages,pkg
}BUILDLINK_CONTENTS_FILTER.
- outputs the contents of thepkg
include
andinclude
andlib
directories in the package -+CONTENTS
, and for - pkgviews packages, it outputs any libtool - archives inlib
- directories. ++CONTENTS
, and for pkgviews + packages, it outputs any libtool archives in +lib
directories.- @@ -7661,16 +8357,20 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} -
@@ -7789,7 +8496,8 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}The last section includes any
@@ -7683,7 +8383,8 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} "updating-buildlink-depends">11.2.2. UpdatingThe last section includes any
buildlink3.mk
needed forpkg
's library - dependencies. Including thesebuildlink3.mk
files means that the headers and libraries for these dependencies are also - symlinked into${BUILDLINK_DIR}
whenever thepkg
-buildlink3.mk
file is +buildlink3.mk
file is included.BUILDLINK_DEPENDS. -
inpkg
pkg
inbuildlink3.mk
files @@ -7717,14 +8418,15 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} In some cases, the packages that depend on this new version may need theirPKGREVISION
s increased and, if they - havebuildlink3.mk
files, - theirBUILDLINK_DEPENDS.
adjusted, too. This is needed so - that binary packages made using it will require the - correct package dependency and not settle for an older - one which will not contain the necessary shared - libraries. + have- pkg
buildlink3.mk
files, their +BUILDLINK_DEPENDS.
adjusted, + too. This is needed so that binary packages made using + it will require the correct package dependency and not + settle for an older one which will not contain the + necessary shared libraries.pkg
Please take careful consideration before adjusting
BUILDLINK_DEPENDS.11.3. Writing -
builtin.mk
files +builtin.mk
filesSome packages in pkgsrc install headers and libraries that coincide with headers and libraries present in the - base system. Aside from a
@@ -7781,7 +8487,8 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} "emphasis">not override anybuildlink3.mk
file, these packages - should also include abuiltin.mk
file that includes the necessary checks to decide whether using the built-in software or the pkgsrc software is appropriate.USE_BUILTIN.
which is - already set before thepkg
builtin.mk
file is included.It should be written to allow multiple inclusion. This is very important and takes - careful attention to
Makefile
coding.
builtin.mk
- filebuiltin.mk
file
@@ -7862,7 +8571,8 @@ CHECK_BUILTIN.foo?= no
should only be “yes” if the actual package is
included as part of the base system. This variable is
- only used internally within the builtin.mk
file.
The second section sets
is
“yes”). This
variable is only used internally within the
- pkg
builtin.mk
file.
builtin.mk
file.
The third section sets USE_BUILTIN.
and is
required in all
- pkg
builtin.mk
files. The
- code in this section must make the determination
- whether the built-in software is adequate to satisfy
- the dependencies listed in builtin.mk
files. The code in
+ this section must make the determination whether the
+ built-in software is adequate to satisfy the
+ dependencies listed in BUILDLINK_DEPENDS.
. This is
typically done by comparing pkg
USE_BUILTIN.
must be set to the correct
- value by the end of the pkg
builtin.mk
file. Note that
USE_BUILTIN.
may be
@@ -7916,7 +8629,8 @@ CHECK_BUILTIN.foo?= no
"replaceable">pkg
pkg
set in the
previous section. This typically includes, e.g., adding
additional dependency restrictions and listing
- additional files to symlink into ${BUILDLINK_DIR}
(via BUILDLINK_FILES.
).pkg
A package must have a must have a
builtin.mk
file to be listed in
PREFER_NATIVE
, otherwise
it is simply ignored in that list.
The following sections inspect each of the above points
in detail. Note that, in order to use any of the described
functionalities, you must add the following to your
- package's Makefile
:
Makefile
:
USE_PKGINSTALL=YES@@ -8121,16 +8838,21 @@ USE_PKGINSTALL=YES -
As you already know, the As you already know, the
PLIST
file holds a list of files and
directories that belong to a package. The names used in
- it are relative to the installation prefix (${PREFIX}
), which means that it cannot
register files outside this directory (absolute path
names are not allowed). Despite this restriction, some
packages need to install files outside this location;
- e.g., under ${VARBASE}
or
- ${PKG_SYSCONFDIR}
.
${VARBASE}
or ${PKG_SYSCONFDIR}
.
The only way to achieve this is to create such files
during installation time by using the installation
@@ -8139,7 +8861,8 @@ USE_PKGINSTALL=YES
anywhere in the filesystem. Here is where pkginstall
comes into play: it provides generic scripts to abstract
the manipulation of such files and directories based on
- variables set in the package's Makefile
. The rest of this section
describes which these variables are.
Creating non-empty files outside the installation
- prefix is tricky because the PLIST
forces all files to be inside
it. To overcome this problem, the only solution is to
extract the file in the known place (i.e., inside the
@@ -8306,10 +9030,14 @@ SUPPORT_FILES_PERMS+= ${PREFIX}/share/somefile ${VARBASE}/somefile ${ROOT_USER}
PKG_SYSCONFBASE
:
The configuration's root directory. Defaults to
- ${PREFIX}/etc
- although it may be overridden by the user to
- point to his preferred location (e.g.,
- /etc
, ${PREFIX}/etc
although it may
+ be overridden by the user to point to his
+ preferred location (e.g., /etc
, /etc/pkg
, etc.). Packages must
not use it directly.
Makefile
(i.e., it
- is not user customizable).
+ Makefile
(i.e., it is not user
+ customizable).
As an example, consider the Apache package,
www/apache2, which places its
- configuration files under the www/apache2
, which places
+ its configuration files under the httpd/
subdirectory of
PKG_SYSCONFBASE
.
This should be set in the package Makefile.
If the previous variable is not defined but
PKG_SYSCONFSUBDIR
is
- set in the package's Makefile
, the resulting value
- is ${PKG_SYSCONFBASE}/${PKG_SYSCONFSUBDIR}
.
Otherwise, it is set to Otherwise, it is set to
${PKG_SYSCONFBASE}
.
It is worth mentioning that It is worth mentioning that
. See Section 12.1.1,
“Directory manipulation” what this
means.${PKG_SYSCONFDIR}
is automatically
- added to OWN_DIRS
. See
- OWN_DIRS
As said before, pkginstall automatically handles
configuration files. This means that the packages themselves must not touch
- the contents of ${PKG_SYSCONFDIR}
directly. Bad news is that many
software installation scripts will, out of the box,
@@ -8451,16 +9190,20 @@ CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
You must teach the package (usually by manually
patching it) to install any configuration files under
- the examples hierarchy, share/examples/${PKGBASE}/
. This way,
- the PLIST
registers them
- and the administrator always has the original copies
+ the PLIST
registers them and the
+ administrator always has the original copies
available.
Once the required configuration files are in place
(i.e., under the examples hierarchy), the pkginstall
framework can use them as master copies during the
- package installation to update what is in ${PKG_SYSCONFDIR}
. To achieve this,
the variables CONF_FILES
and CONF_FILES_PERMS
are
@@ -8471,7 +9214,8 @@ CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
example, taken from the mail/mutt package:
mail/mutt
package:
EGDIR= ${PREFIX}/share/doc/mutt/samples CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc @@ -8528,14 +9272,17 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc@@ -8619,7 +9370,8 @@ RCD_SCRIPTS+= cupsd
- -
@@ -8560,16 +9307,19 @@ RCD_SCRIPTS+= cupsdStore the script inside
Store the script inside
${FILESDIR}
, with the.sh
suffix appended. Considering the print/cups package as an - example, it has a
print/cups
package as an + example, it has acupsd.sh
in its files directory.Process the file found in the files directory applying all the substitutions described in the -
+FILES_SUBST
- variable.FILES_SUBST
variable.- @@ -8596,7 +9346,8 @@ RCD_SCRIPTS+= cupsd by setting the environment variable
Copy the script from the files directory to the - examples hierarchy,
${PREFIX}/share/examples/rc.d/
. Note that this master file must be explicitly - registered in thePLIST
.PKG_RCD_SCRIPTS
prior to package installation. Note that the scripts will be always - copied inside the examples hierarchy,${PREFIX}/share/examples/rc.d/
, no matter what the value of this variable is.Users can be created by adding entries to the
PKG_USERS
variable. Each - entry has the following syntax, which mimics/etc/passwd
:user:group[:[userid][:[descr][:[home][:shell]]]] @@ -8628,12 +9380,14 @@ user:group[:[userid][:[descr][:[home][:shell]]]]Only the user and group are required; everything else is optional, but the colons must be in the right places when specifying optional bits. By default, a new user - will have home directory
+/nonexistent
, and login shell -/sbin/nologin
unless they - are specified as part of the user element. Note that if - the description contains spaces, then spaces should be - double backslash-escaped, as in:/sbin/nologin
unless they are + specified as part of the user element. Note that if the + description contains spaces, then spaces should be double + backslash-escaped, as in:foo:foogrp::The\\ Foomister@@ -8660,7 +9414,8 @@ group[:groupid]Packages that install system shells should register - them in the shell database,
+ target="_top">/etc/shells
, to make things easier to the administrator. This must be done from the installation scripts to keep binary packages working on @@ -8674,7 +9429,8 @@ group[:groupid] following example, taken from shells/zsh:shells/zsh
:USE_PKGINSTALL= YES PKG_SHELL= ${PREFIX}/bin/zsh @@ -8693,9 +9449,9 @@ PKG_SHELL= ${PREFIX}/bin/zshThe automatic registration of shell interpreters can be disabled by the administrator by setting the -
+PKG_REGISTER_SHELLS
- environment variable toNO
.PKG_REGISTER_SHELLS
environment + variable toNO
. @@ -8721,13 +9477,15 @@ PKG_SHELL= ${PREFIX}/bin/zsh
bsd.options.mk
Many packages have the ability to be built to support
- different sets of features. bsd.options.mk
is a framework in pkgsrc
that provides generic handling of those options that
determine different ways in which the packages can be
@@ -8751,7 +9509,8 @@ PKG_SHELL= ${PREFIX}/bin/zsh
"varname">PKG_DEFAULT_OPTIONS, which is a list of
the options that should be built into every package if
that option is supported. This variable should be set in
- /etc/mk.conf
.
/etc/mk.conf
.
bsd.options.mk
The following example shows how The following example shows how
bsd.options.mk
should be used by the
hypothetical ``wibble'' package, either in the package
- Makefile
, or in a file,
- e.g. options.mk
, that is
- included by the main package Makefile
, or in a file, e.g.
+ options.mk
, that is included by
+ the main package Makefile
.
PKG_OPTIONS_VAR= PKG_OPTIONS.wibble @@ -8895,7 +9659,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} of “USE_VARIABLE
:option
” pairs that - map legacy/etc/mk.conf
variables to their option counterparts. Pairs should be added with “+=” to keep @@ -8947,7 +9712,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} "varname">PKG_SUGGESTED_OPTIONS.-
PKG_OPTIONS_VAR
must be - defined before includingbsd.options.mk
. If none ofPKG_SUPPORTED_OPTIONS
,PKG_OPTIONS_OPTIONAL_GROUPS
, and @@ -8958,7 +9724,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} empty list and the package is otherwise treated as not using the options framework.After the inclusion of
@@ -9021,7 +9789,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} the generated binaries, etc. can be put into place on the system. These are exactly the steps performed by the NetBSD package system, which is implemented as a series of targets - in a central Makefile,After the inclusion of
bsd.options.mk
, the variablePKG_OPTIONS
contains the list of selected build options, properly filtered to @@ -8980,7 +9747,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} For options specific to this package, prefix the name with. Document - the option and its meaning in
pkgname
-mk/defaults/options.description
.pkgsrc/mk/bsd.pkg.mk
.@@ -9043,7 +9812,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap}The automatic variable
PREFIX
indicates where all files of the final program shall be installed. It is usually set to -LOCALBASE
(LOCALBASE
(/usr/pkg
), orCROSSBASE
for pkgs in the “cross” category. @@ -9099,7 +9869,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap}Usually, X11 packages should be installed under
@@ -9118,16 +9889,20 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} libraries installed by a pkg that hasLOCALBASE
whenever possible. Note that you will need to include -../../mk/x11.buildlink3.mk
in them to request the presence of X11 and to get the right compilation flags.USE_IMAKE
orUSE_X11BASE
in its pkg -Makefile
, you need to - look in both -${X11BASE}
and -${LOCALBASE}
. To - force installation of all X11 packages in -LOCALBASE
, the - Makefile, you need to look + in both +${X11BASE}
and${LOCALBASE}
. To force + installation of all X11 packages inLOCALBASE
, the pkgtools/xpkgwedge package is + target="_top">pkgtools/xpkgwedge
package is enabled by default. @@ -9163,7 +9938,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap}This is best illustrated by example.
-The following lines are taken from
The following lines are taken from
pkgsrc/wm/scwm/Makefile
:EVAL_PREFIX+= GTKDIR=gtk+ @@ -9186,13 +9962,17 @@ GTKDIR_DEFAULT= ${LOCALBASE}- @@ -9211,7 +9991,8 @@ GTKDIR_DEFAULT= ${LOCALBASE}Within
${PREFIX}
, - packages should install files according to Within${PREFIX}
, packages should + install files according to hier(7), with the - exception that manual pages go into${PREFIX}/man
, not${PREFIX}/man
, not${PREFIX}/share/man
.The main targets used during the build process defined - in
+ inbsd.pkg.mk
are:bsd.pkg.mk
are:-@@ -9222,7 +10003,8 @@ GTKDIR_DEFAULT= ${LOCALBASE} variables
DISTFILES
andPATCHFILES
(as defined in the package's Makefile) are present on - the local system in/usr/pkgsrc/distfiles
. If they are not present, an attempt will be made to fetch them using commands of the form: @@ -9265,7 +10047,8 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS}When the distfiles are present on the local system, they need to be extracted, as they are usually in the form of some compressed archive - format, most commonly
.tar.gz
.If only some of the distfiles need to be @@ -9273,7 +10056,8 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} be put into
-EXTRACT_ONLY
.If the distfiles are not in
+ variablesIf the distfiles are not in
.tar.gz
format, they can be extracted by setting eitherEXTRACT_SUFX
, orEXTRACT_BEFORE_ARGS
andEXTRACT_AFTER_ARGS
. In the former case, pkgsrc knows how to extract a - number of suffixes (.tar.gz
,.tgz
,.tar.gz2
,.tbz
,.tar.Z
,.tar
,.shar.gz
,.shar.bz2
,.shar.Z
,.shar
,.Z
,.bz2
and.tar.gz
,.tgz
,.tar.gz2
,.tbz
,.tar.Z
,.tar
,.shar.gz
,.shar.bz2
,.shar.Z
,.shar
,.Z
,.bz2
and.gz
; see the definition of the variousDECOMPRESS_CMD
- variablesbsd.pkg.mk
- for a complete list). Here's an example on how to - use the other variables for a program that comes - with a compressed shell archive whose name ends in -.msg.gz
:bsd.pkg.mk
for a complete list). + Here's an example on how to use the other variables + for a program that comes with a compressed shell + archive whose name ends in.msg.gz
:EXTRACT_SUFX= .msg.gz EXTRACT_CMD= zcat @@ -9316,13 +10116,18 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS}PATCHFILES
, those present in the patches subdirectory of the package as well as in $LOCALPATCHES/$PKGPATH (e.g. -/usr/local/patches/graphics/png
) - are applied. Patchfiles ending in.Z
or.Z
or.gz
are uncompressed before they - are applied, files ending in.orig
or.orig
or.rej
are ignored. Any special options to @@ -9373,7 +10178,8 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} from the sysutils/top package: + target="_top">sysutils/top
package:HAS_CONFIGURE= yes CONFIGURE_SCRIPT= Configure @@ -9535,8 +10341,10 @@ make build in by a given package, e.g. if make deinstall DEINSTALLDEPENDS=1 is done in -pkgsrc/x11/kde
, - this is likely to remove whole KDE. Works by +pkgsrc/x11/kde
, this + is likely to remove whole KDE. Works by adding “-R” to the @@ -9588,7 +10396,8 @@ make build fail!The following variables can be used either on - the command line or in
@@ -9706,7 +10515,8 @@ make build/etc/mk.conf
to alter the behaviour of make update:The following variables can be used either on - the command line or in
@@ -9749,25 +10559,30 @@ make build/etc/mk.conf
to alter the behaviour of make clean-update:- readme
- -
This target generates a
+This target generates a
README.html
file, which can be viewed using a browser such as www/mozilla orwww/mozilla
or www/links. The generated files - contain references to any packages which are in the -PACKAGES
directory on - the local host. The generated files can be made to - refer to URLs based on
www/links
. The generated + files contain references to any packages which are + in thePACKAGES
+ directory on the local host. The generated files + can be made to refer to URLs based onFTP_PKG_URL_HOST
andFTP_PKG_URL_DIR
. For example, if I - wanted to generateREADME.html
files which pointed to binary packages on the local machine, in the - directory/usr/packages
, setFTP_PKG_URL_HOST=file://localhost
andreadme-all
- -
@@ -9863,7 +10682,9 @@ make build see if they find the shared libs they need. Run by default ifUse this target to create a file
Use this target to create a file
README-all.html
which contains a list of all packages currently available in the NetBSD Packages Collection, together with the category they belong to and a short description. - This file is compiled from thepkgsrc/*/README.html
files, so be sure to run this after a @@ -9800,7 +10617,8 @@ make build “readme” target (see above), but is to be used when generating a pkgsrc tree to be written to a CD-ROM. - This target also producesREADME.html
files, and can be made to refer to URLs based onCDROM_PKG_URL_HOST
and @@ -9813,7 +10631,8 @@ make buildThis target shows which distfiles and patchfiles are needed to build the package. (
DISTFILES
andPATCHFILES
, but notPATCHFILES
, but notpatches/*
)PKG_DEVELOPER
is set in -/etc/mk.conf
./etc/mk.conf
.- print-PLIST
@@ -9872,15 +10693,20 @@ make buildAfter a “make install” from a new or upgraded pkg, this prints out an attempt to generate a new -
PLIST
from a - find -newer +PLIST
from a find -newer work/.extract_done. An attempt is made to care for shared libs etc., but it is strongly recommended to review the result before putting it - intoPLIST
. On - upgrades, it's useful to diff the output of this - command against an already existingPLIST
. On upgrades, it's useful + to diff the output of this command against an + already existingPLIST
file.If the package installs files via tar(1) or other methods that don't update file access times, be sure to add these files manually to your -
+PLIST
, as the - “find - -newer” command used by this target - won't catch them!PLIST
, as the “find -newer” command used by + this target won't catch them!See Section 10.3, @@ -9946,8 +10773,9 @@ make build
@@ -10247,11 +11082,13 @@ CFLAGS+= -your -flags
- -
@@ -10187,27 +11015,32 @@ make buildNone of the package's files (
Makefile
, ...) were +None of the package's files (
Makefile
, ...) were modified since it was built.The problem with package-defined variables that can be overridden via
MAKECONF
- or/etc/mk.conf
is that - /etc/mk.conf is that make(1) expands a variable as it is used, but evaluates preprocessor like statements (.if, .ifdef and .ifndef) as they are read. So, to use any variable (which may be set in -/etc/mk.conf
) in one of - the .if* statements, the file/etc/mk.conf
) in one of the + .if* statements, the file/etc/mk.conf
must be included before that .if* statement.Rather than have a number of ad-hoc ways of - including
+ including/etc/mk.conf
, - should it exist, orMAKECONF
, should it exist, include the -pkgsrc/mk/bsd.prefs.mk
- file in the package Makefile before any - preprocessor-like .if, .ifdef, or .ifndef - statements:/etc/mk.conf
, should it exist, or +MAKECONF
, should it exist, + include thepkgsrc/mk/bsd.prefs.mk
file in the + package Makefile before any preprocessor-like .if, + .ifdef, or .ifndef statements:.include "../../mk/bsd.prefs.mk" @@ -10217,7 +11050,8 @@ make buildIf you wish to set the
CFLAGS
variable inCFLAGS
variable in/etc/mk.conf
please make sure to use:@@ -10231,7 +11065,8 @@ CFLAGS+= -your -flags the devel/cpuflags package if you're + target="_top">devel/cpuflags
package if you're interested in optimization for the current CPU.Documentation should be installed into
+Documentation should be installed into
${PREFIX}/share/doc/${PKGBASE}
or -${PREFIX}/share/doc/${PKGNAME}
(the - latter includes the version number of the package).${PREFIX}/share/doc/${PKGNAME}
+ (the latter includes the version number of the + package).@@ -10350,7 +11187,8 @@ CFLAGS+= -your -flags dependency. pkgsrc supports theBUILD_DEPENDS
andDEPENDS
definitions, as well as - dependencies viabuildlink3.mk
, which is the preferred way to handle dependencies, and which uses the variables named above. SeeIf your package needs another package's binaries or libraries to build or run, and if - that package has a
buildlink3.mk
file available, use it:@@ -10402,7 +11241,8 @@ CFLAGS+= -your -flagsIf your package needs to use another package - to build itself and there is no
@@ -10413,15 +11253,17 @@ BUILD_DEPENDS+= autoconf-2.13:../../devel/autoconfbuildlink3.mk
file available, use theBUILD_DEPENDS
definition:package, which + uses the xpm library, version 3.4j to build: If your package needs a library with which to - link and again there is no
+ target="_top">buildlink3.mk
file available, this is specified using theDEPENDS
definition. An example of this is the print/lyx package, which uses - the xpm library, version 3.4j to build:print/lyx
DEPENDS+= xpm-3.4j:../../graphics/xpm@@ -10515,14 +11357,18 @@ RECOMMENDED+= tiff>=3.6.1:../../graphics/tiffIf your package needs some executable to be able to run correctly and if there's no -
+ target="_top">buildlink3.mk
file, - this is specified using thebuildlink3.mk
file, this is + specified using theDEPENDS
variable. The print/lyx package needs to be - able to execute the latex binary from the teTeX - package when it runs, and that is specified:print/lyx
package needs to + be able to execute the latex binary from the + teTeX package when it runs, and that is + specified:DEPENDS+= teTeX-[0-9]*:../../print/teTeX@@ -10538,7 +11384,8 @@ DEPENDS+= teTeX-[0-9]*:../../print/teTeX "quote">do-configure” target print/ghostscript5 package (it + target="_top">print/ghostscript5
package (it relies on the jpeg sources being present in source form during the build):@@ -10568,13 +11415,15 @@ pre-clean: devel/gettext package. The latter + target="_top">devel/gettext
package. The latter adds a build dependency on either an installed version of an older gettext package, or if it isn't, installs the devel/gettext-m4 package. + target="_top">devel/gettext-m4
package.@@ -10601,17 +11450,21 @@ pre-clean:For example x11/Xaw3d and
x11/Xaw3d
and x11/Xaw-Xpm install provide the - same shared library, thus you set in
x11/Xaw-Xpm
install provide the + same shared library, thus you set inpkgsrc/x11/Xaw3d/Makefile
:CONFLICTS= Xaw-Xpm-[0-9]*-and in
and in
pkgsrc/x11/Xaw-Xpm/Makefile
:CONFLICTS= Xaw3d-[0-9]* @@ -10644,18 +11497,19 @@ CONFLICTS= Xaw3d-[0-9]* "varname">NOT_FOR_PLATFORM. If the package builds and runs on a small handful of platforms, setONLY_FOR_PLATFORM
instead. - If the package should be skipped (for example, because - it provides functionality already provided by the - system), setONLY_FOR_PLATFORM
and +NOT_FOR_PLATFORM
are OS + triples (OS-version-platform) that can use glob-style + wildcards. + +If the package should be skipped (for example, + because it provides functionality already provided by + the system), set
- -PKG_SKIP_REASON
to a descriptive message. If the package should fail because some preconditions are not met, setPKG_FAIL_REASON
to a descriptive message.
IGNORE
is deprecated - because it didn't provide enough information to - determine whether the build should fail.@@ -10696,7 +11550,8 @@ CONFLICTS= Xaw3d-[0-9]*When a vulnerability is found, this should be noted - in
@@ -10858,15 +11715,17 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2localsrc/security/advisories/pkg-vulnerabilities
, and after committing that file, use make @@ -10707,7 +11562,8 @@ CONFLICTS= Xaw3d-[0-9]*PKGREVISION
should be increased (this is of course not necessary if the problem is fixed by using a newer release of the - software). In addition, if abuildlink3.mk
file exists for an affected package, a correspondingBUILDLINK_RECOMMENDED.MACHINE_ARCH
and compiler version, disabling optimisation for that file/MACHINE_ARCH
/compiler - combination, and documenting it inpkgsrc/doc/HACKS
. See that file for a number of examples!If you need to download from a dynamic URL you can set
+ target="_top">DYNAMIC_MASTER_SITES
and a make - fetch will callwill call
files/getsite.sh
with the name of each file to download as an argument, expecting it to output the URL of the directory from which to download it. graphics/ns-cult3d is an example of - this usage.graphics/ns-cult3d
is an example + of this usage.If the download can't be automated, because the user must submit personal information to apply for a @@ -10880,28 +11739,38 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 following packages use this: cad/simian,
@@ -10932,11 +11801,13 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 name, usually based oncad/simian
, devel/ipv6socket,devel/ipv6socket
, emulators/vmware-module,emulators/vmware-module
, + fonts/acroread-jpnfont,fonts/acroread-jpnfont
, multimedia/realplayer,multimedia/realplayer
, sysutils/storage-manager,sysutils/storage-manager
, + www/ap-aolserver,www/ap-aolserver
, www/openacs. Try to be consistent + target="_top">www/openacs
. Try to be consistent with them.PKGNAME_NOREV
. In case this happens more often,PKGNAME
can be - used (thus including thenbX
suffix) or a date stamp can be appended, like${PKGNAME_NOREV}-YYYYMMDD
. Do not - forget regenerating thedistinfo
file after that, since it contains theDIST_SUBDIR
path in the filenames. Furthermore, a mail to the @@ -10979,11 +11850,12 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 hand to test things. The devel/libtool pkg can help here, as - it just “knows” - how to build both static and dynamic libraries from a - set of source files, thus being platform - independent. + target="_top">devel/libtool
pkg can help here, + as it just “knows” how to build both static + and dynamic libraries from a set of source files, thus + being platform independent.Here's how to use libtool in a pkg in seven simple steps:
@@ -11021,12 +11893,17 @@ ${LIBTOOL} --mode=link ${CC} -o ${.TARGET:.a=.la} ${OBJS:.o=.lo} -rpath ${PREFIX
Note that the library is changed to have a
- .la
extension, and
- the objects are changed to have a .la
extension, and the objects
+ are changed to have a .lo
extension. Change
OBJS
as necessary.
This automatically creates all of the
- .a
, .a
, .so.major.minor
, and ELF
symlinks (if necessary) in the build directory.
Be sure to include “” is the install directory
of the library being built.
In the PLIST
,
- include only the In the
PLIST
, include only the
+ .la
file, the other files will
be added automatically.
When linking shared object (When linking shared object (
.so
) files, i.e. files that are
loaded via
@@ -11091,9 +11972,11 @@ dynamic linker chooses the library with the greater REVISION number.
"quote">-module -avoid-version” to
prevent them getting version tacked on.
The PLIST
file
- gets the foo.so
- entry.
The PLIST
file gets the
+ foo.so
entry.
.la
file. e.g.
+ .la
file. e.g.
${LIBTOOL} --mode=link ${CC} -o someprog -L../somelib -lsomelib@@ -11143,13 +12028,15 @@ ${LIBTOOL} --mode=link ${CC} -o cp(1) command with “${LIBTOOL} --mode=install”, and change the - library name to
.la
. e.g.
${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib-
This will install the static This will install the static
.a
, shared library, any needed
symlinks, and run
@@ -11158,8 +12045,11 @@ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib
In your PLIST
,
- include only the In your
PLIST
, include only the
+ .la
file (this is a change from
previous behaviour).
If you do not need *.a
- static libraries built and installed, then use
- SHLIBTOOL_OVERRIDE
- instead.
If you do not need *.a
static libraries built and
+ installed, then use SHLIBTOOL_OVERRIDE
instead.
If your package makes use of the platform independent library for loading dynamic shared objects, @@ -11221,9 +12112,12 @@ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib
The shared object is named correctly,
- i.e. libfoo.la
, not
- foo.la
libfoo.la
, not
+ foo.la
To test whether you are working on a 4.4 BSD-derived
system, you should use the BSD definition, which is
- defined in <sys/param.h>
on said
systems.
@@ -11404,7 +12299,8 @@ pre-configure:The
INTERACTIVE_STAGE
definition is provided to notify the pkgsrc mechanism of an interactive stage which will be needed, and this - should be set in the package'sMakefile
. e.g.INTERACTIVE_STAGE= build @@ -11454,13 +12350,15 @@ INTERACTIVE_STAGE= configure install restrictions should have tags.-Denoting that a package is covered by a particular - license is done by placing the license in
+ target="_top">pkgsrc/licenses
and setting theLICENSE
variable to a string identifying the license, e.g. in graphics/xv:graphics/xv
:LICENSE= xv-license@@ -11481,19 +12379,23 @@ LICENSE= xv-licenseThe license can be viewed with make show-license, and if it is considered appropriate, the line printed above can - be added to
+ be added to/etc/mk.conf
- to indicate acceptance of the particular license:/etc/mk.conf
to indicate acceptance + of the particular license:ACCEPTABLE_LICENSES+=xv-licenseWhen adding a package with a new license, the - license text should be added to
pkgsrc/licenses
for displaying. A list of known licenses can be seen in this directory as well as by looking at the list of (commented out)ACCEPTABLE_LICENSES
- variable settings inpkgsrc/mk/defaults/mk.conf
.The use of
+ in yourmk/defaults/mk.conf
, - control this behaviour:mk/defaults/mk.conf
, control + this behaviour:SETGIDGAME
,GAMEDATAMODE
,GAMEGRP
,Makefile
(we - shall use tclsh in this example):Makefile
(we shall use + tclsh in + this example):REPLACE_INTERPRETER+= tcl _REPLACE.tcl.old= .*/bin/tclsh @@ -11606,7 +12511,8 @@ ACCEPTABLE_LICENSES+=xv-license-Makefiles of packages providing perl5 modules should - include the Makefile fragment
../../lang/perl5/module.mk
. It provides a do-configure target for the @@ -11617,8 +12523,11 @@ ACCEPTABLE_LICENSES+=xv-licensePerl5 modules will install into different places depending on the version of perl used during the build process. To address this, pkgsrc will append lines to - the
+ for in thePLIST
corresponding - to the files listed in the installedPLIST
corresponding to the files + listed in the installed.packlist
file generated by most perl5 modules. This is invoked by definingPERL5_PACKLIST
to a space-separated @@ -11634,7 +12543,9 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist locations in which perl5 modules may be installed, and may be used by perl5 packages that don't have a packlist. These three variables are also substituted - for in thePLIST
.PLIST
.@@ -11657,13 +12568,15 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist-
is considered to be installed in the directory -
${PREFIX}/${INFO_DIR}
,- @@ -11677,8 +12590,10 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist
is registered in the Info directory file -
${PREFIX}/${INFO_DIR}/dir
,
INFO_DIR
defaults to “info” and can - be overridden in the package Makefile.INSTALL
andINSTALL
andDEINSTALL
scripts will be generated to handle registration of the info files in the Info directory file. The “makeinfo” command is needed it should be noted with theTEXINFO_REQD
variable in the package -Makefile
. By default, a - minimum version of 3.12 is required. If the system does - not provide a Makefile. By default, a minimum + version of 3.12 is required. If the system does not + provide a makeinfo command or if it does not match the required minimum, a build dependency on the devel/gtexinfo package will be + target="_top">devel/gtexinfo
package will be added automatically.The build and installation process of the software @@ -11711,8 +12628,9 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist install-info command as the registration of info files is the task of the package -
INSTALL
script, and it - must use the appropriate INSTALL script, and it must use + the appropriate makeinfo command.To achieve this goal the pkgsrc infrastructure @@ -11745,8 +12663,10 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist
If a package installs
@@ -11754,9 +12674,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist.schemas
orIf a package installs
.schemas
or.entries
files, used by GConf2, you need to take some extra steps to make sure they get registered in the database:-
- -
Include
Include
../../devel/GConf2/schemas.mk
- instead of itsbuildlink3.mk
file. This takes care of rebuilding the GConf2 database at installation and deinstallation time, and tells @@ -11768,10 +12690,14 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist- @@ -11789,8 +12715,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist
Ensure that the package installs its -
.schemas
files - under.schemas
files under +${PREFIX}/share/gconf/schemas
. - If they get installed under${PREFIX}/etc
, you will need to manually patch the package.Define the
@@ -11799,8 +12728,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistGCONF2_SCHEMAS
variable in your -Makefile
with a - list of allMakefile
with a list of all +.schemas
files installed by the package, if any. Names must not contain any directories in them.Define the
@@ -11821,7 +12753,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistGCONF2_ENTRIES
variable in your -Makefile
with a - list of allMakefile
with a list of all +.entries
files installed by the package, if any. Names must not contain any directories in them.If a package installs
@@ -11829,9 +12762,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistIf a package installs
.omf
files, used by scrollkeeper, you need to take some extra steps to make sure they get registered in the database:@@ -12755,7 +13739,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist @@ -12765,7 +13749,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist @@ -12793,7 +13777,7 @@ INFO_FILES= bison.info @@ -12810,7 +13794,7 @@ of the NetBSD source tree is beyond me. @@ -12829,7 +13813,7 @@ share/bison.hairy @@ -12839,9 +13823,10 @@ share/bison.hairy
- -
Include
Include
../../textproc/scrollkeeper/omf.mk
- instead of itsbuildlink3.mk
file. This takes care of rebuilding the scrollkeeper database at installation and deinstallation time, and @@ -11841,13 +12776,15 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistCheck the PLIST and remove any entries under - the
libdata/scrollkeeper
directory, as they will be handled automatically.- -
@@ -11869,9 +12806,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistRemove the
Remove the
share/omf
directory from the PLIST. It will be handled by scrollkeeper.If a package installs font files, you will need to rebuild the fonts database in the directory where they get installed at installation and deinstallation time. - This can be automatically done by using
mk/fonts.mk
, which you need to - include in yourMakefile
.When the file is included, you can list the @@ -11883,7 +12822,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist “TTF”, “TYPE1” or “X11”. Also make - sure that the database file
@@ -11911,9 +12851,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistfonts.dir
is not listed in the PLIST.@@ -12541,13 +13521,15 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist out of the way, or cvs will complain the next time you “cvs update” your source tree. Also don't forget to add the new package to - the category's
- -
Include
@@ -11938,12 +12880,16 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistInclude
../../x11/gtk2/modules.mk
- instead of itsbuildlink3.mk
file. This takes care of rebuilding the database at installation and deinstallation time.@@ -11979,12 +12926,14 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist@@ -11952,9 +12898,10 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist
- -
libdata/gtk-2.0/gdk-pixbuf.loaders
- -
libdata/gtk-2.0/gtk.immodules
Check the PLIST and remove any entries under - the
+ thelibdata/gtk-2.0
- directory, as they will be handled - automatically.libdata/gtk-2.0
directory, as + they will be handled automatically.
- -
Include
+ in yourInclude
../../textproc/xmlcatmgr/catalogs.mk
- in yourMakefile
, - which takes care of registering those files in - system-wide catalogs at installation and - deinstallation time.Makefile
, which takes care of + registering those files in system-wide catalogs + at installation and deinstallation time.- @@ -12034,8 +12983,10 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist
If a package provides extensions to the MIME - database by installing
.xml
files inside.xml
files inside${PREFIX}/share/mime/packages
, you need to take some extra steps to ensure that the database is kept consistent with respect to these new @@ -12044,12 +12995,15 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist
- -
Include
Include
../../databases/shared-mime-info/mimedb.mk
- (avoid using thebuildlink3.mk
file from this same directory, which is reserved for inclusion - from otherbuildlink3.mk
files). It takes care of rebuilding the MIME database at installation and deinstallation time, and @@ -12059,10 +13013,12 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistCheck the PLIST and remove any entries under - the
share/mime
- directory, except for files saved - undershare/mime
directory, + except for + files saved undershare/mime/packages
. The former are handled automatically by the update-mime-database program, but the later are @@ -12072,7 +13028,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist- -
Remove any
@@ -12093,7 +13050,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistRemove any
share/mime/*
directories from the PLIST. They will be handled by the shared-mime-info package.If a package uses intltool during its build, include - the
../../textproc/intltool/buildlink3.mk
file, which forces it to use the intltool package provided by pkgsrc, instead of the one bundled with the @@ -12119,9 +13077,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistIf a package contains a rc.d script, it won't be copied into the startup directory by default, but you can enable it, by adding the option
@@ -12173,7 +13133,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistPKG_RCD_SCRIPTS=YES
inPKG_RCD_SCRIPTS=YES
in/etc/mk.conf
. This option will copy - the scripts into/etc/rc.d
when a package is installed, and it will automatically remove the scripts when the package is deinstalled.
- @@ -12181,7 +13142,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist
Be sure to set
PKG_DEVELOPER=1
inPKG_DEVELOPER=1
in/etc/mk.conf
Install pkgtools/url2pkg, create a + target="_top">
@@ -12200,13 +13162,15 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistpkgtools/url2pkg
, create a directory for a new package, change into it, then run url2pkg:- -
Edit the
+Makefile
as - requested.Edit the
Makefile
as requested.- -
Fill in the
+DESCR
- fileFill in the
DESCR
file- @@ -12216,7 +13180,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist
- @@ -12250,20 +13215,24 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist are from the pkgtools/pkgdiff package. + target="_top">
Add any dependencies glimpsed from documentation - and the configure step to the package's
Makefile
.pkgtools/pkgdiff
package.- -
Look at the
Look at the
Makefile
, fix if necessary; see Section 8.1, - “Makefile
”.- -
Generate a
Generate a
PLIST
:-#
make deinstall
You usually need to be
You usually need to be
root
to do this. Look if there are any files left:@@ -12287,13 +13257,16 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistIf this reveals any files that are missing in -
+PLIST
, add them.PLIST
, add them.- -
Now that the
+PLIST
- is OK, install the package again and make a binary - package:Now that the
PLIST
is OK, install the package + again and make a binary package:#
make reinstall
@@ -12337,7 +13310,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist "command">pkglint from pkgtools/pkglint, and fix the + target="_top">pkgtools/pkglint
, and fix the problems it reports:#
Please note all package additions, updates, moves, and - removals in
pkgsrc/doc/CHANGES
. It's very important to keep this file up to date and conforming to the existing format, because it will be used by scripts to automatically update pages on www.NetBSD.org - and other sites. Additionally, check thepkgsrc/doc/TODO
file and remove the entry for the package you updated or removed, in case it was mentioned there.There is a make target that helps in creating proper -
CHANGES
entries: +CHANGES
entries: make changes-entry. It uses the optionalCTYPE
andNETBSD_LOGIN_NAME
variables. The general - usage is to first make sure that yourCHANGES
file is up-to-date (to avoid having to resolve conflicts later-on) and then to cd to the @@ -12503,9 +13481,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistCTYPE
variable on the command line to "Added", "Moved", or "Removed". You can setNETBSD_LOGIN_NAME
in -/etc/mk.conf
if your local - login name is not the same as your NetBSD login name. - Don't forget to commit the changes to/etc/mk.conf
if your local login + name is not the same as your NetBSD login name. Don't + forget to commit the changes topkgsrc/doc/CHANGES
!Makefile
.The commit message of the initial import should - include part of the
+ include part of theDESCR
- file, so people reading the mailing lists know what the - package is/does.DESCR
file, so people reading the + mailing lists know what the package is/does.For new packages, “cvs import” is preferred to “
- -
Remove from
Remove from
oldcategory/Makefile
.- -
@@ -12705,7 +13689,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist @@ -12715,28 +13699,28 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlistAdd to
Add to
newcategory/Makefile
.Table of Contents
- A.1.3. PLIST
+ "#example-plist">1.1.3. PLIST- A.1.4. Checking a + "#checking-package-with-pkglint">1.1.4. Checking a package with pkglint
-- A.2. +
- 1.2. Steps for building, installing, packaging
The NetBSD package system comes with pkgtools/pkglint which helps to check - the contents of these files. After installation it is - quite easy to use, just change to the directory of the + target="_top">
@@ -12864,7 +13849,7 @@ looks fine. @@ -12883,8 +13868,12 @@ looks fine. "userinput">pkgtools/pkglint
which helps to + check the contents of these files. After installation it + is quite easy to use, just change to the directory of the package you wish to examine and execute pkglint:mkdir patches
Create
Makefile
, -DESCR
andCreate
Makefile
,DESCR
andPLIST
(see Chapter 8, Package components - files, directories and @@ -12907,7 +13896,8 @@ Requesting ftp://ftp.freebsd.org/pub/FreeBSD/distfiles//bison-1.25.tar.gz (via f Successfully retrieved file.Generate the checksum of the distfile into
Generate the checksum of the distfile into
distinfo
:#
@@ -13026,10 +14016,10 @@ Creating gzip'd tar ball in '/u/pkgsrc/lang/bison/bison-1.25.tgz'Table of Contents
@@ -13040,7 +14030,7 @@ Creating gzip'd tar ball in '/u/pkgsrc/lang/bison/bison-1.25.tgz' @@ -13144,7 +14134,7 @@ cp figlet.6 /usr/pkg/man/man6 @@ -13167,7 +14157,7 @@ Registering depends:. @@ -13272,7 +14262,7 @@ Registering depends:. @@ -13282,10 +14272,10 @@ Registering depends:.Table of Contents
@@ -13298,29 +14288,33 @@ Registering depends:. -The pkgsrc guide's source code is stored in
The pkgsrc guide's source code is stored in
pkgsrc/doc/guide/files
, and several files are created from it:@@ -13370,27 +14366,33 @@ Registering depends:. PostScript- and PDF version. You will need both packages installed, to make sure documentation is consistent across all formats. The packages can be - found in
- -
pkgsrc/doc/pkgsrc.txt
- -
pkgsrc/doc/pkgsrc.html
- -
http://www.NetBSD.org/Documentation/pkgsrc/
: the documentation on the NetBSD website will be built from pkgsrc and kept up to date on the web server @@ -13330,13 +14324,15 @@ Registering depends:.- -
http://www.NetBSD.org/Documentation/pkgsrc/pkgsrc.pdf
: PDF version of the pkgsrc guide.- -
@@ -13350,7 +14346,7 @@ Registering depends:.
http://www.NetBSD.org/Documentation/pkgsrc/pkgsrc.ps
: PostScript version of the pkgsrc guide.pkgsrc/meta-pkgs/netbsd-doc
and -pkgsrc/meta-pkgs/netbsd-doc-print
.
Edit the XML file(s) in Edit the XML file(s) in
pkgsrc/doc/guide/files
.
Run make extract
&& make do-lint in
- pkgsrc/doc/guide
to
- check the XML syntax, and fix it if needed.
pkgsrc/doc/guide
to check the XML
+ syntax, and fix it if needed.
Run make in make in
pkgsrc/doc/guide
to build the HTML
and ASCII version.
If all is well, run make install-doc to put the
- generated files into pkgsrc/doc
.