[BACK]Return to bsd.port.mk CVS log [TXT][DIR] Up to [local] / src / share / mk

Diff for /src/share/mk/bsd.port.mk between version 1.43 and 1.44

version 1.43, 1998/08/24 04:46:14 version 1.44, 1998/09/07 22:33:19
Line 1 
Line 1 
 #-*- mode: Fundamental; tab-width: 4; -*-  #-*- mode: Fundamental; tab-width: 4; -*-
 # ex:ts=4  # ex:ts=4
 #   $OpenBSD$  #   $OpenBSD$
 #   $NetBSD: $  
 #  #
 #   bsd.port.mk - 940820 Jordan K. Hubbard.  #   bsd.port.mk - 940820 Jordan K. Hubbard.
 #   This file is in the public domain.  #   This file is in the public domain.
 #  #
 # FreeBSD Id: bsd.port.mk,v 1.264 1996/12/25 02:27:44 imp Exp  # FreeBSD Id: bsd.port.mk,v 1.264 1996/12/25 02:27:44 imp Exp
   #   $NetBSD: bsd.port.mk,v 1.62 1998/04/09 12:47:02 hubertf Exp $
 #  #
 # Please view me with 4 column tabs!  # Please view me with 4 column tabs!
   
Line 21 
Line 21 
 # contact information on the person(s) to contact if you have questions/  # contact information on the person(s) to contact if you have questions/
 # suggestions about that specific port.  By default (if no MAINTAINER  # suggestions about that specific port.  By default (if no MAINTAINER
 # is listed), a port is maintained by the subscribers of the ports@freebsd.org  # is listed), a port is maintained by the subscribers of the ports@freebsd.org
 # mailing list, and any correspondece should be directed there.  # mailing list (OpenBSD: ports@openbsd.org), and any correspondece
   # should be directed there.
 #  #
 FreeBSD_MAINTAINER= asami@FreeBSD.ORG  FreeBSD_MAINTAINER= asami@FreeBSD.ORG
 OpenBSD_MAINTAINER= marc@OpenBSD.ORG  OpenBSD_MAINTAINER= marc@OpenBSD.ORG
   NetBSD_MAINTAINER=  agc@netbsd.org
   
 # Supported Variables and their behaviors:  # Supported Variables and their behaviors:
 #  #
 # Variables that typically apply to all ports:  # Variables that typically apply to all ports:
 #  #
 # ONLY_FOR_ARCHS- If a port only makes sense to certain architectures, this  # ONLY_FOR_ARCHS - If a port only makes sense to certain architectures, this
 #                 is a list containing the names for them.  It is checked  #                 is a list containing the names for them.  It is checked
 #                 against the predefined ${MACHINE} value  #                 against the predefined ${MACHINE_ARCH} value
 # ARCH          - The architecture, as returned by "uname -m".  # ARCH          - The architecture, as returned by "uname -m".
 # OPSYS         - Portability clause.  This is the operating system the  # OPSYS         - Portability clause.  This is the operating system the
 #                 makefile is being used on.  Automatically set to  #                 makefile is being used on.  Automatically set to
Line 40 
Line 42 
 # OPSYS_VER     - The current version if the operating system  # OPSYS_VER     - The current version if the operating system
 # PORTSDIR      - The root of the ports tree.  Defaults:  # PORTSDIR      - The root of the ports tree.  Defaults:
 #                   FreeBSD/OpenBSD: /usr/ports  #                   FreeBSD/OpenBSD: /usr/ports
 #                   NetBSD:          /usr/opt  #                   NetBSD:          /usr/pkgsrc
 # DISTDIR       - Where to get gzip'd, tarballed copies of original sources  # DISTDIR       - Where to get gzip'd, tarballed copies of original sources
 #                 (default: ${PORTSDIR}/distfiles).  #                 (default: ${PORTSDIR}/distfiles).
 # PREFIX        - Where to install things in general (default: /usr/local).  # PREFIX        - Where to install things in general (default: /usr/local).
 # MASTER_SITES  - Primary location(s) for distribution files if not found  # MASTER_SITES  - Primary location(s) for distribution files if not found
 #                 locally.  #                 locally.
   # MASTER_SITE_SUBDIR - Directory that "%SUBDIR%" in MASTER_SITES is
   #                 replaced by.
 # PATCH_SITES   - Primary location(s) for distribution patch files  # PATCH_SITES   - Primary location(s) for distribution patch files
 #                 (see PATCHFILES below) if not found locally.  #                 (see PATCHFILES below) if not found locally.
   # PATCH_SITE_SUBDIR - Directory that "%SUBDIR%" in PATCH_SITES is
   #                 replaced by.
 #  #
 # MASTER_SITE_BACKUP - Backup location(s) for distribution files and patch  # MASTER_SITE_BACKUP - Backup location(s) for distribution files and patch
 #                 files if not found locally and ${MASTER_SITES}/${PATCH_SITES}  #                 files if not found locally and ${MASTER_SITES}/${PATCH_SITES}
Line 66 
Line 72 
 # GMAKE         - Set to path of GNU make if not in $PATH (default: gmake).  # GMAKE         - Set to path of GNU make if not in $PATH (default: gmake).
 # XMKMF         - Set to path of `xmkmf' if not in $PATH (default: xmkmf -a ).  # XMKMF         - Set to path of `xmkmf' if not in $PATH (default: xmkmf -a ).
 # MAINTAINER    - The e-mail address of the contact person for this port  # MAINTAINER    - The e-mail address of the contact person for this port
 #                 (default: ports@FreeBSD.ORG).  #                 Defaults: ports@OpenBSD.ORG      (OpenBSD)
   #                           ports@FreeBSD.ORG      (FreeBSD)
   #                           packages@NetBSD.ORG    (NetBSD)
 # CATEGORIES    - A list of descriptive categories into which this port falls.  # CATEGORIES    - A list of descriptive categories into which this port falls.
 # WRKOBJDIR     - A top level directory where, if defined, the separate working  # WRKOBJDIR     - A top level directory where, if defined, the separate working
 #                 directories will get created, and symbolically linked to from  #                 directories will get created, and symbolically linked to from
Line 79 
Line 87 
 # variables without defaults are *mandatory*.  # variables without defaults are *mandatory*.
 #  #
 # WRKDIR        - A temporary working directory that gets *clobbered* on clean  # WRKDIR        - A temporary working directory that gets *clobbered* on clean
 # beware! unless NOCLEANDEPENDS,  dependencies are also nuked on clean.  
 #                 (default: ${.CURDIR}/work).  #                 (default: ${.CURDIR}/work).
 # WRKSRC        - A subdirectory of ${WRKDIR} where the distribution actually  # WRKSRC        - A subdirectory of ${WRKDIR} where the distribution actually
 #                 unpacks to.  (Default: ${WRKDIR}/${DISTNAME} unless  #                 unpacks to.  (Default: ${WRKDIR}/${DISTNAME} unless
Line 97 
Line 104 
 #                 ${DISTDIR}.  Also they will be fetched in this subdirectory  #                 ${DISTDIR}.  Also they will be fetched in this subdirectory
 #                 from FreeBSD mirror sites.  #                 from FreeBSD mirror sites.
 # ALLFILES      - All of ${DISTFILES} and ${PATCHFILES}.  # ALLFILES      - All of ${DISTFILES} and ${PATCHFILES}.
   # MIRROR_DISTFILE   - Whether the distfile is redistributable without restrictions.
   #             Defaults to "yes", set this to "no" if restrictions exist.
 # IGNOREFILES   - If some of the ${ALLFILES} are not checksum-able, set  # IGNOREFILES   - If some of the ${ALLFILES} are not checksum-able, set
 #                 this variable to their names.  #                 this variable to their names.
 # PKGNAME       - Name of the package file to create if the DISTNAME  # PKGNAME       - Name of the package file to create if the DISTNAME
