From 6af780ba0b0655bae204573c10eb5cae4c0a8028 Mon Sep 17 00:00:00 2001 From: rillig Date: Fri, 1 Jun 2007 11:07:24 +0000 Subject: Changed all environments so that the first relevant column starts in column 1. Everything else is left to the style sheet. --- doc/guide/files/binary.xml | 34 +++--- doc/guide/files/build.xml | 161 ++++++++++++++-------------- doc/guide/files/buildlink.xml | 141 ++++++++++++------------ doc/guide/files/components.xml | 111 ++++++++++--------- doc/guide/files/configuring.xml | 6 +- doc/guide/files/creating.xml | 210 ++++++++++++++++++------------------ doc/guide/files/examples.xml | 40 +++---- doc/guide/files/faq.xml | 26 ++--- doc/guide/files/files.xml | 18 ++-- doc/guide/files/fixes.xml | 230 ++++++++++++++++++++-------------------- doc/guide/files/getting.xml | 4 +- doc/guide/files/gnome.xml | 8 +- doc/guide/files/infr.design.xml | 14 +-- doc/guide/files/makefile.xml | 110 +++++++++---------- doc/guide/files/options.xml | 94 ++++++++-------- doc/guide/files/pkginstall.xml | 22 ++-- doc/guide/files/platforms.xml | 40 +++---- doc/guide/files/plist.xml | 18 ++-- doc/guide/files/submit.xml | 6 +- 19 files changed, 657 insertions(+), 636 deletions(-) (limited to 'doc/guide') diff --git a/doc/guide/files/binary.xml b/doc/guide/files/binary.xml index d9a76cd8c51..9a59d683fc5 100644 --- a/doc/guide/files/binary.xml +++ b/doc/guide/files/binary.xml @@ -1,4 +1,4 @@ - + Creating binary packages @@ -85,16 +85,16 @@ As used in this example, _ACCEPTABLE=yes accepts all licenses. - - PACKAGES?= ${_PKGSRCDIR}/packages/${MACHINE_ARCH} - WRKOBJDIR?= /usr/tmp/pkgsrc # build here instead of in pkgsrc - BSDSRCDIR= /usr/src - BSDXSRCDIR= /usr/xsrc # for x11/xservers - OBJHOSTNAME?= yes # use work.`hostname` - FAILOVER_FETCH= yes # insist on the correct checksum - PKG_DEVELOPER?= yes - _ACCEPTABLE= yes - + +PACKAGES?= ${_PKGSRCDIR}/packages/${MACHINE_ARCH} +WRKOBJDIR?= /usr/tmp/pkgsrc # build here instead of in pkgsrc +BSDSRCDIR= /usr/src +BSDXSRCDIR= /usr/xsrc # for x11/xservers +OBJHOSTNAME?= yes # use work.`hostname` +FAILOVER_FETCH= yes # insist on the correct checksum +PKG_DEVELOPER?= yes +_ACCEPTABLE= yes + Some options that are especially useful for bulk builds can be found at the top lines of the file @@ -194,12 +194,12 @@ 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 - /usr/pkg/etc/rc.d/sshd - fi - + +(cd /usr/pkgsrc/security/ssh && make bulk-install) +if [ -f /usr/pkg/etc/rc.d/sshd ]; then + /usr/pkg/etc/rc.d/sshd +fi + Not doing so will result in you being not able to log in via ssh after the bulk build is finished or if the machine diff --git a/doc/guide/files/build.xml b/doc/guide/files/build.xml index b451f3b5cc2..269bbe26ca5 100644 --- a/doc/guide/files/build.xml +++ b/doc/guide/files/build.xml @@ -1,4 +1,4 @@ - + The build process @@ -137,20 +137,20 @@ The following lines are taken from pkgsrc/wm/scwm/Makefile: - - EVAL_PREFIX+= GTKDIR=gtk+ - CONFIGURE_ARGS+= --with-guile-prefix=${LOCALBASE:Q} - CONFIGURE_ARGS+= --with-gtk-prefix=${GTKDIR:Q} - CONFIGURE_ARGS+= --enable-multibyte - + +EVAL_PREFIX+= GTKDIR=gtk+ +CONFIGURE_ARGS+= --with-guile-prefix=${LOCALBASE:Q} +CONFIGURE_ARGS+= --with-gtk-prefix=${GTKDIR:Q} +CONFIGURE_ARGS+= --enable-multibyte + Specific defaults can be defined for the packages evaluated using EVAL_PREFIX, by using a definition of the form: - - GTKDIR_DEFAULT= ${LOCALBASE} - + +GTKDIR_DEFAULT= ${LOCALBASE} + where GTKDIR corresponds to the first definition in @@ -252,9 +252,9 @@ additional filenames using the += operator, but you have write for example: - - DISTFILES= ${DISTNAME}${EXTRACT_SUFX} additional-files.tar.gz - + +DISTFILES= ${DISTNAME}${EXTRACT_SUFX} additional-files.tar.gz + Each distfile is fetched from a list of sites, usually MASTER_SITES. If the package has multiple @@ -266,13 +266,13 @@ distfile (including the suffix) can be found. - - 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= ${DISTNAME}${EXTRACT_SUFX} +DISTFILES+= foo-file.tar.gz +SITES.foo-file.tar.gz= \ +http://www.somewhere.com/somehow/ \ +http://www.somewhereelse.com/mirror/somehow/ + When actually fetching the distfiles, each item from MASTER_SITES or @@ -284,9 +284,9 @@ that gets the name of the distfile as a parameter. In this case, the definition would look like: - - MASTER_SITES= http://www.example.com/download.cgi?file= - + +MASTER_SITES= http://www.example.com/download.cgi?file= + There are some predefined values for MASTER_SITES, which can be used in @@ -295,33 +295,33 @@ - - ${MASTER_SITE_APACHE} - ${MASTER_SITE_BACKUP} - ${MASTER_SITE_CYGWIN} - ${MASTER_SITE_DEBIAN} - ${MASTER_SITE_FREEBSD} - ${MASTER_SITE_FREEBSD_LOCAL} - ${MASTER_SITE_GENTOO} - ${MASTER_SITE_GNOME} - ${MASTER_SITE_GNU} - ${MASTER_SITE_GNUSTEP} - ${MASTER_SITE_IFARCHIVE} - ${MASTER_SITE_KDE} - ${MASTER_SITE_MOZILLA} - ${MASTER_SITE_MYSQL} - ${MASTER_SITE_OPENOFFICE} - ${MASTER_SITE_PERL_CPAN} - ${MASTER_SITE_PGSQL} - ${MASTER_SITE_R_CRAN} - ${MASTER_SITE_SOURCEFORGE} - ${MASTER_SITE_SOURCEFORGE_JP} - ${MASTER_SITE_SUNSITE} - ${MASTER_SITE_SUSE} - ${MASTER_SITE_TEX_CTAN} - ${MASTER_SITE_XCONTRIB} - ${MASTER_SITE_XEMACS} - + +${MASTER_SITE_APACHE} +${MASTER_SITE_BACKUP} +${MASTER_SITE_CYGWIN} +${MASTER_SITE_DEBIAN} +${MASTER_SITE_FREEBSD} +${MASTER_SITE_FREEBSD_LOCAL} +${MASTER_SITE_GENTOO} +${MASTER_SITE_GNOME} +${MASTER_SITE_GNU} +${MASTER_SITE_GNUSTEP} +${MASTER_SITE_IFARCHIVE} +${MASTER_SITE_KDE} +${MASTER_SITE_MOZILLA} +${MASTER_SITE_MYSQL} +${MASTER_SITE_OPENOFFICE} +${MASTER_SITE_PERL_CPAN} +${MASTER_SITE_PGSQL} +${MASTER_SITE_R_CRAN} +${MASTER_SITE_SOURCEFORGE} +${MASTER_SITE_SOURCEFORGE_JP} +${MASTER_SITE_SUNSITE} +${MASTER_SITE_SUSE} +${MASTER_SITE_TEX_CTAN} +${MASTER_SITE_XCONTRIB} +${MASTER_SITE_XEMACS} + Some explanations for the less self-explaining ones: MASTER_SITE_BACKUP contains backup sites @@ -338,10 +338,10 @@ must use the following construct to specify a subdirectory: - - MASTER_SITES= ${MASTER_SITE_GNU:=subdirectory/name/} - MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=project_name/} - + +MASTER_SITES= ${MASTER_SITE_GNU:=subdirectory/name/} +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=project_name/} + Note the trailing slash after the subdirectory name. @@ -356,9 +356,9 @@ user). If the files do not exist, they are fetched using commands of the form - - ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} - + +${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} + where ${site} varies through several possibilities in turn: first, @@ -553,12 +553,13 @@ yes instead. What happens in the configure phase is roughly: - - .for d in ${CONFIGURE_DIRS} - cd ${WRKSRC} && cd ${d} && env ${CONFIGURE_ENV} \ - ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} - .endfor - + +.for d in ${CONFIGURE_DIRS} + cd ${WRKSRC} \ + && cd ${d} \ + && env ${CONFIGURE_ENV} ${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} +.endfor + CONFIGURE_DIRS (default: .) is a list of pathnames relative to @@ -591,13 +592,16 @@ For building a package, a rough equivalent of the following code is executed. - - .for d in ${BUILD_DIRS} - cd ${WRKSRC} && cd ${d} && env ${MAKE_ENV} \ - ${MAKE_PROGRAM} ${BUILD_MAKE_FLAGS} \ - -f ${MAKE_FILE} ${BUILD_TARGET} - .endfor - + +.for d in ${BUILD_DIRS} + cd ${WRKSRC} \ + && cd ${d} \ + && env ${MAKE_ENV} \ + ${MAKE_PROGRAM} ${BUILD_MAKE_FLAGS} \ + -f ${MAKE_FILE} \ + ${BUILD_TARGET} +.endfor + BUILD_DIRS (default: .) is a list of pathnames relative to @@ -641,13 +645,16 @@ before and after this code, much magic is performed to do consistency checks, registering the package, and so on. - - .for d in ${INSTALL_DIRS} - cd ${WRKSRC} && cd ${d} && env ${MAKE_ENV} \ - ${MAKE_PROGRAM} ${INSTALL_MAKE_FLAGS} \ - -f ${MAKE_FILE} ${BUILD_TARGET} - .endfor - + +.for d in ${INSTALL_DIRS} + cd ${WRKSRC} \ + && cd ${d} \ + && env ${MAKE_ENV} \ + ${MAKE_PROGRAM} ${INSTALL_MAKE_FLAGS} \ + -f ${MAKE_FILE} \ + ${INSTALL_TARGET} +.endfor + The variable's meanings are analogous to the ones in the build phase. diff --git a/doc/guide/files/buildlink.xml b/doc/guide/files/buildlink.xml index a82ab55f488..a6c9bda9921 100644 --- a/doc/guide/files/buildlink.xml +++ b/doc/guide/files/buildlink.xml @@ -1,4 +1,4 @@ - + Buildlink methodology @@ -69,24 +69,24 @@ If a dependency on a particular package is required for its libraries and headers, then we replace: - - DEPENDS+= foo>=1.1.0:../../category/foo - + +DEPENDS+= foo>=1.1.0:../../category/foo + with - - .include "../../category/foo/buildlink3.mk" - + +.include "../../category/foo/buildlink3.mk" + The buildlink3.mk files usually define the required dependencies. If you need a newer version of the dependency when using buildlink3.mk files, then you can define it in your Makefile; for example: - - BUILDLINK_API_DEPENDS.foo+= foo>=1.1.0 - .include "../../category/foo/buildlink3.mk" - + +BUILDLINK_API_DEPENDS.foo+= foo>=1.1.0 +.include "../../category/foo/buildlink3.mk" + There are several buildlink3.mk files in pkgsrc/mk @@ -186,29 +186,29 @@ buildlink3.mk is taken from pkgsrc/graphics/tiff: - - # $NetBSD: buildlink3.mk,v 1.7 2004/03/18 09:12:12 jlam Exp $ + +# $NetBSD: buildlink3.mk,v 1.7 2004/03/18 09:12:12 jlam Exp $ - BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ - TIFF_BUILDLINK3_MK:= ${TIFF_BUILDLINK3_MK}+ +BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ +TIFF_BUILDLINK3_MK:= ${TIFF_BUILDLINK3_MK}+ - .if !empty(BUILDLINK_DEPTH:M+) - BUILDLINK_DEPENDS+= tiff - .endif +.if ${BUILDLINK_DEPTH} == "+" +BUILDLINK_DEPENDS+= tiff +.endif - BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ntiff} - BUILDLINK_PACKAGES+= tiff +BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ntiff} +BUILDLINK_PACKAGES+= tiff - .if !empty(TIFF_BUILDLINK3_MK:M+) - BUILDLINK_API_DEPENDS.tiff+= tiff>=3.6.1 - BUILDLINK_PKGSRCDIR.tiff?= ../../graphics/tiff - .endif # TIFF_BUILDLINK3_MK +.if ${TIFF_BUILDLINK3_MK} == "+" +BUILDLINK_API_DEPENDS.tiff+= tiff>=3.6.1 +BUILDLINK_PKGSRCDIR.tiff?= ../../graphics/tiff +.endif # TIFF_BUILDLINK3_MK - .include "../../devel/zlib/buildlink3.mk" - .include "../../graphics/jpeg/buildlink3.mk" +.include "../../devel/zlib/buildlink3.mk" +.include "../../graphics/jpeg/buildlink3.mk" - BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} - +BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} + The header and footer manipulate BUILDLINK_DEPTH, which is common across all @@ -441,46 +441,43 @@ The following is the recommended template for builtin.mk files: - - .if !defined(IS_BUILTIN.foo) - # - # IS_BUILTIN.foo is set to "yes" or "no" depending on whether "foo" - # genuinely exists in the system or not. - # - IS_BUILTIN.foo?= no - - # BUILTIN_PKG.foo should be set here if "foo" is built-in and its package - # version can be determined. - # - . if !empty(IS_BUILTIN.foo:M[yY][eE][sS]) - BUILTIN_PKG.foo?= foo-1.0 - . endif - .endif # IS_BUILTIN.foo - - .if !defined(USE_BUILTIN.foo) - USE_BUILTIN.foo?= ${IS_BUILTIN.foo} - . if defined(BUILTIN_PKG.foo) - . for _depend_ in ${BUILDLINK_API_DEPENDS.foo} - . if !empty(USE_BUILTIN.foo:M[yY][eE][sS]) - USE_BUILTIN.foo!= \ - if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.foo}; then \ - ${ECHO} "yes"; \ - else \ - ${ECHO} "no"; \ - fi - . endif - . endfor - . endif - .endif # USE_BUILTIN.foo - - CHECK_BUILTIN.foo?= no - .if !empty(CHECK_BUILTIN.foo:M[nN][oO]) - # - # Here we place code that depends on whether USE_BUILTIN.foo is set to - # "yes" or "no". - # - .endif # CHECK_BUILTIN.foo - + +.if !defined(IS_BUILTIN.foo) +# +# IS_BUILTIN.foo is set to "yes" or "no" depending on whether "foo" +# genuinely exists in the system or not. +# +IS_BUILTIN.foo?= no + +# BUILTIN_PKG.foo should be set here if "foo" is built-in and its package +# version can be determined. +# +. if !empty(IS_BUILTIN.foo:M[yY][eE][sS]) +BUILTIN_PKG.foo?= foo-1.0 +. endif +.endif # IS_BUILTIN.foo + +.if !defined(USE_BUILTIN.foo) +USE_BUILTIN.foo?= ${IS_BUILTIN.foo} +. if defined(BUILTIN_PKG.foo) +. for _depend_ in ${BUILDLINK_API_DEPENDS.foo} +. if !empty(USE_BUILTIN.foo:M[yY][eE][sS]) +USE_BUILTIN.foo!= \ + ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.foo} \ + && ${ECHO} "yes" || ${ECHO} "no" +. endif +. endfor +. endif +.endif # USE_BUILTIN.foo + +CHECK_BUILTIN.foo?= no +.if !empty(CHECK_BUILTIN.foo:M[nN][oO]) +# +# Here we place code that depends on whether USE_BUILTIN.foo is set to +# "yes" or "no". +# +.endif # CHECK_BUILTIN.foo + The first section sets IS_BUILTIN.pkg @@ -554,10 +551,10 @@ using pkgsrc versions of software for all but the most basic bits on a NetBSD system, you can set: - - PREFER_PKGSRC= yes - PREFER_NATIVE= getopt skey tcp_wrappers - + +PREFER_PKGSRC= yes +PREFER_NATIVE= getopt skey tcp_wrappers + A package must have a builtin.mk diff --git a/doc/guide/files/components.xml b/doc/guide/files/components.xml index f63635a01c0..297a931eba4 100644 --- a/doc/guide/files/components.xml +++ b/doc/guide/files/components.xml @@ -1,4 +1,4 @@ - + Package components - files, directories and contents @@ -57,16 +57,16 @@ sections. 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 - + +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, @@ -306,7 +306,7 @@ sections. PATCHDIR to the path where the patch files can be found, e.g.: - PATCHDIR= ${.CURDIR}/../xemacs/patches +PATCHDIR= ${.CURDIR}/../xemacs/patches Patch files that are distributed by the author or other @@ -373,55 +373,68 @@ sections. configure script - case ${target_os} in - netbsd*) have_kvm=yes ;; - *) have_kvm=no ;; - esac + +case ${target_os} in +netbsd*) have_kvm=yes ;; +*) have_kvm=no ;; +esac + - AC_CHECK_LIB(kvm, kvm_open, have_kvm=yes, have_kvm=no) + +AC_CHECK_LIB(kvm, kvm_open, have_kvm=yes, have_kvm=no) + C source file - #if defined(__NetBSD__) - # include <sys/event.h> - #endif + +#if defined(__NetBSD__) +# include <sys/event.h> +#endif + - #if defined(HAVE_SYS_EVENT_H) - # include <sys/event.h> - #endif + +#if defined(HAVE_SYS_EVENT_H) +# include <sys/event.h> +#endif + C source file - int - monitor_file(...) - { - #if defined(__NetBSD__) - int fd = kqueue(); - ... - #else - ... - #endif - } + + +int +monitor_file(...) +{ +#if defined(__NetBSD__) + int fd = kqueue(); + ... +#else + ... +#endif +} + - int - monitor_file(...) - { - #if defined(HAVE_KQUEUE) - int fd = kqueue(); - ... - #else - ... - #endif - } + +int +monitor_file(...) +{ +#if defined(HAVE_KQUEUE) + int fd = kqueue(); + ... +#else + ... +#endif +} + @@ -543,9 +556,9 @@ sections. MESSAGE_SUBST in the package's Makefile: - - MESSAGE_SUBST+= SOMEVAR="somevalue" - + +MESSAGE_SUBST+= SOMEVAR="somevalue" + replaces "${SOMEVAR}" with somevalue in MESSAGE. By default, substitution is @@ -656,8 +669,8 @@ sections. packages, set the FILESDIR variable to point to the other package's files directory, e.g.: - - FILESDIR=${.CURDIR}/../xemacs/files - + +FILESDIR=${.CURDIR}/../xemacs/files + diff --git a/doc/guide/files/configuring.xml b/doc/guide/files/configuring.xml index 930e505d9ff..e7da55ff679 100644 --- a/doc/guide/files/configuring.xml +++ b/doc/guide/files/configuring.xml @@ -1,4 +1,4 @@ - + Configuring pkgsrc @@ -211,7 +211,7 @@ works. instead of the = operator: - CFLAGS+= -your -flags +CFLAGS+= -your -flags Using CFLAGS= (i.e. without the @@ -236,7 +236,7 @@ the inclusion of mk/x11.buildlink3.mk. As with CFLAGS, if you do not wish to override these settings, use the += operator: - LDFLAGS+= -your -linkerflags +LDFLAGS+= -your -linkerflags diff --git a/doc/guide/files/creating.xml b/doc/guide/files/creating.xml index 999cbe8ae89..f1fd9fac2a9 100644 --- a/doc/guide/files/creating.xml +++ b/doc/guide/files/creating.xml @@ -1,4 +1,4 @@ - + Creating a new pkgsrc package from scratch @@ -44,17 +44,17 @@ needed for building the package, but not when using it, use Your package may then look like this: - [...] +[...] - BUILD_DEPENDS+= lua>=5.0:../../lang/lua - DEPENDS+= screen-[0-9]*:../../misc/screen - DEPENDS+= screen>=4.0:../../misc/screen +BUILD_DEPENDS+= lua>=5.0:../../lang/lua +DEPENDS+= screen-[0-9]*:../../misc/screen +DEPENDS+= screen>=4.0:../../misc/screen - [...] +[...] - .include "../../category/package/buildlink3.mk" - .include "../../devel/glib2/buildlink3.mk" - .include "../../mk/bsd.pkg.mk" +.include "../../category/package/buildlink3.mk" +.include "../../devel/glib2/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" @@ -144,15 +144,15 @@ pkgsrc. As the description says it has to do with the web, the obvious choice for the category is www. - &uprompt; mkdir www/nvu - &uprompt; cd www/nvu +&uprompt; mkdir www/nvu +&uprompt; cd www/nvu The web site says that the sources are available as a tar file, so I fed that URL to the url2pkg program: - &uprompt; url2pkg http://cvs.nvu.com/download/nvu-1.0-sources.tar.bz2 +&uprompt; url2pkg http://cvs.nvu.com/download/nvu-1.0-sources.tar.bz2 My editor popped up, and I added a PKGNAME line @@ -163,46 +163,46 @@ not have the word sources in it. I also filled in the Makefile looked like that: - # $NetBSD$ - # +# $NetBSD$ +# - DISTNAME= nvu-1.0-sources - PKGNAME= nvu-1.0 - CATEGORIES= www - MASTER_SITES= http://cvs.nvu.com/download/ - EXTRACT_SUFX= .tar.bz2 +DISTNAME= nvu-1.0-sources +PKGNAME= nvu-1.0 +CATEGORIES= www +MASTER_SITES= http://cvs.nvu.com/download/ +EXTRACT_SUFX= .tar.bz2 - MAINTAINER= rillig@NetBSD.org - HOMEPAGE= http://cvs.nvu.com/ - COMMENT= Web Authoring System +MAINTAINER= rillig@NetBSD.org +HOMEPAGE= http://cvs.nvu.com/ +COMMENT= Web Authoring System - # url2pkg-marker (please do not remove this line.) - .include "../../mk/bsd.pkg.mk" +# url2pkg-marker (please do not remove this line.) +.include "../../mk/bsd.pkg.mk" Then, I quit the editor and watched pkgsrc downloading a large source archive: - url2pkg> Running "make makesum" ... - => Required installed package digest>=20010302: digest-20060826 found - => Fetching nvu-1.0-sources.tar.bz2 - Requesting http://cvs.nvu.com/download/nvu-1.0-sources.tar.bz2 - 100% |*************************************| 28992 KB 150.77 KB/s 00:00 ETA - 29687976 bytes retrieved in 03:12 (150.77 KB/s) - url2pkg> Running "make extract" ... - => Required installed package digest>=20010302: digest-20060826 found - => Checksum SHA1 OK for nvu-1.0-sources.tar.bz2 - => Checksum RMD160 OK for nvu-1.0-sources.tar.bz2 - work.bacc -> /tmp/roland/pkgsrc/www/nvu/work.bacc - ===> Installing dependencies for nvu-1.0 - ===> Overriding tools for nvu-1.0 - ===> Extracting for nvu-1.0 - url2pkg> Adjusting the Makefile. - - Remember to correct CATEGORIES, HOMEPAGE, COMMENT, and DESCR when you're done! - - Good luck! (See pkgsrc/doc/pkgsrc.txt for some more help :-) +url2pkg> Running "make makesum" ... +=> Required installed package digest>=20010302: digest-20060826 found +=> Fetching nvu-1.0-sources.tar.bz2 +Requesting http://cvs.nvu.com/download/nvu-1.0-sources.tar.bz2 +100% |*************************************| 28992 KB 150.77 KB/s00:00 ETA +29687976 bytes retrieved in 03:12 (150.77 KB/s) +url2pkg> Running "make extract" ... +=> Required installed package digest>=20010302: digest-20060826 found +=> Checksum SHA1 OK for nvu-1.0-sources.tar.bz2 +=> Checksum RMD160 OK for nvu-1.0-sources.tar.bz2 +work.bacc -> /tmp/roland/pkgsrc/www/nvu/work.bacc +===> Installing dependencies for nvu-1.0 +===> Overriding tools for nvu-1.0 +===> Extracting for nvu-1.0 +url2pkg> Adjusting the Makefile. + +Remember to correct CATEGORIES, HOMEPAGE, COMMENT, and DESCR when you're done! + +Good luck! (See pkgsrc/doc/pkgsrc.txt for some more help :-) @@ -218,18 +218,18 @@ in the package, let's hope that it will complain about everything it needs. - &uprompt; bmake - => Required installed package digest>=20010302: digest-20060826 found - => Checksum SHA1 OK for nvu-1.0-sources.tar.bz2 - => Checksum RMD160 OK for nvu-1.0-sources.tar.bz2 - ===> Patching for nvu-1.0 - ===> Creating toolchain wrappers for nvu-1.0 - ===> Configuring for nvu-1.0 - [...] - configure: error: Perl 5.004 or higher is required. - [...] - WARNING: Please add USE_TOOLS+=perl to the package Makefile. - [...] +&uprompt; bmake +=> Required installed package digest>=20010302: digest-20060826 found +=> Checksum SHA1 OK for nvu-1.0-sources.tar.bz2 +=> Checksum RMD160 OK for nvu-1.0-sources.tar.bz2 +===> Patching for nvu-1.0 +===> Creating toolchain wrappers for nvu-1.0 +===> Configuring for nvu-1.0 +[...] +configure: error: Perl 5.004 or higher is required. +[...] +WARNING: Please add USE_TOOLS+=perl to the package Makefile. +[...] That worked quite well. So I opened the package Makefile in my @@ -240,37 +240,37 @@ installed in the tools phase, I need to build the package from scratch. - &uprompt; bmake clean - ===> Cleaning for nvu-1.0 - &uprompt; bmake - [...] - *** /tmp/roland/pkgsrc/www/nvu/work.bacc/.tools/bin/make is not \ - GNU Make. You will not be able to build Mozilla without GNU Make. - [...] +&uprompt; bmake clean +===> Cleaning for nvu-1.0 +&uprompt; bmake +[...] +*** /tmp/roland/pkgsrc/www/nvu/work.bacc/.tools/bin/make is not \ +GNU Make. You will not be able to build Mozilla without GNU Make. +[...] So I added gmake to the USE_TOOLS line and tried again (from scratch). - [...] - checking for GTK - version >= 1.2.0... no - *** Could not run GTK test program, checking why... - [...] +[...] +checking for GTK - version >= 1.2.0... no +*** Could not run GTK test program, checking why... +[...] Now to the other dependencies. The first question is: Where is the GTK package hidden in pkgsrc? - &uprompt; echo ../../*/gtk* - [many packages ...] - &uprompt; echo ../../*/gtk - ../../x11/gtk - &uprompt; echo ../../*/gtk2 - ../../x11/gtk2 - &uprompt; echo ../../*/gtk2/bui* - ../../x11/gtk2/buildlink3.mk +&uprompt; echo ../../*/gtk* +[many packages ...] +&uprompt; echo ../../*/gtk +../../x11/gtk +&uprompt; echo ../../*/gtk2 +../../x11/gtk2 +&uprompt; echo ../../*/gtk2/bui* +../../x11/gtk2/buildlink3.mk The first try was definitely too broad. The second one had exactly @@ -287,25 +287,25 @@ file, adding the dependency is very easy. I just inserted an Makefile, so that it now looks like this: - [...] - .include "../../x11/gtk2/buildlink3.mk" - .include "../../mk/bsd.pkg.mk +[...] +.include "../../x11/gtk2/buildlink3.mk" +.include "../../mk/bsd.pkg.mk After another bmake clean && bmake, the answer was: - [...] - checking for gtk-config... /home/roland/pkg/bin/gtk-config - checking for GTK - version >= 1.2.0... no - *** Could not run GTK test program, checking why... - *** The test program failed to compile or link. See the file config.log for the - *** exact error that occured. This usually means GTK was incorrectly installed - *** or that you have moved GTK since it was installed. In the latter case, you - *** may want to edit the gtk-config script: /home/roland/pkg/bin/gtk-config - configure: error: Test for GTK failed. - [...] +[...] +checking for gtk-config... /home/roland/pkg/bin/gtk-config +checking for GTK - version >= 1.2.0... no +*** Could not run GTK test program, checking why... +*** The test program failed to compile or link. See the file config.log for the +*** exact error that occured. This usually means GTK was incorrectly installed +*** or that you have moved GTK since it was installed. In the latter case, you +*** may want to edit the gtk-config script: /home/roland/pkg/bin/gtk-config +configure: error: Test for GTK failed. +[...] In this particular case, the assumption that every package @@ -318,13 +318,13 @@ So I changed the x11/gtk2 to and tried again. - [...] - cc -o xpidl.o -c -DOSTYPE=\"NetBSD3\" -DOSARCH=\"NetBSD\" -I../../../dist/include/xpcom -I../../../dist/include -I/tmp/roland/pkgsrc/www/nvu/work.bacc/mozilla/dist/include/nspr -I/usr/X11R6/include -fPIC -DPIC -I/home/roland/pkg/include -I/usr/include -I/usr/X11R6/include -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Wno-long-long -pedantic -O2 -I/home/roland/pkg/include -I/usr/include -Dunix -pthread -pipe -DDEBUG -D_DEBUG -DDEBUG_roland -DTRACING -g -I/home/roland/pkg/include/glib/glib-1.2 -I/home/roland/pkg/lib/glib/include -I/usr/pkg/include/orbit-1.0 -I/home/roland/pkg/include -I/usr/include -I/usr/X11R6/include -include ../../../mozilla-config.h -DMOZILLA_CLIENT -Wp,-MD,.deps/xpidl.pp xpidl.c - In file included from xpidl.c:42: - xpidl.h:53:24: libIDL/IDL.h: No such file or directory - In file included from xpidl.c:42: - xpidl.h:132: error: parse error before "IDL_ns" - [...] +[...] +cc -o xpidl.o -c -DOSTYPE=\"NetBSD3\" -DOSARCH=\"NetBSD\" -I../../../dist/include/xpcom -I../../../dist/include -I/tmp/roland/pkgsrc/www/nvu/work.bacc/mozilla/dist/include/nspr -I/usr/X11R6/include -fPIC -DPIC -I/home/roland/pkg/include -I/usr/include -I/usr/X11R6/include -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Wno-long-long -pedantic -O2 -I/home/roland/pkg/include -I/usr/include -Dunix -pthread -pipe -DDEBUG -D_DEBUG -DDEBUG_roland -DTRACING -g -I/home/roland/pkg/include/glib/glib-1.2 -I/home/roland/pkg/lib/glib/include -I/usr/pkg/include/orbit-1.0 -I/home/roland/pkg/include -I/usr/include -I/usr/X11R6/include -include ../../../mozilla-config.h -DMOZILLA_CLIENT -Wp,-MD,.deps/xpidl.pp xpidl.c +In file included from xpidl.c:42: +xpidl.h:53:24: libIDL/IDL.h: No such file or directory +In file included from xpidl.c:42: +xpidl.h:132: error: parse error before "IDL_ns" +[...] The package still does not find all of its dependencies. Now the @@ -332,10 +332,10 @@ question is: Which package provides the libIDL/IDL.h header file? - &uprompt; echo ../../*/*idl* - ../../devel/py-idle ../../wip/idled ../../x11/acidlaunch - &uprompt; echo ../../*/*IDL* - ../../net/libIDL +&uprompt; echo ../../*/*idl* +../../devel/py-idle ../../wip/idled ../../x11/acidlaunch +&uprompt; echo ../../*/*IDL* +../../net/libIDL Let's take the one from the second try. So I included the @@ -347,8 +347,8 @@ large, I didn't want to fix it. So I added the following to the package Makefile and tried again: - CPPFLAGS+= -I${BUILDLINK_PREFIX.libIDL}/include/libIDL-2.0 - BUILDLINK_TRANSFORM+= -l:IDL:IDL-2 +CPPFLAGS+= -I${BUILDLINK_PREFIX.libIDL}/include/libIDL-2.0 +BUILDLINK_TRANSFORM+= -l:IDL:IDL-2 The latter line is needed because the package expects the library @@ -369,11 +369,11 @@ everything worked. Installing the package - &uprompt; bmake CHECK_FILES=no install - [...] - &uprompt; bmake print-PLIST >PLIST - &uprompt; bmake deinstall - &uprompt; bmake install +&uprompt; bmake CHECK_FILES=no install +[...] +&uprompt; bmake print-PLIST >PLIST +&uprompt; bmake deinstall +&uprompt; bmake install diff --git a/doc/guide/files/examples.xml b/doc/guide/files/examples.xml index 6aecfc7dd66..650e45506bb 100644 --- a/doc/guide/files/examples.xml +++ b/doc/guide/files/examples.xml @@ -1,4 +1,4 @@ - + A simple example package: bison @@ -16,21 +16,21 @@ Makefile - # $NetBSD$ - # +# $NetBSD$ +# - DISTNAME= bison-1.25 - CATEGORIES= devel - MASTER_SITES= ${MASTER_SITE_GNU} +DISTNAME= bison-1.25 +CATEGORIES= devel +MASTER_SITES= ${MASTER_SITE_GNU} - MAINTAINER= thorpej@NetBSD.org - HOMEPAGE= http://www.gnu.org/software/bison/bison.html - COMMENT= GNU yacc clone +MAINTAINER= thorpej@NetBSD.org +HOMEPAGE= http://www.gnu.org/software/bison/bison.html +COMMENT= GNU yacc clone - GNU_CONFIGURE= yes - INFO_FILES= bison.info +GNU_CONFIGURE= yes +INFO_FILES= bison.info - .include "../../mk/bsd.pkg.mk" +.include "../../mk/bsd.pkg.mk" @@ -38,9 +38,9 @@ DESCR - GNU version of yacc. Can make re-entrant parsers, and numerous other - improvements. Why you would want this when Berkeley &man.yacc.1; is part - of the &os; source tree is beyond me. +GNU version of yacc. Can make re-entrant parsers, and numerous other +improvements. Why you would want this when Berkeley &man.yacc.1; is part +of the &os; source tree is beyond me. @@ -48,11 +48,11 @@ PLIST - @comment $NetBSD$ - bin/bison - man/man1/bison.1.gz - share/bison.simple - share/bison.hairy +@comment $NetBSD$ +bin/bison +man/man1/bison.1.gz +share/bison.simple +share/bison.hairy diff --git a/doc/guide/files/faq.xml b/doc/guide/files/faq.xml index fb37cafd5fb..4d9c3b389e1 100644 --- a/doc/guide/files/faq.xml +++ b/doc/guide/files/faq.xml @@ -1,4 +1,4 @@ - + Frequently Asked Questions @@ -51,7 +51,7 @@ it contains items for both pkgsrc users and developers. To subscribe, do: - &cprompt; echo subscribe listname | mail majordomo@NetBSD.org +&cprompt; echo subscribe listname | mail majordomo@NetBSD.org Archives for all these mailing lists are available from @@ -279,10 +279,10 @@ values. like: - FETCH_CMD= wget - FETCH_BEFORE_ARGS= --passive-ftp - FETCH_RESUME_ARGS= -c - FETCH_OUTPUT_ARGS= -O +FETCH_CMD= wget +FETCH_BEFORE_ARGS= --passive-ftp +FETCH_RESUME_ARGS= -c +FETCH_OUTPUT_ARGS= -O @@ -298,7 +298,7 @@ X11 (/usr/X11R6, /usr/openwin, /etc/mk.conf: - X11_TYPE=XFree86 +X11_TYPE=XFree86 @@ -314,7 +314,7 @@ you will have to add the following line into /etc/mk.conf: - X11_TYPE=xorg +X11_TYPE=xorg The DragonFly operating system defaults to using @@ -336,8 +336,8 @@ port 80 as the proxy port number. So the proxy environment variables are: - ftp_proxy=ftp://orpheus.amdahl.com:80/ - http_proxy=http://orpheus.amdahl.com:80/ +ftp_proxy=ftp://orpheus.amdahl.com:80/ +http_proxy=http://orpheus.amdahl.com:80/ @@ -474,9 +474,9 @@ following into your /etc/mk.conf, somewhere LOCALBASE variable: - .if exists(${LOCALBASE}/bin/sudo) - SU_CMD= ${LOCALBASE}/bin/sudo /bin/sh -c - .endif +.if exists(${LOCALBASE}/bin/sudo) +SU_CMD= ${LOCALBASE}/bin/sudo /bin/sh -c +.endif diff --git a/doc/guide/files/files.xml b/doc/guide/files/files.xml index 7315ba88b56..623fb6424ae 100644 --- a/doc/guide/files/files.xml +++ b/doc/guide/files/files.xml @@ -1,4 +1,4 @@ - + Directory layout of the installed files @@ -17,20 +17,20 @@ When pkgsrc has been installed as root, the default locations are: - LOCALBASE= /usr/pkg - PKG_SYSCONFBASE= /usr/pkg/etc - VARBASE= /var - PKG_DBDIR= /var/db/pkg +LOCALBASE= /usr/pkg +PKG_SYSCONFBASE= /usr/pkg/etc +VARBASE= /var +PKG_DBDIR= /var/db/pkg In unprivileged mode (when pkgsrc has been installed as any other user), the default locations are: - LOCALBASE= ${HOME}/pkg - PKG_SYSCONFBASE= ${HOME}/pkg/etc - VARBASE= ${HOME}/pkg/var - PKG_DBDIR= ${HOME}/pkg/var/db/pkg +LOCALBASE= ${HOME}/pkg +PKG_SYSCONFBASE= ${HOME}/pkg/etc +VARBASE= ${HOME}/pkg/var +PKG_DBDIR= ${HOME}/pkg/var/db/pkg What these four directories are for, and what they look like is diff --git a/doc/guide/files/fixes.xml b/doc/guide/files/fixes.xml index 438341fed67..fd54bf2ed07 100644 --- a/doc/guide/files/fixes.xml +++ b/doc/guide/files/fixes.xml @@ -1,4 +1,4 @@ - + Making your package work @@ -81,13 +81,13 @@ Makefile, e.g.: - INTERACTIVE_STAGE= build +INTERACTIVE_STAGE= build Multiple interactive stages can be specified: - INTERACTIVE_STAGE= configure install +INTERACTIVE_STAGE= configure install The user can then decide to skip this package by setting the @@ -147,7 +147,7 @@ role="pkg">graphics/xv: - LICENSE= xv-license +LICENSE= xv-license When trying to build, the user will get a notice that the @@ -155,12 +155,12 @@ ACCEPTABLE_LICENSES variable: - &cprompt; make - ===> xv-3.10anb9 has an unacceptable license: xv-license. - ===> To view the license, enter "/usr/bin/make show-license". - ===> To indicate acceptance, add this line to your /etc/mk.conf: - ===> ACCEPTABLE_LICENSES+=xv-license - *** Error code 1 +&cprompt; make +===> xv-3.10anb9 has an unacceptable license: xv-license. +===> To view the license, enter "/usr/bin/make show-license". +===> To indicate acceptance, add this line to your /etc/mk.conf: +===> ACCEPTABLE_LICENSES+=xv-license +*** Error code 1 The license can be viewed with make @@ -170,7 +170,7 @@ that license: - ACCEPTABLE_LICENSES+=xv-license +ACCEPTABLE_LICENSES+=xv-license When adding a package with a new license, the license text @@ -306,7 +306,7 @@ DEPENDS definition is: - <pre-req-package-name>:../../<category>/<pre-req-package> +<pre-req-package-name>:../../<category>/<pre-req-package> Please note that the pre-req-package-name @@ -320,7 +320,7 @@ buildlink3.mk file available, use it: - .include "../../graphics/jpeg/buildlink3.mk" +.include "../../graphics/jpeg/buildlink3.mk" @@ -331,7 +331,7 @@ definition: - BUILD_DEPENDS+= autoconf-2.13:../../devel/autoconf +BUILD_DEPENDS+= autoconf-2.13:../../devel/autoconf @@ -343,13 +343,13 @@ DEPENDS definition. For example: - DEPENDS+= xpm-3.4j:../../graphics/xpm +DEPENDS+= xpm-3.4j:../../graphics/xpm You can also use wildcards in package dependences: - DEPENDS+= xpm-[0-9]*:../../graphics/xpm +DEPENDS+= xpm-[0-9]*:../../graphics/xpm Note that such wildcard dependencies are retained when @@ -368,7 +368,7 @@ pre-requisite: - DEPENDS+= tiff>=3.5.4:../../graphics/tiff +DEPENDS+= tiff>=3.5.4:../../graphics/tiff This means that the package will build against version @@ -385,7 +385,7 @@ ABI_DEPENDS: - ABI_DEPENDS+= tiff>=3.6.1:../../graphics/tiff +ABI_DEPENDS+= tiff>=3.6.1:../../graphics/tiff In addition to the above DEPENDS @@ -426,7 +426,7 @@ when it runs, and that is specified: - DEPENDS+= teTeX-[0-9]*:../../print/teTeX +DEPENDS+= teTeX-[0-9]*:../../print/teTeX The comment about wildcard dependencies from previous @@ -462,13 +462,13 @@ pkgsrc/x11/Xaw3d/Makefile: - CONFLICTS= Xaw-Xpm-[0-9]* +CONFLICTS= Xaw-Xpm-[0-9]* and in pkgsrc/x11/Xaw-Xpm/Makefile: - CONFLICTS= Xaw3d-[0-9]* +CONFLICTS= Xaw3d-[0-9]* Packages will automatically conflict with other packages @@ -555,8 +555,8 @@ . by the package tools. e.g. - DISTNAME= foo-17.42 - PKGREVISION= 9 +DISTNAME= foo-17.42 +PKGREVISION= 9 will result in a PKGNAME of @@ -570,7 +570,7 @@ minor release of the above package, things should be like: - DISTNAME= foo-17.43 +DISTNAME= foo-17.43 PKGREVISION should be incremented for any @@ -585,21 +585,21 @@ changes that do not merit increasing PKGREVISION are: - - Changing HOMEPAGE, MAINTAINER, - or comments in Makefile. - Changing build variables if the resulting binary package is the same. - Changing DESCR. - Adding PKG_OPTIONS if the default options don't change. - + + Changing HOMEPAGE, MAINTAINER, + or comments in Makefile. + Changing build variables if the resulting binary package is the same. + Changing DESCR. + Adding PKG_OPTIONS if the default options don't change. + Examples of changes that do merit an increase to PKGREVISION include: - - Security fixes - Changes or additions to a patch file - Changes to the PLIST - + + Security fixes + Changes or additions to a patch file + Changes to the PLIST + PKGREVISION must also be incremented when dependencies have ABI changes. @@ -615,13 +615,13 @@ Example: - SUBST_CLASSES+= fix-paths - SUBST_STAGE.fix-paths= pre-configure - SUBST_MESSAGE.fix-paths= Fixing absolute paths. - SUBST_FILES.fix-paths= src/*.c - SUBST_FILES.fix-paths+= scripts/*.sh - SUBST_SED.fix-paths= -e 's,"/usr/local,"${PREFIX},g' - SUBST_SED.fix-paths+= -e 's,"/var/log,"${VARBASE}/log,g' +SUBST_CLASSES+= fix-paths +SUBST_STAGE.fix-paths= pre-configure +SUBST_MESSAGE.fix-paths= Fixing absolute paths. +SUBST_FILES.fix-paths= src/*.c +SUBST_FILES.fix-paths+= scripts/*.sh +SUBST_SED.fix-paths= -e 's,"/usr/local,"${PREFIX},g' +SUBST_SED.fix-paths+= -e 's,"/var/log,"${VARBASE}/log,g' SUBST_CLASSES is a list of identifiers @@ -695,9 +695,9 @@ displayed to the user before aborting the build. Example: - FETCH_MESSAGE= "Please download the files" - FETCH_MESSAGE+= " "${DISTFILES:Q} - FETCH_MESSAGE+= "manually from "${MASTER_SITES:Q}"." +FETCH_MESSAGE= "Please download the files" +FETCH_MESSAGE+= " "${DISTFILES:Q} +FETCH_MESSAGE+= "manually from "${MASTER_SITES:Q}"." @@ -780,8 +780,11 @@ -Bshareable commands, and instead use: - ${LIBTOOL} --mode=link ${CC} -o ${.TARGET:.a=.la} ${OBJS:.o=.lo} \ - -rpath ${PREFIX}/lib -version-info major:minor +${LIBTOOL} --mode=link \ + ${CC} -o ${.TARGET:.a=.la} \ + ${OBJS:.o=.lo} \ + -rpath ${PREFIX}/lib \ + -version-info major:minor Note that the library is changed to have a @@ -799,22 +802,22 @@ From the libtool manual: - So, libtool library versions are described by three integers: +So, libtool library versions are described by three integers: - CURRENT - The most recent interface number that this library implements. +CURRENT +The most recent interface number that this library implements. - REVISION - The implementation number of the CURRENT interface. +REVISION +The implementation number of the CURRENT interface. - AGE - The difference between the newest and oldest interfaces that - this library implements. In other words, the library implements - all the interface numbers in the range from number `CURRENT - - AGE' to `CURRENT'. +AGE +The difference between the newest and oldest interfaces that +this library implements. In other words, the library implements +all the interface numbers in the range from number `CURRENT - +AGE' to `CURRENT'. - If two libraries have identical CURRENT and AGE numbers, then the - dynamic linker chooses the library with the greater REVISION number. +If two libraries have identical CURRENT and AGE numbers, then the +dynamic linker chooses the library with the greater REVISION number. The -release option will produce @@ -857,13 +860,13 @@ .la file. e.g. - ${LIBTOOL} --mode=link ${CC} -o someprog -L../somelib -lsomelib +${LIBTOOL} --mode=link ${CC} -o someprog -L../somelib -lsomelib should be changed to: - ${LIBTOOL} --mode=link ${CC} -o someprog ../somelib/somelib.la +${LIBTOOL} --mode=link ${CC} -o someprog ../somelib/somelib.la and it will do the right thing with the libraries. @@ -876,7 +879,7 @@ .la. e.g. - ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib +${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib This will install the static .a, @@ -961,29 +964,28 @@ For packages that need only autoconf: - AUTOCONF_REQD= 2.50 # if default version is not good enough - USE_TOOLS+= autoconf # use "autoconf213" for autoconf-2.13 - ... +AUTOCONF_REQD= 2.50 # if default version is not good enough +USE_TOOLS+= autoconf # use "autoconf213" for autoconf-2.13 +... - pre-configure: - cd ${WRKSRC}; autoconf +pre-configure: + cd ${WRKSRC} && autoconf - ... +... and for packages that need automake and autoconf: - AUTOMAKE_REQD= 1.7.1 # if default version is not good enough - USE_TOOLS+= automake # use "automake14" for automake-1.4 - ... +AUTOMAKE_REQD= 1.7.1 # if default version is not good enough +USE_TOOLS+= automake # use "automake14" for automake-1.4 +... - pre-configure: - cd ${WRKSRC}; \ - aclocal; autoheader; \ - automake -a --foreign -i; autoconf +pre-configure: + set -e; cd ${WRKSRC}; \ + aclocal; autoheader; automake -a --foreign -i; autoconf - ... +... Packages which use GNU Automake will almost certainly @@ -1117,26 +1119,26 @@ rest of the world, you should use the following code. - #include <sys/param.h> - #if (defined(BSD) && BSD >= 199306) - /* BSD-specific code goes here */ - #else - /* non-BSD-specific code goes here */ - #endif +#include <sys/param.h> +#if (defined(BSD) && BSD >= 199306) +/* BSD-specific code goes here */ +#else +/* non-BSD-specific code goes here */ +#endif If this distinction is not fine enough, you can also test for the following macros. - FreeBSD __FreeBSD__ - DragonFly __DragonFly__ - Interix __INTERIX - IRIX __sgi (TODO: get a definite source for this) - Linux linux, __linux, __linux__ - NetBSD __NetBSD__ - OpenBSD __OpenBSD__ - Solaris sun, __sun +FreeBSD __FreeBSD__ +DragonFly __DragonFly__ +Interix __INTERIX +IRIX __sgi (TODO: get a definite source for this) +Linux linux, __linux, __linux__ +NetBSD __NetBSD__ +OpenBSD __OpenBSD__ +Solaris sun, __sun @@ -1144,9 +1146,9 @@ C preprocessor macros to identify the hardware architecture - i386 i386, __i386, __i386__ - MIPS __mips - SPARC sparc, __sparc +i386 i386, __i386, __i386__ +MIPS __mips +SPARC sparc, __sparc @@ -1154,10 +1156,10 @@ C preprocessor macros to identify the compiler - GCC __GNUC__ (major version), __GNUC_MINOR__ - MIPSpro _COMPILER_VERSION (0x741 for MIPSpro 7.41) - SunPro __SUNPRO_C (0x570 for Sun C 5.7) - SunPro C++ __SUNPRO_CC (0x580 for Sun C++ 5.8) +GCC __GNUC__ (major version), __GNUC_MINOR__ +MIPSpro _COMPILER_VERSION (0x741 for MIPSpro 7.41) +SunPro __SUNPRO_C (0x570 for Sun C 5.7) +SunPro C++ __SUNPRO_CC (0x580 for Sun C++ 5.8) @@ -1215,18 +1217,18 @@ possibility. That compiler cannot handle the following code: - extern int extern_func(int); +extern int extern_func(int); - static inline int - inline_func(int x) - { +static inline int +inline_func(int x) +{ return extern_func(x); - } +} - int main(void) - { +int main(void) +{ return 0; - } +} It generates the code for inline_func even if @@ -1266,8 +1268,8 @@ of functions. ${INSTALL_*_DIR} like this: - ${INSTALL_DATA_DIR} ${PREFIX}/dir1 - ${INSTALL_DATA_DIR} ${PREFIX}/dir2 +${INSTALL_DATA_DIR} ${PREFIX}/dir1 +${INSTALL_DATA_DIR} ${PREFIX}/dir2 You can also just append dir1 @@ -1345,11 +1347,11 @@ of functions. shall use tclsh in this example): - REPLACE_INTERPRETER+= tcl - REPLACE.tcl.old= .*/bin/tclsh - REPLACE.tcl.new= ${PREFIX}/bin/tclsh - REPLACE_FILES.tcl= # list of tcl scripts which need to be fixed, - # relative to ${WRKSRC}, just as in REPLACE_PERL +REPLACE_INTERPRETER+= tcl +REPLACE.tcl.old= .*/bin/tclsh +REPLACE.tcl.new= ${PREFIX}/bin/tclsh +REPLACE_FILES.tcl= # list of tcl scripts which need to be fixed, +# relative to ${WRKSRC}, just as in REPLACE_PERL Before March 2006, these variables were called @@ -1380,7 +1382,7 @@ of functions. paths to packlist files, e.g.: - PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist +PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist The variables PERL5_SITELIB, diff --git a/doc/guide/files/getting.xml b/doc/guide/files/getting.xml index 68b8db54a4f..937150005ad 100644 --- a/doc/guide/files/getting.xml +++ b/doc/guide/files/getting.xml @@ -1,4 +1,4 @@ - + Where to get pkgsrc and how to keep it up-to-date @@ -58,7 +58,7 @@ and dashes. supfile has a line - release=pkgsrc +release=pkgsrc in it, see the examples in diff --git a/doc/guide/files/gnome.xml b/doc/guide/files/gnome.xml index e34a6e8ee82..816bab7a3b3 100644 --- a/doc/guide/files/gnome.xml +++ b/doc/guide/files/gnome.xml @@ -1,4 +1,4 @@ - + GNOME packaging and porting @@ -108,9 +108,11 @@ give you a general idea on the minimum required tools: build system. As a general rule you will need to tell this to your package: - GNU_CONFIGURE=yes + +GNU_CONFIGURE=yes USE_LIBTOOL=yes -USE_TOOLS+=gmake +USE_TOOLS+=gmake + diff --git a/doc/guide/files/infr.design.xml b/doc/guide/files/infr.design.xml index c0326d16fac..1191cbc5709 100644 --- a/doc/guide/files/infr.design.xml +++ b/doc/guide/files/infr.design.xml @@ -1,4 +1,4 @@ - + Design of the pkgsrc infrastructure @@ -66,7 +66,7 @@ example. - DISTFILES= ${DISTNAME}${EXTRACT_SUFX} additional-files.tar.gz +DISTFILES= ${DISTNAME}${EXTRACT_SUFX} additional-files.tar.gz Because of the selection of this default value, the same @@ -112,13 +112,13 @@ clear, here is an example: - CONFIGURE_ARGS= # none - CFLAGS= -O - CONFIGURE_ARGS+= CFLAGS=${CFLAGS:Q} +CONFIGURE_ARGS= # none +CFLAGS= -O +CONFIGURE_ARGS+= CFLAGS=${CFLAGS:Q} - CONFIGURE_ARGS:= ${CONFIGURE_ARGS} +CONFIGURE_ARGS:= ${CONFIGURE_ARGS} - CFLAGS+= -Wall +CFLAGS+= -Wall This code shows how the use of the := diff --git a/doc/guide/files/makefile.xml b/doc/guide/files/makefile.xml index bb6848b0912..6ee143ce9ac 100644 --- a/doc/guide/files/makefile.xml +++ b/doc/guide/files/makefile.xml @@ -1,4 +1,4 @@ - + Programming in <filename>Makefile</filename>s @@ -31,16 +31,16 @@ regenerated properly. Example: - wrong: - @echo "line 1" > ${.TARGET} - @echo "line 2" >> ${.TARGET} - @false - - correct: - @echo "line 1" > ${.TARGET}.tmp - @echo "line 2" >> ${.TARGET}.tmp - @false - @mv ${.TARGET}.tmp ${.TARGET} +wrong: + @echo "line 1" > ${.TARGET} + @echo "line 2" >> ${.TARGET} + @false + +correct: + @echo "line 1" > ${.TARGET}.tmp + @echo "line 2" >> ${.TARGET}.tmp + @false + @mv ${.TARGET}.tmp ${.TARGET} When you run make wrong twice, the file @@ -163,16 +163,16 @@ Adding things to a list - STRING= foo * bar `date` - INT_LIST= # empty - ANOTHER_INT_LIST= apache-[0-9]*:../../www/apache - EXT_LIST= # empty - ANOTHER_EXT_LIST= a=b c=d - - INT_LIST+= ${STRING} # 1 - INT_LIST+= ${ANOTHER_INT_LIST} # 2 - EXT_LIST+= ${STRING:Q} # 3 - EXT_LIST+= ${ANOTHER_EXT_LIST} # 4 +STRING= foo * bar `date` +INT_LIST= # empty +ANOTHER_INT_LIST= apache-[0-9]*:../../www/apache +EXT_LIST= # empty +ANOTHER_EXT_LIST= a=b c=d + +INT_LIST+= ${STRING} # 1 +INT_LIST+= ${ANOTHER_INT_LIST} # 2 +EXT_LIST+= ${STRING:Q} # 3 +EXT_LIST+= ${ANOTHER_EXT_LIST} # 4 When you add a string to an external list (example 3), it @@ -187,10 +187,10 @@ Converting an internal list into an external list - EXT_LIST= # empty - .for i in ${INT_LIST} - EXT_LIST+= ${i:Q}"" - .endfor +EXT_LIST= # empty +.for i in ${INT_LIST} +EXT_LIST+= ${i:Q}"" +.endfor This code converts the internal list @@ -209,17 +209,17 @@ nastiness. - STRING= foo bar < > * `date` $$HOME ' " - EXT_LIST= string=${STRING:Q} x=second\ item - - all: - echo ${STRING} # 1 - echo "${STRING}" # 2 - echo "${STRING:Q}" # 3 - echo ${STRING:Q} # 4 - echo x${STRING:Q} | sed 1s,.,, # 5 - printf "%s\\n" ${STRING:Q}"" # 6 - env ${EXT_LIST} /bin/sh -c 'echo "$$string"; echo "$$x"' +STRING= foo bar < > * `date` $$HOME ' " +EXT_LIST= string=${STRING:Q} x=second\ item + +all: + echo ${STRING} # 1 + echo "${STRING}" # 2 + echo "${STRING:Q}" # 3 + echo ${STRING:Q} # 4 + echo x${STRING:Q} | sed 1s,.,, # 5 + printf "%s\\n" ${STRING:Q}"" # 6 + env ${EXT_LIST} /bin/sh -c 'echo "$$string"; echo "$$x"' Example 1 leads to a syntax error in the shell, as the @@ -284,15 +284,15 @@ here is how we do it: - CPPFLAGS= # empty - CPPFLAGS+= -Wundef -DPREFIX=\"${PREFIX:Q}\" - CPPFLAGS+= ${MY_CPPFLAGS} +CPPFLAGS= # empty +CPPFLAGS+= -Wundef -DPREFIX=\"${PREFIX:Q}\" +CPPFLAGS+= ${MY_CPPFLAGS} - CONFIGURE_ARGS+= CPPFLAGS=${CPPFLAGS:M*:Q} +CONFIGURE_ARGS+= CPPFLAGS=${CPPFLAGS:M*:Q} - all: - echo x${CPPFLAGS:Q}x # leading and trailing whitespace - echo x${CONFIGURE_ARGS}x # properly trimmed +all: + echo x${CPPFLAGS:Q}x # leading and trailing whitespace + echo x${CONFIGURE_ARGS}x # properly trimmed The example above contains one bug: The @@ -313,17 +313,17 @@ same trick. - EMPTY= # empty - empty_test: - for i in a ${EMPTY:Q} c; do \ - echo "$$i"; \ - done - - for_test: - .for i in a:\ a:\test.txt - echo ${i:Q} - echo "foo" - .endfor +EMPTY= # empty +empty_test: + for i in a ${EMPTY:Q} c; do \ + echo "$$i"; \ + done + +for_test: +.for i in a:\ a:\test.txt + echo ${i:Q} + echo "foo" +.endfor The first example will only print two of the three lines @@ -354,7 +354,7 @@ in ${VAR} after this code executes. - VAR:= ${VAR:N${_othervar_:C/-//}} +VAR:= ${VAR:N${_othervar_:C/-//}} For a more complex code snippet and a workaround, see the diff --git a/doc/guide/files/options.xml b/doc/guide/files/options.xml index da215e73792..66b7da7dd44 100644 --- a/doc/guide/files/options.xml +++ b/doc/guide/files/options.xml @@ -1,4 +1,4 @@ - + @@ -36,51 +36,51 @@ e.g. options.mk, that is included by the main package Makefile. - PKG_OPTIONS_VAR= PKG_OPTIONS.wibble - PKG_SUPPORTED_OPTIONS= wibble-foo ldap - PKG_OPTIONS_OPTIONAL_GROUPS= database - PKG_OPTIONS_GROUP.database= mysql pgsql - PKG_SUGGESTED_OPTIONS= wibble-foo - PKG_OPTIONS_LEGACY_VARS+= WIBBLE_USE_OPENLDAP:ldap - PKG_OPTIONS_LEGACY_OPTS+= foo:wibble-foo - - .include "../../mk/bsd.prefs.mk" - - # this package was previously named wibble2 - .if defined(PKG_OPTIONS.wibble2) - PKG_LEGACY_OPTIONS+= ${PKG_OPTIONS.wibble2} - PKG_OPTIONS_DEPRECATED_WARNINGS+= \ - "Deprecated variable PKG_OPTIONS.wibble2 used, use ${PKG_OPTIONS_VAR} instead." - .endif - - .include "../../mk/bsd.options.mk" - - # Package-specific option-handling - - ### - ### FOO support - ### - .if !empty(PKG_OPTIONS:Mwibble-foo) - CONFIGURE_ARGS+= --enable-foo - .endif - - ### - ### LDAP support - ### - .if !empty(PKG_OPTIONS:Mldap) - . include "../../databases/openldap-client/buildlink3.mk" - CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap-client} - .endif - - ### - ### database support - ### - .if !empty(PKG_OPTIONS:Mmysql) - . include "../../mk/mysql.buildlink3.mk" - .endif - .if !empty(PKG_OPTIONS:Mpgsql) - . include "../../mk/pgsql.buildlink3.mk" - .endif +PKG_OPTIONS_VAR= PKG_OPTIONS.wibble +PKG_SUPPORTED_OPTIONS= wibble-foo ldap +PKG_OPTIONS_OPTIONAL_GROUPS= database +PKG_OPTIONS_GROUP.database= mysql pgsql +PKG_SUGGESTED_OPTIONS= wibble-foo +PKG_OPTIONS_LEGACY_VARS+= WIBBLE_USE_OPENLDAP:ldap +PKG_OPTIONS_LEGACY_OPTS+= foo:wibble-foo + +.include "../../mk/bsd.prefs.mk" + +# this package was previously named wibble2 +.if defined(PKG_OPTIONS.wibble2) +PKG_LEGACY_OPTIONS+= ${PKG_OPTIONS.wibble2} +PKG_OPTIONS_DEPRECATED_WARNINGS+= \ + "Deprecated variable PKG_OPTIONS.wibble2 used, use ${PKG_OPTIONS_VAR} instead." +.endif + +.include "../../mk/bsd.options.mk" + +# Package-specific option-handling + +### +### FOO support +### +.if !empty(PKG_OPTIONS:Mwibble-foo) +CONFIGURE_ARGS+= --enable-foo +.endif + +### +### LDAP support +### +.if !empty(PKG_OPTIONS:Mldap) +. include "../../databases/openldap-client/buildlink3.mk" +CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap-client} +.endif + +### +### database support +### +.if !empty(PKG_OPTIONS:Mmysql) +. include "../../mk/mysql.buildlink3.mk" +.endif +.if !empty(PKG_OPTIONS:Mpgsql) +. include "../../mk/pgsql.buildlink3.mk" +.endif The first section contains the information about which build @@ -179,7 +179,7 @@ each option. The correct way to check for an option is to check whether it is listed in PKG_OPTIONS: - .if !empty(PKG_OPTIONS:Moption) +.if !empty(PKG_OPTIONS:Moption) diff --git a/doc/guide/files/pkginstall.xml b/doc/guide/files/pkginstall.xml index 9395c5cba82..57e950c5094 100644 --- a/doc/guide/files/pkginstall.xml +++ b/doc/guide/files/pkginstall.xml @@ -1,4 +1,4 @@ - + The pkginstall framework @@ -114,7 +114,7 @@ directories anywhere in the file system: numerical mode. For example: - MAKE_DIRS_PERMS+= ${VARBASE}/foo/private ${ROOT_USER} ${ROOT_GROUP} 0700 +MAKE_DIRS_PERMS+= ${VARBASE}/foo/private ${ROOT_USER} ${ROOT_GROUP} 0700 The difference between the two is exactly the same as their @@ -164,7 +164,7 @@ installation prefix: this order. For example: - SUPPORT_FILES_PERMS+= ${PREFIX}/share/somefile ${VARBASE}/somefile ${ROOT_USER} ${ROOT_GROUP} 0700 +SUPPORT_FILES_PERMS+= ${PREFIX}/share/somefile ${VARBASE}/somefile ${ROOT_USER} ${ROOT_GROUP} 0700 The difference between the two is exactly the same as their @@ -288,7 +288,7 @@ extra flag to the configuration script; this is the case of GNU Autoconf- generated files: - CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR} +CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR} Note that this specifies where the package has to look @@ -326,8 +326,8 @@ about their syntax and their purpose. Here is an example, taken from the mail/mutt package: - EGDIR= ${PREFIX}/share/doc/mutt/samples - CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc +EGDIR= ${PREFIX}/share/doc/mutt/samples +CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc Note that the EGDIR variable is specific to that @@ -380,7 +380,7 @@ to: Continuing the previous example: - RCD_SCRIPTS+= cupsd +RCD_SCRIPTS+= cupsd @@ -445,7 +445,7 @@ installation, it can do so by using the pkginstall framework. syntax: - user:group +user:group Further specification of user details may be done by setting @@ -465,7 +465,7 @@ not specified. PKG_GROUPS variable, whose syntax is: - group +group The numeric GID of the group may be set by defining @@ -497,7 +497,7 @@ add some hooks to the installation scripts to handle it. Consider the following example, taken from shells/zsh: - PKG_SHELL= ${PREFIX}/bin/zsh +PKG_SHELL= ${PREFIX}/bin/zsh @@ -536,7 +536,7 @@ installation prefix. Consider the following example, taken from fonts/dbz-ttf: - FONTS_DIRS.ttf= ${PREFIX}/lib/X11/fonts/TTF +FONTS_DIRS.ttf= ${PREFIX}/lib/X11/fonts/TTF diff --git a/doc/guide/files/platforms.xml b/doc/guide/files/platforms.xml index 7ff53a793c4..9fc07c4ade9 100644 --- a/doc/guide/files/platforms.xml +++ b/doc/guide/files/platforms.xml @@ -1,4 +1,4 @@ - + Using pkgsrc on systems other than &os; @@ -504,7 +504,7 @@ file and inspect the contents before extracting it. entry provides adequate emulation in most cases: - interix:kP=\E[S:kN=\E[T:kH=\E[U:dc@:DC@:tc=pcansi: +interix:kP=\E[S:kN=\E[T:kH=\E[U:dc@:DC@:tc=pcansi: @@ -623,7 +623,7 @@ file and inspect the contents before extracting it. If you are using SGI's MIPSPro compiler, please set - PKGSRC_COMPILER= mipspro +PKGSRC_COMPILER= mipspro in /etc/mk.conf. Otherwise, pkgsrc will assume you @@ -654,8 +654,8 @@ file and inspect the contents before extracting it. directory: - env CC=/opt/intel_cc_80/bin/icc LDFLAGS=-static-libcxa \ - ac_cv___attribute__=yes ./bootstrap +env CC=/opt/intel_cc_80/bin/icc LDFLAGS=-static-libcxa \ +ac_cv___attribute__=yes ./bootstrap @@ -673,7 +673,7 @@ file and inspect the contents before extracting it. in /etc/mk.conf: - PKGSRC_COMPILER= icc +PKGSRC_COMPILER= icc The default installation directory for icc is @@ -683,7 +683,7 @@ file and inspect the contents before extracting it. /etc/mk.conf: - ICCBASE= /opt/icc +ICCBASE= /opt/icc pkgsrc uses the static linking method of the runtime libraries @@ -739,11 +739,11 @@ file and inspect the contents before extracting it. of the file with: - .ifdef BSD_PKG_MK - # pkgsrc stuff, e.g. insert defaults/mk.conf or similar here - .else - # OpenBSD stuff - .endif +.ifdef BSD_PKG_MK +# pkgsrc stuff, e.g. insert defaults/mk.conf or similar here +.else +# OpenBSD stuff +.endif @@ -811,10 +811,10 @@ file and inspect the contents before extracting it. mk.conf file: - CC= cc - CXX= CC - CPP= cc -E - CXXCPP= CC -E +CC= cc +CXX= CC +CPP= cc -E +CXXCPP= CC -E The CPP setting might break some @@ -830,8 +830,8 @@ file and inspect the contents before extracting it. file: - PKGSRC_COMPILER= sunpro - ABI= 64 +PKGSRC_COMPILER= sunpro +ABI= 64 This setting has been tested for the SPARC @@ -849,8 +849,8 @@ file and inspect the contents before extracting it. to your mk.conf: - CONFIG_SHELL= ${LOCALBASE}/bin/bash - WRAPPER_SHELL= ${LOCALBASE}/bin/bash +CONFIG_SHELL= ${LOCALBASE}/bin/bash +WRAPPER_SHELL= ${LOCALBASE}/bin/bash Then, rebuild the + PLIST issues @@ -20,7 +20,7 @@ PLIST file you write: - @comment $NetBSD$ +@comment $NetBSD$ @@ -56,7 +56,7 @@ resulting PLIST: - PRINT_PLIST_AWK+= /^libdata\/foo/ { next; } +PRINT_PLIST_AWK+= /^libdata\/foo/ { next; } And to get all the @dirrm lines referring @@ -64,7 +64,7 @@ @comments: - PRINT_PLIST_AWK+= /^@dirrm share\/specific/ { print "@comment " $$0; next; } +PRINT_PLIST_AWK+= /^@dirrm share\/specific/ { print "@comment " $$0; next; } @@ -141,7 +141,7 @@ linkend="components.optional"/>): - PLIST_SUBST+= SOMEVAR="somevalue" +PLIST_SUBST+= SOMEVAR="somevalue" This replaces all occurrences of ${SOMEVAR} @@ -221,7 +221,7 @@ an extra package to remove it. Therefore, one simply does: - @unexec ${RMDIR} %D/path/to/shared/directory 2>/dev/null || ${TRUE} +@unexec ${RMDIR} %D/path/to/shared/directory 2>/dev/null || ${TRUE} in the PLISTs of all affected packages, instead of the @@ -250,8 +250,8 @@ idea of the *-dirs packages available, issue: - &cprompt; cd .../pkgsrc - &cprompt; ls -d */*-dirs +&cprompt; cd .../pkgsrc +&cprompt; ls -d */*-dirs Their use from other packages is very simple. The @@ -265,7 +265,7 @@ following line in it: - USE_DIRS+= xdg-1.1 +USE_DIRS+= xdg-1.1 After regenerating the PLIST using make diff --git a/doc/guide/files/submit.xml b/doc/guide/files/submit.xml index ba84189ef5e..3f343bb09b9 100644 --- a/doc/guide/files/submit.xml +++ b/doc/guide/files/submit.xml @@ -1,4 +1,4 @@ - + Submitting and Committing @@ -97,8 +97,8 @@ pkgsrc-base, e.g: - &uprompt; cd .../pkgsrc/category/pkgname - &uprompt; cvs import pkgsrc/category/pkgname TNF pkgsrc-base +&uprompt; cd .../pkgsrc/category/pkgname +&uprompt; cvs import pkgsrc/category/pkgname TNF pkgsrc-base Remember to move the directory from which you imported out of -- cgit v1.2.3