1996-12-25 15:10:09 -05:00
|
|
|
#-*- mode: Fundamental; tab-width: 4; -*-
|
2000-02-02 10:28:17 -05:00
|
|
|
# ex:ts=4 sw=4 filetype=make:
|
2001-09-16 10:56:42 -04:00
|
|
|
FULL_REVISION=$$OpenBSD: bsd.port.mk,v 1.457 2001/09/16 14:56:42 espie Exp $$
|
1999-05-10 17:35:25 -04:00
|
|
|
# $FreeBSD: 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 $
|
1996-06-03 18:47:10 -04:00
|
|
|
#
|
|
|
|
# bsd.port.mk - 940820 Jordan K. Hubbard.
|
|
|
|
# This file is in the public domain.
|
|
|
|
|
2000-09-13 10:06:55 -04:00
|
|
|
# Each port has a MAINTAINER, which is the email address(es) of the person(s)
|
|
|
|
# to contact if you have questions/suggestions about that specific port.
|
|
|
|
# To obtain that address, just type
|
|
|
|
# make show VARNAME=MAINTAINER
|
|
|
|
# in the specific port's directory.
|
|
|
|
#
|
|
|
|
# The ports@openbsd.org address is the `default' MAINTAINER (the generic
|
|
|
|
# OpenBSD ports mailing-list).
|
1997-09-09 11:11:28 -04:00
|
|
|
|
2000-09-13 10:06:55 -04:00
|
|
|
# Enquiries as to the bsd.port.mk framework should usually be directed
|
|
|
|
# to ports@openbsd.org.
|
2000-03-26 16:23:20 -05:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
|
1998-12-17 13:25:06 -05:00
|
|
|
# NEED_VERSION: we need at least this version of bsd.port.mk for this
|
|
|
|
# port to build
|
|
|
|
|
|
|
|
.if defined(NEED_VERSION)
|
1999-02-20 19:50:28 -05:00
|
|
|
_VERSION_REVISION=${FULL_REVISION:M[0-9]*.*}
|
1998-12-17 13:25:06 -05:00
|
|
|
|
1999-02-20 19:50:28 -05:00
|
|
|
_VERSION=${_VERSION_REVISION:C/\..*//}
|
|
|
|
_REVISION=${_VERSION_REVISION:C/.*\.//}
|
1998-12-17 13:25:06 -05:00
|
|
|
|
1999-02-20 19:50:28 -05:00
|
|
|
_VERSION_NEEDED=${NEED_VERSION:C/\..*//}
|
|
|
|
_REVISION_NEEDED=${NEED_VERSION:C/.*\.//}
|
2000-01-13 12:40:20 -05:00
|
|
|
. if ${_VERSION_NEEDED} > ${_VERSION} || \
|
1999-12-03 12:37:33 -05:00
|
|
|
(${_VERSION_NEEDED} == ${_VERSION} && ${_REVISION_NEEDED} > ${_REVISION})
|
2001-07-17 12:11:45 -04:00
|
|
|
ERRORS+= "Fatal: Need version ${NEED_VERSION} of bsd.port.mk."
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1998-12-17 13:25:06 -05:00
|
|
|
.endif
|
|
|
|
|
2001-03-28 10:01:01 -05:00
|
|
|
.if ${.MAKEFLAGS:MFLAVOR=*}
|
2001-07-17 12:11:45 -04:00
|
|
|
ERRORS+= "Fatal: Use 'env FLAVOR=${FLAVOR} ${MAKE}' instead."
|
2001-03-28 10:01:01 -05:00
|
|
|
.endif
|
|
|
|
|
2000-09-13 10:06:55 -04:00
|
|
|
# There is a transition in progress. When the dust settles,
|
|
|
|
# the definitive source of documentation to this file's working
|
|
|
|
# should be bsd.port.mk(5).
|
1996-06-03 18:47:10 -04:00
|
|
|
#
|
2000-12-01 11:31:11 -05:00
|
|
|
# All redundant documentation is being stripped, refer to bsd.port.mk(5),
|
|
|
|
# really !
|
|
|
|
#
|
1999-11-05 17:44:34 -05:00
|
|
|
# IMPORTANT: any variable or target starting with an underscore
|
|
|
|
# (e.g., _DEPEND_ECHO) is internal to bsd.port.mk, and
|
|
|
|
# liable to change without notice.
|
|
|
|
#
|
|
|
|
# DON'T USE IN INDIVIDUAL PORTS !!!
|
|
|
|
#
|
1996-06-03 18:47:10 -04:00
|
|
|
# Variables that typically apply to all ports:
|
|
|
|
#
|
|
|
|
# MASTER_SITES - Primary location(s) for distribution files if not found
|
1996-12-25 15:10:09 -05:00
|
|
|
# locally.
|
1999-09-26 06:50:07 -04:00
|
|
|
# MASTER_SITESn - Primary location(s) for more distribution files, in case
|
|
|
|
# some distfiles must be fetched from elsewhere.
|
1998-09-07 18:33:19 -04:00
|
|
|
# MASTER_SITE_SUBDIR - Directory that "%SUBDIR%" in MASTER_SITES is
|
|
|
|
# replaced by.
|
1996-06-03 18:47:10 -04:00
|
|
|
#
|
|
|
|
# Variables that typically apply to an individual port. Non-Boolean
|
|
|
|
# variables without defaults are *mandatory*.
|
|
|
|
#
|
1998-03-26 22:30:43 -05:00
|
|
|
# COMES_WITH - The first version that a port was made part of the
|
|
|
|
# standard OpenBSD distribution. If the current OpenBSD
|
|
|
|
# version is >= this version then a notice will be
|
2001-03-28 06:43:16 -05:00
|
|
|
# displayed instead of the port being generated.
|
1996-06-03 18:47:10 -04:00
|
|
|
#
|
1996-08-23 07:37:41 -04:00
|
|
|
# NO_DESCRIBE - Use a dummy (do-nothing) describe target.
|
|
|
|
# NO_INSTALL - Use a dummy (do-nothing) install target.
|
|
|
|
# NO_PACKAGE - Use a dummy (do-nothing) package target.
|
|
|
|
# NO_PKG_REGISTER - Don't register a port install as a package.
|
1996-12-25 15:10:09 -05:00
|
|
|
# BROKEN - Port is broken. Set this string to the reason why.
|
1996-06-03 18:47:10 -04:00
|
|
|
# RESTRICTED - Port is restricted. Set this string to the reason why.
|
1998-11-24 20:08:35 -05:00
|
|
|
#
|
2001-07-30 10:13:16 -04:00
|
|
|
# PKG_DBDIR - Where package installation is recorded (default: /var/db/pkg)
|
|
|
|
#
|
2000-03-26 16:23:20 -05:00
|
|
|
# USE_X11 - Port uses X11.
|
2000-06-02 07:42:53 -04:00
|
|
|
#
|
1997-09-09 11:11:28 -04:00
|
|
|
# SCRIPTS_ENV - Additional environment vars passed to scripts in
|
|
|
|
# ${SCRIPTDIR} executed by bsd.port.mk.
|
1996-06-03 18:47:10 -04:00
|
|
|
# DEPENDS - A list of other ports this package depends on being
|
2001-03-28 06:43:16 -05:00
|
|
|
# made first.
|
1999-05-14 00:38:36 -04:00
|
|
|
#
|
1996-08-23 07:37:41 -04:00
|
|
|
# FETCH_BEFORE_ARGS -
|
|
|
|
# Arguments to ${FETCH_CMD} before filename (default: none).
|
|
|
|
# FETCH_AFTER_ARGS -
|
|
|
|
# Arguments to ${FETCH_CMD} following filename (default: none).
|
1999-09-26 06:47:30 -04:00
|
|
|
# NO_IGNORE - Set this to Yes (most probably in a "make fetch" in
|
1998-09-07 18:33:19 -04:00
|
|
|
# ${PORTSDIR}) if you want to fetch all distfiles,
|
|
|
|
# even for packages not built due to limitation by
|
2001-04-18 10:43:55 -04:00
|
|
|
# absent X or ONLY_FOR_ARCHS...
|
1999-09-26 06:47:30 -04:00
|
|
|
# NO_WARNINGS - Set this to Yes to disable warnings regarding variables
|
1998-12-16 14:59:48 -05:00
|
|
|
# to define to control the build. Automatically set
|
|
|
|
# from the "mirror-distfiles" target.
|
1996-06-03 18:47:10 -04:00
|
|
|
#
|
|
|
|
# Motif support:
|
|
|
|
#
|
2001-04-18 10:43:55 -04:00
|
|
|
# USE_MOTIF - Set this to "any" for ports that work with lesstif or
|
|
|
|
# openmotif (automatic flavoring), "openmotif" for ports
|
|
|
|
# that require openmotif, "lesstif" for ports that require
|
|
|
|
# lesstif. "any" will create an extra hidden lesstif
|
|
|
|
# FLAVOR, beware in flavor tests.
|
1996-06-03 18:47:10 -04:00
|
|
|
#
|
|
|
|
# Variables to change if you want a special behavior:
|
|
|
|
#
|
1997-09-09 11:11:28 -04:00
|
|
|
# DEPENDS_TARGET - The target to execute when a port is calling a
|
|
|
|
# dependency (default: "install").
|
2000-12-01 11:31:11 -05:00
|
|
|
#
|
1996-06-03 18:47:10 -04:00
|
|
|
#
|
1998-09-07 18:33:19 -04:00
|
|
|
# It is assumed that the port installs manpages uncompressed. If this is
|
|
|
|
# not the case, set MANCOMPRESSED in the port and define MAN<sect> and
|
2000-01-01 10:43:34 -05:00
|
|
|
# CAT<sect> for the compressed pages. The pages will then be automatically
|
1998-09-07 18:33:19 -04:00
|
|
|
# uncompressed.
|
1996-12-25 15:10:09 -05:00
|
|
|
#
|
1998-09-07 18:33:19 -04:00
|
|
|
# MANCOMPRESSED - Indicates that the port installs manpages in a compressed
|
|
|
|
# form (default: port installs manpages uncompressed).
|
1996-12-25 15:10:09 -05:00
|
|
|
# MAN<sect> - A list of manpages, categorized by section. For
|
|
|
|
# example, if your port has "man/man1/foo.1" and
|
|
|
|
# "man/mann/bar.n", set "MAN1=foo.1" and "MANN=bar.n".
|
|
|
|
# The available sections chars are "123456789LN".
|
1998-09-07 18:33:19 -04:00
|
|
|
# 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}).
|
1996-12-25 15:10:09 -05:00
|
|
|
#
|
1999-03-01 14:44:18 -05:00
|
|
|
# Other variables:
|
|
|
|
#
|
1996-06-03 18:47:10 -04:00
|
|
|
# Default targets and their behaviors:
|
|
|
|
#
|
2000-02-04 06:15:16 -05:00
|
|
|
# fetch - Retrieves ${DISTFILES} (and ${PATCHFILES} if defined, and
|
|
|
|
# ${SUPDISTFILES} if needed) into ${DISTDIR} as necessary.
|
|
|
|
# extract - Unpacks ${EXTRACT_ONLY} (${DISTFILES} by default)
|
|
|
|
# into ${WRKDIR}.
|
1996-06-03 18:47:10 -04:00
|
|
|
# patch - Apply any provided patches to the source.
|
Add intermediate `distpatch' target.
This is done in a tricky way, so as not to disturb the usual sequence
of targets. Namely, you still have
fetch, extract, patch, configure, build, install, package,
but patch does invoke a subtarget distpatch when needed,
and you can
fetch, extract, distpatch, patch, configure, build, install, package
for the same results.
Mostly useful for porters: provide an intermediate point to work on
patches, and make it easy to override distpatch/OpenBSD patches separately.
2000-01-30 10:19:40 -05:00
|
|
|
# distpatch - Intermediate patch target, apply only distribution patches.
|
1996-06-03 18:47:10 -04:00
|
|
|
# configure - Runs either GNU configure, one or more local configure
|
|
|
|
# scripts or nothing, depending on what's available.
|
|
|
|
# build - Actually compile the sources.
|
2000-03-03 16:24:50 -05:00
|
|
|
#
|
|
|
|
# If ${FAKE} == Yes
|
|
|
|
# fake - Perform a fake installation into ${WRKINST}.
|
|
|
|
# package - Build package from the fake installation.
|
|
|
|
# install - Install the resulting package.
|
|
|
|
#
|
2000-03-10 13:09:23 -05:00
|
|
|
# Note that `fake' uses {pre,do,post}-install for its own dark purposes.
|
|
|
|
# There is also a special pre-fake target that gets run after mtree but
|
|
|
|
# before making the INSTALL_PRECOOKIE, to finish setting up the fake tree.
|
|
|
|
#
|
1998-07-06 18:06:51 -04:00
|
|
|
# plist - create a file suitable for use as a packing list. This
|
|
|
|
# is for port maintainers.
|
1996-06-03 18:47:10 -04:00
|
|
|
# describe - Try to generate a one-line description for each port for
|
|
|
|
# use in INDEX files and the like.
|
|
|
|
# checkpatch - Do a "patch -C" instead of a "patch". Note that it may
|
|
|
|
# give incorrect results if multiple patches deal with
|
1998-11-24 20:08:35 -05:00
|
|
|
# the same file.
|
1999-03-03 13:18:46 -05:00
|
|
|
# checksum - Use ${CHECKSUM_FILE} to ensure that your distfiles are valid.
|
|
|
|
# makesum - Generate ${CHECKSUM_FILE} (only do this for your own ports!).
|
|
|
|
# addsum - update ${CHECKSUM_FILE} in a non-destructive way
|
|
|
|
# (your own ports only!)
|
2001-04-11 12:06:07 -04:00
|
|
|
# obj - pre-build ${WRKDIR} -> ${WRKOBJDIR}/${PKGPATH} links
|
|
|
|
#
|
1998-09-07 18:33:19 -04:00
|
|
|
# readme - Create a README.html file describing the category or package
|
2001-04-11 12:06:07 -04:00
|
|
|
# (somewhat broken due to NEW_DEPENDS)
|
|
|
|
|
|
|
|
|
|
|
|
# Somewhat obsolete targets:
|
1999-04-02 01:55:56 -05:00
|
|
|
# list-distfiles- list the distribution and patch files used by a port.
|
|
|
|
# Typical use is (from the top level of the ports tree)
|
|
|
|
# make ECHO_MSG=: list-distfiles | tee some-file
|
2001-04-11 12:06:07 -04:00
|
|
|
# (rely on mirror-maker instead)
|
1999-04-20 14:22:56 -04:00
|
|
|
# print-depends - print all dependencies for the given package
|
2001-04-11 12:06:07 -04:00
|
|
|
# (for new dependencies, use
|
|
|
|
# build-depends-list/run-depends-list instead)
|
|
|
|
#
|
1996-06-03 18:47:10 -04:00
|
|
|
#
|
|
|
|
# Default sequence for "all" is: fetch checksum extract patch configure build
|
|
|
|
#
|
|
|
|
# Please read the comments in the targets section below, you
|
2000-01-26 19:09:44 -05:00
|
|
|
# should be able to use the pre-* or post-* targets (which
|
|
|
|
# are available for every stage except checksum) or provide
|
|
|
|
# an overriding do-* target to do pretty much anything you
|
|
|
|
# want.
|
1996-06-03 18:47:10 -04:00
|
|
|
#
|
Add intermediate `distpatch' target.
This is done in a tricky way, so as not to disturb the usual sequence
of targets. Namely, you still have
fetch, extract, patch, configure, build, install, package,
but patch does invoke a subtarget distpatch when needed,
and you can
fetch, extract, distpatch, patch, configure, build, install, package
for the same results.
Mostly useful for porters: provide an intermediate point to work on
patches, and make it easy to override distpatch/OpenBSD patches separately.
2000-01-30 10:19:40 -05:00
|
|
|
# For historical reasons, the distpatch target is a subtarget of patch.
|
|
|
|
# If you provide a do-patch, you MUST call distpatch explicitly.
|
|
|
|
# The sequence of hooks actually run is:
|
|
|
|
#
|
2000-02-04 06:09:33 -05:00
|
|
|
# pre-patch `real distpatch' post-distpatch `real patch' post-patch
|
2001-04-11 12:06:07 -04:00
|
|
|
#
|
|
|
|
# For historical reasons, you shouldn't override pre-extract and
|
|
|
|
# do-extract. Rely on EXTRACT_ONLY and post-extract instead.
|
|
|
|
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2000-04-09 11:24:13 -04:00
|
|
|
.if exists(${.CURDIR}/../Makefile.inc)
|
|
|
|
.include "${.CURDIR}/../Makefile.inc"
|
|
|
|
.endif
|
|
|
|
|
2001-08-25 07:23:46 -04:00
|
|
|
# MODULES support
|
|
|
|
# reserved name spaces: for module=NAME, modname*, _modname* variables and
|
|
|
|
# targets.
|
|
|
|
|
2001-08-16 10:49:31 -04:00
|
|
|
.if defined(show)
|
|
|
|
VARNAME=${show}
|
|
|
|
.MAIN: show
|
|
|
|
.elif defined(clean)
|
|
|
|
.MAIN: clean
|
|
|
|
.else
|
|
|
|
.MAIN: all
|
|
|
|
.endif
|
|
|
|
|
2000-05-30 10:51:59 -04:00
|
|
|
FAKE?=Yes
|
2001-04-20 12:25:24 -04:00
|
|
|
TRUST_PACKAGES?=No
|
2001-07-30 10:13:16 -04:00
|
|
|
BIN_PACKAGES?=No
|
2001-03-21 19:22:36 -05:00
|
|
|
WRKINST?=${WRKDIR}/fake-${ARCH}${FLAVOR_EXT}
|
2000-03-03 16:24:50 -05:00
|
|
|
|
1998-09-07 18:33:19 -04:00
|
|
|
# Get the architecture
|
|
|
|
ARCH!= uname -m
|
|
|
|
|
1998-07-06 18:06:51 -04:00
|
|
|
# Get the operating system type and version
|
1999-10-27 08:48:40 -04:00
|
|
|
OPSYS= OpenBSD
|
|
|
|
OPSYS_VER= ${OSREV}
|
1998-04-04 23:20:38 -05:00
|
|
|
|
2001-08-07 07:46:17 -04:00
|
|
|
NO_SHARED_ARCHS=hppa mvme88k vax
|
1996-06-03 18:47:10 -04:00
|
|
|
|
1999-08-10 15:54:17 -04:00
|
|
|
# Define NO_SHARED_LIBS for those machines that don't support shared libraries.
|
2001-04-14 12:49:53 -04:00
|
|
|
.for _m in ${MACHINE_ARCH}
|
|
|
|
. if !empty(NO_SHARED_ARCHS:M${_m})
|
1999-09-26 06:47:30 -04:00
|
|
|
NO_SHARED_LIBS= Yes
|
2001-04-14 12:49:53 -04:00
|
|
|
. endif
|
|
|
|
.endfor
|
1999-02-17 18:45:15 -05:00
|
|
|
|
1999-09-26 06:45:35 -04:00
|
|
|
# Compatibility kludge for old scripts
|
|
|
|
.if defined(NOCLEANDEPENDS)
|
2001-01-08 17:34:51 -05:00
|
|
|
. if ${NOCLEANDEPENDS:L} == "no"
|
1999-09-26 06:47:30 -04:00
|
|
|
CLEANDEPENDS?=Yes
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
1999-09-26 06:47:30 -04:00
|
|
|
CLEANDEPENDS?=No
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1999-09-26 06:45:35 -04:00
|
|
|
.else
|
1999-09-26 18:20:46 -04:00
|
|
|
CLEANDEPENDS?=No
|
1999-09-26 06:45:35 -04:00
|
|
|
.endif
|
2001-08-16 10:49:31 -04:00
|
|
|
clean?=work
|
|
|
|
.if ${CLEANDEPENDS:L} == "yes"
|
|
|
|
clean+=depends
|
|
|
|
.endif
|
|
|
|
.if ${clean:L:Mwork}
|
|
|
|
clean+=fake
|
|
|
|
.endif
|
|
|
|
.if ${clean:L:Mforce}
|
|
|
|
clean+=-f
|
|
|
|
.endif
|
|
|
|
|
1999-09-26 06:47:30 -04:00
|
|
|
NOMANCOMPRESS?= Yes
|
1997-09-21 06:58:41 -04:00
|
|
|
DEF_UMASK?= 022
|
1996-08-23 07:37:41 -04:00
|
|
|
|
2001-03-28 06:43:16 -05:00
|
|
|
NO_DEPENDS?= No
|
|
|
|
NO_BUILD?= No
|
|
|
|
|
1999-11-28 09:12:24 -05:00
|
|
|
.if exists(${.CURDIR}/Makefile.${ARCH})
|
1997-09-09 11:11:28 -04:00
|
|
|
.include "${.CURDIR}/Makefile.${ARCH}"
|
2001-05-05 19:42:03 -04:00
|
|
|
.else
|
|
|
|
.if exists(${.CURDIR}/Makefile.${MACHINE_ARCH})
|
|
|
|
.include "${.CURDIR}/Makefile.${MACHINE_ARCH}"
|
|
|
|
.endif
|
1997-09-09 11:11:28 -04:00
|
|
|
.endif
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
# These need to be absolute since we don't know how deep in the ports
|
|
|
|
# tree we are and thus can't go relative. They can, of course, be overridden
|
1996-12-25 15:10:09 -05:00
|
|
|
# by individual Makefiles or local system make configuration.
|
1997-09-09 11:11:28 -04:00
|
|
|
PORTSDIR?= /usr/ports
|
2001-01-08 17:10:36 -05:00
|
|
|
LOCALBASE?= /usr/local
|
|
|
|
X11BASE?= /usr/X11R6
|
1996-12-25 15:10:09 -05:00
|
|
|
DISTDIR?= ${PORTSDIR}/distfiles
|
2000-02-02 10:28:17 -05:00
|
|
|
.if defined(DIST_SUBDIR)
|
1999-09-22 06:16:58 -04:00
|
|
|
FULLDISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
|
2000-02-02 10:28:17 -05:00
|
|
|
.else
|
|
|
|
FULLDISTDIR?= ${DISTDIR}
|
|
|
|
.endif
|
2001-05-05 19:42:03 -04:00
|
|
|
PACKAGES?= ${PORTSDIR}/packages/${MACHINE_ARCH}
|
1999-07-28 08:40:56 -04:00
|
|
|
TEMPLATES?= ${PORTSDIR}/infrastructure/templates
|
1997-09-21 06:58:41 -04:00
|
|
|
|
2001-05-05 19:42:03 -04:00
|
|
|
CDROM_PACKAGES?= ${PORTSDIR}/cdrom-packages/${MACHINE_ARCH}
|
|
|
|
FTP_PACKAGES?= ${PORTSDIR}/ftp-packages/${MACHINE_ARCH}
|
2000-04-09 08:04:13 -04:00
|
|
|
|
1999-11-28 09:12:24 -05:00
|
|
|
.if exists(${.CURDIR}/patches.${ARCH})
|
1997-09-09 11:11:28 -04:00
|
|
|
PATCHDIR?= ${.CURDIR}/patches.${ARCH}
|
|
|
|
.else
|
2001-05-05 19:42:03 -04:00
|
|
|
.if exists(${.CURDIR}/patches.${MACHINE_ARCH})
|
|
|
|
PATCHDIR?= ${.CURDIR}/patches.${MACHINE_ARCH}
|
|
|
|
.else
|
1996-06-03 18:47:10 -04:00
|
|
|
PATCHDIR?= ${.CURDIR}/patches
|
1997-09-09 11:11:28 -04:00
|
|
|
.endif
|
2001-05-05 19:42:03 -04:00
|
|
|
.endif
|
1997-09-09 11:11:28 -04:00
|
|
|
|
1998-11-18 23:20:09 -05:00
|
|
|
PATCH_LIST?= patch-*
|
|
|
|
|
1999-11-28 09:12:24 -05:00
|
|
|
.if exists(${.CURDIR}/scripts.${ARCH})
|
1997-09-09 11:11:28 -04:00
|
|
|
SCRIPTDIR?= ${.CURDIR}/scripts.${ARCH}
|
|
|
|
.else
|
2001-05-05 19:42:03 -04:00
|
|
|
.if exists(${.CURDIR}/scripts.${MACHINE_ARCH})
|
|
|
|
SCRIPTDIR?= ${.CURDIR}/scripts.${MACHINE_ARCH}
|
|
|
|
.else
|
1996-06-03 18:47:10 -04:00
|
|
|
SCRIPTDIR?= ${.CURDIR}/scripts
|
1997-09-09 11:11:28 -04:00
|
|
|
.endif
|
2001-05-05 19:42:03 -04:00
|
|
|
.endif
|
1997-09-09 11:11:28 -04:00
|
|
|
|
1999-11-28 09:12:24 -05:00
|
|
|
.if exists(${.CURDIR}/files.${ARCH})
|
1997-09-09 11:11:28 -04:00
|
|
|
FILESDIR?= ${.CURDIR}/files.${ARCH}
|
|
|
|
.else
|
2001-05-05 19:42:03 -04:00
|
|
|
.if exists(${.CURDIR}/files.${MACHINE_ARCH})
|
|
|
|
FILESDIR?= ${.CURDIR}/files.${MACHINE_ARCH}
|
|
|
|
.else
|
1996-06-03 18:47:10 -04:00
|
|
|
FILESDIR?= ${.CURDIR}/files
|
1997-09-09 11:11:28 -04:00
|
|
|
.endif
|
2001-05-05 19:42:03 -04:00
|
|
|
.endif
|
1997-09-09 11:11:28 -04:00
|
|
|
|
1999-11-28 09:12:24 -05:00
|
|
|
.if exists(${.CURDIR}/pkg.${ARCH})
|
1997-09-09 11:11:28 -04:00
|
|
|
PKGDIR?= ${.CURDIR}/pkg.${ARCH}
|
|
|
|
.else
|
2001-05-05 19:42:03 -04:00
|
|
|
.if exists(${.CURDIR}/pkg.${MACHINE_ARCH})
|
|
|
|
PKGDIR?= ${.CURDIR}/pkg.${MACHINE_ARCH}
|
|
|
|
.else
|
1996-06-03 18:47:10 -04:00
|
|
|
PKGDIR?= ${.CURDIR}/pkg
|
1997-09-09 11:11:28 -04:00
|
|
|
.endif
|
2001-05-05 19:42:03 -04:00
|
|
|
.endif
|
1997-09-09 11:11:28 -04:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
PREFIX?= ${LOCALBASE}
|
2001-01-08 17:10:36 -05:00
|
|
|
TRUEPREFIX?= ${PREFIX}
|
2001-07-18 12:19:47 -04:00
|
|
|
DESTDIRNAME?= DESTDIR
|
2001-01-08 17:10:36 -05:00
|
|
|
DESTDIR?= ${WRKINST}
|
1999-03-16 18:35:37 -05:00
|
|
|
|
2001-08-26 17:42:18 -04:00
|
|
|
MAKE_FLAGS?=
|
|
|
|
LIBTOOL_FLAGS?=
|
|
|
|
.if !defined(FAKE_FLAGS)
|
|
|
|
FAKE_FLAGS=${DESTDIRNAME}=${WRKINST}
|
|
|
|
.endif
|
|
|
|
|
2000-06-10 11:27:54 -04:00
|
|
|
CONFIGURE_STYLE?=
|
|
|
|
|
1999-03-16 18:35:37 -05:00
|
|
|
# where configuration files should go
|
|
|
|
SYSCONFDIR?= /etc
|
1996-06-03 18:47:10 -04:00
|
|
|
.if defined(USE_GMAKE)
|
2000-07-14 19:07:25 -04:00
|
|
|
BUILD_DEPENDS+= ${GMAKE}::devel/gmake
|
1998-09-07 18:33:19 -04:00
|
|
|
MAKE_PROGRAM= ${GMAKE}
|
|
|
|
.else
|
|
|
|
MAKE_PROGRAM= ${MAKE}
|
1997-09-09 11:11:28 -04:00
|
|
|
.endif
|
2000-06-10 11:27:54 -04:00
|
|
|
.if ${CONFIGURE_STYLE:L:Mautoconf}
|
|
|
|
CONFIGURE_STYLE+=gnu
|
2000-07-14 19:07:25 -04:00
|
|
|
BUILD_DEPENDS+= ${AUTOCONF}::devel/autoconf
|
1998-11-24 20:08:35 -05:00
|
|
|
AUTOCONF_DIR?=${WRKSRC}
|
|
|
|
# missing ?= not an oversight
|
|
|
|
AUTOCONF_ENV=PATH=${PORTPATH}
|
|
|
|
.endif
|
2000-06-10 11:27:54 -04:00
|
|
|
|
1999-05-04 14:12:24 -04:00
|
|
|
.if defined(USE_LIBTOOL)
|
|
|
|
LIBTOOL?= ${LOCALBASE}/bin/libtool
|
2000-07-14 19:07:25 -04:00
|
|
|
BUILD_DEPENDS+= ${LIBTOOL}::devel/libtool
|
1999-05-04 14:12:24 -04:00
|
|
|
CONFIGURE_ENV+= LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}"
|
|
|
|
MAKE_ENV+= LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}"
|
2001-08-26 17:42:18 -04:00
|
|
|
MAKE_FLAGS+= LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}"
|
1999-05-04 14:12:24 -04:00
|
|
|
.endif
|
1998-09-07 18:33:19 -04:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
.if exists(${PORTSDIR}/../Makefile.inc)
|
|
|
|
.include "${PORTSDIR}/../Makefile.inc"
|
|
|
|
.endif
|
|
|
|
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
SUBPACKAGE?=
|
2001-03-28 09:33:24 -05:00
|
|
|
FLAVOR?=
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
|
2001-04-18 10:43:55 -04:00
|
|
|
USE_MOTIF?=No
|
|
|
|
HAVE_MOTIF?=No
|
|
|
|
|
|
|
|
.if ${USE_MOTIF:L} != "no"
|
|
|
|
. if ${USE_MOTIF:L} == "lesstif"
|
|
|
|
LIB_DEPENDS+= Xm.1.::x11/lesstif
|
|
|
|
. elif ${USE_MOTIF:L} == "openmotif"
|
|
|
|
LIB_DEPENDS+= Xm.2.::x11/openmotif
|
|
|
|
. elif ${USE_MOTIF:L} == "any" || ${USE_MOTIF:L} == "yes"
|
|
|
|
FLAVORS+=lesstif
|
|
|
|
. if ${FLAVOR:L:Mlesstif}
|
|
|
|
LIB_DEPENDS+= Xm.1.::x11/lesstif
|
|
|
|
. else
|
|
|
|
LIB_DEPENDS+= Xm.2.::x11/openmotif
|
|
|
|
. endif
|
|
|
|
. else
|
2001-07-17 12:11:45 -04:00
|
|
|
ERRORS+= "Fatal: Unknown USE_MOTIF=${USE_MOTIF} settings."
|
2001-04-18 10:43:55 -04:00
|
|
|
. endif
|
2001-04-18 21:56:53 -04:00
|
|
|
MOTIFLIB=-L${LOCALBASE}/lib -lXm
|
2001-04-18 10:43:55 -04:00
|
|
|
.endif
|
|
|
|
|
2001-04-17 12:45:14 -04:00
|
|
|
.if !empty(SUBPACKAGE)
|
|
|
|
. for _i in ${SUBPACKAGE}
|
|
|
|
. if !defined(MULTI_PACKAGES) || empty(MULTI_PACKAGES:M${_i})
|
2001-07-17 12:11:45 -04:00
|
|
|
ERRORS+= "Fatal: Subpackage ${SUBPACKAGE} does not exist."
|
2001-04-17 12:45:14 -04:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.endif
|
|
|
|
|
2001-07-20 09:13:47 -04:00
|
|
|
# Support architecture and flavor dependent packing lists
|
|
|
|
#
|
|
|
|
SED_PLIST?=
|
|
|
|
|
2001-07-18 14:23:04 -04:00
|
|
|
# Build FLAVOR_EXT, checking that no flavors are misspelled
|
|
|
|
FLAVOR_EXT:=
|
2001-07-20 09:13:47 -04:00
|
|
|
|
|
|
|
# Create the basic sed substitution pipeline for fragments
|
|
|
|
# (applies only to PLIST for now)
|
2001-07-18 14:23:04 -04:00
|
|
|
.if defined(FLAVORS)
|
2001-07-20 09:13:47 -04:00
|
|
|
. for _i in ${FLAVORS:L}
|
|
|
|
. if empty(FLAVOR:L:M${_i})
|
|
|
|
SED_PLIST+=|sed -e '/^!%%${_i}%%$$/r${PKGDIR}/PFRAG.no-${_i}' -e '//d' -e '/^%%${_i}%%$$/d'
|
|
|
|
. else
|
|
|
|
FLAVOR_EXT:=${FLAVOR_EXT}-${_i}
|
|
|
|
SED_PLIST+=|sed -e '/^!%%${_i}%%$$/d' -e '/^%%${_i}%%$$/r${PKGDIR}/PFRAG.${_i}' -e '//d'
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !empty(FLAVOR)
|
|
|
|
. if defined(FLAVORS)
|
2001-07-18 14:23:04 -04:00
|
|
|
. for _i in ${FLAVOR:L}
|
|
|
|
. if empty(FLAVORS:L:M${_i})
|
|
|
|
ERRORS+= "Fatal: Unknown flavor: ${_i}"
|
|
|
|
ERRORS+= " (Possible flavors are: ${FLAVORS})."
|
|
|
|
. endif
|
|
|
|
. endfor
|
2001-07-20 09:13:47 -04:00
|
|
|
. else
|
|
|
|
ERRORS+= "Fatal: no flavors for this port."
|
2001-07-18 14:23:04 -04:00
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
PKGREPOSITORYSUBDIR?= All
|
|
|
|
PKG_SUFX?= .tgz
|
|
|
|
PKGREPOSITORY?= ${PACKAGES}/${PKGREPOSITORYSUBDIR}
|
2001-07-30 10:13:16 -04:00
|
|
|
PKG_DBDIR?= /var/db/pkg
|
|
|
|
|
|
|
|
|
2001-08-12 07:33:10 -04:00
|
|
|
PKGNAME?=${DISTNAME}
|
|
|
|
FULLPKGNAME?=${PKGNAME}${FLAVOR_EXT}
|
|
|
|
PKGFILE=${PKGREPOSITORY}/${FULLPKGNAME}${PKG_SUFX}
|
2001-07-30 10:13:16 -04:00
|
|
|
|
|
|
|
.if defined(MULTI_PACKAGES)
|
|
|
|
. for _s in ${MULTI_PACKAGES}
|
2001-08-12 07:33:10 -04:00
|
|
|
. if !defined(FULLPKGNAME${_s})
|
|
|
|
. if defined(PKGNAME${_s})
|
|
|
|
FULLPKGNAME${_s} = ${PKGNAME${_s}}${FLAVOR_EXT}
|
|
|
|
. else
|
|
|
|
FULLPKGNAME${_s} = ${PKGNAME}${_s}${FLAVOR_EXT}
|
|
|
|
. endif
|
2001-07-30 10:13:16 -04:00
|
|
|
. endif
|
2001-08-12 07:33:10 -04:00
|
|
|
PKGFILE${_s} = ${PKGREPOSITORY}/${FULLPKGNAME${_s}}${PKG_SUFX}
|
2001-07-30 10:13:16 -04:00
|
|
|
. endfor
|
|
|
|
.endif
|
|
|
|
|
2001-09-05 05:13:18 -04:00
|
|
|
_WRKDIR_COOKIE= ${WRKDIR}/.extract_started
|
1999-12-08 12:11:09 -05:00
|
|
|
_EXTRACT_COOKIE= ${WRKDIR}/.extract_done
|
|
|
|
_PATCH_COOKIE= ${WRKDIR}/.patch_done
|
Add intermediate `distpatch' target.
This is done in a tricky way, so as not to disturb the usual sequence
of targets. Namely, you still have
fetch, extract, patch, configure, build, install, package,
but patch does invoke a subtarget distpatch when needed,
and you can
fetch, extract, distpatch, patch, configure, build, install, package
for the same results.
Mostly useful for porters: provide an intermediate point to work on
patches, and make it easy to override distpatch/OpenBSD patches separately.
2000-01-30 10:19:40 -05:00
|
|
|
_DISTPATCH_COOKIE= ${WRKDIR}/.distpatch_done
|
|
|
|
_PREPATCH_COOKIE= ${WRKDIR}/.prepatch_done
|
2001-08-12 07:33:10 -04:00
|
|
|
_INSTALL_COOKIE= ${PKG_DBDIR}/${FULLPKGNAME${SUBPACKAGE}}/+CONTENTS
|
2001-01-08 17:34:51 -05:00
|
|
|
.if ${FAKE:L} == "yes"
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
_FAKE_COOKIE= ${WRKINST}/.fake_done
|
2000-03-03 16:24:50 -05:00
|
|
|
_INSTALL_PRE_COOKIE=${WRKINST}/.install_started
|
|
|
|
.elif defined(SEPARATE_BUILD)
|
|
|
|
_INSTALL_PRE_COOKIE=${WRKBUILD}/.install_started
|
|
|
|
.else
|
|
|
|
_INSTALL_PRE_COOKIE=${WRKDIR}/.install_started
|
2000-04-17 17:53:38 -04:00
|
|
|
_FAKE_COOKIE= ${WRKDIR}/.fake_done
|
2000-03-03 16:24:50 -05:00
|
|
|
.endif
|
2001-08-12 07:33:10 -04:00
|
|
|
_PACKAGE_COOKIE= ${PKGFILE}
|
1999-02-28 18:23:47 -05:00
|
|
|
.if defined(SEPARATE_BUILD)
|
1999-12-08 12:11:09 -05:00
|
|
|
_CONFIGURE_COOKIE= ${WRKBUILD}/.configure_done
|
|
|
|
_BUILD_COOKIE= ${WRKBUILD}/.build_done
|
1999-02-28 18:23:47 -05:00
|
|
|
.else
|
1999-12-08 12:11:09 -05:00
|
|
|
_CONFIGURE_COOKIE= ${WRKDIR}/.configure_done
|
|
|
|
_BUILD_COOKIE= ${WRKDIR}/.build_done
|
1999-02-28 18:23:47 -05:00
|
|
|
.endif
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
|
1999-12-08 12:11:09 -05:00
|
|
|
_ALL_COOKIES=${_EXTRACT_COOKIE} ${_PATCH_COOKIE} ${_CONFIGURE_COOKIE} \
|
2001-04-02 06:35:51 -04:00
|
|
|
${_INSTALL_PRE_COOKIE} ${_BUILD_COOKIE} ${_PACKAGE_COOKIES} \
|
2001-09-05 05:13:18 -04:00
|
|
|
${_DISTPATCH_COOKIE} ${_PREPATCH_COOKIE} ${_FAKE_COOKIE} \
|
|
|
|
${_WRKDIR_COOKIE} ${_DEPlib_COOKIES} ${_DEPmisc_COOKIES} \
|
|
|
|
${_DEPfetch_COOKIES} ${_DEPbuild_COOKIES} ${_DEPrun_COOKIES}
|
1999-12-08 12:11:09 -05:00
|
|
|
|
1999-12-03 09:57:12 -05:00
|
|
|
_MAKE_COOKIE=touch -f
|
1996-06-03 18:47:10 -04:00
|
|
|
|
|
|
|
# Miscellaneous overridable commands:
|
|
|
|
GMAKE?= gmake
|
1998-11-24 20:08:35 -05:00
|
|
|
AUTOCONF?= autoconf
|
1999-03-03 13:18:46 -05:00
|
|
|
|
|
|
|
# Compatibility game
|
1996-06-03 18:47:10 -04:00
|
|
|
MD5_FILE?= ${FILESDIR}/md5
|
1999-03-03 13:18:46 -05:00
|
|
|
CHECKSUM_FILE?= ${MD5_FILE}
|
|
|
|
|
|
|
|
# Don't touch !!! Used for generating checksums.
|
1999-12-03 09:57:12 -05:00
|
|
|
_CIPHERS= sha1 rmd160 md5
|
1999-03-03 13:18:46 -05:00
|
|
|
|
|
|
|
# This is the one you can override
|
1999-12-03 09:57:12 -05:00
|
|
|
PREFERRED_CIPHERS?= ${_CIPHERS}
|
1996-06-03 18:47:10 -04:00
|
|
|
|
1998-11-24 20:08:35 -05:00
|
|
|
PORTPATH?= /usr/bin:/bin:/usr/sbin:/sbin:${LOCALBASE}/bin:${X11BASE}/bin
|
|
|
|
|
1999-03-10 18:22:19 -05:00
|
|
|
# Add any COPTS to CFLAGS. Note: programs that use imake do not
|
|
|
|
# use CFLAGS! Also, many (most?) ports hard code CFLAGS, ignoring
|
|
|
|
# what we pass in.
|
2001-07-11 08:57:20 -04:00
|
|
|
.if defined(COPTS)
|
1999-03-10 18:22:19 -05:00
|
|
|
CFLAGS+= ${COPTS}
|
2001-07-11 08:57:20 -04:00
|
|
|
.endif
|
2001-07-18 10:52:27 -04:00
|
|
|
.if defined(CXXOPTS)
|
|
|
|
CXXFLAGS+= ${CXXOPTS}
|
|
|
|
.endif
|
|
|
|
.if defined(WARNINGS) && ${WARNINGS:L} == "yes"
|
|
|
|
. if defined(CDIAGFLAGS)
|
|
|
|
CFLAGS+= ${CDIAGFLAGS}
|
|
|
|
. endif
|
|
|
|
. if defined(CXXDIAGFLAGS)
|
|
|
|
CXXFLAGS+= ${CXXDIAGFLAGS}
|
|
|
|
. endif
|
|
|
|
.endif
|
1999-03-10 18:22:19 -05:00
|
|
|
|
2000-02-22 12:08:31 -05:00
|
|
|
MAKE_FILE?= Makefile
|
2000-06-10 11:27:54 -04:00
|
|
|
MAKE_ENV+= PATH='${PORTPATH}' PREFIX='${PREFIX}' \
|
2001-04-18 11:00:53 -04:00
|
|
|
LOCALBASE='${LOCALBASE}' X11BASE='${X11BASE}' \
|
2000-06-10 11:27:54 -04:00
|
|
|
MOTIFLIB='${MOTIFLIB}' CFLAGS='${CFLAGS}' \
|
2001-07-18 12:19:47 -04:00
|
|
|
TRUEPREFIX='${PREFIX}' ${DESTDIRNAME}=''
|
1996-06-03 18:47:10 -04:00
|
|
|
|
1997-09-09 11:11:28 -04:00
|
|
|
FETCH_CMD?= /usr/bin/ftp
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2000-03-03 15:41:11 -05:00
|
|
|
DISTORIG?= .bak.orig
|
1996-06-03 18:47:10 -04:00
|
|
|
PATCH?= /usr/bin/patch
|
2001-08-24 10:43:28 -04:00
|
|
|
PATCHORIG?= .orig
|
1996-06-03 18:47:10 -04:00
|
|
|
PATCH_STRIP?= -p0
|
|
|
|
PATCH_DIST_STRIP?= -p0
|
2000-09-16 09:54:56 -04:00
|
|
|
|
|
|
|
PATCH_DEBUG?=No
|
|
|
|
.if ${PATCH_DEBUG:L} != "no"
|
2001-08-24 10:43:28 -04:00
|
|
|
PATCH_ARGS?= -d ${WRKDIST} -b ${PATCHORIG} -E ${PATCH_STRIP}
|
2000-02-08 19:23:26 -05:00
|
|
|
PATCH_DIST_ARGS?= -b ${DISTORIG} -d ${WRKDIST} -E ${PATCH_DIST_STRIP}
|
1996-06-03 18:47:10 -04:00
|
|
|
.else
|
2001-08-24 10:43:28 -04:00
|
|
|
PATCH_ARGS?= -d ${WRKDIST} -b ${PATCHORIG} --forward --quiet -E ${PATCH_STRIP}
|
2000-02-08 19:23:26 -05:00
|
|
|
PATCH_DIST_ARGS?= -b ${DISTORIG} -d ${WRKDIST} --forward --quiet -E ${PATCH_DIST_STRIP}
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
|
|
|
|
2000-09-23 08:36:39 -04:00
|
|
|
PATCH_CHECK_ONLY?=No
|
2000-09-23 18:03:21 -04:00
|
|
|
.if ${PATCH_CHECK_ONLY:L} == "yes"
|
1996-06-03 18:47:10 -04:00
|
|
|
PATCH_ARGS+= -C
|
|
|
|
PATCH_DIST_ARGS+= -C
|
|
|
|
.endif
|
|
|
|
|
1999-05-14 00:38:36 -04:00
|
|
|
TAR?= /bin/tar
|
|
|
|
UNZIP?= unzip
|
|
|
|
BZIP2?= bzip2
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
|
1997-01-11 06:58:11 -05:00
|
|
|
MAKE_ENV+= EXTRA_SYS_MK_INCLUDES="<bsd.own.mk>"
|
1998-09-07 18:33:19 -04:00
|
|
|
|
2000-04-03 13:32:42 -04:00
|
|
|
|
2000-02-04 06:09:33 -05:00
|
|
|
.if defined(OBJMACHINE)
|
2001-08-16 10:49:31 -04:00
|
|
|
WRKDIR?= ${.CURDIR}/w-${PKGNAME}${FLAVOR_EXT}.${MACHINE_ARCH}
|
1998-09-07 18:33:19 -04:00
|
|
|
.else
|
2000-04-03 13:32:42 -04:00
|
|
|
. if defined(SEPARATE_BUILD) && ${SEPARATE_BUILD:L:Mflavored}
|
2001-08-16 10:49:31 -04:00
|
|
|
WRKDIR?= ${.CURDIR}/w-${PKGNAME}
|
2000-04-03 13:32:42 -04:00
|
|
|
. else
|
2001-08-16 10:49:31 -04:00
|
|
|
WRKDIR?= ${.CURDIR}/w-${PKGNAME}${FLAVOR_EXT}
|
2000-04-03 13:32:42 -04:00
|
|
|
. endif
|
1998-09-07 18:33:19 -04:00
|
|
|
.endif
|
2000-02-04 06:09:33 -05:00
|
|
|
|
2000-02-08 19:23:26 -05:00
|
|
|
WRKDIST?= ${WRKDIR}/${DISTNAME}
|
1998-09-07 18:33:19 -04:00
|
|
|
|
2000-02-08 19:54:33 -05:00
|
|
|
WRKSRC?= ${WRKDIST}
|
2000-02-08 19:23:26 -05:00
|
|
|
|
1999-02-28 18:23:47 -05:00
|
|
|
.if defined(SEPARATE_BUILD)
|
2001-05-05 19:42:03 -04:00
|
|
|
WRKBUILD?= ${WRKDIR}/build-${MACHINE_ARCH}${FLAVOR_EXT}
|
2001-08-16 10:49:31 -04:00
|
|
|
WRKPKG?= ${WRKBUILD}/pkg
|
1999-02-28 18:23:47 -05:00
|
|
|
.else
|
1999-02-03 12:53:13 -05:00
|
|
|
WRKBUILD?= ${WRKSRC}
|
2001-08-16 10:49:31 -04:00
|
|
|
WRKPKG?= ${WRKDIR}/pkg
|
1999-02-28 18:23:47 -05:00
|
|
|
.endif
|
1999-02-03 12:53:13 -05:00
|
|
|
|
2001-08-25 07:23:46 -04:00
|
|
|
ALL_TARGET?= all
|
|
|
|
INSTALL_TARGET?= install
|
|
|
|
|
|
|
|
FAKE_TARGET ?= ${INSTALL_TARGET}
|
|
|
|
|
2001-08-28 04:09:31 -04:00
|
|
|
.for _i in perl gnu imake
|
2001-08-25 07:23:46 -04:00
|
|
|
. if ${CONFIGURE_STYLE:L:M${_i}}
|
|
|
|
MODULES+=${_i}
|
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.for _m in ${MODULES:L}
|
2001-08-27 04:50:30 -04:00
|
|
|
. if exists(${PORTSDIR}/infrastructure/mk/${_m}.port.mk)
|
2001-08-25 07:23:46 -04:00
|
|
|
. include "${PORTSDIR}/infrastructure/mk/${_m}.port.mk"
|
2001-08-27 04:50:30 -04:00
|
|
|
. else
|
|
|
|
ERRORS+="Missing support for modules ${_m}."
|
2001-08-25 07:23:46 -04:00
|
|
|
. endif
|
|
|
|
.endfor
|
2000-06-16 19:53:40 -04:00
|
|
|
|
2001-07-30 10:13:16 -04:00
|
|
|
.if ${FAKE:L} == "yes"
|
|
|
|
_PACKAGE_COOKIE_DEPS=${_FAKE_COOKIE}
|
|
|
|
.else
|
|
|
|
_PACKAGE_COOKIE_DEPS=${_INSTALL_COOKIE}
|
|
|
|
.endif
|
|
|
|
|
2001-04-02 06:35:51 -04:00
|
|
|
_PACKAGE_COOKIES= ${_PACKAGE_COOKIE}
|
2001-07-30 10:13:16 -04:00
|
|
|
.if ${BIN_PACKAGES:L} == "yes"
|
|
|
|
${_PACKAGE_COOKIE}:
|
|
|
|
@${MAKE} ${_PACKAGE_COOKIE_DEPS}
|
|
|
|
.else
|
|
|
|
${_PACKAGE_COOKIE}: ${_PACKAGE_COOKIE_DEPS}
|
|
|
|
.endif
|
2001-08-16 10:49:31 -04:00
|
|
|
@cd ${.CURDIR} && SUBPACKAGE='' FLAVOR='${FLAVOR}' PACKAGING='' exec ${MAKE} _package
|
2001-04-02 06:35:51 -04:00
|
|
|
.if !defined(PACKAGE_NOINSTALL)
|
|
|
|
@${_MAKE_COOKIE} $@
|
|
|
|
.endif
|
|
|
|
|
2001-07-30 10:13:16 -04:00
|
|
|
.for _s in ${MULTI_PACKAGES}
|
2001-08-12 07:33:10 -04:00
|
|
|
_PACKAGE_COOKIE${_s} = ${PKGFILE${_s}}
|
2001-07-30 10:13:16 -04:00
|
|
|
_PACKAGE_COOKIES += ${_PACKAGE_COOKIE${_s}}
|
|
|
|
. if ${BIN_PACKAGES:L} == "yes"
|
|
|
|
${_PACKAGE_COOKIE${_s}}:
|
|
|
|
@${MAKE} ${_PACKAGE_COOKIE_DEPS}
|
2001-04-02 06:35:51 -04:00
|
|
|
. else
|
2001-07-30 10:13:16 -04:00
|
|
|
${_PACKAGE_COOKIE${_s}}: ${_PACKAGE_COOKIE_DEPS}
|
2001-04-02 06:35:51 -04:00
|
|
|
. endif
|
2001-08-16 10:49:31 -04:00
|
|
|
@cd ${.CURDIR} && SUBPACKAGE='${_s}' FLAVOR='${FLAVOR}' PACKAGING='${_s}' exec ${MAKE} _package
|
2001-04-02 06:35:51 -04:00
|
|
|
.endfor
|
|
|
|
|
2001-07-30 10:13:16 -04:00
|
|
|
.PRECIOUS: ${_PACKAGE_COOKIES} ${_INSTALL_COOKIE}
|
|
|
|
|
2000-07-14 19:01:11 -04:00
|
|
|
.if !defined(PKGPATH)
|
|
|
|
_PORTSDIR!= cd ${PORTSDIR} && pwd -P
|
|
|
|
_CURDIR!= cd ${.CURDIR} && pwd -P
|
2000-07-17 03:11:50 -04:00
|
|
|
PKGPATH=${_CURDIR:S,${_PORTSDIR}/,,}
|
1997-01-11 06:58:11 -05:00
|
|
|
.endif
|
|
|
|
|
2001-04-08 12:55:17 -04:00
|
|
|
PKGDEPTH=${PKGPATH:C|[^./][^/]*|..|g}
|
|
|
|
.if empty(SUBPACKAGE)
|
2001-04-16 17:40:04 -04:00
|
|
|
FULLPKGPATH=${PKGPATH}${FLAVOR_EXT:S/-/,/g}
|
2001-04-08 12:55:17 -04:00
|
|
|
.else
|
2001-04-17 12:45:14 -04:00
|
|
|
FULLPKGPATH=${PKGPATH},${SUBPACKAGE}${FLAVOR_EXT:S/-/,/g}
|
2001-04-08 12:55:17 -04:00
|
|
|
.endif
|
|
|
|
|
1996-08-23 07:37:41 -04:00
|
|
|
# A few aliases for *-install targets
|
|
|
|
INSTALL_PROGRAM= \
|
1997-04-27 17:38:33 -04:00
|
|
|
${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
|
1996-08-23 07:37:41 -04:00
|
|
|
INSTALL_SCRIPT= \
|
1997-04-27 17:38:33 -04:00
|
|
|
${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
|
1996-08-23 07:37:41 -04:00
|
|
|
INSTALL_DATA= \
|
1997-04-27 17:38:33 -04:00
|
|
|
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}
|
1996-08-23 07:37:41 -04:00
|
|
|
INSTALL_MAN= \
|
1997-04-27 17:38:33 -04:00
|
|
|
${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
|
2000-02-08 19:26:32 -05:00
|
|
|
|
1998-09-07 18:33:19 -04:00
|
|
|
INSTALL_PROGRAM_DIR= \
|
2000-02-08 19:26:32 -05:00
|
|
|
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${DIRMODE}
|
1998-09-07 18:33:19 -04:00
|
|
|
INSTALL_SCRIPT_DIR= \
|
|
|
|
${INSTALL_PROGRAM_DIR}
|
|
|
|
INSTALL_DATA_DIR= \
|
2000-02-08 19:26:32 -05:00
|
|
|
${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${DIRMODE}
|
1998-09-07 18:33:19 -04:00
|
|
|
INSTALL_MAN_DIR= \
|
2000-02-08 19:26:32 -05:00
|
|
|
${INSTALL} -d -o ${MANOWN} -g ${MANGRP} -m ${DIRMODE}
|
1996-08-23 07:37:41 -04:00
|
|
|
|
2000-09-17 12:26:57 -04:00
|
|
|
_INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
|
1997-09-09 11:11:28 -04:00
|
|
|
BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
|
|
|
|
BSD_INSTALL_DATA="${INSTALL_DATA}" \
|
1998-09-07 18:33:19 -04:00
|
|
|
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}"
|
2000-09-17 12:26:57 -04:00
|
|
|
MAKE_ENV+= ${_INSTALL_MACROS}
|
|
|
|
SCRIPTS_ENV+= ${_INSTALL_MACROS}
|
1997-09-09 11:11:28 -04:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
# The user can override the NO_PACKAGE by specifying this from
|
|
|
|
# the make command line
|
|
|
|
.if defined(FORCE_PACKAGE)
|
|
|
|
.undef NO_PACKAGE
|
|
|
|
.endif
|
|
|
|
|
2000-03-29 10:59:50 -05:00
|
|
|
|
2000-06-09 12:26:54 -04:00
|
|
|
# Create the generic variable substitution list, from subst vars
|
2001-05-23 10:18:24 -04:00
|
|
|
SUBST_VARS+=MACHINE_ARCH ARCH HOMEPAGE PREFIX SYSCONFDIR FLAVOR_EXT
|
2000-06-09 12:26:54 -04:00
|
|
|
_SED_SUBST=sed
|
|
|
|
.for _v in ${SUBST_VARS}
|
|
|
|
_SED_SUBST+=-e 's,$${${_v}},${${_v}},g'
|
|
|
|
.endfor
|
2001-03-21 19:22:36 -05:00
|
|
|
_SED_SUBST+=-e 's,$${FLAVORS},${FLAVOR_EXT},g' -e 's,$$\\,$$,g'
|
2000-06-09 12:26:54 -04:00
|
|
|
# and append it to the PLIST substitution pipeline
|
|
|
|
SED_PLIST+=|${_SED_SUBST}
|
2000-03-29 10:59:50 -05:00
|
|
|
|
2000-06-09 12:26:54 -04:00
|
|
|
# find out the most appropriate PLIST source
|
2001-03-21 19:22:36 -05:00
|
|
|
.if !defined(PLIST) && exists(${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT}.${ARCH})
|
|
|
|
PLIST= ${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT}.${ARCH}
|
2001-05-05 19:42:03 -04:00
|
|
|
.else
|
|
|
|
.if !defined(PLIST) && exists(${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT}.${MACHINE_ARCH})
|
|
|
|
PLIST= ${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT}.${MACHINE_ARCH}
|
|
|
|
.endif
|
2000-03-31 13:51:09 -05:00
|
|
|
.endif
|
2001-03-21 19:22:36 -05:00
|
|
|
.if !defined(PLIST) && defined(NO_SHARED_LIBS) && exists(${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT}.noshared)
|
|
|
|
PLIST= ${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT}.noshared
|
2000-03-31 13:51:09 -05:00
|
|
|
.endif
|
2001-03-21 19:22:36 -05:00
|
|
|
.if !defined(PLIST) && exists(${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT})
|
|
|
|
PLIST= ${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT}
|
2000-03-31 13:51:09 -05:00
|
|
|
.endif
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
.if !defined(PLIST) && exists(${PKGDIR}/PLIST${SUBPACKAGE}.${ARCH})
|
|
|
|
PLIST= ${PKGDIR}/PLIST${SUBPACKAGE}.${ARCH}
|
2001-05-05 19:42:03 -04:00
|
|
|
.else
|
|
|
|
.if !defined(PLIST) && exists(${PKGDIR}/PLIST${SUBPACKAGE}.${MACHINE_ARCH})
|
|
|
|
PLIST= ${PKGDIR}/PLIST${SUBPACKAGE}.${MACHINE_ARCH}
|
|
|
|
.endif
|
2000-03-31 13:51:09 -05:00
|
|
|
.endif
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
.if !defined(PLIST) && defined(NO_SHARED_LIBS) && exists(${PKGDIR}/PLIST${SUBPACKAGE}.noshared)
|
|
|
|
PLIST= ${PKGDIR}/PLIST${SUBPACKAGE}.noshared
|
2000-03-31 13:51:09 -05:00
|
|
|
.endif
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
PLIST?= ${PKGDIR}/PLIST${SUBPACKAGE}
|
1997-09-09 11:11:28 -04:00
|
|
|
|
2000-06-09 12:26:54 -04:00
|
|
|
# Likewise for DESCR/MESSAGE/COMMENT
|
2001-03-21 19:22:36 -05:00
|
|
|
.if defined(COMMENT${SUBPACKAGE}${FLAVOR_EXT})
|
2001-05-23 09:28:14 -04:00
|
|
|
_COMMENT=${COMMENT${SUBPACKAGE}${FLAVOR_EXT}}
|
2001-03-16 09:56:41 -05:00
|
|
|
.elif defined(COMMENT${SUBPACKAGE})
|
2001-05-23 09:28:14 -04:00
|
|
|
_COMMENT=${COMMENT${SUBPACKAGE}}
|
2000-03-29 10:59:50 -05:00
|
|
|
.endif
|
2000-06-09 12:26:54 -04:00
|
|
|
|
2001-03-16 09:56:41 -05:00
|
|
|
${WRKPKG}/COMMENT${SUBPACKAGE}:
|
2001-05-23 09:28:14 -04:00
|
|
|
.if defined(_COMMENT)
|
|
|
|
@echo ${_COMMENT} >$@
|
|
|
|
.else
|
2001-07-17 12:11:45 -04:00
|
|
|
ERRORS+="Fatal: Missing comment."
|
2001-05-23 09:28:14 -04:00
|
|
|
.endif
|
2001-03-16 09:56:41 -05:00
|
|
|
|
2000-06-09 12:26:54 -04:00
|
|
|
.if exists(${PKGDIR}/MESSAGE${SUBPACKAGE})
|
|
|
|
MESSAGE?= ${PKGDIR}/MESSAGE${SUBPACKAGE}
|
|
|
|
.endif
|
|
|
|
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
DESCR?= ${PKGDIR}/DESCR${SUBPACKAGE}
|
2000-03-29 10:59:50 -05:00
|
|
|
|
2000-06-09 12:26:54 -04:00
|
|
|
# And create the actual files from sources
|
2000-06-16 19:53:40 -04:00
|
|
|
${WRKPKG}/PLIST${SUBPACKAGE}: ${PLIST}
|
2001-04-17 12:45:14 -04:00
|
|
|
@echo "@comment subdir=${FULLPKGPATH} cdrom=${PERMIT_PACKAGE_CDROM:L} ftp=${PERMIT_PACKAGE_FTP:L}" >$@.tmp
|
2001-08-12 07:33:10 -04:00
|
|
|
@self=${FULLPKGNAME${SUBPACKAGE}} exec ${MAKE} new-depends|sort -u >>$@.tmp
|
2001-04-02 07:50:25 -04:00
|
|
|
.if defined(NO_SHARED_LIBS)
|
2001-07-03 08:06:13 -04:00
|
|
|
@sed -e '/^!%%SHARED%%$$/r${PKGDIR}/PFRAG.no-shared${SUBPACKAGE}' \
|
|
|
|
-e '/^%%!SHARED%%$$/r${PKGDIR}/PFRAG.no-shared${SUBPACKAGE}' \
|
2000-06-09 12:26:54 -04:00
|
|
|
-e '//d' -e '/^%%SHARED%%$$/d' <$? \
|
2001-04-02 07:50:25 -04:00
|
|
|
${SED_PLIST} >>$@.tmp && mv -f $@.tmp $@
|
|
|
|
.else
|
2000-06-30 17:42:36 -04:00
|
|
|
@if [ -x /sbin/ldconfig ]; then \
|
2001-07-03 08:06:13 -04:00
|
|
|
sed -e '/^!%%SHARED%%$$/d' \
|
|
|
|
-e '/^%%!SHARED%%$$/d' \
|
2000-06-30 17:42:36 -04:00
|
|
|
-e '/^%%SHARED%%$$/r${PKGDIR}/PFRAG.shared${SUBPACKAGE}' \
|
|
|
|
-e '//d' <$? ${SED_PLIST} \
|
2001-04-02 07:50:25 -04:00
|
|
|
| sed -f ${LDCONFIG_SED_SCRIPT} >>$@.tmp && mv -f $@.tmp $@; \
|
2000-06-30 17:42:36 -04:00
|
|
|
else \
|
2001-07-03 08:06:13 -04:00
|
|
|
sed -e '/^!%%SHARED%%$$/d' \
|
|
|
|
-e '/^%%!SHARED%%$$/d' \
|
2000-06-30 17:42:36 -04:00
|
|
|
-e '/^%%SHARED%%$$/r${PKGDIR}/PFRAG.shared${SUBPACKAGE}' \
|
|
|
|
-e '//d' <$? \
|
2001-04-02 07:50:25 -04:00
|
|
|
${SED_PLIST} >>$@.tmp && mv -f $@.tmp $@; \
|
2000-06-30 17:42:36 -04:00
|
|
|
fi
|
2001-04-02 07:50:25 -04:00
|
|
|
.endif
|
2000-06-09 12:26:54 -04:00
|
|
|
|
2001-03-06 13:59:38 -05:00
|
|
|
MTREE_FILE?=
|
|
|
|
MTREE_FILE+=${PORTSDIR}/infrastructure/db/fake.mtree
|
|
|
|
|
2000-06-16 19:53:40 -04:00
|
|
|
${WRKPKG}/DESCR${SUBPACKAGE}: ${DESCR}
|
2000-06-09 12:26:54 -04:00
|
|
|
@${_SED_SUBST} <$? >$@.tmp && mv -f $@.tmp $@
|
2000-05-30 12:39:04 -04:00
|
|
|
|
2001-03-06 13:59:38 -05:00
|
|
|
${WRKPKG}/mtree.spec: ${MTREE_FILE}
|
|
|
|
@${_SED_SUBST} ${MTREE_FILE}>$@.tmp && mv -f $@.tmp $@
|
|
|
|
|
2001-07-30 10:34:34 -04:00
|
|
|
PKG_TMPDIR?= /var/tmp
|
1996-06-03 18:47:10 -04:00
|
|
|
PKG_CMD?= /usr/sbin/pkg_create
|
1998-11-24 20:08:35 -05:00
|
|
|
PKG_DELETE?= /usr/sbin/pkg_delete
|
1999-12-01 08:36:50 -05:00
|
|
|
_SORT_DEPENDS?=tsort|tail -r
|
1999-04-20 14:22:56 -04:00
|
|
|
|
2000-06-09 12:26:54 -04:00
|
|
|
# Fill out package command, and package dependencies
|
2001-03-16 09:56:41 -05:00
|
|
|
_PKG_PREREQ= ${WRKPKG}/PLIST${SUBPACKAGE} ${WRKPKG}/DESCR${SUBPACKAGE} ${WRKPKG}/COMMENT${SUBPACKAGE}
|
2000-06-09 12:26:54 -04:00
|
|
|
# Note that if you override PKG_ARGS, you will not get correct dependencies
|
1996-06-03 18:47:10 -04:00
|
|
|
.if !defined(PKG_ARGS)
|
2001-03-16 09:56:41 -05:00
|
|
|
PKG_ARGS= -v -c '${WRKPKG}/COMMENT${SUBPACKAGE}' -d ${WRKPKG}/DESCR${SUBPACKAGE}
|
2000-06-16 19:53:40 -04:00
|
|
|
PKG_ARGS+=-f ${WRKPKG}/PLIST${SUBPACKAGE} -p ${PREFIX}
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
. if exists(${PKGDIR}/INSTALL${SUBPACKAGE})
|
2000-06-16 19:53:40 -04:00
|
|
|
PKG_ARGS+= -i ${WRKPKG}/INSTALL${SUBPACKAGE}
|
|
|
|
_PKG_PREREQ+=${WRKPKG}/INSTALL${SUBPACKAGE}
|
|
|
|
${WRKPKG}/INSTALL${SUBPACKAGE}: ${PKGDIR}/INSTALL${SUBPACKAGE}
|
|
|
|
@${_SED_SUBST} <$? >$@.tmp && mv -f $@.tmp $@
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
. if exists(${PKGDIR}/DEINSTALL${SUBPACKAGE})
|
2000-06-16 19:53:40 -04:00
|
|
|
PKG_ARGS+= -k ${WRKPKG}/DEINSTALL${SUBPACKAGE}
|
|
|
|
_PKG_PREREQ+=${WRKPKG}/DEINSTALL${SUBPACKAGE}
|
|
|
|
${WRKPKG}/DEINSTALL${SUBPACKAGE}: ${PKGDIR}/DEINSTALL${SUBPACKAGE}
|
|
|
|
@${_SED_SUBST} <$? >$@.tmp && mv -f $@.tmp $@
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
. if exists(${PKGDIR}/REQ${SUBPACKAGE})
|
2000-06-16 19:53:40 -04:00
|
|
|
PKG_ARGS+= -r ${WRKPKG}/REQ${SUBPACKAGE}
|
|
|
|
_PKG_PREREQ+=${WRKPKG}/REQ${SUBPACKAGE}
|
|
|
|
${WRKPKG}/REQ${SUBPACKAGE}: ${PKGDIR}/REQ${SUBPACKAGE}
|
|
|
|
@${_SED_SUBST} <$? >$@.tmp && mv -f $@.tmp $@
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
2000-06-09 12:26:54 -04:00
|
|
|
. if defined(MESSAGE)
|
2000-06-16 19:53:40 -04:00
|
|
|
PKG_ARGS+= -D ${WRKPKG}/MESSAGE${SUBPACKAGE}
|
|
|
|
_PKG_PREREQ+=${WRKPKG}/MESSAGE${SUBPACKAGE}
|
|
|
|
${WRKPKG}/MESSAGE${SUBPACKAGE}: ${MESSAGE}
|
|
|
|
@${_SED_SUBST} <$? >$@.tmp && mv -f $@.tmp $@
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
2001-01-08 17:34:51 -05:00
|
|
|
.if ${FAKE:L} == "yes"
|
2000-03-03 16:24:50 -05:00
|
|
|
PKG_ARGS+= -s ${WRKINST}${PREFIX}
|
|
|
|
.endif
|
|
|
|
|
1999-08-22 19:44:51 -04:00
|
|
|
CHMOD?= /bin/chmod
|
|
|
|
CHOWN?= /usr/sbin/chown
|
1997-09-09 11:11:28 -04:00
|
|
|
GUNZIP_CMD?= /usr/bin/gunzip -f
|
1996-12-25 15:10:09 -05:00
|
|
|
GZCAT?= /usr/bin/gzcat
|
|
|
|
GZIP?= -9
|
|
|
|
GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
|
1998-02-10 03:33:16 -05:00
|
|
|
LDCONFIG?= [ ! -x /sbin/ldconfig ] || /sbin/ldconfig
|
2000-08-22 19:10:38 -04:00
|
|
|
LDCONFIG_SED_SCRIPT?=${PORTSDIR}/infrastructure/install/ldconfig-new.sed
|
1998-11-18 23:20:09 -05:00
|
|
|
M4?= /usr/bin/m4
|
1999-09-02 17:57:32 -04:00
|
|
|
STRIP?= /usr/bin/strip
|
1998-11-24 20:08:35 -05:00
|
|
|
|
1999-12-08 12:00:15 -05:00
|
|
|
# Autoconf scripts MAY tend to use bison by default otherwise
|
|
|
|
YACC?=yacc
|
1998-11-24 20:08:35 -05:00
|
|
|
# XXX ${SETENV} is needed in front of var=value lists whenever the next
|
|
|
|
# command is expanded from a variable, as this could be a shell construct
|
2000-05-16 14:14:29 -04:00
|
|
|
SETENV?= /usr/bin/env -i
|
1997-09-09 11:11:28 -04:00
|
|
|
SH?= /bin/sh
|
1999-12-03 09:57:12 -05:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
# Used to print all the '===>' style prompts - override this to turn them off.
|
1999-11-22 18:44:01 -05:00
|
|
|
ECHO_MSG?= echo
|
1996-06-03 18:47:10 -04:00
|
|
|
|
1999-09-22 07:49:23 -04:00
|
|
|
# XXX
|
1999-11-22 18:44:01 -05:00
|
|
|
_DEPEND_ECHO?= echo
|
1999-09-22 07:49:23 -04:00
|
|
|
|
1999-09-26 06:50:07 -04:00
|
|
|
# basic master sites configuration
|
1998-04-04 23:20:38 -05:00
|
|
|
|
2000-01-27 10:32:15 -05:00
|
|
|
.if exists(${PORTSDIR}/infrastructure/db/network.conf)
|
1999-09-26 06:48:47 -04:00
|
|
|
.include "${PORTSDIR}/infrastructure/db/network.conf"
|
2000-01-27 10:32:15 -05:00
|
|
|
.else
|
|
|
|
.include "${PORTSDIR}/infrastructure/templates/network.conf.template"
|
|
|
|
.endif
|
1997-09-09 11:11:28 -04:00
|
|
|
# Where to put distfiles that don't have any other master site
|
2000-12-01 11:31:11 -05:00
|
|
|
# ;;; This is referenced in a few Makefiles -- we'd like to get rid of it
|
1998-04-04 23:20:38 -05:00
|
|
|
#
|
1997-09-09 11:11:28 -04:00
|
|
|
MASTER_SITE_LOCAL?= \
|
1998-09-07 18:33:19 -04:00
|
|
|
ftp://ftp.netbsd.org/pub/NetBSD/packages/distfiles/LOCAL_PORTS/ \
|
1997-09-09 11:11:28 -04:00
|
|
|
ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/LOCAL_PORTS/
|
|
|
|
|
1999-09-26 06:50:07 -04:00
|
|
|
# Empty declarations to avoid "variable XXX is recursive" errors
|
|
|
|
MASTER_SITES?=
|
|
|
|
# Substitute subdirectory names in intermediate form
|
1999-11-22 15:40:53 -05:00
|
|
|
_MASTER_SITES:= ${MASTER_SITES:S@%SUBDIR%@${MASTER_SITE_SUBDIR}@}
|
1996-06-03 18:47:10 -04:00
|
|
|
# I guess we're in the master distribution business! :) As we gain mirror
|
|
|
|
# sites for distfiles, add them to this list.
|
|
|
|
.if !defined(MASTER_SITE_OVERRIDE)
|
1999-09-26 06:50:07 -04:00
|
|
|
MASTER_SITES:= ${_MASTER_SITES} ${MASTER_SITE_BACKUP}
|
1996-06-03 18:47:10 -04:00
|
|
|
.else
|
1999-09-26 06:50:07 -04:00
|
|
|
MASTER_SITES:= ${MASTER_SITE_OVERRIDE} ${_MASTER_SITES}
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
|
|
|
|
2000-02-04 06:15:16 -05:00
|
|
|
# _SITE_SELECTOR chooses the value of sites based on select.
|
|
|
|
_SITE_SELECTOR=case $$select in
|
|
|
|
|
|
|
|
|
1999-12-21 16:43:37 -05:00
|
|
|
.for _I in 0 1 2 3 4 5 6 7 8 9
|
2000-01-13 12:40:20 -05:00
|
|
|
. if defined(MASTER_SITES${_I})
|
1999-12-21 16:43:37 -05:00
|
|
|
_MASTER_SITES${_I}:= ${MASTER_SITES${_I}:S@%SUBDIR%@${MASTER_SITE_SUBDIR}@}
|
2000-01-13 12:40:20 -05:00
|
|
|
. if !defined(MASTER_SITE_OVERRIDE)
|
1999-12-21 16:43:37 -05:00
|
|
|
MASTER_SITES${_I}:= ${_MASTER_SITES${_I}} ${MASTER_SITE_BACKUP}
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
1999-12-21 16:43:37 -05:00
|
|
|
MASTER_SITES${_I}:= ${MASTER_SITE_OVERRIDE} ${_MASTER_SITES${_I}}
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
2000-02-04 06:15:16 -05:00
|
|
|
_SITE_SELECTOR+=*:${_I}) sites="${MASTER_SITES${_I}}";;
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1999-12-21 16:43:37 -05:00
|
|
|
.endfor
|
2000-02-04 06:15:16 -05:00
|
|
|
_SITE_SELECTOR+=*) sites="${MASTER_SITES}";; esac
|
1999-12-21 16:43:37 -05:00
|
|
|
|
|
|
|
|
1998-04-06 17:46:00 -04:00
|
|
|
# OpenBSD code to handle ports distfiles on a CDROM. The distfiles
|
|
|
|
# are located in /cdrom/distfiles/${DIST_SUBDIR}/ (assuming that the
|
|
|
|
# CDROM is mounted on /cdrom).
|
|
|
|
#
|
|
|
|
.if exists(/cdrom/distfiles)
|
2000-09-03 12:00:49 -04:00
|
|
|
CDROM_SITE= /cdrom/distfiles/${DIST_SUBDIR}
|
1998-04-06 17:46:00 -04:00
|
|
|
.endif
|
|
|
|
|
1999-12-23 19:27:58 -05:00
|
|
|
.if defined(CDROM_SITE)
|
2000-01-13 12:40:20 -05:00
|
|
|
. if defined(FETCH_SYMLINK_DISTFILES)
|
2000-07-20 22:38:33 -04:00
|
|
|
_CDROM_OVERRIDE=if ln -s ${CDROM_SITE}/$$f .; then exit 0; fi
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
2000-07-20 22:38:33 -04:00
|
|
|
_CDROM_OVERRIDE=if cp -f ${CDROM_SITE}/$$f .; then exit 0; fi
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1999-12-23 19:27:58 -05:00
|
|
|
.else
|
|
|
|
_CDROM_OVERRIDE=:
|
|
|
|
.endif
|
|
|
|
|
2000-09-11 14:06:24 -04:00
|
|
|
EXTRACT_SUFX?= .tar.gz
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
|
2000-02-04 06:15:16 -05:00
|
|
|
|
2000-02-04 07:55:33 -05:00
|
|
|
_EVERYTHING=${DISTFILES}
|
|
|
|
_DISTFILES= ${DISTFILES:C/:[0-9]$//}
|
|
|
|
ALLFILES= ${_DISTFILES}
|
2000-02-04 06:15:16 -05:00
|
|
|
|
|
|
|
.if defined(PATCHFILES)
|
2000-02-04 07:55:33 -05:00
|
|
|
_PATCHFILES=${PATCHFILES:C/:[0-9]$//}
|
2000-02-04 06:15:16 -05:00
|
|
|
_EVERYTHING+=${PATCHFILES}
|
2000-02-04 07:55:33 -05:00
|
|
|
ALLFILES+= ${_PATCHFILES}
|
2000-02-04 06:15:16 -05:00
|
|
|
.endif
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2000-02-04 06:15:16 -05:00
|
|
|
.if make(makesum) || make(addsum) || make(list-distfiles) || defined(__FETCH_ALL)
|
2000-01-13 12:40:20 -05:00
|
|
|
. if defined(SUPDISTFILES)
|
2000-02-04 06:15:16 -05:00
|
|
|
_EVERYTHING+= ${SUPDISTFILES}
|
|
|
|
ALLFILES+= ${SUPDISTFILES:C/:[0-9]$//}
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1999-04-20 14:04:27 -04:00
|
|
|
.endif
|
1996-12-25 15:10:09 -05:00
|
|
|
|
2000-02-04 15:33:42 -05:00
|
|
|
CKSUMFILES=
|
2000-02-22 09:07:09 -05:00
|
|
|
# First, remove duplicates
|
|
|
|
.for _file in ${ALLFILES}
|
|
|
|
. if empty(CKSUMFILES:M${_file})
|
|
|
|
CKSUMFILES+=${_file}
|
2000-02-04 15:33:42 -05:00
|
|
|
. endif
|
|
|
|
.endfor
|
2000-02-22 09:07:09 -05:00
|
|
|
ALLFILES:=${CKSUMFILES}
|
|
|
|
|
|
|
|
.if defined(IGNOREFILES)
|
|
|
|
. for _file in ${IGNOREFILES}
|
|
|
|
CKSUMFILES:=${CKSUMFILES:N${_file}}
|
|
|
|
. endfor
|
|
|
|
.endif
|
1996-12-25 15:10:09 -05:00
|
|
|
|
|
|
|
# List of all files, with ${DIST_SUBDIR} in front. Used for checksum.
|
|
|
|
.if defined(DIST_SUBDIR)
|
1999-12-03 12:37:33 -05:00
|
|
|
_CKSUMFILES= ${CKSUMFILES:S/^/${DIST_SUBDIR}\//}
|
|
|
|
_IGNOREFILES= ${IGNOREFILES:S/^/${DIST_SUBDIR}\//}
|
1996-12-25 15:10:09 -05:00
|
|
|
.else
|
1999-12-03 12:37:33 -05:00
|
|
|
_CKSUMFILES= ${CKSUMFILES}
|
|
|
|
_IGNOREFILES= ${IGNOREFILES}
|
1996-12-25 15:10:09 -05:00
|
|
|
.endif
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
# This is what is actually going to be extracted, and is overridable
|
|
|
|
# by user.
|
1999-09-26 06:50:07 -04:00
|
|
|
EXTRACT_ONLY?= ${_DISTFILES}
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2000-09-11 14:06:24 -04:00
|
|
|
# okay, time for some guess work
|
2000-12-23 07:27:17 -05:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.zip)
|
2001-08-18 19:16:57 -04:00
|
|
|
_USE_ZIP?= Yes
|
2000-12-23 07:27:17 -05:00
|
|
|
.endif
|
2001-06-03 10:42:07 -04:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.tar.bz2) || (defined(PATCHFILES) && !empty(_PATCHFILES:M*.bz2))
|
2001-08-18 19:16:57 -04:00
|
|
|
_USE_BZIP2?= Yes
|
2001-06-03 10:42:07 -04:00
|
|
|
.endif
|
2001-08-18 19:16:57 -04:00
|
|
|
_USE_ZIP?= No
|
|
|
|
_USE_BZIP2?= No
|
2000-09-11 14:06:24 -04:00
|
|
|
|
|
|
|
EXTRACT_CASES?=
|
|
|
|
|
2001-07-30 11:07:49 -04:00
|
|
|
_SED_FIX_SHAR?= sed -n -e '/^\#\![[:blank:]]*\/bin\/sh[[:space:]]*$$/,$$p'
|
2001-07-30 10:45:26 -04:00
|
|
|
|
2000-09-11 14:06:24 -04:00
|
|
|
# XXX note that we DON'T set EXTRACT_SUFX.
|
2001-08-18 19:16:57 -04:00
|
|
|
.if ${_USE_ZIP:L} != "no"
|
2000-09-11 14:06:24 -04:00
|
|
|
BUILD_DEPENDS+= ${UNZIP}::archivers/unzip
|
|
|
|
EXTRACT_CASES+= *.zip) ${UNZIP} -q ${FULLDISTDIR}/$$archive -d ${WRKDIR};;
|
2000-12-16 10:44:35 -05:00
|
|
|
.endif
|
2001-08-18 19:16:57 -04:00
|
|
|
.if ${_USE_BZIP2:L} != "no"
|
2000-09-11 14:06:24 -04:00
|
|
|
BUILD_DEPENDS+= ${BZIP2}::archivers/bzip2
|
|
|
|
EXTRACT_CASES+= *.tar.bz2) ${BZIP2} -dc ${FULLDISTDIR}/$$archive | ${TAR} xf -;;
|
2000-12-16 10:44:35 -05:00
|
|
|
.endif
|
2000-09-11 14:06:24 -04:00
|
|
|
EXTRACT_CASES+= *.tar) ${TAR} xf ${FULLDISTDIR}/$$archive;;
|
2001-07-30 10:45:26 -04:00
|
|
|
EXTRACT_CASES+= *.shar.gz|*.shar.Z|*.sh.gz|*.sh.Z) ${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive | ${_SED_FIX_SHAR} | /bin/sh;;
|
|
|
|
EXTRACT_CASES+= *.shar | *.sh) ${_SED_FIX_SHAR} ${FULLDISTDIR}/$$archive | /bin/sh;;
|
2001-06-22 03:21:24 -04:00
|
|
|
EXTRACT_CASES+= *.tar.gz) ${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive | ${TAR} xf -;;
|
|
|
|
EXTRACT_CASES+= *.gz) ${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive >`basename $$archive .gz`;;
|
2000-09-11 14:06:24 -04:00
|
|
|
EXTRACT_CASES+= *) ${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive | ${TAR} xf -;;
|
|
|
|
|
2001-06-03 10:42:07 -04:00
|
|
|
PATCH_CASES?=
|
2001-08-18 19:16:57 -04:00
|
|
|
.if ${_USE_BZIP2:L} != "no"
|
2001-06-03 10:42:07 -04:00
|
|
|
PATCH_CASES+= *.bz2) ${BZIP2} -dc $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
|
|
|
|
.endif
|
|
|
|
PATCH_CASES+= *.Z|*.gz) ${GZCAT} $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
|
|
|
|
PATCH_CASES+= *) ${PATCH} ${PATCH_DIST_ARGS} < $$patchfile;;
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
# Documentation
|
1999-08-22 20:03:42 -04:00
|
|
|
MAINTAINER?= ports@openbsd.org
|
1996-12-25 15:10:09 -05:00
|
|
|
|
|
|
|
.if !defined(CATEGORIES)
|
2001-07-17 12:11:45 -04:00
|
|
|
ERRORS+= "Fatal: CATEGORIES is mandatory."
|
1996-12-25 15:10:09 -05:00
|
|
|
.endif
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2000-06-02 07:42:53 -04:00
|
|
|
|
1999-03-02 23:16:03 -05:00
|
|
|
CONFIGURE_SCRIPT?= configure
|
2001-09-16 10:56:42 -04:00
|
|
|
.if ${CONFIGURE_SCRIPT:M/*}
|
|
|
|
_CONFIGURE_SCRIPT=${CONFIGURE_SCRIPT}
|
1999-03-02 23:16:03 -05:00
|
|
|
.else
|
2001-09-16 10:56:42 -04:00
|
|
|
. if defined(SEPARATE_BUILD)
|
|
|
|
_CONFIGURE_SCRIPT=${WRKSRC}/${CONFIGURE_SCRIPT}
|
|
|
|
. else
|
1999-03-02 23:16:03 -05:00
|
|
|
_CONFIGURE_SCRIPT=./${CONFIGURE_SCRIPT}
|
2001-09-16 10:56:42 -04:00
|
|
|
. endif
|
1999-03-02 23:16:03 -05:00
|
|
|
.endif
|
2001-09-16 10:56:42 -04:00
|
|
|
|
1999-03-02 23:16:03 -05:00
|
|
|
CONFIGURE_ENV+= PATH=${PORTPATH}
|
1996-06-03 18:47:10 -04:00
|
|
|
|
1999-03-01 14:44:18 -05:00
|
|
|
.if defined(NO_SHARED_LIBS)
|
|
|
|
CONFIGURE_SHARED?= --disable-shared
|
|
|
|
.else
|
|
|
|
CONFIGURE_SHARED?= --enable-shared
|
|
|
|
.endif
|
|
|
|
|
2000-02-08 19:23:26 -05:00
|
|
|
# Passed to configure invocations, and user scripts
|
1998-09-07 18:33:19 -04:00
|
|
|
SCRIPTS_ENV+= CURDIR=${.CURDIR} DISTDIR=${DISTDIR} \
|
2000-02-08 19:23:26 -05:00
|
|
|
PATH=${PORTPATH} WRKDIR=${WRKDIR} WRKDIST=${WRKDIST} \
|
|
|
|
WRKSRC=${WRKSRC} WRKBUILD=${WRKBUILD} \
|
1999-02-03 12:53:13 -05:00
|
|
|
PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
|
1997-09-09 11:11:28 -04:00
|
|
|
PORTSDIR=${PORTSDIR} DEPENDS="${DEPENDS}" \
|
|
|
|
PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE}
|
|
|
|
|
|
|
|
.if defined(BATCH)
|
|
|
|
SCRIPTS_ENV+= BATCH=yes
|
|
|
|
.endif
|
|
|
|
|
2001-01-08 17:34:51 -05:00
|
|
|
.if ${FAKE:L} == "yes"
|
2001-01-08 17:10:36 -05:00
|
|
|
MANPREFIX?= ${WRKINST}${TRUEPREFIX}
|
|
|
|
CATPREFIX?= ${WRKINST}${TRUEPREFIX}
|
2000-03-03 16:24:50 -05:00
|
|
|
.endif
|
1996-12-25 15:10:09 -05:00
|
|
|
|
2000-01-06 16:53:27 -05:00
|
|
|
.for sect in 1 2 3 4 5 6 7 8 9 L N
|
1996-12-25 15:10:09 -05:00
|
|
|
MAN${sect}PREFIX?= ${MANPREFIX}
|
1998-09-07 18:33:19 -04:00
|
|
|
CAT${sect}PREFIX?= ${CATPREFIX}
|
1996-12-25 15:10:09 -05:00
|
|
|
.endfor
|
|
|
|
|
|
|
|
MANLANG?= "" # english only by default
|
|
|
|
|
|
|
|
.for lang in ${MANLANG}
|
|
|
|
|
2000-01-13 12:40:20 -05:00
|
|
|
. for sect in 1 2 3 4 5 6 7 8 9 L N
|
|
|
|
. if defined(MAN${sect})
|
1999-11-22 15:34:14 -05:00
|
|
|
_MANPAGES+= ${MAN${sect}:S%^%${MAN${sect}PREFIX}/man/${lang}/man${sect:L}/%}
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
|
|
|
. if defined(CAT${sect})
|
1999-11-22 15:34:14 -05:00
|
|
|
_CATPAGES+= ${CAT${sect}:S%^%${CAT${sect}PREFIX}/man/${lang}/cat${sect:L}/%}
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
|
|
|
. endfor
|
1998-09-07 18:33:19 -04:00
|
|
|
.endfor
|
|
|
|
|
2001-07-17 12:11:45 -04:00
|
|
|
.if defined(ERRORS)
|
|
|
|
.BEGIN:
|
|
|
|
. for _m in ${ERRORS}
|
|
|
|
@echo 1>&2 ${_m}
|
|
|
|
. endfor
|
|
|
|
. if !empty(ERRORS:M"Fatal\:*")
|
|
|
|
@exit 1
|
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
################################################################
|
|
|
|
# Many ways to disable a port.
|
|
|
|
#
|
|
|
|
# If we're in BATCH mode and the port is interactive, or we're
|
|
|
|
# in interactive mode and the port is non-interactive, skip all
|
|
|
|
# the important targets. The reason we have two modes is that
|
|
|
|
# one might want to leave a build in BATCH mode running
|
|
|
|
# overnight, then come back in the morning and do _only_ the
|
|
|
|
# interactive ones that required your intervention.
|
|
|
|
#
|
|
|
|
# Ignore ports that can't be resold if building for a CDROM.
|
|
|
|
#
|
|
|
|
# Don't build a port if it's restricted and we don't want to get
|
|
|
|
# into that.
|
|
|
|
#
|
|
|
|
# Don't build a port if it's broken.
|
1998-04-04 23:20:38 -05:00
|
|
|
#
|
|
|
|
# Don't build a port if it comes with the base system.
|
1996-06-03 18:47:10 -04:00
|
|
|
################################################################
|
|
|
|
|
1997-09-09 11:11:28 -04:00
|
|
|
.if !defined(NO_IGNORE)
|
2000-01-13 12:40:20 -05:00
|
|
|
. if (defined(IS_INTERACTIVE) && defined(BATCH))
|
1996-12-25 15:10:09 -05:00
|
|
|
IGNORE= "is an interactive port"
|
2000-01-13 12:40:20 -05:00
|
|
|
. elif (!defined(IS_INTERACTIVE) && defined(INTERACTIVE))
|
1996-12-25 15:10:09 -05:00
|
|
|
IGNORE= "is not an interactive port"
|
2000-01-13 12:40:20 -05:00
|
|
|
. elif (defined(RESTRICTED) && defined(NO_RESTRICTED))
|
1996-12-25 15:10:09 -05:00
|
|
|
IGNORE= "is restricted: ${RESTRICTED}"
|
2001-08-25 07:23:46 -04:00
|
|
|
. elif defined(USE_X11) && !exists(${X11BASE})
|
1997-09-09 11:11:28 -04:00
|
|
|
IGNORE= "uses X11, but ${X11BASE} not found"
|
2000-01-13 12:40:20 -05:00
|
|
|
. elif defined(BROKEN)
|
1996-12-25 15:10:09 -05:00
|
|
|
IGNORE= "is marked as broken: ${BROKEN}"
|
2000-01-13 12:40:20 -05:00
|
|
|
. elif defined(ONLY_FOR_ARCHS)
|
|
|
|
. for __ARCH in ${MACHINE_ARCH} ${ARCH}
|
|
|
|
. if !empty(ONLY_FOR_ARCHS:M${__ARCH})
|
1999-12-03 12:37:33 -05:00
|
|
|
_ARCH_OK=1
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. if !defined(_ARCH_OK)
|
|
|
|
. if ${MACHINE_ARCH} == "${ARCH}"
|
1998-09-07 18:33:19 -04:00
|
|
|
IGNORE= "is only for ${ONLY_FOR_ARCHS}, not ${MACHINE_ARCH}"
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
1998-11-17 01:39:25 -05:00
|
|
|
IGNORE= "is only for ${ONLY_FOR_ARCHS}, not ${MACHINE_ARCH} \(${ARCH}\)"
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
|
|
|
. endif
|
2001-03-28 05:25:38 -05:00
|
|
|
. elif defined(NOT_FOR_ARCHS)
|
|
|
|
. for __ARCH in ${MACHINE_ARCH} ${ARCH}
|
|
|
|
. if !empty(NOT_FOR_ARCHS:M${__ARCH})
|
|
|
|
IGNORE= "is not for ${NOT_FOR_ARCHS}"
|
|
|
|
. endif
|
|
|
|
. endfor
|
2000-04-09 07:34:01 -04:00
|
|
|
. endif
|
|
|
|
. if !defined(IGNORE) && defined(COMES_WITH)
|
2000-01-13 12:40:20 -05:00
|
|
|
. if ( ${OPSYS_VER} >= ${COMES_WITH} )
|
2001-08-12 07:33:10 -04:00
|
|
|
IGNORE= "-- ${FULLPKGNAME${SUBPACKAGE}:C/-[0-9].*//g} comes with ${OPSYS} as of release ${COMES_WITH}"
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
|
|
|
. endif
|
1996-06-03 18:47:10 -04:00
|
|
|
|
1999-12-19 18:48:36 -05:00
|
|
|
.endif # NO_IGNORE
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
|
1997-09-09 11:11:28 -04:00
|
|
|
.if !defined(DEPENDS_TARGET)
|
2000-01-13 12:40:20 -05:00
|
|
|
. if make(reinstall)
|
1997-09-09 11:11:28 -04:00
|
|
|
DEPENDS_TARGET= reinstall
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
1997-09-09 11:11:28 -04:00
|
|
|
DEPENDS_TARGET= install
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
|
|
|
|
1999-12-19 18:48:36 -05:00
|
|
|
makesum: fetch-all
|
2000-06-16 19:10:41 -04:00
|
|
|
.if !defined(NO_CHECKSUM)
|
1999-12-19 18:48:36 -05:00
|
|
|
@mkdir -p ${FILESDIR} && rm -f ${CHECKSUM_FILE}
|
|
|
|
@cd ${DISTDIR} && \
|
|
|
|
for cipher in ${_CIPHERS}; do \
|
|
|
|
$$cipher ${_CKSUMFILES} >> ${CHECKSUM_FILE}; \
|
|
|
|
done
|
|
|
|
@for file in ${_IGNOREFILES}; do \
|
|
|
|
echo "MD5 ($$file) = IGNORE" >> ${CHECKSUM_FILE}; \
|
|
|
|
done
|
|
|
|
@sort -u -o ${CHECKSUM_FILE} ${CHECKSUM_FILE}
|
1996-12-25 15:10:09 -05:00
|
|
|
.endif
|
1999-12-19 18:48:36 -05:00
|
|
|
|
2000-02-04 06:09:33 -05:00
|
|
|
|
1999-12-19 18:48:36 -05:00
|
|
|
addsum: fetch-all
|
2000-06-16 19:10:41 -04:00
|
|
|
.if !defined(NO_CHECKSUM)
|
1999-12-19 18:48:36 -05:00
|
|
|
@mkdir -p ${FILESDIR} && touch ${CHECKSUM_FILE}
|
|
|
|
@cd ${DISTDIR} && \
|
|
|
|
for cipher in ${_CIPHERS}; do \
|
|
|
|
$$cipher ${_CKSUMFILES} >> ${CHECKSUM_FILE}; \
|
|
|
|
done
|
|
|
|
@for file in ${_IGNOREFILES}; do \
|
|
|
|
echo "MD5 ($$file) = IGNORE" >> ${CHECKSUM_FILE}; \
|
|
|
|
done
|
|
|
|
@sort -u -o ${CHECKSUM_FILE} ${CHECKSUM_FILE}
|
|
|
|
@if [ `sed -e 's/\=.*$$//' ${CHECKSUM_FILE} | uniq -d | wc -l` -ne 0 ]; then \
|
|
|
|
echo "Inconsistent checksum in ${CHECKSUM_FILE}"; \
|
|
|
|
exit 1; \
|
|
|
|
else \
|
|
|
|
${ECHO_MSG} "${CHECKSUM_FILE} updated okay, don't forget to remove cruft"; \
|
|
|
|
fi
|
1999-03-05 11:32:49 -05:00
|
|
|
.endif
|
1996-12-25 15:10:09 -05:00
|
|
|
|
2001-03-28 06:48:12 -05:00
|
|
|
################################################################
|
|
|
|
# Dependency checking
|
|
|
|
################################################################
|
2001-04-02 07:45:11 -04:00
|
|
|
|
|
|
|
# Code to invoke to split dir,-multi,flavor
|
|
|
|
|
2001-03-28 09:33:24 -05:00
|
|
|
_flavor_fragment= \
|
2001-03-28 10:04:34 -05:00
|
|
|
multi=''; flavor=''; sawflavor=false; \
|
2001-03-28 09:33:24 -05:00
|
|
|
case "$$dir" in \
|
|
|
|
*,*) \
|
|
|
|
IFS=,; first=true; for i in $$dir; do \
|
|
|
|
if $$first; then \
|
|
|
|
dir=$$i; first=false; \
|
|
|
|
else \
|
|
|
|
case X"$$i" in \
|
|
|
|
X-*) \
|
|
|
|
multi="$$i";; \
|
|
|
|
*) \
|
2001-03-28 10:04:34 -05:00
|
|
|
sawflavor=true; \
|
2001-03-28 09:33:24 -05:00
|
|
|
flavor="$$flavor $$i";; \
|
|
|
|
esac \
|
|
|
|
fi; \
|
2001-04-04 05:55:34 -04:00
|
|
|
done; unset IFS;; \
|
2001-03-28 09:33:24 -05:00
|
|
|
esac; \
|
|
|
|
toset="PKGPATH=$$dir"; \
|
|
|
|
case X$$multi in "X");; *) \
|
|
|
|
toset="$$toset SUBPACKAGE=\"$$multi\"";; \
|
|
|
|
esac; \
|
2001-03-28 10:04:34 -05:00
|
|
|
if $$sawflavor; then \
|
2001-03-28 10:07:05 -05:00
|
|
|
toset="$$toset FLAVOR=\"$$flavor\""; \
|
2001-03-28 10:04:34 -05:00
|
|
|
fi
|
2001-03-28 09:33:24 -05:00
|
|
|
|
2001-04-02 07:45:11 -04:00
|
|
|
# Various dependency styles
|
2001-03-28 06:48:12 -05:00
|
|
|
|
2001-04-20 12:25:24 -04:00
|
|
|
_fetch_depends_fragment= \
|
|
|
|
if pkg dependencies check $$pkg; then \
|
|
|
|
found=true; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
_build_depends_fragment=${_fetch_depends_fragment}
|
|
|
|
_run_depends_fragment=${_fetch_depends_fragment}
|
|
|
|
|
2001-09-14 11:04:23 -04:00
|
|
|
.if ${TRUST_PACKAGES:L} == "yes"
|
|
|
|
_lib_depends_fragment=${_fetch_depends_fragment}
|
2001-04-20 12:25:24 -04:00
|
|
|
.else
|
|
|
|
. if defined(NO_SHARED_LIBS)
|
2001-03-28 06:48:12 -05:00
|
|
|
_lib_depends_fragment = \
|
2001-09-05 05:10:34 -04:00
|
|
|
IFS=,; bad=false; for d in $$dep; do \
|
|
|
|
lib=`echo $$d | sed -e 's|\([^\\]\)[\\\.].*|\1|'`; \
|
|
|
|
tmp=`mktemp /tmp/bpmXXXXXXXXXX`; \
|
|
|
|
if ${LD} -r -o $$tmp ${EXTRA_LIBDIRS:S/^/-L/} -L${LOCALBASE}/lib -L${X11BASE}/lib -l$$lib; then :; else\
|
|
|
|
bad=true; msg="$$msg $$lib missing..."; \
|
|
|
|
fi; \
|
|
|
|
done; $$bad || found=true
|
2001-04-20 12:25:24 -04:00
|
|
|
. else
|
2001-03-28 06:48:12 -05:00
|
|
|
_lib_depends_fragment = \
|
2001-09-05 05:10:34 -04:00
|
|
|
IFS=,; bad=false; for d in $$dep; do \
|
|
|
|
lib=`echo $$d | sed -e 's|\.$$||' -e 's|\([^\\]\)\.|\1\\\\.|g'`; \
|
|
|
|
check=`${LDCONFIG} -r | awk "/:-l$$lib[ .]/"'{ print $$3 }'`; \
|
|
|
|
case "X$$check" in "X") bad=true; msg="$$msg $$lib missing...";; esac; \
|
|
|
|
done; $$bad || found=true
|
2001-04-20 12:25:24 -04:00
|
|
|
. endif
|
2001-03-28 06:48:12 -05:00
|
|
|
.endif
|
|
|
|
|
|
|
|
_misc_depends_fragment = :
|
|
|
|
|
|
|
|
depends: lib-depends misc-depends fetch-depends build-depends run-depends
|
|
|
|
|
|
|
|
# Let DEPENDS behave like the others
|
|
|
|
.if defined(DEPENDS)
|
|
|
|
MISC_DEPENDS=${DEPENDS:S/^/nonexistent::/}
|
|
|
|
.endif
|
|
|
|
|
2001-04-02 07:45:11 -04:00
|
|
|
# and the rules for the actual dependencies
|
|
|
|
|
2001-08-12 07:33:10 -04:00
|
|
|
_print-packagename:
|
|
|
|
@echo ${FULLPKGNAME${SUBPACKAGE}}
|
|
|
|
|
2001-03-28 06:48:12 -05:00
|
|
|
.for _DEP in fetch build run lib misc
|
2001-09-05 05:13:18 -04:00
|
|
|
_DEP${_DEP}_COOKIES=
|
2001-03-28 06:48:12 -05:00
|
|
|
. if defined(${_DEP:U}_DEPENDS) && ${NO_DEPENDS:L} == "no"
|
2001-04-12 16:35:59 -04:00
|
|
|
. for _i in ${${_DEP:U}_DEPENDS}
|
2001-09-07 06:56:50 -04:00
|
|
|
${WRKDIR}/.${_DEP}${_i:C,[:./<=>*],-,g}: ${_WRKDIR_COOKIE}
|
2001-08-27 04:47:37 -04:00
|
|
|
@unset PACKAGING DEPENDS_TARGET FLAVOR SUBPACKAGE || true; \
|
2001-04-12 16:35:59 -04:00
|
|
|
echo '${_i}'|{ \
|
|
|
|
IFS=:; read dep pkg dir target; \
|
|
|
|
case "X$$target" in X) target=${DEPENDS_TARGET};; esac; \
|
2001-08-27 04:47:37 -04:00
|
|
|
case "X$$target" in Xinstall|Xreinstall) early_exit=false;; \
|
|
|
|
*) early_exit=true;; esac; \
|
2001-04-12 16:35:59 -04:00
|
|
|
${_flavor_fragment}; \
|
|
|
|
case "X$$pkg" in X) pkg=`cd ${PORTSDIR} && cd $$dir && \
|
2001-08-12 07:33:10 -04:00
|
|
|
eval $$toset ${MAKE} _print-packagename`;; esac; \
|
2001-04-12 16:35:59 -04:00
|
|
|
for abort in false false true; do \
|
|
|
|
if $$abort; then \
|
|
|
|
${ECHO_MSG} "Dependency check failed"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
cd ${PORTSDIR}; \
|
|
|
|
if [ ! -d $$dir ]; then \
|
|
|
|
echo ">> No directory for $$dep ($$dir)"; \
|
|
|
|
fi; \
|
|
|
|
if [ -L $$dir ]; then \
|
|
|
|
echo ">> Broken dependency: $$dir is a symbolic link"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
found=false; \
|
|
|
|
case "$$dep" in \
|
2001-08-27 04:47:37 -04:00
|
|
|
"/nonexistent") ;; \
|
2001-09-05 05:10:34 -04:00
|
|
|
*) \
|
2001-04-12 16:35:59 -04:00
|
|
|
${_${_DEP}_depends_fragment}; \
|
|
|
|
if $$found; then \
|
2001-08-12 07:33:10 -04:00
|
|
|
${ECHO_MSG} "===> ${FULLPKGNAME${SUBPACKAGE}} depends on: $$dep - found"; \
|
2001-03-28 06:48:12 -05:00
|
|
|
break; \
|
2001-04-12 16:35:59 -04:00
|
|
|
else \
|
2001-09-05 05:10:34 -04:00
|
|
|
: $${msg:= not found}; \
|
|
|
|
${ECHO_MSG} "===> ${FULLPKGNAME${SUBPACKAGE}} depends on: $$dep -$$msg"; \
|
2001-04-12 16:35:59 -04:00
|
|
|
fi;; \
|
|
|
|
esac; \
|
|
|
|
${ECHO_MSG} "===> Verifying $$target for $$dep in $$dir"; \
|
|
|
|
if cd $$dir && eval $$toset ${MAKE} ${_DEPEND_THRU} $$target; then \
|
2001-08-12 07:33:10 -04:00
|
|
|
${ECHO_MSG} "===> Returning to build of ${FULLPKGNAME${SUBPACKAGE}}"; \
|
2001-04-12 16:35:59 -04:00
|
|
|
else \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
if $$earlyexit; then \
|
|
|
|
break; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
}
|
2001-09-05 05:13:18 -04:00
|
|
|
@${_MAKE_COOKIE} $@
|
2001-09-07 06:56:50 -04:00
|
|
|
_DEP${_DEP}_COOKIES+=${WRKDIR}/.${_DEP}${_i:C,[:./<=>*],-,g}
|
2001-04-12 16:35:59 -04:00
|
|
|
. endfor
|
2001-03-28 06:48:12 -05:00
|
|
|
. endif
|
2001-09-05 05:13:18 -04:00
|
|
|
${_DEP}-depends: ${_DEP${_DEP}_COOKIES}
|
2001-03-28 06:48:12 -05:00
|
|
|
.endfor
|
|
|
|
|
|
|
|
|
2001-09-05 05:13:18 -04:00
|
|
|
|
2001-03-29 14:01:05 -05:00
|
|
|
.if defined(IGNORE) && !defined(NO_IGNORE)
|
|
|
|
fetch checksum extract patch configure all build install \
|
|
|
|
uninstall deinstall fake package:
|
|
|
|
. if !defined(IGNORE_SILENT)
|
2001-08-12 07:33:10 -04:00
|
|
|
@${ECHO_MSG} "===> ${FULLPKGNAME${SUBPACKAGE}} ${IGNORE}."
|
2001-03-29 14:01:05 -05:00
|
|
|
. endif
|
|
|
|
|
|
|
|
.else
|
|
|
|
|
|
|
|
|
|
|
|
# Most standard port targets create a cookie to avoid being re-run.
|
|
|
|
#
|
|
|
|
# fetch is an exception, as it uses the files it fetches as `cookies',
|
|
|
|
# and it's run by checksum, so in essence it's a sub-goal of extract,
|
|
|
|
# in normal use.
|
|
|
|
#
|
|
|
|
# Besides, fetch can't create cookies, as it does not have WRKDIR available
|
|
|
|
# in the first place.
|
|
|
|
#
|
|
|
|
# IMPORTANT: pre-fetch/do-fetch/post-fetch MUST be designed so that they
|
|
|
|
# can be run several times in a row.
|
|
|
|
|
|
|
|
fetch: fetch-depends
|
|
|
|
# You need to define PERMIT_* to make the warning go away.
|
|
|
|
# See ports/infrastructure/templates/Makefile.template
|
|
|
|
@${ECHO_MSG} "===> Checking files for ${FULLPKGNAME}"
|
|
|
|
. if !defined(PERMIT_PACKAGE_CDROM) || !defined(PERMIT_PACKAGE_FTP) || \
|
|
|
|
!defined(PERMIT_DISTFILES_CDROM) || !defined(PERMIT_DISTFILES_FTP)
|
|
|
|
@echo >&2 "*** The licensing info for this port is incomplete."
|
|
|
|
@echo >&2 "*** Please notify the OpenBSD port maintainer: ${MAINTAINER}"
|
|
|
|
. endif
|
|
|
|
. if target(pre-fetch)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} pre-fetch
|
|
|
|
. endif
|
|
|
|
. if target(do-fetch)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} do-fetch
|
|
|
|
. else
|
|
|
|
# What FETCH normally does:
|
|
|
|
. if !empty(ALLFILES)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} ${ALLFILES:S@^@${FULLDISTDIR}/@}
|
|
|
|
. endif
|
|
|
|
# End of FETCH
|
|
|
|
. endif
|
|
|
|
. if target(post-fetch)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-fetch
|
|
|
|
. endif
|
|
|
|
|
|
|
|
|
|
|
|
# Set to true to try to retrieve older distfiles from ftp.openbsd.org if
|
|
|
|
# checksums no longer match.
|
|
|
|
|
|
|
|
REFETCH?=false
|
|
|
|
|
|
|
|
checksum: fetch
|
|
|
|
. if ! defined(NO_CHECKSUM)
|
|
|
|
@if [ ! -f ${CHECKSUM_FILE} ]; then \
|
|
|
|
${ECHO_MSG} ">> No checksum file."; \
|
|
|
|
else \
|
|
|
|
cd ${DISTDIR}; OK=true; list=''; \
|
|
|
|
for file in ${_CKSUMFILES}; do \
|
|
|
|
for cipher in ${PREFERRED_CIPHERS}; do \
|
|
|
|
set -- `grep -i "^$$cipher ($$file)" ${CHECKSUM_FILE}` && break || \
|
|
|
|
${ECHO_MSG} ">> No $$cipher checksum recorded for $$file."; \
|
|
|
|
done; \
|
|
|
|
case "$$4" in \
|
|
|
|
"") \
|
|
|
|
${ECHO_MSG} ">> No checksum recorded for $$file."; \
|
|
|
|
OK=false;; \
|
|
|
|
"IGNORE") \
|
|
|
|
echo ">> Checksum for $$file is set to IGNORE in md5 file even though"; \
|
|
|
|
echo " the file is not in the "'$$'"{IGNOREFILES} list."; \
|
|
|
|
OK=false;; \
|
|
|
|
*) \
|
|
|
|
CKSUM=`$$cipher < $$file`; \
|
|
|
|
case "$$CKSUM" in \
|
|
|
|
"$$4") \
|
|
|
|
${ECHO_MSG} ">> Checksum OK for $$file. ($$cipher)";; \
|
|
|
|
*) \
|
|
|
|
echo ">> Checksum mismatch for $$file. ($$cipher)"; \
|
|
|
|
list="$$list $$file $$cipher $$4"; \
|
|
|
|
OK=false;; \
|
|
|
|
esac;; \
|
|
|
|
esac; \
|
|
|
|
done; \
|
|
|
|
set --; \
|
|
|
|
for file in ${_IGNOREFILES}; do \
|
|
|
|
set -- `grep "($$file)" ${CHECKSUM_FILE}` || \
|
|
|
|
{ echo ">> No checksum recorded for $$file, file is in "'$$'"{IGNOREFILES} list." && \
|
|
|
|
OK=false; } ; \
|
|
|
|
case "$$4" in \
|
|
|
|
"IGNORE") : ;; \
|
|
|
|
*) \
|
|
|
|
echo ">> Checksum for $$file is not set to IGNORE in md5 file even though"; \
|
|
|
|
echo " the file is in the "'$$'"{IGNOREFILES} list."; \
|
|
|
|
OK=false;; \
|
|
|
|
esac; \
|
|
|
|
done; \
|
|
|
|
if ! $$OK; then \
|
|
|
|
if ${REFETCH}; then \
|
|
|
|
cd ${.CURDIR} && ${MAKE} refetch PROBLEMS="$$list"; \
|
|
|
|
else \
|
|
|
|
echo "Make sure the Makefile and checksum file (${CHECKSUM_FILE})"; \
|
|
|
|
echo "are up to date. If you want to override this check, type"; \
|
|
|
|
echo "\"make NO_CHECKSUM=Yes [other args]\"."; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
fi ; \
|
|
|
|
fi
|
|
|
|
. endif
|
|
|
|
|
|
|
|
refetch:
|
2001-08-16 11:13:17 -04:00
|
|
|
. for file cipher value in ${PROBLEMS}
|
|
|
|
@rm ${FULLDISTDIR}/${file}
|
|
|
|
@cd ${.CURDIR} && ${MAKE} ${FULLDISTDIR}/${file} \
|
|
|
|
MASTER_SITE_OVERRIDE="ftp://ftp.openbsd.org/pub/OpenBSD/distfiles/${cipher}/${value}/"
|
|
|
|
. endfor
|
2001-03-29 14:01:05 -05:00
|
|
|
cd ${.CURDIR} && exec ${MAKE} checksum REFETCH=false
|
|
|
|
|
|
|
|
|
2001-03-28 06:48:12 -05:00
|
|
|
# Normal user-mode targets are PHONY targets, e.g., don't create the
|
|
|
|
# corresponding file. However, there is nothing phony about the cookie.
|
|
|
|
|
|
|
|
# The cookie's recipe hold the real rule for each of those targets.
|
|
|
|
|
|
|
|
extract: ${_EXTRACT_COOKIE}
|
2001-09-05 05:13:18 -04:00
|
|
|
patch: ${_DEPbuild_COOKIES} ${_DEPlib_COOKIES} ${_DEPmisc_COOKIES} \
|
|
|
|
${_PATCH_COOKIE}
|
|
|
|
distpatch: ${_DEPbuild_COOKIES} ${_DEPlib_COOKIES} ${_DEPmisc_COOKIES} \
|
|
|
|
${_DISTPATCH_COOKIE}
|
|
|
|
configure: ${_DEPbuild_COOKIES} ${_DEPlib_COOKIES} ${_DEPmisc_COOKIES} \
|
|
|
|
${_CONFIGURE_COOKIE}
|
|
|
|
all build: ${_DEPbuild_COOKIES} ${_DEPlib_COOKIES} ${_DEPmisc_COOKIES} \
|
|
|
|
${_BUILD_COOKIE}
|
2001-03-28 06:48:12 -05:00
|
|
|
.if defined(ALWAYS_PACKAGE)
|
2001-04-02 06:35:51 -04:00
|
|
|
install: ${_INSTALL_COOKIE} ${_PACKAGE_COOKIES}
|
2001-03-28 06:48:12 -05:00
|
|
|
.else
|
|
|
|
install: ${_INSTALL_COOKIE}
|
|
|
|
.endif
|
|
|
|
fake: ${_FAKE_COOKIE}
|
2001-04-02 06:35:51 -04:00
|
|
|
package: ${_PACKAGE_COOKIES}
|
2000-02-04 06:09:33 -05:00
|
|
|
|
2001-03-29 14:01:05 -05:00
|
|
|
.endif # IGNORECMD
|
|
|
|
|
2001-08-16 10:49:31 -04:00
|
|
|
_create_wrkobjdir = \
|
|
|
|
rm -rf ${WRKOBJDIR}/${PKGNAME}${FLAVOR_EXT}; \
|
|
|
|
mkdir -p ${WRKOBJDIR}/${PKGNAME}${FLAVOR_EXT}; \
|
|
|
|
if [ ! -L ${WRKDIR} ] || \
|
|
|
|
[ X`readlink ${WRKDIR}` != X${WRKOBJDIR}/${PKGNAME}${FLAVOR_EXT} ]; then \
|
|
|
|
${ECHO_MSG} "${WRKDIR} -> ${WRKOBJDIR}/${PKGNAME}${FLAVOR_EXT}"; \
|
|
|
|
rm -f ${WRKDIR}; \
|
|
|
|
ln -sf ${WRKOBJDIR}/${PKGNAME}${FLAVOR_EXT} ${WRKDIR}; \
|
|
|
|
fi
|
|
|
|
|
2000-02-04 06:09:33 -05:00
|
|
|
# The real targets. Note that some parts always get run, some parts can be
|
|
|
|
# disabled, and there are hooks to override behavior.
|
|
|
|
|
2001-09-05 05:13:18 -04:00
|
|
|
${_WRKDIR_COOKIE}:
|
|
|
|
. if defined(WRKOBJDIR)
|
|
|
|
@${_create_wrkobjdir}
|
|
|
|
. else
|
|
|
|
@rm -rf ${WRKDIR}
|
|
|
|
@mkdir -p ${WRKDIR}
|
|
|
|
. endif
|
|
|
|
@${_MAKE_COOKIE} $@
|
|
|
|
|
|
|
|
${_EXTRACT_COOKIE}: ${_WRKDIR_COOKIE}
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} checksum build-depends lib-depends misc-depends
|
2001-03-21 19:22:36 -05:00
|
|
|
@${ECHO_MSG} "===> Extracting for ${FULLPKGNAME}"
|
2000-06-16 19:10:41 -04:00
|
|
|
.if target(pre-extract)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} pre-extract
|
2000-06-16 19:10:41 -04:00
|
|
|
.endif
|
|
|
|
.if target(do-extract)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} do-extract
|
2000-06-16 19:10:41 -04:00
|
|
|
.else
|
2000-01-26 18:11:08 -05:00
|
|
|
# What EXTRACT normally does:
|
2000-09-11 14:06:24 -04:00
|
|
|
@PATH=${PORTPATH}; set -e; cd ${WRKDIR}; \
|
|
|
|
for archive in ${EXTRACT_ONLY}; do \
|
|
|
|
case $$archive in \
|
|
|
|
${EXTRACT_CASES} \
|
|
|
|
esac; \
|
1996-06-03 18:47:10 -04:00
|
|
|
done
|
2000-01-26 18:11:08 -05:00
|
|
|
# End of EXTRACT
|
2000-06-16 19:10:41 -04:00
|
|
|
.endif
|
|
|
|
.if target(post-extract)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-extract
|
2000-01-26 18:11:08 -05:00
|
|
|
.endif
|
2001-03-28 06:32:29 -05:00
|
|
|
@${_MAKE_COOKIE} $@
|
2000-02-04 06:09:33 -05:00
|
|
|
|
2000-01-26 18:11:08 -05:00
|
|
|
|
2000-02-04 06:09:33 -05:00
|
|
|
|
|
|
|
# Both distpatch and patch invoke pre-patch, if it's defined.
|
|
|
|
# Hence it needs special treatment (a specific cookie).
|
2000-01-26 18:11:08 -05:00
|
|
|
.if target(pre-patch)
|
2000-02-04 06:09:33 -05:00
|
|
|
${_PREPATCH_COOKIE}:
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} pre-patch
|
2000-09-23 08:36:39 -04:00
|
|
|
. if ${PATCH_CHECK_ONLY:L} != "yes"
|
2001-03-28 06:32:29 -05:00
|
|
|
@${_MAKE_COOKIE} $@
|
2000-09-23 08:36:39 -04:00
|
|
|
. endif
|
2000-01-26 18:11:08 -05:00
|
|
|
.endif
|
2000-02-04 06:09:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# The real distpatch
|
|
|
|
|
|
|
|
${_DISTPATCH_COOKIE}: ${_EXTRACT_COOKIE}
|
2000-06-16 19:10:41 -04:00
|
|
|
.if target(pre-patch)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} ${_PREPATCH_COOKIE}
|
2000-06-16 19:10:41 -04:00
|
|
|
.endif
|
|
|
|
.if target(do-distpatch)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} do-distpatch
|
2000-06-16 19:10:41 -04:00
|
|
|
.else
|
Add intermediate `distpatch' target.
This is done in a tricky way, so as not to disturb the usual sequence
of targets. Namely, you still have
fetch, extract, patch, configure, build, install, package,
but patch does invoke a subtarget distpatch when needed,
and you can
fetch, extract, distpatch, patch, configure, build, install, package
for the same results.
Mostly useful for porters: provide an intermediate point to work on
patches, and make it easy to override distpatch/OpenBSD patches separately.
2000-01-30 10:19:40 -05:00
|
|
|
# What DISTPATCH normally does
|
2000-06-16 19:10:41 -04:00
|
|
|
. if defined(_PATCHFILES)
|
2001-03-21 19:22:36 -05:00
|
|
|
@${ECHO_MSG} "===> Applying distribution patches for ${FULLPKGNAME}"
|
1999-09-22 06:16:58 -04:00
|
|
|
@cd ${FULLDISTDIR}; \
|
2001-06-03 10:42:07 -04:00
|
|
|
for patchfile in ${_PATCHFILES}; do \
|
2000-09-21 22:20:30 -04:00
|
|
|
case "${PATCH_DEBUG:L}" in \
|
2000-09-16 09:54:56 -04:00
|
|
|
no) ;; \
|
2001-06-03 10:42:07 -04:00
|
|
|
*) ${ECHO_MSG} "===> Applying distribution patch $$patchfile" ;; \
|
1999-07-28 08:56:15 -04:00
|
|
|
esac; \
|
2001-06-03 10:42:07 -04:00
|
|
|
case $$patchfile in \
|
|
|
|
${PATCH_CASES} \
|
1996-06-03 18:47:10 -04:00
|
|
|
esac; \
|
1999-07-28 08:56:15 -04:00
|
|
|
done
|
2000-02-04 06:09:33 -05:00
|
|
|
. endif
|
2000-06-16 19:10:41 -04:00
|
|
|
# End of DISTPATCH.
|
|
|
|
.endif
|
|
|
|
.if target(post-distpatch)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-distpatch
|
Add intermediate `distpatch' target.
This is done in a tricky way, so as not to disturb the usual sequence
of targets. Namely, you still have
fetch, extract, patch, configure, build, install, package,
but patch does invoke a subtarget distpatch when needed,
and you can
fetch, extract, distpatch, patch, configure, build, install, package
for the same results.
Mostly useful for porters: provide an intermediate point to work on
patches, and make it easy to override distpatch/OpenBSD patches separately.
2000-01-30 10:19:40 -05:00
|
|
|
.endif
|
2000-09-23 08:36:39 -04:00
|
|
|
.if ${PATCH_CHECK_ONLY:L} != "yes"
|
2001-03-28 06:32:29 -05:00
|
|
|
@${_MAKE_COOKIE} $@
|
2000-09-23 08:36:39 -04:00
|
|
|
.endif
|
Add intermediate `distpatch' target.
This is done in a tricky way, so as not to disturb the usual sequence
of targets. Namely, you still have
fetch, extract, patch, configure, build, install, package,
but patch does invoke a subtarget distpatch when needed,
and you can
fetch, extract, distpatch, patch, configure, build, install, package
for the same results.
Mostly useful for porters: provide an intermediate point to work on
patches, and make it easy to override distpatch/OpenBSD patches separately.
2000-01-30 10:19:40 -05:00
|
|
|
|
2000-02-04 06:09:33 -05:00
|
|
|
# The real patch
|
|
|
|
|
|
|
|
${_PATCH_COOKIE}: ${_EXTRACT_COOKIE}
|
2001-03-21 19:22:36 -05:00
|
|
|
@${ECHO_MSG} "===> Patching for ${FULLPKGNAME}"
|
2000-06-16 19:10:41 -04:00
|
|
|
.if target(pre-patch)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} ${_PREPATCH_COOKIE}
|
2000-06-16 19:10:41 -04:00
|
|
|
.endif
|
|
|
|
.if target(do-patch)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} do-patch
|
2000-06-16 19:10:41 -04:00
|
|
|
.else
|
Add intermediate `distpatch' target.
This is done in a tricky way, so as not to disturb the usual sequence
of targets. Namely, you still have
fetch, extract, patch, configure, build, install, package,
but patch does invoke a subtarget distpatch when needed,
and you can
fetch, extract, distpatch, patch, configure, build, install, package
for the same results.
Mostly useful for porters: provide an intermediate point to work on
patches, and make it easy to override distpatch/OpenBSD patches separately.
2000-01-30 10:19:40 -05:00
|
|
|
# What PATCH normally does:
|
|
|
|
# XXX test for efficiency, don't bother with distpatch if it's not needed
|
2000-06-16 19:10:41 -04:00
|
|
|
. if target(do-distpatch) || target(post-distpatch) || defined(PATCHFILES)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} distpatch
|
2000-06-16 19:10:41 -04:00
|
|
|
. endif
|
1999-08-10 15:50:37 -04:00
|
|
|
@if cd ${PATCHDIR} 2>/dev/null; then \
|
2001-03-28 06:52:20 -05:00
|
|
|
error=false; \
|
1998-11-24 20:08:35 -05:00
|
|
|
for i in ${PATCH_LIST}; do \
|
1998-11-18 23:20:09 -05:00
|
|
|
case $$i in \
|
|
|
|
*.orig|*.rej|*~) \
|
|
|
|
${ECHO_MSG} "===> Ignoring patchfile $$i" ; \
|
|
|
|
;; \
|
|
|
|
*) \
|
|
|
|
if [ -e $$i ]; then \
|
2000-09-16 09:54:56 -04:00
|
|
|
case "${PATCH_DEBUG:L}" in \
|
|
|
|
no) ;; \
|
|
|
|
*) ${ECHO_MSG} "===> Applying ${OPSYS} patch $$i" ;; \
|
1999-07-29 11:41:47 -04:00
|
|
|
esac; \
|
1999-07-27 18:12:26 -04:00
|
|
|
${PATCH} ${PATCH_ARGS} < $$i || \
|
|
|
|
{ echo "***> $$i did not apply cleanly"; \
|
2001-03-28 06:52:20 -05:00
|
|
|
error=true; }\
|
1998-11-18 23:20:09 -05:00
|
|
|
else \
|
1999-11-22 18:44:01 -05:00
|
|
|
echo "===> Can't find patch matching $$i"; \
|
1998-11-18 23:20:09 -05:00
|
|
|
if [ -d ${PATCHDIR}/CVS -a "$$i" = \
|
|
|
|
"${PATCHDIR}/patch-*" ]; then \
|
1999-11-22 18:44:01 -05:00
|
|
|
echo "===> Perhaps you forgot the -P flag to cvs co or update?"; \
|
2001-03-28 06:52:20 -05:00
|
|
|
error=true; \
|
1998-11-18 23:20:09 -05:00
|
|
|
fi; \
|
|
|
|
fi; \
|
|
|
|
;; \
|
|
|
|
esac; \
|
1999-07-27 18:12:26 -04:00
|
|
|
done;\
|
2001-03-28 06:52:20 -05:00
|
|
|
if $$error; then exit 1; fi; \
|
1996-06-03 18:47:10 -04:00
|
|
|
fi
|
2000-01-26 18:11:08 -05:00
|
|
|
# End of PATCH.
|
2000-06-16 19:10:41 -04:00
|
|
|
.endif
|
|
|
|
.if target(post-patch)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-patch
|
2000-02-04 06:09:33 -05:00
|
|
|
.endif
|
2000-09-23 08:36:39 -04:00
|
|
|
.if ${PATCH_CHECK_ONLY:L} != "yes"
|
|
|
|
. if ${CONFIGURE_STYLE:L:Mautoconf}
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${AUTOCONF_DIR} && exec ${SETENV} ${AUTOCONF_ENV} ${AUTOCONF}
|
2000-09-23 08:36:39 -04:00
|
|
|
. endif
|
2001-03-28 06:32:29 -05:00
|
|
|
@${_MAKE_COOKIE} $@
|
2000-09-23 08:36:39 -04:00
|
|
|
.endif
|
2000-02-04 06:09:33 -05:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2001-08-28 04:09:31 -04:00
|
|
|
MODSIMPLE_configure= \
|
|
|
|
cd ${WRKBUILD} && CC="${CC}" ac_cv_path_CC="${CC}" CFLAGS="${CFLAGS}" \
|
|
|
|
CXX="${CXX}" ac_cv_path_CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
|
|
|
|
INSTALL="/usr/bin/install -c -o ${BINOWN} -g ${BINGRP}" \
|
|
|
|
ac_given_INSTALL="/usr/bin/install -c -o ${BINOWN} -g ${BINGRP}" \
|
|
|
|
INSTALL_PROGRAM="${INSTALL_PROGRAM}" INSTALL_MAN="${INSTALL_MAN}" \
|
|
|
|
INSTALL_SCRIPT="${INSTALL_SCRIPT}" INSTALL_DATA="${INSTALL_DATA}" \
|
|
|
|
YACC="${YACC}" \
|
|
|
|
${CONFIGURE_ENV} ${_CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
|
|
|
|
|
2000-02-04 06:09:33 -05:00
|
|
|
# The real configure
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2000-02-04 06:09:33 -05:00
|
|
|
${_CONFIGURE_COOKIE}: ${_PATCH_COOKIE}
|
2001-03-21 19:22:36 -05:00
|
|
|
@${ECHO_MSG} "===> Configuring for ${FULLPKGNAME}"
|
2000-06-16 19:53:40 -04:00
|
|
|
@mkdir -p ${WRKBUILD} ${WRKPKG}
|
2000-06-16 19:10:41 -04:00
|
|
|
.if target(pre-configure)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} pre-configure
|
2000-06-16 19:10:41 -04:00
|
|
|
.endif
|
|
|
|
.if target(do-configure)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} do-configure
|
2000-06-16 19:10:41 -04:00
|
|
|
.else
|
2000-01-26 18:11:08 -05:00
|
|
|
# What CONFIGURE normally does
|
1996-10-22 10:01:19 -04:00
|
|
|
@if [ -f ${SCRIPTDIR}/configure ]; then \
|
1997-09-09 11:11:28 -04:00
|
|
|
cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
|
|
|
|
${SCRIPTDIR}/configure; \
|
1996-06-03 18:47:10 -04:00
|
|
|
fi
|
2001-08-28 04:09:31 -04:00
|
|
|
. for _c in ${CONFIGURE_STYLE:L}
|
|
|
|
. if defined(MOD${_c:U}_configure)
|
|
|
|
@${MOD${_c:U}_configure}
|
2001-08-25 07:23:46 -04:00
|
|
|
. endif
|
|
|
|
. endfor
|
2000-06-16 19:10:41 -04:00
|
|
|
# End of CONFIGURE.
|
|
|
|
.endif
|
|
|
|
.if target(post-configure)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-configure
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
2001-03-28 06:32:29 -05:00
|
|
|
@${_MAKE_COOKIE} $@
|
1996-06-03 18:47:10 -04:00
|
|
|
|
1999-02-03 12:53:13 -05:00
|
|
|
|
2000-02-04 06:09:33 -05:00
|
|
|
# The real build
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2000-02-04 06:09:33 -05:00
|
|
|
${_BUILD_COOKIE}: ${_CONFIGURE_COOKIE}
|
2001-03-28 06:43:16 -05:00
|
|
|
.if ${NO_BUILD:L} == "no"
|
2001-03-21 19:22:36 -05:00
|
|
|
@${ECHO_MSG} "===> Building for ${FULLPKGNAME}"
|
2000-02-04 06:09:33 -05:00
|
|
|
. if target(pre-build)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} pre-build
|
2000-02-04 06:09:33 -05:00
|
|
|
. endif
|
|
|
|
. if target(do-build)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} do-build
|
2000-02-04 06:09:33 -05:00
|
|
|
. else
|
2000-01-26 18:11:08 -05:00
|
|
|
# What BUILD normally does:
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} -f ${MAKE_FILE} ${ALL_TARGET}
|
2000-01-26 18:11:08 -05:00
|
|
|
# End of BUILD
|
2000-02-04 06:09:33 -05:00
|
|
|
. endif
|
|
|
|
. if target(post-build)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-build
|
2000-02-04 06:09:33 -05:00
|
|
|
. endif
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
2001-03-28 06:32:29 -05:00
|
|
|
@${_MAKE_COOKIE} $@
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2001-07-18 12:19:47 -04:00
|
|
|
_FAKE_SETUP=TRUEPREFIX=${PREFIX} PREFIX=${WRKINST}${PREFIX} ${DESTDIRNAME}=${WRKINST}
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2001-01-08 17:34:51 -05:00
|
|
|
.if ${FAKE:L} == "yes"
|
2001-03-06 13:59:38 -05:00
|
|
|
${_FAKE_COOKIE}: ${_BUILD_COOKIE} ${WRKPKG}/mtree.spec
|
2001-03-21 19:22:36 -05:00
|
|
|
@${ECHO_MSG} "===> Faking installation for ${FULLPKGNAME}"
|
2001-09-07 05:48:23 -04:00
|
|
|
@if [ x`${SUDO} ${SH} -c umask` != x${DEF_UMASK} ]; then \
|
2000-03-03 16:24:50 -05:00
|
|
|
echo >&2 "Error: your umask is \"`${SH} -c umask`"\".; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2000-05-16 13:06:46 -04:00
|
|
|
@${SUDO} install -d -m 755 -o root -g wheel ${WRKINST}
|
2000-07-11 06:32:22 -04:00
|
|
|
@${SUDO} /usr/sbin/mtree -U -e -d -n -p ${WRKINST} \
|
2001-03-06 13:59:38 -05:00
|
|
|
-f ${WRKPKG}/mtree.spec >/dev/null
|
2001-08-25 07:23:46 -04:00
|
|
|
.for _m in ${MODULES}
|
|
|
|
. if defined(MOD${_m:U}_pre-fake)
|
|
|
|
@${MOD${_m:U}_pre-fake}
|
2000-06-02 07:42:53 -04:00
|
|
|
. endif
|
2001-08-25 07:23:46 -04:00
|
|
|
.endfor
|
2000-06-02 07:42:53 -04:00
|
|
|
|
2001-09-13 05:12:45 -04:00
|
|
|
. if target(pre-fake)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${MAKE} pre-fake ${_FAKE_SETUP}
|
2000-03-10 13:09:23 -05:00
|
|
|
. endif
|
2000-05-16 13:06:46 -04:00
|
|
|
@${SUDO} ${_MAKE_COOKIE} ${_INSTALL_PRE_COOKIE}
|
2000-03-03 16:24:50 -05:00
|
|
|
. if target(pre-install)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${MAKE} pre-install ${_FAKE_SETUP}
|
2000-03-03 16:24:50 -05:00
|
|
|
. endif
|
|
|
|
. if target(do-install)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${MAKE} do-install ${_FAKE_SETUP}
|
2000-03-03 16:24:50 -05:00
|
|
|
. else
|
|
|
|
# What FAKE normally does:
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${WRKBUILD} && exec ${SUDO} ${SETENV} ${MAKE_ENV} ${_FAKE_SETUP} ${MAKE_PROGRAM} ${FAKE_FLAGS} -f ${MAKE_FILE} ${FAKE_TARGET}
|
2000-03-03 16:24:50 -05:00
|
|
|
# End of FAKE.
|
|
|
|
. endif
|
|
|
|
. if target(post-install)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${MAKE} post-install ${_FAKE_SETUP}
|
2000-03-03 16:24:50 -05:00
|
|
|
. endif
|
|
|
|
. if defined(_MANPAGES) || defined(_CATPAGES)
|
|
|
|
. if defined(MANCOMPRESSED) && defined(NOMANCOMPRESS)
|
2001-03-21 19:22:36 -05:00
|
|
|
@${ECHO_MSG} "===> Uncompressing manual pages for ${FULLPKGNAME}"
|
2000-03-03 16:24:50 -05:00
|
|
|
. for manpage in ${_MANPAGES} ${_CATPAGES}
|
2000-05-16 13:06:46 -04:00
|
|
|
@${SUDO} ${GUNZIP_CMD} ${manpage}.gz
|
2000-03-03 16:24:50 -05:00
|
|
|
. endfor
|
|
|
|
. elif !defined(MANCOMPRESSED) && !defined(NOMANCOMPRESS)
|
2001-03-21 19:22:36 -05:00
|
|
|
@${ECHO_MSG} "===> Compressing manual pages for ${FULLPKGNAME}"
|
2000-03-03 16:24:50 -05:00
|
|
|
. for manpage in ${_MANPAGES} ${_CATPAGES}
|
|
|
|
@if [ -L ${manpage} ]; then \
|
|
|
|
set - `file ${manpage}`; \
|
|
|
|
shift `expr $$# - 1`; \
|
2000-05-16 13:06:46 -04:00
|
|
|
${SUDO} ln -sf $${1}.gz ${manpage}.gz; \
|
|
|
|
${SUDO} rm ${manpage}; \
|
2000-03-03 16:24:50 -05:00
|
|
|
else \
|
2000-05-16 13:06:46 -04:00
|
|
|
${SUDO} ${GZIP_CMD} ${manpage}; \
|
2000-03-03 16:24:50 -05:00
|
|
|
fi
|
|
|
|
. endfor
|
|
|
|
. endif
|
|
|
|
. endif
|
2000-03-21 16:23:54 -05:00
|
|
|
@if find ${WRKINST} -type l -ls|fgrep -- '-> ${WRKINST}'; then \
|
|
|
|
echo >&2 "*** bad links in ${WRKINST}"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2001-03-28 06:32:29 -05:00
|
|
|
@${SUDO} ${_MAKE_COOKIE} $@
|
2000-03-03 16:24:50 -05:00
|
|
|
|
2001-04-02 06:35:51 -04:00
|
|
|
# The real install
|
|
|
|
|
|
|
|
${_INSTALL_COOKIE}: ${_PACKAGE_COOKIES}
|
2001-08-27 04:47:37 -04:00
|
|
|
@cd ${.CURDIR} && DEPENDS_TARGET=package exec ${MAKE} run-depends lib-depends
|
2001-08-12 07:33:10 -04:00
|
|
|
@${ECHO_MSG} "===> Installing ${FULLPKGNAME${SUBPACKAGE}} from ${PKGFILE${SUBPACKAGE}}"
|
2001-08-25 07:23:46 -04:00
|
|
|
. for _m in ${MODULES}
|
|
|
|
. if defined(MOD${_m:U}_pre_install)
|
|
|
|
@${MOD${_m:U}_pre_install}
|
|
|
|
. endif
|
|
|
|
. endfor
|
2001-04-20 12:25:24 -04:00
|
|
|
. if ${TRUST_PACKAGES:L} == "yes"
|
2001-08-12 07:33:10 -04:00
|
|
|
@if pkg dependencies check ${FULLPKGNAME${SUBPACKAGE}}; then \
|
|
|
|
echo "Package ${FULLPKGNAME${SUBPACKAGE}} is already installed"; \
|
2001-04-20 12:25:24 -04:00
|
|
|
else \
|
2001-08-12 07:33:10 -04:00
|
|
|
${SUDO} ${SETENV} PKG_PATH=${PKGREPOSITORY}:${PKG_PATH} PKG_TMPDIR=${PKG_TMPDIR} pkg_add ${PKGFILE${SUBPACKAGE}}; \
|
2001-04-20 12:25:24 -04:00
|
|
|
fi
|
|
|
|
. else
|
2001-08-12 07:33:10 -04:00
|
|
|
@${SUDO} ${SETENV} PKG_PATH=${PKGREPOSITORY}:${PKG_PATH} PKG_TMPDIR=${PKG_TMPDIR} pkg_add ${PKGFILE${SUBPACKAGE}}
|
2001-04-20 12:25:24 -04:00
|
|
|
. endif
|
2001-07-30 10:13:16 -04:00
|
|
|
@-${SUDO} ${_MAKE_COOKIE} $@
|
2000-03-03 16:24:50 -05:00
|
|
|
.endif
|
|
|
|
|
2001-04-02 06:35:51 -04:00
|
|
|
# The real package
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
|
2001-04-02 06:35:51 -04:00
|
|
|
_package: ${_PKG_PREREQ}
|
2000-02-04 06:09:33 -05:00
|
|
|
.if !defined(NO_PACKAGE)
|
|
|
|
. if target(pre-package)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} pre-package
|
2000-02-04 06:09:33 -05:00
|
|
|
. endif
|
|
|
|
. if target(do-package)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} do-package
|
2000-02-04 06:09:33 -05:00
|
|
|
. else
|
2000-01-26 18:11:08 -05:00
|
|
|
# What PACKAGE normally does:
|
2001-08-12 07:33:10 -04:00
|
|
|
@${ECHO_MSG} "===> Building package for ${FULLPKGNAME${SUBPACKAGE}}"
|
2000-04-02 14:08:31 -04:00
|
|
|
@if [ ! -d ${PKGREPOSITORY} ]; then \
|
|
|
|
if ! mkdir -p ${PKGREPOSITORY}; then \
|
2000-03-03 16:24:50 -05:00
|
|
|
echo ">> Can't create directory ${PKGREPOSITORY}."; \
|
|
|
|
exit 1; \
|
2000-04-02 14:08:31 -04:00
|
|
|
fi; \
|
1999-12-19 19:07:17 -05:00
|
|
|
fi
|
2000-05-29 12:43:35 -04:00
|
|
|
# PLIST should normally hold no duplicates.
|
|
|
|
# This is left as a warning, because stuff such as @exec %F/%D
|
|
|
|
# completion may cause legitimate dups.
|
2001-04-02 07:32:32 -04:00
|
|
|
@duplicates=`sort <${WRKPKG}/PLIST${SUBPACKAGE}|egrep -v '@(comment|mode|owner)'|uniq -d`; \
|
2000-05-29 12:43:35 -04:00
|
|
|
case "$${duplicates}" in "");; \
|
|
|
|
*) echo "\n*** WARNING *** Duplicates in PLIST:\n$$duplicates\n";; \
|
|
|
|
esac
|
2000-03-03 16:24:50 -05:00
|
|
|
@cd ${.CURDIR} && \
|
2001-08-12 07:33:10 -04:00
|
|
|
if ${SUDO} ${PKG_CMD} ${PKG_ARGS} ${PKGFILE${SUBPACKAGE}}; then \
|
|
|
|
mode=`id -u`:`id -g`; ${SUDO} ${CHOWN} $${mode} ${PKGFILE${SUBPACKAGE}}; \
|
2000-05-16 11:54:17 -04:00
|
|
|
${MAKE} package-links; \
|
2000-03-03 16:24:50 -05:00
|
|
|
else \
|
2001-09-05 07:59:54 -04:00
|
|
|
${SUDO} ${MAKE} delete-package; \
|
2000-03-03 16:24:50 -05:00
|
|
|
exit 1; \
|
|
|
|
fi
|
2000-01-26 18:11:08 -05:00
|
|
|
# End of PACKAGE.
|
2000-02-04 06:09:33 -05:00
|
|
|
. endif
|
|
|
|
. if target(post-package)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-package
|
2000-02-04 06:09:33 -05:00
|
|
|
. endif
|
|
|
|
.else
|
|
|
|
. if !defined(IGNORE_SILENT)
|
2001-08-12 07:33:10 -04:00
|
|
|
@${ECHO_MSG} "===> ${FULLPKGNAME${SUBPACKAGE}} may not be packaged: ${NO_PACKAGE}."
|
2000-02-04 06:09:33 -05:00
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(fetch-all)
|
|
|
|
fetch-all:
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} __FETCH_ALL=Yes __ARCH_OK=Yes NO_IGNORE=Yes NO_WARNINGS=Yes fetch
|
2000-02-04 06:09:33 -05:00
|
|
|
.endif
|
|
|
|
|
|
|
|
# Separate target for each file fetch will retrieve
|
|
|
|
|
2000-02-04 06:15:16 -05:00
|
|
|
.for _F in ${ALLFILES:S@^@${FULLDISTDIR}/@}
|
2000-02-04 06:09:33 -05:00
|
|
|
${_F}:
|
2000-07-07 11:49:32 -04:00
|
|
|
@mkdir -p ${_F:H}; \
|
2000-02-04 06:09:33 -05:00
|
|
|
cd ${_F:H}; \
|
2000-02-04 06:15:16 -05:00
|
|
|
select=${_EVERYTHING:M*${_F:S@^${FULLDISTDIR}/@@}\:[0-9]}; \
|
2000-02-04 06:09:33 -05:00
|
|
|
f=${_F:S@^${FULLDISTDIR}/@@}; \
|
|
|
|
${ECHO_MSG} ">> $$f doesn't seem to exist on this system."; \
|
|
|
|
${_CDROM_OVERRIDE}; \
|
2000-02-04 06:15:16 -05:00
|
|
|
${_SITE_SELECTOR}; \
|
2000-02-04 06:09:33 -05:00
|
|
|
for site in $$sites; do \
|
|
|
|
${ECHO_MSG} ">> Attempting to fetch ${_F} from $${site}."; \
|
|
|
|
if ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$$f ${FETCH_AFTER_ARGS}; then \
|
|
|
|
exit 0; \
|
|
|
|
fi; \
|
|
|
|
done; exit 1
|
|
|
|
.endfor
|
|
|
|
|
2001-07-30 10:13:16 -04:00
|
|
|
bulk-packages:
|
|
|
|
@${MAKE} package BATCH=Yes && exec ${SUDO} ${MAKE} clean CLEANDEPENDS=Yes
|
|
|
|
|
2001-08-12 07:33:10 -04:00
|
|
|
all-packages: ${PKGFILE${SUBPACKAGE}}
|
2000-04-18 19:20:49 -04:00
|
|
|
.if defined(MULTI_PACKAGES) && empty(SUBPACKAGE)
|
|
|
|
. for _sub in ${MULTI_PACKAGES}
|
2001-03-28 09:33:24 -05:00
|
|
|
@cd ${.CURDIR} && SUBPACKAGE='${_sub}' FLAVOR='${FLAVOR}' exec ${MAKE} ${.TARGET}
|
2000-04-18 19:20:49 -04:00
|
|
|
. endfor
|
|
|
|
.endif
|
2000-04-09 08:04:13 -04:00
|
|
|
|
|
|
|
# Invoke "make cdrom-packages CDROM_PACKAGES=/cdrom/snapshots/packages"
|
2000-04-09 21:11:36 -04:00
|
|
|
.if defined(PERMIT_PACKAGE_CDROM) && ${PERMIT_PACKAGE_CDROM:L} == "yes"
|
2001-08-12 07:33:10 -04:00
|
|
|
cdrom-packages: ${CDROM_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX}
|
2000-04-09 21:11:36 -04:00
|
|
|
.else
|
2000-04-09 08:04:13 -04:00
|
|
|
cdrom-packages:
|
|
|
|
.endif
|
2000-04-18 19:20:49 -04:00
|
|
|
.if defined(MULTI_PACKAGES) && empty(SUBPACKAGE)
|
|
|
|
. for _sub in ${MULTI_PACKAGES}
|
2001-03-28 09:33:24 -05:00
|
|
|
@cd ${.CURDIR} && SUBPACKAGE='${_sub}' FLAVOR='${FLAVOR}' exec ${MAKE} ${.TARGET}
|
2000-04-18 19:20:49 -04:00
|
|
|
. endfor
|
|
|
|
.endif
|
2000-04-09 08:04:13 -04:00
|
|
|
|
|
|
|
# Invoke "make ftp-packages FTP_PACKAGES=/pub/OpenBSD/snapshots/packages"
|
2000-04-09 21:11:36 -04:00
|
|
|
.if defined(PERMIT_PACKAGE_FTP) && ${PERMIT_PACKAGE_FTP:L} == "yes"
|
2001-08-12 07:33:10 -04:00
|
|
|
ftp-packages: ${FTP_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX}
|
2000-04-09 21:11:36 -04:00
|
|
|
.else
|
2000-04-09 08:04:13 -04:00
|
|
|
ftp-packages:
|
|
|
|
.endif
|
2000-04-18 19:20:49 -04:00
|
|
|
.if defined(MULTI_PACKAGES) && empty(SUBPACKAGE)
|
|
|
|
. for _sub in ${MULTI_PACKAGES}
|
2001-03-28 09:33:24 -05:00
|
|
|
@cd ${.CURDIR} && SUBPACKAGE='${_sub}' FLAVOR='${FLAVOR}' exec ${MAKE} ${.TARGET}
|
2000-04-18 19:20:49 -04:00
|
|
|
. endfor
|
|
|
|
.endif
|
2000-04-09 08:04:13 -04:00
|
|
|
|
2000-04-09 21:11:36 -04:00
|
|
|
|
2001-08-12 07:33:10 -04:00
|
|
|
${PKGFILE${SUBPACKAGE}}:
|
2001-05-05 19:42:03 -04:00
|
|
|
@mkdir -p ${PORTSDIR}/logs/${MACHINE_ARCH}
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} package ALWAYS_PACKAGE=Yes 2>&1 | \
|
2001-05-05 19:42:03 -04:00
|
|
|
tee ${PORTSDIR}/logs/${MACHINE_ARCH}/${FULLPKGNAME}.log
|
2000-04-09 21:11:36 -04:00
|
|
|
|
2001-08-12 07:33:10 -04:00
|
|
|
${FTP_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX}: ${PKGFILE${SUBPACKAGE}}
|
2000-04-09 21:11:36 -04:00
|
|
|
@mkdir -p ${FTP_PACKAGES}
|
2001-08-12 07:33:10 -04:00
|
|
|
@rm -f ${FTP_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX}
|
|
|
|
@ln ${PKGFILE${SUBPACKAGE}} ${FTP_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX} 2>/dev/null || \
|
|
|
|
cp -p ${PKGFILE${SUBPACKAGE}} ${FTP_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX}
|
2000-04-09 21:11:36 -04:00
|
|
|
|
2001-08-21 18:22:57 -04:00
|
|
|
${CDROM_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX}: ${PKGFILE${SUBPACKAGE}}
|
|
|
|
@mkdir -p ${CDROM_PACKAGES}
|
2001-08-12 07:33:10 -04:00
|
|
|
@rm -f ${CDROM_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX}
|
|
|
|
@ln ${PKGFILE${SUBPACKAGE}} ${CDROM_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX} 2>/dev/null || \
|
|
|
|
cp -p ${PKGFILE${SUBPACKAGE}} ${CDROM_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX}
|
2000-04-09 21:11:36 -04:00
|
|
|
|
2000-02-04 06:09:33 -05:00
|
|
|
# list the distribution and patch files used by a port. Typical
|
|
|
|
# use is make ECHO_MSG=: list-distfiles | tee some-file
|
|
|
|
#
|
|
|
|
list-distfiles:
|
2001-03-21 19:22:36 -05:00
|
|
|
@echo "${FULLPKGNAME}"
|
2000-02-04 06:15:16 -05:00
|
|
|
@for file in ${ALLFILES}; do \
|
2000-02-04 06:09:33 -05:00
|
|
|
if [ "$$file" != "${EXTRACT_SUFX}" ]; then \
|
|
|
|
if [ -z "${DIST_SUBDIR}" ]; then \
|
|
|
|
printf "\t$$file\n"; \
|
|
|
|
else \
|
|
|
|
printf "\t${DIST_SUBDIR}/$$file\n"; \
|
|
|
|
fi \
|
|
|
|
fi \
|
|
|
|
done
|
|
|
|
@echo ""
|
|
|
|
|
|
|
|
# Obj
|
|
|
|
#
|
|
|
|
.if !target(obj)
|
|
|
|
obj:
|
|
|
|
. if defined(WRKOBJDIR)
|
2001-08-16 10:49:31 -04:00
|
|
|
@${_create_wrkobjdir}
|
2000-02-04 06:09:33 -05:00
|
|
|
. else
|
|
|
|
@echo ">>"
|
|
|
|
@echo ">> Please set the WRKOBJDIR variable before using 'make obj'"
|
|
|
|
@echo ">>"
|
|
|
|
@exit 1;
|
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
|
|
# Some support rules for do-package
|
|
|
|
|
|
|
|
.if !target(package-links)
|
|
|
|
package-links:
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} delete-package-links
|
2000-02-04 06:09:33 -05:00
|
|
|
@for cat in ${CATEGORIES}; do \
|
|
|
|
if [ ! -d ${PACKAGES}/$$cat ]; then \
|
|
|
|
if ! mkdir -p ${PACKAGES}/$$cat; then \
|
|
|
|
echo ">> Can't create directory ${PACKAGES}/$$cat."; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
2001-08-12 07:33:10 -04:00
|
|
|
ln -s ../${PKGREPOSITORYSUBDIR}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX} ${PACKAGES}/$$cat; \
|
2000-02-04 06:09:33 -05:00
|
|
|
done;
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(delete-package-links)
|
|
|
|
delete-package-links:
|
2001-08-12 07:33:10 -04:00
|
|
|
@cd ${PACKAGES} && find . -type l -name ${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX}|xargs rm -f
|
1999-12-19 19:07:17 -05:00
|
|
|
.endif
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2000-02-04 06:09:33 -05:00
|
|
|
.if !target(delete-package)
|
|
|
|
delete-package:
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} delete-package-links
|
2001-08-12 07:33:10 -04:00
|
|
|
@rm -f ${PKGFILE${SUBPACKAGE}}
|
2000-02-04 06:09:33 -05:00
|
|
|
.endif
|
1996-06-03 18:47:10 -04:00
|
|
|
|
|
|
|
# Checkpatch
|
|
|
|
#
|
|
|
|
# Special target to verify patches
|
1998-11-24 20:08:35 -05:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
.if !target(checkpatch)
|
|
|
|
checkpatch:
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} PATCH_CHECK_ONLY=Yes patch
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
# Reinstall
|
|
|
|
#
|
|
|
|
# Special target to re-run install
|
|
|
|
|
1997-09-09 11:11:28 -04:00
|
|
|
reinstall:
|
2001-08-12 07:33:10 -04:00
|
|
|
@${SUDO} ${PKG_DELETE} -f ${FULLPKGNAME${SUBPACKAGE}}
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && DEPENDS_TARGET=${DEPENDS_TARGET} exec ${MAKE} install
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2001-03-28 06:27:18 -05:00
|
|
|
# Rebuild
|
|
|
|
#
|
|
|
|
# Special target to re-run build
|
|
|
|
rebuild:
|
|
|
|
@rm -f ${_BUILD_COOKIE}
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} build
|
|
|
|
|
1998-09-07 18:33:19 -04:00
|
|
|
# Deinstall
|
|
|
|
#
|
|
|
|
# Special target to remove installation
|
|
|
|
|
|
|
|
uninstall deinstall:
|
2001-08-12 07:33:10 -04:00
|
|
|
@${ECHO_MSG} "===> Deinstalling for ${FULLPKGNAME${SUBPACKAGE}}"
|
|
|
|
@${SUDO} ${PKG_DELETE} -f ${FULLPKGNAME${SUBPACKAGE}}
|
1998-09-07 18:33:19 -04:00
|
|
|
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
################################################################
|
|
|
|
# Some more targets supplied for users' convenience
|
|
|
|
################################################################
|
|
|
|
|
|
|
|
# Cleaning up
|
|
|
|
|
|
|
|
.if !target(pre-clean)
|
|
|
|
pre-clean:
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(clean)
|
|
|
|
clean: pre-clean
|
2001-08-16 10:49:31 -04:00
|
|
|
. if ${clean:L:Mdepends}
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} clean-depends
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
2001-08-12 07:33:10 -04:00
|
|
|
@${ECHO_MSG} "===> Cleaning for ${FULLPKGNAME${SUBPACKAGE}}"
|
2001-08-16 10:49:31 -04:00
|
|
|
. if ${clean:L:Mfake}
|
2000-06-07 11:46:15 -04:00
|
|
|
@if cd ${WRKINST} 2>/dev/null; then ${SUDO} rm -rf ${WRKINST}; fi
|
2001-08-16 10:49:31 -04:00
|
|
|
. endif
|
|
|
|
. if ${clean:L:Mwork}
|
|
|
|
. if ${clean:L:Mflavors}
|
|
|
|
@for i in ${.CURDIR}/w-*; do \
|
|
|
|
if [ -L $$i ]; then ${SUDO} rm -rf `readlink $$i`; fi; \
|
|
|
|
${SUDO} rm -rf $$i; \
|
|
|
|
done
|
|
|
|
. else
|
2000-02-04 06:09:33 -05:00
|
|
|
@if [ -L ${WRKDIR} ]; then rm -rf `readlink ${WRKDIR}`; fi
|
|
|
|
@rm -rf ${WRKDIR}
|
2001-08-16 10:49:31 -04:00
|
|
|
. endif
|
|
|
|
. endif
|
|
|
|
. if ${clean:L:Mdist}
|
2001-08-24 10:39:36 -04:00
|
|
|
@${ECHO_MSG} "===> Dist cleaning for ${FULLPKGNAME${SUBPACKAGE}}"
|
|
|
|
@if cd ${FULLDISTDIR} 2>/dev/null; then \
|
|
|
|
if [ "${_DISTFILES}" -o "${_PATCHFILES}" ]; then \
|
|
|
|
rm -f ${_DISTFILES} ${_PATCHFILES}; \
|
|
|
|
fi \
|
|
|
|
fi
|
|
|
|
. if defined(DIST_SUBDIR)
|
|
|
|
-@rmdir ${FULLDISTDIR}
|
|
|
|
. endif
|
2001-08-16 10:49:31 -04:00
|
|
|
. endif
|
|
|
|
. if ${clean:L:Minstall}
|
|
|
|
. if ${clean:L:Msub}
|
|
|
|
. for _s in ${MULTI_PACKAGES}
|
2001-08-16 11:15:24 -04:00
|
|
|
${SUDO} ${PKG_DELETE} ${clean:M-f} ${FULLPKGNAME${_s}}
|
2001-08-16 10:49:31 -04:00
|
|
|
. endfor
|
|
|
|
. else
|
2001-08-16 11:15:24 -04:00
|
|
|
${SUDO} ${PKG_DELETE} ${clean:M-f} ${FULLPKGNAME${SUBPACKAGE}}
|
2001-08-16 10:49:31 -04:00
|
|
|
. endif
|
|
|
|
. endif
|
|
|
|
. if ${clean:L:Mpackages} || ${clean:L:Mpackage} && ${clean:L:Msub}
|
|
|
|
rm -f ${_PACKAGE_COOKIES}
|
|
|
|
. elif ${clean:L:Mpackage}
|
2001-08-16 11:15:24 -04:00
|
|
|
rm -f ${PKGFILE${SUBPACKAGE}}
|
2001-08-16 10:49:31 -04:00
|
|
|
. endif
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
|
|
|
|
1996-12-25 15:10:09 -05:00
|
|
|
.if !target(pre-distclean)
|
|
|
|
pre-distclean:
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(distclean)
|
2001-08-24 10:39:36 -04:00
|
|
|
distclean: pre-distclean
|
|
|
|
@${MAKE} clean=dist
|
1996-12-25 15:10:09 -05:00
|
|
|
.endif
|
|
|
|
|
1999-09-26 06:47:30 -04:00
|
|
|
RECURSIVE_FETCH_LIST?= Yes
|
1998-09-07 18:33:19 -04:00
|
|
|
|
1998-07-06 18:06:51 -04:00
|
|
|
# packing list utilities. This generates a packing list from a recently
|
|
|
|
# installed port. Not perfect, but pretty close. The generated file
|
|
|
|
# will have to have some tweaks done by hand.
|
2001-05-05 19:42:03 -04:00
|
|
|
# Note: add @comment PACKAGE(arch=${MACHINE_ARCH}, opsys=${OPSYS}, vers=${OPSYS_VER})
|
1998-07-08 23:12:18 -04:00
|
|
|
# when port is installed or package created.
|
1998-07-06 18:06:51 -04:00
|
|
|
#
|
2001-01-08 17:34:51 -05:00
|
|
|
.if ${FAKE:L} == "yes"
|
2001-05-23 10:18:24 -04:00
|
|
|
_tmp:=
|
|
|
|
. for _v in ${SUBST_VARS}
|
|
|
|
_tmp += ${_v}='${${_v}}'
|
|
|
|
. endfor
|
2000-03-03 16:24:50 -05:00
|
|
|
plist: fake
|
2000-05-18 15:59:21 -04:00
|
|
|
@DESTDIR=${WRKINST} PREFIX=${WRKINST}${PREFIX} LDCONFIG="${LDCONFIG}" \
|
2001-03-06 13:59:38 -05:00
|
|
|
MTREE_FILE=${WRKPKG}/mtree.spec \
|
2000-03-03 16:24:50 -05:00
|
|
|
INSTALL_PRE_COOKIE=${_INSTALL_PRE_COOKIE} \
|
2001-05-23 10:18:24 -04:00
|
|
|
perl ${PORTSDIR}/infrastructure/install/make-plist ${PKGDIR} ${_tmp}
|
2000-03-03 16:24:50 -05:00
|
|
|
.endif
|
1998-07-06 18:06:51 -04:00
|
|
|
|
2000-04-19 10:37:19 -04:00
|
|
|
update-patches:
|
|
|
|
@toedit=`WRKDIST=${WRKDIST} PATCHDIR=${PATCHDIR} PATCH_LIST=${PATCH_LIST} \
|
2001-08-24 10:43:28 -04:00
|
|
|
DIFF_ARGS=${DIFF_ARGS} DISTORIG=${DISTORIG} PATCHORIG=${PATCHORIG} \
|
2000-04-19 10:37:19 -04:00
|
|
|
/bin/sh ${PORTSDIR}/infrastructure/build/update-patches`; \
|
|
|
|
case $$toedit in "");; \
|
|
|
|
*) read i?'edit patches: '; \
|
|
|
|
cd ${PATCHDIR} && $${VISUAL:-$${EDIT:-/usr/bin/vi}} $$toedit;; esac
|
|
|
|
|
2000-06-09 12:26:54 -04:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
################################################################
|
|
|
|
# The special package-building targets
|
|
|
|
# You probably won't need to touch these
|
|
|
|
################################################################
|
|
|
|
|
2000-03-03 12:51:37 -05:00
|
|
|
# mirroring utilities
|
|
|
|
.if defined(DIST_SUBDIR)
|
|
|
|
_ALLFILES=${ALLFILES:S/^/${DIST_SUBDIR}\//}
|
|
|
|
.else
|
|
|
|
_ALLFILES=${ALLFILES}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
fetch-makefile:
|
2001-06-30 15:06:09 -04:00
|
|
|
.if !defined(COMES_WITH)
|
2000-03-04 13:16:02 -05:00
|
|
|
@echo -n "all"
|
2001-06-30 15:06:09 -04:00
|
|
|
. if defined(PERMIT_DISTFILES_FTP) && ${PERMIT_DISTFILES_FTP:L} == "yes"
|
2000-03-04 13:16:02 -05:00
|
|
|
@echo -n " ftp"
|
2001-06-30 15:06:09 -04:00
|
|
|
. endif
|
|
|
|
. if defined(PERMIT_DISTFILES_CDROM) && ${PERMIT_DISTFILES_CDROM:L} == "yes"
|
2000-03-04 13:16:02 -05:00
|
|
|
@echo -n " cdrom"
|
2001-06-30 15:06:09 -04:00
|
|
|
. endif
|
2001-03-21 19:22:36 -05:00
|
|
|
@echo ":: ${PKGPATH}/${FULLPKGNAME}"
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} __FETCH_ALL=Yes __ARCH_OK=Yes NO_IGNORE=Yes NO_WARNINGS=Yes _fetch-makefile-helper
|
2001-06-30 15:06:09 -04:00
|
|
|
.endif
|
2000-03-03 12:51:37 -05:00
|
|
|
|
|
|
|
_fetch-makefile-helper:
|
|
|
|
# write generic package dependencies
|
2001-03-21 19:22:36 -05:00
|
|
|
@name='${PKGPATH}/${FULLPKGNAME}'; \
|
2000-03-03 12:51:37 -05:00
|
|
|
echo ".PHONY: $${name}"; \
|
|
|
|
case '${RECURSIVE_FETCH_LIST:L}' in yes) \
|
2000-05-16 11:54:17 -04:00
|
|
|
echo "$${name}:: "`${MAKE} depends-list package-depends FULL_PACKAGE_NAME=Yes |${_SORT_DEPENDS}`;; \
|
2000-03-03 12:51:37 -05:00
|
|
|
esac; \
|
|
|
|
echo "$${name}:: ${_ALLFILES}"
|
2000-03-05 11:33:38 -05:00
|
|
|
.if !empty(ALLFILES)
|
|
|
|
. for _F in ${_ALLFILES}
|
2000-03-03 12:51:37 -05:00
|
|
|
@echo '${_F}: $$F'
|
|
|
|
@echo -n '\t@MAINTAINER="${MAINTAINER}" '
|
2000-03-05 11:33:38 -05:00
|
|
|
. if defined(DIST_SUBDIR)
|
2000-03-03 12:51:37 -05:00
|
|
|
@echo -n 'DIST_SUBDIR="${DIST_SUBDIR}" '
|
2000-03-05 11:33:38 -05:00
|
|
|
. endif
|
2000-03-03 12:51:37 -05:00
|
|
|
@echo '\\'
|
|
|
|
@select='${_EVERYTHING:M*${_F:S@^${DIST_SUBDIR}/@@}\:[0-9]}'; \
|
|
|
|
${_SITE_SELECTOR}; \
|
|
|
|
echo "\t SITES=\"$$sites\" \\"
|
2000-03-05 11:33:38 -05:00
|
|
|
. if !defined(NO_CHECKSUM) && !empty(_CKSUMFILES:M${_F})
|
2000-03-03 12:51:37 -05:00
|
|
|
@if [ ! -f ${CHECKSUM_FILE} ]; then \
|
|
|
|
echo >&2 'Missing checksum file: ${CHECKSUM_FILE}'; \
|
|
|
|
echo '\t ERROR="no checksum file" \\'; \
|
|
|
|
else \
|
|
|
|
for c in ${PREFERRED_CIPHERS}; do \
|
|
|
|
if set -- `grep -i "^$$c (${_F})" ${CHECKSUM_FILE}`; then break; fi; \
|
|
|
|
done; \
|
|
|
|
case "$$4" in \
|
|
|
|
"") \
|
|
|
|
echo >&2 "No checksum recorded for ${_F}."; \
|
|
|
|
echo '\t ERROR="no checksum" \\';; \
|
|
|
|
"IGNORE") \
|
|
|
|
echo >&2 "Checksum for ${_F} is IGNORE in ${CHECKSUM_FILE}"; \
|
|
|
|
echo >&2 'but file is not in $${IGNORE_FILES}'; \
|
|
|
|
echo '\t ERROR="IGNORE inconsistent" \\';; \
|
|
|
|
*) \
|
|
|
|
echo "\t CIPHER=\"$$c\" CKSUM=\"$$4\" \\";; \
|
|
|
|
esac; \
|
|
|
|
fi
|
2000-03-05 11:33:38 -05:00
|
|
|
. endif
|
2000-06-09 15:34:31 -04:00
|
|
|
@echo '\t $${EXEC} $${FETCH} "$$@"'
|
2000-03-05 11:33:38 -05:00
|
|
|
. endfor
|
|
|
|
.endif
|
2000-03-03 12:51:37 -05:00
|
|
|
@echo
|
|
|
|
|
1998-09-07 18:33:19 -04:00
|
|
|
|
1999-04-20 14:22:56 -04:00
|
|
|
# The README.html target needs full information (this is passed via
|
|
|
|
# depends-list and package-depends)
|
2000-07-14 19:01:11 -04:00
|
|
|
FULL_PACKAGE_NAME?=No
|
1998-09-07 18:33:19 -04:00
|
|
|
|
2000-04-22 15:20:12 -04:00
|
|
|
# Make variables to pass along on recursive builds
|
2001-03-28 09:33:24 -05:00
|
|
|
_DEPEND_THRU=FULL_PACKAGE_NAME=${FULL_PACKAGE_NAME}
|
1998-09-07 18:33:19 -04:00
|
|
|
|
1999-09-22 07:49:23 -04:00
|
|
|
# XXX
|
1996-06-03 18:47:10 -04:00
|
|
|
package-name:
|
2000-01-13 12:40:20 -05:00
|
|
|
. if (${FULL_PACKAGE_NAME:L} == "yes")
|
2001-08-12 07:33:10 -04:00
|
|
|
@${_DEPEND_ECHO} '${PKGPATH}/${FULLPKGNAME${SUBPACKAGE}}'
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
2001-08-12 07:33:10 -04:00
|
|
|
@${_DEPEND_ECHO} '${FULLPKGNAME${SUBPACKAGE}}'
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1998-09-07 18:33:19 -04:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
# Build a package but don't check the package cookie
|
|
|
|
|
|
|
|
.if !target(repackage)
|
|
|
|
repackage: pre-repackage package
|
|
|
|
|
|
|
|
pre-repackage:
|
2001-04-02 06:35:51 -04:00
|
|
|
@rm -f ${_PACKAGE_COOKIES}
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
|
|
|
|
1999-12-01 08:36:50 -05:00
|
|
|
# Internal variables, used by dependencies targets
|
2001-04-02 17:08:49 -04:00
|
|
|
# Only keep pkg:dir spec
|
2001-02-24 17:02:08 -05:00
|
|
|
.if defined(LIB_DEPENDS) || defined(MISC_DEPENDS)
|
2001-04-02 17:08:49 -04:00
|
|
|
_ALWAYS_DEP2 = ${LIB_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/} \
|
|
|
|
${MISC_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
|
|
|
_ALWAYS_DEP= ${_ALWAYS_DEP2:C/[^:]*://}
|
2001-03-28 07:15:26 -05:00
|
|
|
.else
|
2001-04-02 17:08:49 -04:00
|
|
|
_ALWAYS_DEP2=
|
|
|
|
_ALWAYS_DEP=
|
1999-12-01 08:36:50 -05:00
|
|
|
.endif
|
|
|
|
|
2001-04-02 17:08:49 -04:00
|
|
|
.if defined(RUN_DEPENDS)
|
|
|
|
_RUN_DEP2 = ${RUN_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
|
|
|
_RUN_DEP = ${_RUN_DEP2:C/[^:]*://}
|
2001-03-28 07:15:26 -05:00
|
|
|
.else
|
2001-04-02 17:08:49 -04:00
|
|
|
_RUN_DEP2=
|
|
|
|
_RUN_DEP=
|
1999-12-01 08:36:50 -05:00
|
|
|
.endif
|
|
|
|
|
2001-04-02 17:08:49 -04:00
|
|
|
.if defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS)
|
|
|
|
_BUILD_DEP2 = ${FETCH_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/} \
|
|
|
|
${BUILD_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
|
|
|
_BUILD_DEP = ${_BUILD_DEP2:C/[^:]*://}
|
2001-03-28 07:15:26 -05:00
|
|
|
.else
|
2001-04-02 17:08:49 -04:00
|
|
|
_BUILD_DEP2=
|
|
|
|
_BUILD_DEP=
|
1999-12-01 08:36:50 -05:00
|
|
|
.endif
|
|
|
|
|
1996-12-25 15:10:09 -05:00
|
|
|
.if !target(clean-depends)
|
|
|
|
clean-depends:
|
2001-03-28 07:15:26 -05:00
|
|
|
. if !empty(_ALWAYS_DEP) || !empty(_BUILD_DEP) || !empty(_RUN_DEP)
|
2001-03-28 09:33:24 -05:00
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
|
|
|
for dir in \
|
1999-12-01 08:36:50 -05:00
|
|
|
`echo ${_ALWAYS_DEP} ${_BUILD_DEP} ${_RUN_DEP} \
|
|
|
|
| tr '\040' '\012' | sort -u`; do \
|
2001-03-28 09:33:24 -05:00
|
|
|
${_flavor_fragment}; \
|
2000-06-01 13:33:53 -04:00
|
|
|
if cd ${PORTSDIR} && cd $$dir 2>/dev/null ; then \
|
2001-03-28 09:33:24 -05:00
|
|
|
eval $$toset ${MAKE} CLEANDEPENDS=No ${_DEPEND_THRU} clean clean-depends; \
|
1997-09-09 11:11:28 -04:00
|
|
|
fi \
|
1996-12-25 15:10:09 -05:00
|
|
|
done
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1996-12-25 15:10:09 -05:00
|
|
|
.endif
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
# This target generates an index entry suitable for aggregation into
|
|
|
|
# a large index. Format is:
|
|
|
|
#
|
|
|
|
# distribution-name|port-path|installation-prefix|comment| \
|
1998-09-07 18:33:19 -04:00
|
|
|
# description-file|maintainer|categories|build deps|run deps|for arch
|
1996-06-03 18:47:10 -04:00
|
|
|
#
|
|
|
|
describe:
|
1999-12-20 14:02:37 -05:00
|
|
|
.if !defined(NO_DESCRIBE)
|
2001-05-05 16:23:42 -04:00
|
|
|
. if !defined(PACKAGING) && defined(MULTI_PACKAGES)
|
2001-08-16 10:49:31 -04:00
|
|
|
@cd ${.CURDIR} && SUBPACKAGE='${SUBPACKAGE}' FLAVOR='${FLAVOR}' PACKAGING='${SUBPACKAGE}' exec ${MAKE} describe
|
2001-04-20 11:06:19 -04:00
|
|
|
. else
|
2001-08-12 07:33:10 -04:00
|
|
|
@echo -n "${FULLPKGNAME${SUBPACKAGE}}|${FULLPKGPATH}|"
|
2001-04-20 11:06:19 -04:00
|
|
|
. if ${PREFIX} == ${LOCALBASE}
|
2000-03-28 04:27:03 -05:00
|
|
|
@echo -n "|"
|
2001-04-20 11:06:19 -04:00
|
|
|
. else
|
2000-04-02 14:35:41 -04:00
|
|
|
@echo -n "${PREFIX}|"
|
2001-04-20 11:06:19 -04:00
|
|
|
. endif
|
2001-05-23 11:48:08 -04:00
|
|
|
@echo -n ${_COMMENT}"|"; \
|
1997-09-09 11:11:28 -04:00
|
|
|
if [ -f ${DESCR} ]; then \
|
2000-03-26 20:52:17 -05:00
|
|
|
echo -n "${DESCR:S,^${PORTSDIR}/,,}|"; \
|
1996-06-03 18:47:10 -04:00
|
|
|
else \
|
1999-11-22 18:44:01 -05:00
|
|
|
echo -n "/dev/null|"; \
|
1997-09-09 11:11:28 -04:00
|
|
|
fi; \
|
1999-11-22 18:44:01 -05:00
|
|
|
echo -n "${MAINTAINER}|${CATEGORIES}|"
|
2001-05-23 09:28:14 -04:00
|
|
|
. if !empty(_ALWAYS_DEP2) || !empty(_BUILD_DEP2)
|
2001-04-04 04:17:31 -04:00
|
|
|
@cd ${.CURDIR} && _FINAL_ECHO=: _INITIAL_ECHO=: exec ${MAKE} build-depends-list
|
2001-04-20 11:06:19 -04:00
|
|
|
. endif
|
1999-11-22 18:44:01 -05:00
|
|
|
@echo -n "|"
|
2001-05-23 09:28:14 -04:00
|
|
|
. if !empty(_ALWAYS_DEP2) || !empty(_RUN_DEP2)
|
2001-04-04 04:17:31 -04:00
|
|
|
@cd ${.CURDIR} && _FINAL_ECHO=: _INITIAL_ECHO=: exec ${MAKE} run-depends-list
|
2001-04-20 11:06:19 -04:00
|
|
|
. endif
|
1999-11-22 18:44:01 -05:00
|
|
|
@echo -n "|"
|
2001-03-28 05:25:38 -05:00
|
|
|
@case "${ONLY_FOR_ARCHS}" in \
|
|
|
|
"") case "${NOT_FOR_ARCHS}" in \
|
|
|
|
"") echo -n "any|";; \
|
|
|
|
*) echo -n "!${NOT_FOR_ARCHS}|";; \
|
|
|
|
esac;; \
|
|
|
|
*) echo -n "${ONLY_FOR_ARCHS}|";; \
|
|
|
|
esac
|
2000-02-21 17:09:57 -05:00
|
|
|
|
2001-04-20 11:06:19 -04:00
|
|
|
. if defined(PERMIT_PACKAGE_CDROM)
|
|
|
|
. if ${PERMIT_PACKAGE_CDROM:L} == "yes"
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "y|"
|
2001-04-20 11:06:19 -04:00
|
|
|
. else
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "n|"
|
2001-04-20 11:06:19 -04:00
|
|
|
. endif
|
|
|
|
. else
|
2000-02-22 04:18:36 -05:00
|
|
|
@echo -n "?|"
|
2001-04-20 11:06:19 -04:00
|
|
|
. endif
|
2000-02-21 17:09:57 -05:00
|
|
|
|
2001-04-20 11:06:19 -04:00
|
|
|
. if defined(PERMIT_PACKAGE_FTP)
|
|
|
|
. if ${PERMIT_PACKAGE_FTP:L} == "yes"
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "y|"
|
2001-04-20 11:06:19 -04:00
|
|
|
. else
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "n|"
|
2001-04-20 11:06:19 -04:00
|
|
|
. endif
|
|
|
|
. else
|
2000-02-22 04:18:36 -05:00
|
|
|
@echo -n "?|"
|
2001-04-20 11:06:19 -04:00
|
|
|
. endif
|
2000-02-21 17:09:57 -05:00
|
|
|
|
|
|
|
|
2001-04-20 11:06:19 -04:00
|
|
|
. if defined(PERMIT_DISTFILES_CDROM)
|
|
|
|
. if ${PERMIT_DISTFILES_CDROM:L} == "yes"
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "y|"
|
2001-04-20 11:06:19 -04:00
|
|
|
. else
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "n|"
|
2001-04-20 11:06:19 -04:00
|
|
|
. endif
|
|
|
|
. else
|
2000-02-22 04:18:36 -05:00
|
|
|
@echo -n "?|"
|
2001-04-20 11:06:19 -04:00
|
|
|
. endif
|
2000-02-21 17:09:57 -05:00
|
|
|
|
|
|
|
|
2001-04-20 11:06:19 -04:00
|
|
|
. if defined(PERMIT_DISTFILES_FTP)
|
|
|
|
. if ${PERMIT_DISTFILES_FTP:L} == "yes"
|
2000-03-04 09:40:21 -05:00
|
|
|
@echo "y"
|
2001-04-20 11:06:19 -04:00
|
|
|
. else
|
2000-03-04 09:40:21 -05:00
|
|
|
@echo "n"
|
2001-04-20 11:06:19 -04:00
|
|
|
. endif
|
|
|
|
. else
|
2000-03-04 09:40:21 -05:00
|
|
|
@echo "?"
|
2001-04-20 11:06:19 -04:00
|
|
|
. endif
|
2001-05-22 07:46:17 -04:00
|
|
|
. if defined(MULTI_PACKAGES) && empty(SUBPACKAGE)
|
|
|
|
. for _sub in ${MULTI_PACKAGES}
|
2001-08-16 10:49:31 -04:00
|
|
|
@cd ${.CURDIR} && SUBPACKAGE='${_sub}' FLAVOR='${FLAVOR}' PACKAGING='${_sub}' exec ${MAKE} describe
|
2001-05-22 07:46:17 -04:00
|
|
|
. endfor
|
|
|
|
. endif
|
2001-04-20 11:06:19 -04:00
|
|
|
. endif
|
2001-05-22 07:46:17 -04:00
|
|
|
.endif
|
2000-02-22 04:27:51 -05:00
|
|
|
|
1999-09-30 13:28:31 -04:00
|
|
|
|
1999-09-30 17:07:09 -04:00
|
|
|
README.html:
|
2001-08-12 07:33:10 -04:00
|
|
|
@echo ${FULLPKGNAME${SUBPACKAGE}} | ${HTMLIFY} > $@.tmp3
|
2001-03-28 07:15:26 -05:00
|
|
|
.if !empty(_ALWAYS_DEP) || !empty(_BUILD_DEP) || target(depends-list)
|
2000-05-16 11:54:17 -04:00
|
|
|
@cd ${.CURDIR} && ${MAKE} depends-list FULL_PACKAGE_NAME=Yes | ${_SORT_DEPENDS}>$@.tmp1
|
1999-09-30 17:07:09 -04:00
|
|
|
.endif
|
2001-03-28 07:15:26 -05:00
|
|
|
.if !empty(_ALWAYS_DEP) || !empty(_RUN_DEP) || target(package-depends)
|
2000-05-16 11:54:17 -04:00
|
|
|
@cd ${.CURDIR} && ${MAKE} package-depends FULL_PACKAGE_NAME=Yes | ${_SORT_DEPENDS} >$@.tmp2
|
1999-09-30 17:07:09 -04:00
|
|
|
.endif
|
2000-02-15 13:19:12 -05:00
|
|
|
.if defined(HOMEPAGE)
|
|
|
|
@echo 'See <a href="${HOMEPAGE}">${HOMEPAGE}</a> for details.' >$@.tmp4
|
|
|
|
.else
|
|
|
|
@echo "" >$@.tmp4
|
|
|
|
.endif
|
1999-09-30 17:07:09 -04:00
|
|
|
.for I in 1 2
|
|
|
|
@if [ -s $@.tmp$I ]; then \
|
1999-12-03 09:57:12 -05:00
|
|
|
{ cat $@.tmp$I | while read n; do \
|
1999-09-30 17:07:09 -04:00
|
|
|
j=`dirname $$n|${HTMLIFY}`; k=`basename $$n|${HTMLIFY}`; \
|
|
|
|
echo "<A HREF=\"${PKGDEPTH}/$$j/README.html\">$$k</A>"; \
|
1999-11-23 10:06:14 -05:00
|
|
|
done; } >$@.tmp$Ia; \
|
1999-09-30 17:07:09 -04:00
|
|
|
else \
|
|
|
|
echo "(none)" > $@.tmp$Ia; \
|
|
|
|
fi
|
|
|
|
.endfor
|
1999-12-03 09:57:12 -05:00
|
|
|
@cat ${README_NAME} | \
|
2000-12-14 08:13:53 -05:00
|
|
|
sed -e 's|%%PORT%%|'"`echo ${PKGPATH} | ${HTMLIFY}`"'|g' \
|
2000-02-28 13:13:18 -05:00
|
|
|
-e '/%%PKG%%/r$@.tmp3' -e '//d' \
|
|
|
|
-e '/%%COMMENT%%/r${PKGDIR}/COMMENT' -e '//d' \
|
|
|
|
-e '/%%DESCR%%/r${PKGDIR}/DESCR' -e '//d' \
|
|
|
|
-e '/%%HOMEPAGE%%/r$@.tmp4' -e '//d' \
|
|
|
|
-e '/%%BUILD_DEPENDS%%/r$@.tmp1a' -e '//d' \
|
|
|
|
-e '/%%RUN_DEPENDS%%/r$@.tmp2a' -e '//d' \
|
1999-09-30 17:07:09 -04:00
|
|
|
>> $@
|
|
|
|
@rm -f $@.tmp*
|
|
|
|
|
1999-09-30 13:34:22 -04:00
|
|
|
.if !target(print-depends-list)
|
|
|
|
print-depends-list:
|
2001-03-28 07:15:26 -05:00
|
|
|
. if !empty(_ALWAYS_DEP) || !empty(_BUILD_DEP) || target(depends-list)
|
1999-11-22 18:44:01 -05:00
|
|
|
@echo -n 'This port requires package(s) "'
|
2001-03-28 09:33:24 -05:00
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
|
|
|
echo -n `cd ${.CURDIR} && ${MAKE} ${_DEPEND_THRU} depends-list | ${_SORT_DEPENDS}`
|
1999-11-22 18:44:01 -05:00
|
|
|
@echo '" to build.'
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1999-09-30 13:34:22 -04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(print-package-depends)
|
|
|
|
print-package-depends:
|
2001-03-28 07:15:26 -05:00
|
|
|
. if !empty(_ALWAYS_DEP) || !empty(_RUN_DEP) || target(package-depends)
|
1999-11-22 18:44:01 -05:00
|
|
|
@echo -n 'This port requires package(s) "'
|
2001-03-28 09:33:24 -05:00
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
|
|
|
echo -n `cd ${.CURDIR} && ${MAKE} ${_DEPEND_THRU} package-depends | ${_SORT_DEPENDS}`
|
1999-11-22 18:44:01 -05:00
|
|
|
@echo '" to run.'
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1999-09-30 13:34:22 -04:00
|
|
|
.endif
|
|
|
|
|
1999-11-10 08:46:40 -05:00
|
|
|
|
1999-11-15 13:37:58 -05:00
|
|
|
.if !target(recurse-build-depends)
|
|
|
|
recurse-build-depends:
|
2001-03-28 07:15:26 -05:00
|
|
|
. if !empty(_ALWAYS_DEP) || !empty(_BUILD_DEP) || !empty(_RUN_DEP)
|
2000-05-16 11:54:17 -04:00
|
|
|
@pname=`cd ${.CURDIR} && ${MAKE} _DEPEND_ECHO='echo -n' package-name ${_DEPEND_THRU}`; \
|
2001-03-28 09:33:24 -05:00
|
|
|
unset FLAVOR SUBPACKAGE || true; \
|
1999-11-15 13:37:58 -05:00
|
|
|
for dir in `echo ${_ALWAYS_DEP} ${_BUILD_DEP} ${_RUN_DEP} \
|
|
|
|
| tr '\040' '\012' | sort -u`; do \
|
2001-03-28 09:33:24 -05:00
|
|
|
${_flavor_fragment}; \
|
2000-03-07 19:07:37 -05:00
|
|
|
if cd ${PORTSDIR} && cd $$dir 2>/dev/null; then \
|
2001-03-28 09:33:24 -05:00
|
|
|
if ! eval $$toset ${MAKE} _DEPEND_ECHO=\"echo $$pname\" package-name recurse-build-depends ${_DEPEND_THRU}; then \
|
1999-11-15 13:37:58 -05:00
|
|
|
echo 1>&2 "*** Problem checking deps in \"$$dir\"."; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
else \
|
|
|
|
echo 1>&2 "*** Build dependencies bogus: \"$$dir\" non-existent"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
done
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
2000-05-16 11:54:17 -04:00
|
|
|
@pname=`cd ${.CURDIR} && ${MAKE} _DEPEND_ECHO='echo -n' package-name`; echo $$pname $$pname
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1999-11-15 13:37:58 -05:00
|
|
|
.endif
|
|
|
|
|
1999-09-30 13:28:31 -04:00
|
|
|
.if !target(depends-list)
|
|
|
|
depends-list:
|
2001-03-28 07:15:26 -05:00
|
|
|
. if !empty(_ALWAYS_DEP) || !empty(_BUILD_DEP)
|
2001-03-28 09:33:24 -05:00
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
|
|
|
for dir in `echo ${_ALWAYS_DEP} ${_BUILD_DEP} \
|
1999-11-15 13:37:58 -05:00
|
|
|
| tr '\040' '\012' | sort -u`; do \
|
2001-03-28 09:33:24 -05:00
|
|
|
${_flavor_fragment}; \
|
2000-03-07 19:07:37 -05:00
|
|
|
if cd ${PORTSDIR} && cd $$dir 2>/dev/null; then \
|
2001-03-28 09:33:24 -05:00
|
|
|
if ! eval $$toset ${MAKE} recurse-build-depends ${_DEPEND_THRU}; then \
|
1999-11-15 13:37:58 -05:00
|
|
|
echo 1>&2 "*** Problem checking deps in \"$$dir\"."; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
1999-09-30 13:28:31 -04:00
|
|
|
else \
|
1999-11-15 13:37:58 -05:00
|
|
|
echo 1>&2 "*** Build dependencies bogus: \"$$dir\" non-existent"; \
|
|
|
|
exit 1; \
|
1999-09-30 13:28:31 -04:00
|
|
|
fi; \
|
|
|
|
done
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1999-09-30 13:28:31 -04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
# Build (recursively) a list of package dependencies suitable for tsort
|
1999-11-15 13:37:58 -05:00
|
|
|
.if !target(recurse-package-depends)
|
|
|
|
recurse-package-depends:
|
2001-03-28 07:15:26 -05:00
|
|
|
. if !empty(_ALWAYS_DEP) || !empty(_RUN_DEP)
|
2000-05-16 11:54:17 -04:00
|
|
|
@pname=`cd ${.CURDIR} && ${MAKE} _DEPEND_ECHO='echo -n' package-name ${_DEPEND_THRU}`; \
|
2001-03-28 09:33:24 -05:00
|
|
|
unset FLAVOR SUBPACKAGE || true; \
|
1999-11-10 08:46:40 -05:00
|
|
|
for dir in `echo ${_ALWAYS_DEP} ${_RUN_DEP} \
|
|
|
|
| tr '\040' '\012' | sort -u`; do \
|
2001-03-28 09:33:24 -05:00
|
|
|
${_flavor_fragment}; \
|
2000-03-05 11:40:52 -05:00
|
|
|
if cd ${PORTSDIR} && cd $$dir 2>/dev/null; then \
|
2001-03-28 09:33:24 -05:00
|
|
|
if ! eval $$toset ${MAKE} _DEPEND_ECHO=\"echo $$pname\" package-name recurse-package-depends ${_DEPEND_THRU}; then \
|
1999-11-15 13:37:58 -05:00
|
|
|
echo 1>&2 "*** Problem checking deps in \"$$dir\"." ; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
1999-09-30 13:28:31 -04:00
|
|
|
else \
|
1999-11-15 13:37:58 -05:00
|
|
|
echo 1>&2 "*** @pkgdep registration bogus: \"$$dir\" non-existent"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
done
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
2000-05-16 11:54:17 -04:00
|
|
|
@pname=`cd ${.CURDIR} && ${MAKE} _DEPEND_ECHO='echo -n' package-name`; echo $$pname $$pname
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1999-11-15 13:37:58 -05:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(package-depends)
|
|
|
|
package-depends:
|
2001-03-28 07:15:26 -05:00
|
|
|
. if !empty(_ALWAYS_DEP) || !empty(_RUN_DEP)
|
2001-03-28 09:33:24 -05:00
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
|
|
|
for dir in `echo ${_ALWAYS_DEP} ${_RUN_DEP} \
|
1999-11-15 13:37:58 -05:00
|
|
|
| tr '\040' '\012' | sort -u`; do \
|
2001-03-28 09:33:24 -05:00
|
|
|
${_flavor_fragment}; \
|
2000-03-05 11:40:52 -05:00
|
|
|
if cd ${PORTSDIR} && cd $$dir 2>/dev/null; then \
|
2001-03-28 09:33:24 -05:00
|
|
|
if ! eval $$toset ${MAKE} recurse-package-depends ${_DEPEND_THRU}; then \
|
1999-11-15 13:37:58 -05:00
|
|
|
echo 1>&2 "*** Problem checking deps in \"$$dir\"." ; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
else \
|
|
|
|
echo 1>&2 "*** @pkgdep registration bogus: \"$$dir\" non-existent"; \
|
|
|
|
exit 1; \
|
1999-09-30 13:28:31 -04:00
|
|
|
fi; \
|
|
|
|
done
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
|
|
|
|
2001-04-04 04:17:31 -04:00
|
|
|
# recursively build a list of dirs to pass to tsort...
|
2001-04-18 10:43:55 -04:00
|
|
|
_recurse-dir-depends:
|
2001-04-04 04:17:31 -04:00
|
|
|
.if !empty(_ALWAYS_DEP) || !empty(_BUILD_DEP) || !empty(_RUN_DEP)
|
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
|
|
|
for dir in `echo ${_ALWAYS_DEP} ${_BUILD_DEP} ${_RUN_DEP} \
|
|
|
|
| tr '\040' '\012' | sort -u`; do \
|
|
|
|
echo "$$self $$dir"; \
|
|
|
|
self2="$$dir"; \
|
|
|
|
${_flavor_fragment}; \
|
|
|
|
toset="$$toset self=\"$$self2\""; \
|
|
|
|
if cd ${PORTSDIR} && cd $$dir 2>/dev/null; then \
|
2001-04-19 18:15:05 -04:00
|
|
|
if ! eval $$toset ${MAKE} _recurse-dir-depends ${_DEPEND_THRU}; then \
|
2001-04-04 04:17:31 -04:00
|
|
|
echo 1>&2 "*** Problem checking deps in \"$$dir\"."; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
else \
|
|
|
|
echo 1>&2 "*** Build dependencies bogus: \"$$dir\" non-existent"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# recursively build a list of dirs to pass to tsort...
|
|
|
|
dir-depends:
|
|
|
|
.if !empty(_ALWAYS_DEP) || !empty(_BUILD_DEP)
|
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
|
|
|
for dir in `echo ${_ALWAYS_DEP} ${_BUILD_DEP} \
|
|
|
|
| tr '\040' '\012' | sort -u`; do \
|
2001-04-08 12:55:17 -04:00
|
|
|
echo "${FULLPKGPATH} $$dir"; \
|
2001-04-04 04:17:31 -04:00
|
|
|
self2="$$dir"; \
|
|
|
|
${_flavor_fragment}; \
|
|
|
|
toset="$$toset self=\"$$self2\""; \
|
|
|
|
if cd ${PORTSDIR} && cd $$dir 2>/dev/null; then \
|
2001-04-18 10:43:55 -04:00
|
|
|
if ! eval $$toset ${MAKE} _recurse-dir-depends ${_DEPEND_THRU}; then \
|
2001-04-04 04:17:31 -04:00
|
|
|
echo 1>&2 "*** Problem checking deps in \"$$dir\"."; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
else \
|
|
|
|
echo 1>&2 "*** Build dependencies bogus: \"$$dir\" non-existent"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
.else
|
2001-04-08 12:55:17 -04:00
|
|
|
@echo "${FULLPKGPATH} ${FULLPKGPATH}"
|
2001-04-04 04:17:31 -04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.for _i in RUN BUILD
|
|
|
|
${_i:L}-depends-list:
|
|
|
|
. if !empty(_ALWAYS_DEP2) || !empty(_${_i}_DEP2)
|
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
|
|
|
: $${_INITIAL_ECHO:='echo -n "This port requires \""'}; \
|
|
|
|
: $${_ECHO='echo -n'}; \
|
|
|
|
: $${_FINAL_ECHO:='echo "\" to ${_i:L}."'}; space=''; \
|
|
|
|
eval $${_INITIAL_ECHO}; \
|
2001-04-09 19:16:50 -04:00
|
|
|
for spec in `echo '${_ALWAYS_DEP2} ${_${_i}_DEP2}' \
|
2001-04-04 04:17:31 -04:00
|
|
|
| tr '\040' '\012' | sort -u`; do \
|
|
|
|
dir=$${spec#*:}; pkg=$${spec%:*}; \
|
|
|
|
case X"$$pkg" in \
|
|
|
|
X) $${_ECHO} "$$space$${dir}";; \
|
|
|
|
*) $${_ECHO} "$$space$${pkg}:$${dir}";; \
|
|
|
|
esac; space=' '; \
|
|
|
|
done; eval $${_FINAL_ECHO}
|
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
2001-04-18 10:43:55 -04:00
|
|
|
# recursively build a list of dirs to pass to tsort...
|
|
|
|
_package-recurse-dir-depends:
|
|
|
|
.if !empty(_ALWAYS_DEP) || !empty(_RUN_DEP)
|
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
|
|
|
for dir in `echo ${_ALWAYS_DEP} ${_RUN_DEP} \
|
|
|
|
| tr '\040' '\012' | sort -u`; do \
|
|
|
|
echo "$$self $$dir"; \
|
|
|
|
self2="$$dir"; \
|
|
|
|
${_flavor_fragment}; \
|
|
|
|
toset="$$toset self=\"$$self2\""; \
|
|
|
|
if cd ${PORTSDIR} && cd $$dir 2>/dev/null; then \
|
|
|
|
if ! eval $$toset ${MAKE} _package-recurse-dir-depends ${_DEPEND_THRU}; then \
|
|
|
|
echo 1>&2 "*** Problem checking deps in \"$$dir\"."; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
else \
|
|
|
|
echo 1>&2 "*** Run dependencies bogus: \"$$dir\" non-existent"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# recursively build a list of dirs to pass to tsort...
|
|
|
|
package-dir-depends:
|
|
|
|
.if !empty(_ALWAYS_DEP) || !empty(_RUN_DEP)
|
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
|
|
|
for dir in `echo ${_ALWAYS_DEP} ${_RUN_DEP} \
|
|
|
|
| tr '\040' '\012' | sort -u`; do \
|
|
|
|
echo "${FULLPKGPATH} $$dir"; \
|
|
|
|
self2="$$dir"; \
|
|
|
|
${_flavor_fragment}; \
|
|
|
|
toset="$$toset self=\"$$self2\""; \
|
|
|
|
if cd ${PORTSDIR} && cd $$dir 2>/dev/null; then \
|
|
|
|
if ! eval $$toset ${MAKE} _package-recurse-dir-depends ${_DEPEND_THRU}; then \
|
|
|
|
echo 1>&2 "*** Problem checking deps in \"$$dir\"."; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
else \
|
|
|
|
echo 1>&2 "*** Run dependencies bogus: \"$$dir\" non-existent"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
.else
|
|
|
|
@echo "${FULLPKGPATH} ${FULLPKGPATH}"
|
|
|
|
.endif
|
|
|
|
|
2001-04-02 07:50:25 -04:00
|
|
|
new-depends:
|
|
|
|
.if !empty(_ALWAYS_DEP2) || !empty(_RUN_DEP2)
|
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
|
|
|
: $${self:=self}; \
|
2001-04-09 19:16:50 -04:00
|
|
|
for spec in `echo '${_ALWAYS_DEP2} ${_RUN_DEP2}' \
|
2001-04-02 07:50:25 -04:00
|
|
|
| tr '\040' '\012' | sort -u`; do \
|
|
|
|
dir=$${spec#*:}; pkg=$${spec%:*}; \
|
|
|
|
${_flavor_fragment}; \
|
|
|
|
default=`cd ${PORTSDIR} && cd $$dir 2>/dev/null && eval $$toset ${MAKE} package-name`; \
|
|
|
|
: $${pkg:=$$default}; \
|
|
|
|
echo "@newdepend $$self:$$pkg:$$default"; \
|
|
|
|
toset="$$toset self=\"$$default\""; \
|
|
|
|
if cd ${PORTSDIR} && cd $$dir 2>/dev/null; then \
|
|
|
|
if ! eval $$toset ${MAKE} new-depends; then \
|
|
|
|
echo 1>&2 "*** Problem checking deps in \"$$dir\"." ; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
else \
|
|
|
|
echo 1>&2 "*** @pkgdep registration bogus: \"$$dir\" non-existent"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
.endif
|
1999-04-20 14:22:56 -04:00
|
|
|
README_NAME?= ${TEMPLATES}/README.port
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
.if !target(readmes)
|
|
|
|
readmes: readme
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(readme)
|
|
|
|
readme:
|
|
|
|
@rm -f README.html
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} README_NAME=${README_NAME} README.html
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
|
|
|
|
1999-04-20 14:22:56 -04:00
|
|
|
|
1999-12-03 09:57:12 -05:00
|
|
|
HTMLIFY= sed -e 's/&/\&/g' -e 's/>/\>/g' -e 's/</\</g'
|
1999-04-20 14:22:56 -04:00
|
|
|
|
|
|
|
.if !target(print-depends)
|
|
|
|
print-depends:
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} FULL_PACKAGE_NAME=Yes print-depends-list print-package-depends
|
1999-04-20 14:22:56 -04:00
|
|
|
.endif
|
|
|
|
|
2000-02-18 17:54:27 -05:00
|
|
|
.if defined(VARNAME)
|
|
|
|
show:
|
2000-08-28 18:38:37 -04:00
|
|
|
@echo ${${VARNAME}:Q}
|
2000-02-18 17:54:27 -05:00
|
|
|
.endif
|
2000-08-28 18:38:37 -04:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
# Depend is generally meaningless for arbitrary ports, but if someone wants
|
|
|
|
# one they can override this. This is just to catch people who've gotten into
|
|
|
|
# the habit of typing `make depend all install' as a matter of course.
|
|
|
|
#
|
|
|
|
.if !target(depend)
|
|
|
|
depend:
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Same goes for tags
|
|
|
|
.if !target(tags)
|
|
|
|
tags:
|
|
|
|
.endif
|
1997-01-11 06:58:11 -05:00
|
|
|
|
2000-12-16 10:49:12 -05:00
|
|
|
link-categories:
|
|
|
|
.for _CAT in ${CATEGORIES}
|
|
|
|
@linkname=${PORTSDIR}/${_CAT}/`basename ${.CURDIR}`; \
|
|
|
|
if [ ! -e $$linkname ]; then \
|
|
|
|
echo "$$linkname -> ${.CURDIR}"; \
|
|
|
|
mkdir -p ${PORTSDIR}/${_CAT}; \
|
|
|
|
ln -s ${.CURDIR} $$linkname; \
|
|
|
|
fi
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
unlink-categories:
|
|
|
|
.for _CAT in ${CATEGORIES}
|
|
|
|
@linkname=${PORTSDIR}/${_CAT}/`basename ${.CURDIR}`; \
|
|
|
|
if [ -L $$linkname ]; then \
|
|
|
|
echo "rm $$linkname"; \
|
|
|
|
rm $$linkname; \
|
|
|
|
if rmdir ${PORTSDIR}/${_CAT} 2>/dev/null; then \
|
|
|
|
echo "rmdir ${PORTSDIR}/${_CAT}"; \
|
|
|
|
fi; \
|
|
|
|
fi
|
|
|
|
.endfor
|
|
|
|
|
2001-01-08 17:34:51 -05:00
|
|
|
.if ${FAKE:L} == "no"
|
2000-12-23 07:25:57 -05:00
|
|
|
. include "${PORTSDIR}/infrastructure/mk/old-install.mk"
|
|
|
|
.endif
|
|
|
|
|
1999-02-24 07:34:46 -05:00
|
|
|
.PHONY: \
|
|
|
|
addsum all build build-depends checkpatch \
|
|
|
|
checksum clean clean-depends configure deinstall \
|
|
|
|
delete-package delete-package-links depend depends depends-list \
|
|
|
|
describe distclean do-build do-configure do-extract \
|
1999-04-02 01:55:56 -05:00
|
|
|
do-fetch do-install do-package do-patch extract list-distfiles \
|
2000-12-23 07:25:57 -05:00
|
|
|
fetch fetch-depends install lib-depends makesum \
|
2000-04-09 20:42:02 -04:00
|
|
|
cdrom-packages ftp-packages \
|
1999-02-24 07:34:46 -05:00
|
|
|
misc-depends package package-depends package-links package-name \
|
2000-07-14 19:01:11 -04:00
|
|
|
package-noinstall patch plist update-patches post-build \
|
1999-02-24 07:34:46 -05:00
|
|
|
post-configure post-extract post-fetch post-install post-package \
|
|
|
|
post-patch pre-build pre-clean pre-configure pre-distclean \
|
|
|
|
pre-extract pre-fetch pre-install pre-package pre-patch \
|
|
|
|
pre-repackage print-depends-list print-package-depends readme \
|
2001-03-28 06:28:31 -05:00
|
|
|
readmes rebuild reinstall \
|
1999-11-15 13:37:58 -05:00
|
|
|
repackage run-depends tags uninstall fetch-all print-depends \
|
Add intermediate `distpatch' target.
This is done in a tricky way, so as not to disturb the usual sequence
of targets. Namely, you still have
fetch, extract, patch, configure, build, install, package,
but patch does invoke a subtarget distpatch when needed,
and you can
fetch, extract, distpatch, patch, configure, build, install, package
for the same results.
Mostly useful for porters: provide an intermediate point to work on
patches, and make it easy to override distpatch/OpenBSD patches separately.
2000-01-30 10:19:40 -05:00
|
|
|
recurse-build-depends recurse-package-depends \
|
2000-12-16 10:49:12 -05:00
|
|
|
distpatch real-distpatch do-distpatch post-distpatch show \
|
2001-04-04 04:17:31 -04:00
|
|
|
link-categories unlink-categories _package new-depends \
|
2001-04-18 10:43:55 -04:00
|
|
|
dir-depends _recurse-dir-depends package-dir-depends \
|
|
|
|
_package-recurse-dir-depends recursebuild-depends-list run-depends-list
|