Line 138 
Line 147 
 # NO_WRKDIR     - There's no work directory at all; port does this someplace  # NO_WRKDIR     - There's no work directory at all; port does this someplace
 #                 else.  #                 else.
 # NO_DEPENDS    - Don't verify build of dependencies.  # NO_DEPENDS    - Don't verify build of dependencies.
 # NOCLEANDEPENDS - Don't nuke dependent dirs on make clean.  # NOCLEANDEPENDS - Don't nuke dependent dirs on make clean (Default: yes)
 # BROKEN        - Port is broken.  Set this string to the reason why.  # BROKEN        - Port is broken.  Set this string to the reason why.
 # RESTRICTED    - Port is restricted.  Set this string to the reason why.  # RESTRICTED    - Port is restricted.  Set this string to the reason why.
 # USE_GMAKE     - Says that the port uses gmake.  # USE_GMAKE     - Says that the port uses gmake.
Line 183 
Line 192 
 # LIB_DEPENDS   - A list of "lib:dir" pairs of other ports this package  # LIB_DEPENDS   - A list of "lib:dir" pairs of other ports this package
 #                 depends on.  "lib" is the name of a shared library.  #                 depends on.  "lib" is the name of a shared library.
 #                 make will use "ldconfig -r" to search for the  #                 make will use "ldconfig -r" to search for the
 #                 library.  Note that lib can be any regular expression,  #                 library.  Note that lib can be any regular expression.
 #                 and you need two backslashes in front of dots (.) to  #                 In older versions of this file, you need two backslashes
 #                 supress its special meaning (e.g., use  #                 in front of dots (.) to supress its special meaning (e.g.,
 #                 "foo\\.2\\.:${PORTSDIR}/utils/foo" to match "libfoo.2.*").  #                 use "foo\\.2\\.:${PORTSDIR}/utils/foo" to match "libfoo.2.*").
   #                 No special backslashes are needed to escape regular
   #                 expression metacharacters in OpenBSD, and the old backslash
   #                 escapes are recognised for backwards compatibility.
 # DEPENDS       - A list of other ports this package depends on being  # DEPENDS       - A list of other ports this package depends on being
 #                 made first.  Use this for things that don't fall into  #                 made first.  Use this for things that don't fall into
 #                 the above two categories.  #                 the above two categories.
Line 200 
Line 212 
 #                 (default: none).  #                 (default: none).
 #  #
 # FETCH_CMD       - Full path to ftp/http fetch command if not in $PATH  # FETCH_CMD       - Full path to ftp/http fetch command if not in $PATH
 #                 (default: /usr/bin/fetch).  #                 (default: /usr/bin/ftp).
 # FETCH_BEFORE_ARGS -  # FETCH_BEFORE_ARGS -
 #                 Arguments to ${FETCH_CMD} before filename (default: none).  #                 Arguments to ${FETCH_CMD} before filename (default: none).
 # FETCH_AFTER_ARGS -  # FETCH_AFTER_ARGS -
 #                 Arguments to ${FETCH_CMD} following filename (default: none).  #                 Arguments to ${FETCH_CMD} following filename (default: none).
   # NO_IGNORE     - Set this to YES (most probably in a "make fetch" in
   #                 ${PORTSDIR}) if you want to fetch all distfiles,
   #                 even for packages not built due to limitation by
   #                 absent X or Motif or ONLY_FOR_ARCHS...
   # ALL_TARGET    - The target to pass to make in the package when building.
   #                 (default: "all")
   # INSTALL_TARGET- The target to pass to make in the package when installing.
   #                 (default: "install")
 #  #
 # Motif support:  # Motif support:
 #  #
 # REQUIRES_MOTIF - Set this in your port if it requires Motif.  It will  be  # REQUIRES_MOTIF - Set this in your port if it requires Motif.  It will  be
 #                 built only if HAVE_MOTIF is set.  #                 built only if HAVE_MOTIF is set.
 # HAVE_MOTIF    - If set, means system has Motif.  Typically set in  # HAVE_MOTIF    - If set, means system has Motif.  Typically set in
 #                 /etc/make.conf (FreeBSD,NetBSD) or  #                 /etc/make.conf (FreeBSD) or
 #                 /etc/mk.conf (OpenBSD).  #                 /etc/mk.conf (OpenBSD, NetBSD).
 # MOTIF_STATIC  - If set, link libXm statically; otherwise, link it  # MOTIF_STATIC  - If set, link libXm statically; otherwise, link it
 #                 dynamically.  Typically set in  #                 dynamically.  Typically set in
 #                 /etc/make.conf (FreeBSD,NetBSD) or  #                 /etc/make.conf (FreeBSD) or
 #                 /etc/mk.conf (OpenBSD).  #                 /etc/mk.conf (OpenBSD, NetBSD).
 # MOTIFLIB      - Set automatically to appropriate value depending on  # MOTIFLIB      - Set automatically to appropriate value depending on
 #                 ${MOTIF_STATIC}.  Substitute references to -lXm with  #                 ${MOTIF_STATIC}.  Substitute references to -lXm with
 #                 patches to make your port conform to our standards.  #                 patches to make your port conform to our standards.
Line 235 
Line 255 
 # Variables that serve as convenient "aliases" for your *-install targets.  # Variables that serve as convenient "aliases" for your *-install targets.
 # Use these like: "${INSTALL_PROGRAM} ${WRKSRC}/prog ${PREFIX}/bin".  # Use these like: "${INSTALL_PROGRAM} ${WRKSRC}/prog ${PREFIX}/bin".
 #  #
 # INSTALL_PROGRAM - A command to install binary executables.  # INSTALL_PROGRAM       - A command to install binary executables.
 # INSTALL_SCRIPT - A command to install executable scripts.  # INSTALL_SCRIPT        - A command to install executable scripts.
 # INSTALL_DATA  - A command to install sharable data.  # INSTALL_DATA          - A command to install sharable data.
 # INSTALL_MAN   - A command to install manpages (doesn't compress).  # INSTALL_MAN           - A command to install manpages (doesn't compress).
   # INSTALL_PROGRAM_DIR   - Create a directory for storing programs
   # INSTALL_SCRIPT_DIR    - Create a directory for storing scripts (alias for
   #                         (INSTALL_PROGRAM_DIR)
   # INSTALL_DATA_DIR      - Create a directory for storing arbitrary data
   # INSTALL_MAN_DIR       - Create a directory for storing man pages
 #  #
 # If your port doesn't automatically compress manpages, set the following.  # It is assumed that the port installs manpages uncompressed. If this is
 # Depending on the setting of NOMANCOMPRESS, the make rules will compress  # not the case, set MANCOMPRESSED in the port and define MAN<sect> and
 # the manpages for you.  # CAT<sect> for the compressed pages.  The pages will then be automagically
   # uncompressed.
 #  #
   # MANCOMPRESSED - Indicates that the port installs manpages in a compressed
   #                 form (default: port installs manpages uncompressed).
 # MAN<sect>     - A list of manpages, categorized by section.  For  # MAN<sect>     - A list of manpages, categorized by section.  For
 #                 example, if your port has "man/man1/foo.1" and  #                 example, if your port has "man/man1/foo.1" and
 #                 "man/mann/bar.n", set "MAN1=foo.1" and "MANN=bar.n".  #                 "man/mann/bar.n", set "MAN1=foo.1" and "MANN=bar.n".
 #                 The available sections chars are "123456789LN".  #                 The available sections chars are "123456789LN".
 # MANPREFIX     - The directory prefix for ${MAN<sect>} (default: ${PREFIX}).  # CAT<sect>     - The same as MAN<sect>, only for formatted manpages.
   # MANPREFIX      -The directory prefix for ${MAN<sect>} (default: ${PREFIX}).
   # CATPREFIX     - The directory prefix for ${CAT<sect>} (default: ${PREFIX}).
 #  #
 # Default targets and their behaviors:  # Default targets and their behaviors:
 #  #
Line 263 
Line 293 
 # install       - Install the results of a build.  # install       - Install the results of a build.
 # reinstall     - Install the results of a build, ignoring "already installed"  # reinstall     - Install the results of a build, ignoring "already installed"
 #                 flag.  #                 flag.
   # deinstall     - Remove the installation.  Alias: uninstall
 # plist         - create a file suitable for use as a packing list.  This  # plist         - create a file suitable for use as a packing list.  This
 #                 is for port maintainers.  #                 is for port maintainers.
 # package       - Create a package from an _installed_ port.  # package       - Create a package from an _installed_ port.
Line 273 
Line 304 
 #                 the same file.  #                 the same file.
 # checksum      - Use files/md5 to ensure that your distfiles are valid.  # checksum      - Use files/md5 to ensure that your distfiles are valid.
 # makesum       - Generate files/md5 (only do this for your own ports!).  # makesum       - Generate files/md5 (only do this for your own ports!).
   # readme        - Create a README.html file describing the category or package
   # mirror-distfiles  - Mirror the distfile(s) if they are freely redistributable
   #                 Setting MIRROR_DISTFILE to "no" in the package Makefile
   #                 will override the default "yes", and the distfile will
   #                 not be fetched.
 #  #
 # Default sequence for "all" is:  fetch checksum extract patch configure build  # Default sequence for "all" is:  fetch checksum extract patch configure build
 #  #
Line 284 
Line 320 
 # NEVER override the "regular" targets unless you want to open  # NEVER override the "regular" targets unless you want to open
 # a major can of worms.  # a major can of worms.
   
   # Get the architecture
   ARCH!=  uname -m
   
 # Get the operating system type and version  # Get the operating system type and version
 OPSYS!= uname -s  OPSYS!= uname -s
 OPSYS_VER!= uname -r  OPSYS_VER!= uname -r
   
 # Get the architecture  
 ARCH!=  uname -m  
   
 .if exists(${.CURDIR}/../Makefile.inc)  .if exists(${.CURDIR}/../Makefile.inc)
 .include "${.CURDIR}/../Makefile.inc"  .include "${.CURDIR}/../Makefile.inc"
 .endif  .endif
   
 .if (${OPSYS} == "OpenBSD")  .if (${OPSYS} == "OpenBSD")
   NOCLEANDEPENDS= yes
 NOMANCOMPRESS?= yes  NOMANCOMPRESS?= yes
 DEF_UMASK?=     022  DEF_UMASK?=     022
   .elif (${OPSYS} == "NetBSD")
   DEF_UMASK?=     0022
   NOCLEANDEPENDS= yes
 .else  .else
 DEF_UMASK?=     0022  DEF_UMASK?=     0022
 .endif  .endif
Line 314 
Line 354 
 # tree we are and thus can't go relative.  They can, of course, be overridden  # tree we are and thus can't go relative.  They can, of course, be overridden
 # by individual Makefiles or local system make configuration.  # by individual Makefiles or local system make configuration.
 .if (${OPSYS} == "NetBSD")  .if (${OPSYS} == "NetBSD")
 PORTSDIR?=      /usr/opt  PORTSDIR?=      /usr/pkgsrc
   LOCALBASE?=     ${DESTDIR}/usr/pkg
 .else  .else
 PORTSDIR?=      /usr/ports  PORTSDIR?=      /usr/ports
 .endif  
 LOCALBASE?=     ${DESTDIR}/usr/local  LOCALBASE?=     ${DESTDIR}/usr/local
   .endif
 X11BASE?=       ${DESTDIR}/usr/X11R6  X11BASE?=       ${DESTDIR}/usr/X11R6
 DISTDIR?=       ${PORTSDIR}/distfiles  DISTDIR?=       ${PORTSDIR}/distfiles
 _DISTDIR?=      ${DISTDIR}/${DIST_SUBDIR}  _DISTDIR?=      ${DISTDIR}/${DIST_SUBDIR}
 PACKAGES?=      ${PORTSDIR}/packages  PACKAGES?=      ${PORTSDIR}/packages
 TEMPLATES?=     ${PORTSDIR}/templates  TEMPLATES?=     ${PORTSDIR}/templates
 .if !defined(NO_WRKDIR)  
 .if defined(OBJMACHINE)  
 WRKDIR?=        ${.CURDIR}/work.${MACHINE}  
 .else  
 WRKDIR?=        ${.CURDIR}/work  
 .endif  
 .else  
 WRKDIR?=        ${.CURDIR}  
 .endif  
 .if defined(NO_WRKSUBDIR)  
 WRKSRC?=        ${WRKDIR}  
 .else  
 WRKSRC?=        ${WRKDIR}/${DISTNAME}  
 .endif  
   
 .if defined(WRKOBJDIR)  
 # XXX Is pwd -P available in FreeBSD's /bin/sh?  
 __canonical_PORTSDIR!=  cd ${PORTSDIR}; pwd -P  
 __canonical_CURDIR!=    cd ${.CURDIR}; pwd -P  
 PORTSUBDIR=     ${__canonical_CURDIR:S,${__canonical_PORTSDIR}/,,}  
 .endif  
   
 .if exists(${.CURDIR}/patches.${ARCH}-${OPSYS})  .if exists(${.CURDIR}/patches.${ARCH}-${OPSYS})
 PATCHDIR?=      ${.CURDIR}/patches.${ARCH}-${OPSYS}  PATCHDIR?=      ${.CURDIR}/patches.${ARCH}-${OPSYS}
 .elif exists(${.CURDIR}/patches.${OPSYS})  .elif exists(${.CURDIR}/patches.${OPSYS})
Line 397 
Line 417 
 RUN_DEPENDS+=   ${EXEC_DEPENDS}  RUN_DEPENDS+=   ${EXEC_DEPENDS}
 .endif  .endif
 .if defined(USE_GMAKE)  .if defined(USE_GMAKE)
 BUILD_DEPENDS+=     gmake:${PORTSDIR}/devel/gmake  BUILD_DEPENDS+=     ${GMAKE}:${PORTSDIR}/devel/gmake
   MAKE_PROGRAM=       ${GMAKE}
   .else
   MAKE_PROGRAM=       ${MAKE}
 .endif  .endif
   
 # OpenBSD has perl5 in-tree  # OpenBSD has perl5 in-tree
   #
 #.if defined(USE_PERL5)  #.if defined(USE_PERL5)
 #BUILD_DEPENDS+=        perl5.00401:${PORTSDIR}/lang/perl5  #BUILD_DEPENDS+=        perl5.00404:${PORTSDIR}/lang/perl5
 #RUN_DEPENDS+=      perl5.00401:${PORTSDIR}/lang/perl5  #RUN_DEPENDS+=      perl5.00404:${PORTSDIR}/lang/perl5
 #.endif  #.endif
   
 .if exists(${PORTSDIR}/../Makefile.inc)  .if exists(${PORTSDIR}/../Makefile.inc)
Line 419 
Line 444 
 PATCH_COOKIE?=      ${WRKDIR}/.patch_done  PATCH_COOKIE?=      ${WRKDIR}/.patch_done
 PACKAGE_COOKIE?=    ${WRKDIR}/.package_done  PACKAGE_COOKIE?=    ${WRKDIR}/.package_done
   
 # How to do nothing.  Override if you, for some strange reason, would rather  
 # do something.  
 DO_NADA?=       /usr/bin/true  
   
 # Miscellaneous overridable commands:  # Miscellaneous overridable commands:
 GMAKE?=         gmake  GMAKE?=         gmake
 XMKMF?=         xmkmf -a  XMKMF?=         xmkmf -a
Line 439 
Line 460 
   
 MAKE_FLAGS?=    -f  MAKE_FLAGS?=    -f
 MAKEFILE?=      Makefile  MAKEFILE?=      Makefile
 MAKE_ENV+=      PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} MOTIFLIB="${MOTIFLIB}" CFLAGS="${CFLAGS}"  MAKE_ENV+=      PATH=${PATH}:${LOCALBASE}/bin:${X11BASE}/bin PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} MOTIFLIB="${MOTIFLIB}" CFLAGS="${CFLAGS}"
   
 .if exists(/usr/bin/fetch)  .if exists(/usr/bin/fetch)
 FETCH_CMD?=     /usr/bin/fetch  FETCH_CMD?=     /usr/bin/fetch
Line 447 
Line 468 
 FETCH_CMD?=     /usr/bin/ftp  FETCH_CMD?=     /usr/bin/ftp
 .endif  .endif
   
   # By default, distfiles have no restrictions placed on them
   MIRROR_DISTFILE?=   yes
   
 TOUCH?=         /usr/bin/touch  TOUCH?=         /usr/bin/touch
 TOUCH_FLAGS?=   -f  TOUCH_FLAGS?=   -f
   
Line 477 
Line 501 
 .else  .else
 EXTRACT_CMD?=   /usr/bin/tar  EXTRACT_CMD?=   /usr/bin/tar
 .endif  .endif
 EXTRACT_SUFX?=  .tar.gz  
 # Backwards compatability.  # Backwards compatability.
 .if defined(EXTRACT_ARGS)  .if defined(EXTRACT_ARGS)
 EXTRACT_BEFORE_ARGS?=   ${EXTRACT_ARGS}  EXTRACT_BEFORE_ARGS?=   ${EXTRACT_ARGS}
 .else  .else
 EXTRACT_BEFORE_ARGS?=   -xzf  EXTRACT_BEFORE_ARGS?=   -xzf
 .endif  .endif
   EXTRACT_SUFX?=  .tar.gz
   
 # Figure out where the local mtree file is  # Figure out where the local mtree file is
 .if !defined(MTREE_FILE)  .if !defined(MTREE_FILE)
 .if defined(USE_IMAKE) || defined(USE_X11)  .if defined(USE_IMAKE) || defined(USE_X11)
 MTREE_FILE= /etc/mtree/BSD.x11.dist  MTREE_FILE= /etc/mtree/BSD.x11.dist
 .else  .else
   .if (${OPSYS} == "NetBSD")
   MTREE_FILE= /etc/mtree/BSD.pkg.dist
   .else
 MTREE_FILE= /etc/mtree/BSD.local.dist  MTREE_FILE= /etc/mtree/BSD.local.dist
 .endif  .endif
 .endif  .endif
   .endif
 MTREE_CMD?= /usr/sbin/mtree  MTREE_CMD?= /usr/sbin/mtree
 MTREE_ARGS?=    -U -f ${MTREE_FILE} -d -e -q -p  MTREE_ARGS?=    -U -f ${MTREE_FILE} -d -e -q -p
   
 .if (${OPSYS} == "OpenBSD")  .if (${OPSYS} == "OpenBSD")
 .include <bsd.own.mk>  .include <bsd.own.mk>
 MAKE_ENV+=  EXTRA_SYS_MK_INCLUDES="<bsd.own.mk>"  MAKE_ENV+=  EXTRA_SYS_MK_INCLUDES="<bsd.own.mk>"
   .elif (${OPSYS} == "NetBSD")
   NEED_OWN_INSTALL_TARGET=    no
   .include <bsd.own.mk>
   SHAREOWN = ${DOCOWN}
   SHAREGRP = ${DOCGRP}
   SHAREMODE = ${DOCMODE}
 .endif  .endif
   
   .if !defined(NO_WRKDIR)
   .if defined(OBJMACHINE)
   WRKDIR?=        ${.CURDIR}/work.${MACHINE_ARCH}
   .else
   WRKDIR?=        ${.CURDIR}/work
   .endif
   .else
   WRKDIR?=        ${.CURDIR}
   .endif
   .if defined(NO_WRKSUBDIR)
   WRKSRC?=        ${WRKDIR}
   .else
   WRKSRC?=        ${WRKDIR}/${DISTNAME}
   .endif
   
   .if defined(WRKOBJDIR)
   # XXX Is pwd -P available in FreeBSD's /bin/sh?
   __canonical_PORTSDIR!=  cd ${PORTSDIR}; pwd -P
   __canonical_CURDIR!=    cd ${.CURDIR}; pwd -P
   PORTSUBDIR=     ${__canonical_CURDIR:S,${__canonical_PORTSDIR}/,,}
   .endif
   
 # A few aliases for *-install targets  # A few aliases for *-install targets
 INSTALL_PROGRAM= \  INSTALL_PROGRAM= \
     ${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}      ${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
Line 510 
Line 566 
     ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}      ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}
 INSTALL_MAN= \  INSTALL_MAN= \
     ${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}      ${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
   INSTALL_PROGRAM_DIR= \
       ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
   INSTALL_SCRIPT_DIR= \
       ${INSTALL_PROGRAM_DIR}
   INSTALL_DATA_DIR= \
       ${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${BINMODE}
   INSTALL_MAN_DIR= \
       ${INSTALL} -d -o ${MANOWN} -g ${MANGRP} -m ${BINMODE}
   
 INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \  INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
             BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \              BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
             BSD_INSTALL_DATA="${INSTALL_DATA}" \              BSD_INSTALL_DATA="${INSTALL_DATA}" \
             BSD_INSTALL_MAN="${INSTALL_MAN}"              BSD_INSTALL_MAN="${INSTALL_MAN}" \
               BSD_INSTALL_PROGRAM_DIR="${INSTALL_PROGRAM_DIR}" \
               BSD_INSTALL_SCRIPT_DIR="${INSTALL_SCRIPT_DIR}" \
               BSD_INSTALL_DATA_DIR="${INSTALL_DATA_DIR}" \
               BSD_INSTALL_MAN_DIR="${INSTALL_MAN_DIR}"
 MAKE_ENV+=  ${INSTALL_MACROS}  MAKE_ENV+=  ${INSTALL_MACROS}
 SCRIPTS_ENV+=   ${INSTALL_MACROS}  SCRIPTS_ENV+=   ${INSTALL_MACROS}
   
Line 573 
Line 641 
 DIRNAME?=   /usr/bin/dirname  DIRNAME?=   /usr/bin/dirname
 ECHO?=      /bin/echo  ECHO?=      /bin/echo
 FALSE?=     /usr/bin/false  FALSE?=     /usr/bin/false
   FILE?=      /usr/bin/file
 GREP?=      /usr/bin/grep  GREP?=      /usr/bin/grep
 GUNZIP_CMD?=    /usr/bin/gunzip -f  GUNZIP_CMD?=    /usr/bin/gunzip -f
 GZCAT?=     /usr/bin/gzcat  GZCAT?=     /usr/bin/gzcat
Line 586 
Line 655 
 RM?=        /bin/rm  RM?=        /bin/rm
 RMDIR?=     /bin/rmdir  RMDIR?=     /bin/rmdir
 SED?=       /usr/bin/sed  SED?=       /usr/bin/sed
 PORTSPATH?= ${PATH}:${X11BASE}/bin:${LOCALBASE}/bin  SETENV?=    /usr/bin/env
 SETENV?=    /usr/bin/env PATH=${PORTSPATH}  
 SH?=        /bin/sh  SH?=        /bin/sh
 TR?=        /usr/bin/tr  TR?=        /usr/bin/tr
   TRUE?=      /usr/bin/true
   
 # Used to print all the '===>' style prompts - override this to turn them off.  # Used to print all the '===>' style prompts - override this to turn them off.
 ECHO_MSG?=      ${ECHO}  ECHO_MSG?=      ${ECHO}
   
   # How to do nothing.  Override if you, for some strange reason, would rather
   # do something.
   DO_NADA?=       ${TRUE}
   
 ALL_TARGET?=        all  ALL_TARGET?=        all
 INSTALL_TARGET?=    install  INSTALL_TARGET?=    install
   
   .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)
   INSTALL_TARGET+=    install.man
   .endif
   
 # Popular master sites  # Popular master sites
 MASTER_SITE_XCONTRIB+=  \  MASTER_SITE_XCONTRIB+=  \
     ftp://crl.dec.com/pub/X11/contrib/%SUBDIR%/ \      ftp://crl.dec.com/pub/X11/contrib/%SUBDIR%/ \
     ftp://ftp.eu.net/X11/contrib/%SUBDIR%/      ftp://ftp.eu.net/X11/contrib/%SUBDIR%/ \
       ftp://ftp.uni-paderborn.de/pub/X11/contrib/%SUBDIR%/ \
       ftp://ftp.x.org/contrib/%SUBDIR%/
   
 MASTER_SITE_GNU+=   \  MASTER_SITE_GNU+=   \
     ftp://prep.ai.mit.edu/pub/gnu/%SUBDIR%/ \      ftp://prep.ai.mit.edu/pub/gnu/%SUBDIR%/ \
Line 662 
Line 741 
 # ;;; This is referenced in a few Makefiles -- I'd like to get rid of it  # ;;; This is referenced in a few Makefiles -- I'd like to get rid of it
 #  #
 MASTER_SITE_LOCAL?= \  MASTER_SITE_LOCAL?= \
       ftp://ftp.netbsd.org/pub/NetBSD/packages/distfiles/LOCAL_PORTS/ \
     ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/LOCAL_PORTS/      ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/LOCAL_PORTS/
   
 # I guess we're in the master distribution business! :)  As we gain mirror  # I guess we're in the master distribution business! :)  As we gain mirror
Line 720 
Line 800 
         done; \          done; \
         if [ "$$ignore" = 0 ]; then \          if [ "$$ignore" = 0 ]; then \
             echo "$$file"; \              echo "$$file"; \
           else \
               echo ""; \
         fi; \          fi; \
     done      done
 .else  .else
Line 740 
Line 822 
 EXTRACT_ONLY?=  ${DISTFILES}  EXTRACT_ONLY?=  ${DISTFILES}
   
 # Documentation  # Documentation
   .if (${OPSYS} == "OpenBSD")
   MAINTAINER?=    ports@OpenBSD.ORG
   .elif (${OPSYS} == "NetBSD")
   MAINTAINER?=    packages@NetBSD.ORG
   .else
 MAINTAINER?=    ports@FreeBSD.ORG  MAINTAINER?=    ports@FreeBSD.ORG
   .endif
   
 .if !defined(CATEGORIES)  .if !defined(CATEGORIES)
 .BEGIN:  .BEGIN:
Line 759 
Line 847 
 .endif  .endif
   
 CONFIGURE_SCRIPT?=  configure  CONFIGURE_SCRIPT?=  configure
   CONFIGURE_ENV+=     PATH=${PATH}:${LOCALBASE}/bin:${X11BASE}/bin
   
 .if defined(GNU_CONFIGURE)  .if defined(GNU_CONFIGURE)
 CONFIGURE_ARGS+=    --prefix=${PREFIX}  CONFIGURE_ARGS+=    --prefix=${PREFIX}
Line 766 
Line 855 
 .endif  .endif
   
 # Passed to most of script invocations  # Passed to most of script invocations
 SCRIPTS_ENV+=   CURDIR=${.CURDIR} DISTDIR=${DISTDIR} \  SCRIPTS_ENV+= CURDIR=${.CURDIR} DISTDIR=${DISTDIR} \
             PATH=${PATH}:${LOCALBASE}/bin:${X11BASE}/bin \
           WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \            WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} \
           SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \            SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
           PORTSDIR=${PORTSDIR} DEPENDS="${DEPENDS}" \            PORTSDIR=${PORTSDIR} DEPENDS="${DEPENDS}" \
Line 777 
Line 867 
 .endif  .endif
   
 MANPREFIX?= ${PREFIX}  MANPREFIX?= ${PREFIX}
   CATPREFIX?= ${PREFIX}
   
 .for sect in 1 2 3 4 5 6 7 8 9  .for sect in 1 2 3 4 5 6 7 8 9
 MAN${sect}PREFIX?=  ${MANPREFIX}  MAN${sect}PREFIX?=  ${MANPREFIX}
   CAT${sect}PREFIX?=  ${CATPREFIX}
 .endfor  .endfor
 MANLPREFIX?=    ${MANPREFIX}  MANLPREFIX?=    ${MANPREFIX}
 MANNPREFIX?=    ${MANPREFIX}  MANNPREFIX?=    ${MANPREFIX}
   CATLPREFIX?=    ${CATPREFIX}
   CATNPREFIX?=    ${CATPREFIX}
   
 MANLANG?=   ""  # english only by default  MANLANG?=   ""  # english only by default
   
Line 792 
Line 886 
 .if defined(MAN${sect})  .if defined(MAN${sect})
 _MANPAGES+= ${MAN${sect}:S%^%${MAN${sect}PREFIX}/man/${lang}/man${sect}/%}  _MANPAGES+= ${MAN${sect}:S%^%${MAN${sect}PREFIX}/man/${lang}/man${sect}/%}
 .endif  .endif
   .if defined(CAT${sect})
   _CATPAGES+= ${CAT${sect}:S%^%${CAT${sect}PREFIX}/man/${lang}/cat${sect}/%}
   .endif
 .endfor  .endfor
   
 .if defined(MANL)  .if defined(MANL)
Line 802 
Line 899 
 _MANPAGES+= ${MANN:S%^%${MANNPREFIX}/man/${lang}/mann/%}  _MANPAGES+= ${MANN:S%^%${MANNPREFIX}/man/${lang}/mann/%}
 .endif  .endif
   
 .endfor  .if defined(CATL)
   _CATPAGES+= ${CATL:S%^%${CATLPREFIX}/man/${lang}/catl/%}
   .endif
   
 .if defined(_MANPAGES) && defined(MANCOMPRESSED)  .if defined(CATN)
 _MANPAGES:= ${_MANPAGES:S/$/.gz/}  _CATPAGES+= ${CATN:S%^%${CATNPREFIX}/man/${lang}/catn/%}
 .endif  .endif
   
   .endfor
   
 .MAIN: all  .MAIN: all
   
 ################################################################  ################################################################
Line 852 
Line 953 
 IGNORE= "is marked as broken: ${BROKEN}"  IGNORE= "is marked as broken: ${BROKEN}"
 .elif defined(ONLY_FOR_ARCHS)  .elif defined(ONLY_FOR_ARCHS)
 .for __ARCH in ${ONLY_FOR_ARCHS}  .for __ARCH in ${ONLY_FOR_ARCHS}
 .if ( ${MACHINE} == "${__ARCH}" || ${MACHINE_ARCH} == "${__ARCH}" )  .if ${MACHINE_ARCH} == "${__ARCH}"
 __ARCH_OK=  1  __ARCH_OK=  1
 .endif  .endif
 .endfor  .endfor
 .if !defined(__ARCH_OK)  .if !defined(__ARCH_OK)
 .if ( ${MACHINE} != ${MACHINE_ARCH} )  IGNORE= "is only for ${ONLY_FOR_ARCHS}, not ${MACHINE_ARCH}"
 IGNORE= "is only for ${ONLY_FOR_ARCHS}, not ${MACHINE} \(${MACHINE_ARCH}\)"  
 .else  
 IGNORE= "is only for ${ONLY_FOR_ARCHS}, not ${MACHINE}"  
 .endif  .endif
 .endif  
 .elif defined(COMES_WITH)  .elif defined(COMES_WITH)
 .if ( ${OPSYS_VER} >= ${COMES_WITH} )  .if ( ${OPSYS_VER} >= ${COMES_WITH} )
 IGNORE= "-- ${PKGNAME:C/-[0-9].*//g} comes with ${OPSYS} as of release ${COMES_WITH}"  IGNORE= "-- ${PKGNAME:C/-[0-9].*//g} comes with ${OPSYS} as of release ${COMES_WITH}"
Line 891 
Line 988 
     @${IGNORECMD}      @${IGNORECMD}
 install:  install:
     @${IGNORECMD}      @${IGNORECMD}
   uninstall deinstall:
       @${IGNORECMD}
 package:  package:
     @${IGNORECMD}      @${IGNORECMD}
 .endif  .endif # IGNORE
 .endif  .endif # !NO_IGNORE
   
 .if defined(ALL_HOOK)  .if defined(ALL_HOOK)
 all:  all:
Line 1048 
Line 1147 
 .endif  .endif
 .endif  .endif
   
   # This is for the use of sites which store distfiles which others may
   # fetch - only fetch the distfile if it is allowed to be
   # re-distributed freely
   mirror-distfiles:
   .if (${MIRROR_DISTFILE} == "yes")
       @make fetch __ARCH_OK=yes NO_IGNORE=yes
   .endif
   
 # Extract  # Extract
   
 .if !target(do-extract)  .if !target(do-extract)
Line 1055 
Line 1162 
 .if !defined(NO_WRKDIR)  .if !defined(NO_WRKDIR)
 .if defined(WRKOBJDIR)  .if defined(WRKOBJDIR)
     @${RM} -rf ${WRKOBJDIR}/${PORTSUBDIR}      @${RM} -rf ${WRKOBJDIR}/${PORTSUBDIR}
     @${MKDIR} ${WRKOBJDIR}/${PORTSUBDIR}      @${MKDIR} -p ${WRKOBJDIR}/${PORTSUBDIR}
     @if [ ! -L ${WRKDIR} ] || \      @if [ ! -L ${WRKDIR} ] || \
       [ X`${READLINK} ${WRKDIR}` != X${WRKOBJDIR}/${PORTSUBDIR} ]; then \        [ X`${READLINK} ${WRKDIR}` != X${WRKOBJDIR}/${PORTSUBDIR} ]; then \
         echo "${WRKDIR} -> ${WRKOBJDIR}/${PORTSUBDIR}"; \          echo "${WRKDIR} -> ${WRKOBJDIR}/${PORTSUBDIR}"; \
Line 1136 
Line 1243 
         ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS})          ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS})
 .endif  .endif
 .if defined(USE_IMAKE)  .if defined(USE_IMAKE)
     @(cd ${WRKSRC} && ${SETENV} ${XMKMF})      @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${XMKMF})
 .endif  .endif
 .endif  .endif
   
Line 1144 
Line 1251 
   
 .if !target(do-build)  .if !target(do-build)
 do-build:  do-build:
 .if defined(USE_GMAKE)      @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} ${MAKEFILE} ${ALL_TARGET})
     @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${ALL_TARGET})  
 .else defined(USE_GMAKE)  
     @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${ALL_TARGET})  
 .endif  .endif
 .endif  
   
 # Install  # Install
   
 .if !target(do-install)  .if !target(do-install)
 do-install:  do-install:
 .if defined(USE_GMAKE)      @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET})
     @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET})  
 .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)  
     @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} install.man)  
 .endif  .endif
 .else defined(USE_GMAKE)  
     @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET})  
 .if defined(USE_IMAKE) && !defined(NO_INSTALL_MANPAGES)  
     @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} install.man)  
 .endif  
 .endif  
 .endif  
   
 # Package  # Package
   
Line 1236 
Line 1329 
 .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)  .if !defined(NO_PKG_REGISTER) && !defined(FORCE_PKG_REGISTER)
     @if [ -d ${PKG_DBDIR}/${PKGNAME} -o "X$$(ls -d ${PKG_DBDIR}/${PKGNAME:C/-[0-9].*//g}-* 2> /dev/null)" != "X" ]; then \      @if [ -d ${PKG_DBDIR}/${PKGNAME} -o "X$$(ls -d ${PKG_DBDIR}/${PKGNAME:C/-[0-9].*//g}-* 2> /dev/null)" != "X" ]; then \
         ${ECHO_MSG} "===>  ${PKGNAME} is already installed - perhaps an older version?"; \          ${ECHO_MSG} "===>  ${PKGNAME} is already installed - perhaps an older version?"; \
         ${ECHO_MSG} "      If so, you may wish to \`\`pkg_delete ${PKGNAME}'' and install"; \          ${ECHO_MSG} "      If so, you may wish to \`\`make deinstall'' and install"; \
         ${ECHO_MSG} "      this port again by \`\`make reinstall'' to upgrade it properly."; \          ${ECHO_MSG} "      this port again by \`\`make reinstall'' to upgrade it properly."; \
         ${ECHO_MSG} "      If you really wish to overwrite the old port of ${PKGNAME}"; \          ${ECHO_MSG} "      If you really wish to overwrite the old port of ${PKGNAME}"; \
         ${ECHO_MSG} "      without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \          ${ECHO_MSG} "      without deleting it first, set the variable \"FORCE_PKG_REGISTER\""; \
Line 1259 
Line 1352 
             ${ECHO_MSG} "Copy it from a suitable location (e.g., /usr/src/etc/mtree) and try again."; \              ${ECHO_MSG} "Copy it from a suitable location (e.g., /usr/src/etc/mtree) and try again."; \
             exit 1; \              exit 1; \
         else \          else \
               if [ ! -d ${PREFIX} ]; then \
                   mkdir -p ${PREFIX}; \
               fi; \
             ${MTREE_CMD} ${MTREE_ARGS} ${PREFIX}/; \              ${MTREE_CMD} ${MTREE_ARGS} ${PREFIX}/; \
         fi; \          fi; \
     else \      else \
Line 1278 
Line 1374 
         cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \          cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
             ${SCRIPTDIR}/${.TARGET:S/^real-/post-/}; \              ${SCRIPTDIR}/${.TARGET:S/^real-/post-/}; \
     fi      fi
 .if make(real-install) && defined(_MANPAGES)  .if make(real-install) && (defined(_MANPAGES) || defined(_CATPAGES))
 .if defined(MANCOMPRESSED) && defined(NOMANCOMPRESS)  .if defined(MANCOMPRESSED) && defined(NOMANCOMPRESS)
     @${ECHO_MSG} "===>   Uncompressing manual pages for ${PKGNAME}"      @${ECHO_MSG} "===>   Uncompressing manual pages for ${PKGNAME}"
 .for manpage in ${_MANPAGES}  .for manpage in ${_MANPAGES} ${_CATPAGES}
     @${GUNZIP_CMD} ${manpage}      @${GUNZIP_CMD} ${manpage}.gz
 .endfor  .endfor
 .elif !defined(MANCOMPRESSED) && !defined(NOMANCOMPRESS)  .elif !defined(MANCOMPRESSED) && !defined(NOMANCOMPRESS)
     @${ECHO_MSG} "===>   Compressing manual pages for ${PKGNAME}"      @${ECHO_MSG} "===>   Compressing manual pages for ${PKGNAME}"
 .for manpage in ${_MANPAGES}  .for manpage in ${_MANPAGES} ${_CATPAGES}
     @${GZIP_CMD} ${manpage}      @if [ -L ${manpage} ]; then \
           set - `${FILE} ${manpage}`; \
           shift `expr $$# - 1`; \
           ${LN} -sf $${1}.gz ${manpage}.gz; \
           ${RM} ${manpage}; \
       else \
           ${GZIP_CMD} ${manpage}; \
       fi
 .endfor  .endfor
 .endif  .endif
 .endif  .endif
Line 1403 
Line 1506 
     @DEPENDS_TARGET=${DEPENDS_TARGET} ${MAKE} install      @DEPENDS_TARGET=${DEPENDS_TARGET} ${MAKE} install
 .endif  .endif
   
   # Deinstall
   #
   # Special target to remove installation
   
   .if !target(deinstall)
   uninstall deinstall:
       @${ECHO_MSG} "===> Deinstalling for ${PKGNAME}"
       @pkg_delete -f ${PKGNAME}
       @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE}
   .endif
   
   
 ################################################################  ################################################################
 # Some more targets supplied for users' convenience  # Some more targets supplied for users' convenience
 ################################################################  ################################################################
Line 1421 
Line 1536 
 .endif  .endif
     @${ECHO_MSG} "===>  Cleaning for ${PKGNAME}"      @${ECHO_MSG} "===>  Cleaning for ${PKGNAME}"
 .if !defined(NO_WRKDIR)  .if !defined(NO_WRKDIR)
   .if  defined(WRKOBJDIR)
       @${RM} -rf ${WRKOBJDIR}/${PORTSUBDIR}
       @${RM} -f ${WRKDIR}
   .else
     @if [ -d ${WRKDIR} ]; then \      @if [ -d ${WRKDIR} ]; then \
         if [ -w ${WRKDIR} ]; then \          if [ -w ${WRKDIR} ]; then \
             ${RM} -rf ${WRKDIR}; \              ${RM} -rf ${WRKDIR}; \
Line 1428 
Line 1547 
             ${ECHO_MSG} "===>   ${WRKDIR} not writable, skipping"; \              ${ECHO_MSG} "===>   ${WRKDIR} not writable, skipping"; \
         fi; \          fi; \
     fi      fi
   .endif
 .else  .else
     @${RM} -f ${WRKDIR}/.*_done      @${RM} -f ${WRKDIR}/.*_done
 .endif  .endif
Line 1452 
Line 1572 
   
 # Prints out a list of files to fetch (useful to do a batch fetch)  # Prints out a list of files to fetch (useful to do a batch fetch)
   
   # are we called from bsd.port.subdir.mk (i.e. do we scan all dirs anyways)? XXX
   .ifdef(DIRPRFX)
   RECURSIVE_FETCH_LIST?=  NO
   .else
   RECURSIVE_FETCH_LIST?=  YES
   .endif
   
 .if !target(fetch-list)  .if !target(fetch-list)
 fetch-list:  fetch-list:
       @${MAKE} fetch-list-recursive RECURSIVE_FETCH_LIST=${RECURSIVE_FETCH_LIST} | sort -u
   .endif # !target(fetch-list)
   
   .if !target(fetch-list-recursive)
   fetch-list-recursive:
       @${MAKE} fetch-list-one-pkg
   .if ${RECURSIVE_FETCH_LIST} != "NO"
       @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}  ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
           (cd $$dir; ${MAKE} fetch-list-recursive; ); \
       done
   .endif # ${RECURSIVE_FETCH_LIST} != "NO"
   .endif # !target(fetch-list-recursive)
   
   .if !target(fetch-list-one-pkg)
   fetch-list-one-pkg:
     @${MKDIR} ${_DISTDIR}      @${MKDIR} ${_DISTDIR}
       @[ -z "${_DISTDIR}" ] || ${ECHO} "${MKDIR} ${_DISTDIR}"
     @(cd ${_DISTDIR}; \      @(cd ${_DISTDIR}; \
      for file in ${DISTFILES}; do \       for file in ${DISTFILES}; do \
         if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \          if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
             for site in ${MASTER_SITES}; do \              ${ECHO} -n "cd ${_DISTDIR} && [ -f $$file -o -f `${BASENAME} $$file` ] || " ; \
                 ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '||' ; \              for site in ${MASTER_SITES} ; do \
                     break; \                  ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '|| ' ; \
             done; \              done; \
             ${ECHO} "echo $${file} not fetched" ; \              ${ECHO} "echo $${file} not fetched" ; \
         fi \          fi \
Line 1469 
Line 1612 
     @(cd ${_DISTDIR}; \      @(cd ${_DISTDIR}; \
      for file in ${PATCHFILES}; do \       for file in ${PATCHFILES}; do \
         if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \          if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
               ${ECHO} -n "cd ${_DISTDIR} && [ -f $$file -o -f `${BASENAME} $$file` ] || " ; \
             for site in ${PATCH_SITES}; do \              for site in ${PATCH_SITES}; do \
                 ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '||' ; \                  ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '|| ' ; \
                     break; \  
             done; \              done; \
             ${ECHO} "echo $${file} not fetched" ; \              ${ECHO} "echo $${file} not fetched" ; \
         fi \          fi \
      done)      done)
 .endif  .endif # defined(PATCHFILES)
 .endif  .endif # !target(fetch-list-one-pkg)
   
 # Checksumming utilities  # Checksumming utilities
   
Line 1579 
Line 1722 
 # You probably won't need to touch these  # You probably won't need to touch these
 ################################################################  ################################################################
   
   HTMLIFY=    ${SED} -e 's/&/\&amp;/g' -e 's/>/\&gt;/g' -e 's/</\&lt;/g'
   
   # Set to YES by the README.html target (and passed via depends-list
   # and package-depends)
   .ifndef PACKAGE_NAME_AS_LINK
   PACKAGE_NAME_AS_LINK=NO
   .endif # PACKAGE_NAME_AS_LINK
   
   
 # Nobody should want to override this unless PKGNAME is simply bogus.  # Nobody should want to override this unless PKGNAME is simply bogus.
   
 .if !target(package-name)  .if !target(package-name)
 package-name:  package-name:
     @${ECHO} ${PKGNAME}  .if (${PACKAGE_NAME_AS_LINK} == "YES")
       @${ECHO} '<A HREF="../../'`${MAKE} package-path | ${HTMLIFY}`'/README.html">'`echo ${PKGNAME} | ${HTMLIFY}`'</A>'
   .else
       @${ECHO} '${PKGNAME}'
   .endif # PACKAGE_NAME_AS_LINK != ""
   .endif # !target(package-name)
   
   .if !target(package-path)
   package-path:
       @pwd | sed s@`cd ${PORTSDIR} ; pwd`/@@g
 .endif  .endif
   
 # Show (recursively) all the packages this package depends on.  # Show (recursively) all the packages this package depends on.
Line 1592 
Line 1753 
 package-depends:  package-depends:
     @for dir in `${ECHO} ${LIB_DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \      @for dir in `${ECHO} ${LIB_DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
         if [ -d $$dir ]; then \          if [ -d $$dir ]; then \
             (cd $$dir ; ${MAKE} package-name package-depends); \              (cd $$dir ; ${MAKE} package-name package-depends PACKAGE_NAME_AS_LINK=${PACKAGE_NAME_AS_LINK}); \
         else \          else \
             ${ECHO_MSG} "Warning: \"$$dir\" non-existent -- @pkgdep registration incomplete" >&2; \              ${ECHO_MSG} "Warning: \"$$dir\" non-existent -- @pkgdep registration incomplete" >&2; \
         fi; \          fi; \
Line 1641 
Line 1802 
 _DEPENDS_USE:   .USE  _DEPENDS_USE:   .USE
 .if defined(DEPENDS_TMP)  .if defined(DEPENDS_TMP)
 .if !defined(NO_DEPENDS)  .if !defined(NO_DEPENDS)
     @PATH=${PORTSPATH}; for i in ${DEPENDS_TMP}; do \      @for i in ${DEPENDS_TMP}; do \
         prog=`${ECHO} $$i | ${SED} -e 's/:.*//'`; \          prog=`${ECHO} $$i | ${SED} -e 's/:.*//'`; \
         dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \          dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \
         if expr "$$dir" : '.*:' > /dev/null; then \          if expr "$$dir" : '.*:' > /dev/null; then \
Line 1650 
Line 1811 
         else \          else \
             target=${DEPENDS_TARGET}; \              target=${DEPENDS_TARGET}; \
         fi; \          fi; \
           found=not; \
         if expr "$$prog" : \\/ >/dev/null; then \          if expr "$$prog" : \\/ >/dev/null; then \
             if [ -e "$$prog" ]; then \              if [ -e "$$prog" ]; then \
                 ${ECHO_MSG} "===>  ${PKGNAME} depends on file: $$prog - found"; \                  ${ECHO_MSG} "===>  ${PKGNAME} depends on file: $$prog - found"; \
                 notfound=0; \                  found=""; \
             else \              else \
                 ${ECHO_MSG} "===>  ${PKGNAME} depends on file: $$prog - not found"; \                  ${ECHO_MSG} "===>  ${PKGNAME} depends on file: $$prog - not found"; \
                 notfound=1; \  
             fi; \              fi; \
         else \          else \
             if which "$$prog" > /dev/null 2>&1 ; then \              for d in `echo $$PATH | tr ':' ' '`; do \
                 ${ECHO_MSG} "===>  ${PKGNAME} depends on executable: $$prog - found"; \                  if [ -x $$d/$$prog ]; then \
                 notfound=0; \                      found="$$d/$$prog"; \
             else \                      break; \
                 ${ECHO_MSG} "===>  ${PKGNAME} depends on executable: $$prog - not found"; \                  fi \
                 notfound=1; \              done; \
             fi; \              ${ECHO_MSG} "===>  ${PKGNAME} depends on executable: $$prog - $$found found"; \
         fi; \          fi; \
         if [ $$notfound != 0 ]; then \          if [ X"$$found" = Xnot ]; then \
             ${ECHO_MSG} "===>  Verifying $$target for $$prog in $$dir"; \              ${ECHO_MSG} "===>  Verifying $$target for $$prog in $$dir"; \
             if [ ! -d "$$dir" ]; then \              if [ ! -d "$$dir" ]; then \
                 ${ECHO_MSG} ">> No directory for $$prog.  Skipping.."; \                  ${ECHO_MSG} ">> No directory for $$prog.  Skipping.."; \
Line 1691 
Line 1852 
 .if !defined(NO_DEPENDS)  .if !defined(NO_DEPENDS)
 .if (${MACHINE_ARCH} == "alpha")  .if (${MACHINE_ARCH} == "alpha")
     @for i in ${LIB_DEPENDS}; do \      @for i in ${LIB_DEPENDS}; do \
         lib=`${ECHO} $$i | ${SED} -e 's/\\\.[0-9][0-9]*\\\.[0-9]*:.*//'`; \          lib=`${ECHO} $$i | ${SED} -e 's/:.*//' -e 's|\([^\\]\)\.|\1\\\\.|g'`; \
         dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \          dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \
         if expr "$$dir" : '.*:' > /dev/null; then \          if expr "$$dir" : '.*:' > /dev/null; then \
             target=`${ECHO} $$dir | ${SED} -e 's/.*://'`; \              target=`${ECHO} $$dir | ${SED} -e 's/.*://'`; \
Line 1716 
Line 1877 
     done      done
 .else  .else
     @for i in ${LIB_DEPENDS}; do \      @for i in ${LIB_DEPENDS}; do \
         lib=`${ECHO} $$i | ${SED} -e 's/:.*//'`; \          lib=`${ECHO} $$i | ${SED} -e 's/:.*//' -e 's|\([^\\]\)\.|\1\\\\.|g'`; \
         dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \          dir=`${ECHO} $$i | ${SED} -e 's/[^:]*://'`; \
         if expr "$$dir" : '.*:' > /dev/null; then \          if expr "$$dir" : '.*:' > /dev/null; then \
             target=`${ECHO} $$dir | ${SED} -e 's/.*://'`; \              target=`${ECHO} $$dir | ${SED} -e 's/.*://'`; \
Line 1724 
Line 1885 
         else \          else \
             target=${DEPENDS_TARGET}; \              target=${DEPENDS_TARGET}; \
         fi; \          fi; \
         if /sbin/ldconfig -r | ${GREP} -q -e "-l$$lib"; then \          libname=`${ECHO} $$lib | ${SED} -e 's|\\\\||g'`; \
             ${ECHO_MSG} "===>  ${PKGNAME} depends on shared library: $$lib - found"; \          reallib=`${LDCONFIG} -r | ${GREP} -e "-l$$lib" | awk '{ print $$3 }'`; \
         else \          if [ "X$$reallib" = X"" ]; then \
             ${ECHO_MSG} "===>  ${PKGNAME} depends on shared library: $$lib - not found"; \              ${ECHO_MSG} "===>  ${PKGNAME} depends on shared library: $$libname - not found"; \
             ${ECHO_MSG} "===>  Verifying $$target for $$lib in $$dir"; \              ${ECHO_MSG} "===>  Verifying $$target for $$libname in $$dir"; \
             if [ ! -d "$$dir" ]; then \              if [ ! -d "$$dir" ]; then \
                 ${ECHO_MSG} ">> No directory for $$lib.  Skipping.."; \                  ${ECHO_MSG} ">> No directory for $$libname.  Skipping.."; \
             else \              else \
                 (cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \                  (cd $$dir; ${MAKE} ${.MAKEFLAGS} $$target) ; \
                 ${ECHO_MSG} "===>  Returning to build of ${PKGNAME}"; \                  ${ECHO_MSG} "===>  Returning to build of ${PKGNAME}"; \
             fi; \              fi; \
           else \
               ${ECHO_MSG} "===>  ${PKGNAME} depends on shared library: $$libname - $$reallib found"; \
         fi; \          fi; \
     done      done
 .endif  .endif
Line 1791 
Line 1954 
 .if !target(depends-list)  .if !target(depends-list)
 depends-list:  depends-list:
     @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \      @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \
         (cd $$dir; ${MAKE} package-name depends-list); \          (cd $$dir; ${MAKE} package-name depends-list PACKAGE_NAME_AS_LINK=${PACKAGE_NAME_AS_LINK}; ); \
     done      done
 .endif  .endif
   
Line 1804 
Line 1967 
 # a large index.  Format is:  # a large index.  Format is:
 #  #
 # distribution-name|port-path|installation-prefix|comment| \  # distribution-name|port-path|installation-prefix|comment| \
 #  description-file|maintainer|categories|build deps|run deps  #  description-file|maintainer|categories|build deps|run deps|for arch
 #  #
 .if !target(describe)  .if !target(describe)
 describe:  describe:
Line 1830 
Line 1993 
         ABCD) ;; \          ABCD) ;; \
         *) cd ${.CURDIR} && ${ECHO} -n `make package-depends|sort -u`;; \          *) cd ${.CURDIR} && ${ECHO} -n `make package-depends|sort -u`;; \
     esac; \      esac; \
       ${ECHO} -n "|"; \
       if [ "${ONLY_FOR_ARCHS}" = "" ]; then \
           ${ECHO} -n "any"; \
       else \
           ${ECHO} -n "${ONLY_FOR_ARCHS}"; \
       fi; \
     ${ECHO} ""      ${ECHO} ""
 .endif  .endif
   
Line 1843 
Line 2012 
     @cd ${.CURDIR} && make README.html      @cd ${.CURDIR} && make README.html
 .endif  .endif
   
   .if (${OPSYS} == "NetBSD")
   README_NAME=    ${TEMPLATES}/README.pkg
   .else
   README_NAME=    ${TEMPLATES}/README.port
   .endif
   
 README.html:  README.html:
     @${ECHO_MSG} "===>  Creating README.html for ${PKGNAME}"      @${ECHO_MSG} "===>  Creating README.html for ${PKGNAME}"
     @${CAT} ${TEMPLATES}/README.port | \      @${MAKE} depends-list PACKAGE_NAME_AS_LINK=YES >> $@.tmp1
         ${SED} -e 's&%%PORT%%&'`${ECHO} ${.CURDIR} | ${SED} -e 's.*/\([^/]*/[^/]*\)$$\1'`'&g' \      @[ -s $@.tmp1 ] || echo "(none)" >> $@.tmp1
             -e 's&%%PKG%%&${PKGNAME}&g' \      @${MAKE} package-depends PACKAGE_NAME_AS_LINK=YES >> $@.tmp2
       @[ -s $@.tmp2 ] || echo "(none)" >> $@.tmp2
       @${ECHO} ${PKGNAME} | ${HTMLIFY} >> $@.tmp3
       @${CAT} ${README_NAME} | \
           ${SED} -e 's|%%PORT%%|'"`${MAKE} package-path | ${HTMLIFY}`"'|g' \
               -e '/%%PKG%%/r$@.tmp3' \
               -e '/%%PKG%%/d' \
             -e '/%%COMMENT%%/r${PKGDIR}/COMMENT' \              -e '/%%COMMENT%%/r${PKGDIR}/COMMENT' \
             -e '/%%COMMENT%%/d' \              -e '/%%COMMENT%%/d' \
             -e 's&%%BUILD_DEPENDS%%&'"`${MAKE} print-depends-list`"'&' \              -e '/%%BUILD_DEPENDS%%/r$@.tmp1' \
             -e 's&%%RUN_DEPENDS%%&'"`${MAKE} print-package-depends`"'&' \              -e '/%%BUILD_DEPENDS%%/d' \
               -e '/%%RUN_DEPENDS%%/r$@.tmp2' \
               -e '/%%RUN_DEPENDS%%/d' \
         >> $@          >> $@
       @rm -f $@.tmp1 $@.tmp2 $@.tmp3
   
 .if !target(print-depends-list)  .if !target(print-depends-list)
 print-depends-list:  print-depends-list:
Line 1899 
Line 2083 
         if [ -f ${PKGDIR}/REQ ]; then \          if [ -f ${PKGDIR}/REQ ]; then \
             ${CP} ${PKGDIR}/REQ ${PKG_DBDIR}/${PKGNAME}/+REQ; \              ${CP} ${PKGDIR}/REQ ${PKG_DBDIR}/${PKGNAME}/+REQ; \
         fi; \          fi; \
         for dep in `make package-depends ECHO_MSG=/usr/bin/true | sort -u`; do \          if [ -f ${PKGDIR}/MESSAGE ]; then \
               ${CP} ${PKGDIR}/MESSAGE ${PKG_DBDIR}/${PKGNAME}/+DISPLAY; \
           fi; \
           for dep in `make package-depends ECHO_MSG=${TRUE} | sort -u`; do \
             if [ -d ${PKG_DBDIR}/$$dep ]; then \              if [ -d ${PKG_DBDIR}/$$dep ]; then \
                 if ! ${GREP} ^${PKGNAME}$$ ${PKG_DBDIR}/$$dep/+REQUIRED_BY \                  if ! ${GREP} ^${PKGNAME}$$ ${PKG_DBDIR}/$$dep/+REQUIRED_BY \
                     >/dev/null 2>&1; then \                      >/dev/null 2>&1; then \

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44