2003-07-18 15:02:13 -04:00
|
|
|
#-*- mode: Makefile; tab-width: 4; -*-
|
2000-02-02 10:28:17 -05:00
|
|
|
# ex:ts=4 sw=4 filetype=make:
|
2009-01-05 07:43:49 -05:00
|
|
|
# $OpenBSD: bsd.port.mk,v 1.959 2009/01/05 12:43:49 ajacoutot 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.
|
2003-07-18 15:02:13 -04:00
|
|
|
# To obtain that address, just type
|
2003-07-12 08:51:19 -04:00
|
|
|
# make show=MAINTAINER
|
2000-09-13 10:06:55 -04:00
|
|
|
# in the specific port's directory.
|
2003-07-18 15:02:13 -04:00
|
|
|
#
|
2000-09-13 10:06:55 -04:00
|
|
|
# The ports@openbsd.org address is the `default' MAINTAINER (the generic
|
|
|
|
# OpenBSD ports mailing-list).
|
1997-09-09 11:11:28 -04:00
|
|
|
|
2003-07-18 15:02:13 -04:00
|
|
|
# Enquiries as to the bsd.port.mk framework should usually be directed
|
2000-09-13 10:06:55 -04:00
|
|
|
# to ports@openbsd.org.
|
2000-03-26 16:23:20 -05:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2001-03-28 10:01:01 -05:00
|
|
|
.if ${.MAKEFLAGS:MFLAVOR=*}
|
2006-11-27 10:28:40 -05:00
|
|
|
ERRORS += "Fatal: Use 'env FLAVOR=${FLAVOR} ${MAKE}' instead."
|
2001-03-28 10:01:01 -05:00
|
|
|
.endif
|
2001-09-29 13:36:02 -04:00
|
|
|
.if ${.MAKEFLAGS:MSUBPACKAGE=*}
|
2006-11-27 10:28:40 -05:00
|
|
|
ERRORS += "Fatal: Use 'env SUBPACKAGE=${SUBPACKAGE} ${MAKE}' instead."
|
2001-09-29 13:36:02 -04:00
|
|
|
.endif
|
2001-03-28 10:01:01 -05:00
|
|
|
|
2006-11-23 19:10:00 -05:00
|
|
|
.for v in PKGREPOSITORY PKGREPOSITORYBASE CDROM_PACKAGES FTP_PACKAGES SED_PLIST
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
. if defined($v)
|
2006-11-27 10:28:40 -05:00
|
|
|
ERRORS += "Fatal: Variable $v is obsolete, use PACKAGE_REPOSITORY instead."
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
2003-07-14 10:02:18 -04:00
|
|
|
# The definitive source of documentation to this file's user-visible parts
|
|
|
|
# is bsd.port.mk(5).
|
1996-06-03 18:47:10 -04:00
|
|
|
#
|
2003-07-18 15:02:13 -04:00
|
|
|
# Any variable or target starting with an underscore (e.g., _DEPEND_ECHO)
|
|
|
|
# is internal to bsd.port.mk, not part of the user's API, and liable to
|
|
|
|
# change without notice.
|
2000-12-01 11:31:11 -05:00
|
|
|
#
|
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
|
|
|
#
|
2003-07-30 15:31:31 -04:00
|
|
|
|
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.
|
2003-07-18 15:02:13 -04:00
|
|
|
# The sequence of hooks actually run is:
|
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
|
|
|
# pre-patch `real distpatch' post-distpatch `real patch' post-patch
|
2001-04-11 12:06:07 -04:00
|
|
|
#
|
|
|
|
|
2004-01-06 10:02:57 -05:00
|
|
|
# User settings
|
2006-11-27 10:28:40 -05:00
|
|
|
TRUST_PACKAGES ?= No
|
|
|
|
FETCH_PACKAGES ?= No
|
|
|
|
CLEANDEPENDS ?= No
|
|
|
|
USE_SYSTRACE ?= No
|
|
|
|
BULK ?= No
|
|
|
|
RECURSIVE_FETCH_LIST ?= Yes
|
2008-09-19 09:00:30 -04:00
|
|
|
WRKDIR_LINKNAME ?=
|
2007-07-28 08:58:34 -04:00
|
|
|
_FETCH_MAKEFILE ?= /dev/stdout
|
2006-11-27 10:28:40 -05:00
|
|
|
WRKOBJDIR ?=
|
|
|
|
FAKEOBJDIR ?=
|
|
|
|
BULK_TARGETS ?=
|
|
|
|
BULK_DO ?=
|
2007-04-03 06:14:14 -04:00
|
|
|
CHECK_LIB_DEPENDS ?= No
|
2006-11-27 10:28:40 -05:00
|
|
|
FORCE_UPDATE ?= No
|
2006-07-09 07:10:16 -04:00
|
|
|
# All variables relevant to the port's description
|
2006-11-27 10:28:40 -05:00
|
|
|
_ALL_VARIABLES ?= HOMEPAGE DISTNAME BUILD_DEPENDS RUN_DEPENDS \
|
|
|
|
REGRESS_DEPENDS USE_GMAKE MODULES FLAVORS \
|
2008-08-19 19:49:32 -04:00
|
|
|
NO_BUILD NO_REGRESS SHARED_ONLY ONLY_FOR_ARCHS NOT_FOR_ARCHS IS_INTERACTIVE \
|
2006-11-27 10:28:40 -05:00
|
|
|
BROKEN MULTI_PACKAGES PSEUDO_FLAVORS \
|
|
|
|
REGRESS_IS_INTERACTIVE DISTFILES DIST_SUBDIR \
|
|
|
|
PERMIT_DISTFILES_CDROM PERMIT_DISTFILES_FTP \
|
|
|
|
CONFIGURE_STYLE USE_LIBTOOL SEPARATE_BUILD \
|
2006-11-29 04:42:08 -05:00
|
|
|
SHARED_LIBS USE_MOTIF MASTER_SITES \
|
2006-11-27 10:28:40 -05:00
|
|
|
MASTER_SITES0 MASTER_SITES1 MASTER_SITES2 MASTER_SITES3 MASTER_SITES4 \
|
|
|
|
MASTER_SITES5 MASTER_SITES6 MASTER_SITES7 MASTER_SITES8 MASTER_SITES9 \
|
2008-10-25 11:06:26 -04:00
|
|
|
MAINTAINER SUPDISTFILES SUBPACKAGE \
|
2006-11-27 10:28:40 -05:00
|
|
|
AUTOCONF_VERSION AUTOMAKE_VERSION CONFIGURE_ARGS
|
2006-11-01 07:41:34 -05:00
|
|
|
# and stuff needing to be MULTI_PACKAGE'd
|
2006-11-27 10:28:40 -05:00
|
|
|
_ALL_VARIABLES_INDEXED ?= COMMENT FULLPKGNAME PKGNAME PKG_ARCH \
|
|
|
|
PERMIT_PACKAGE_FTP PERMIT_PACKAGE_CDROM RUN_DEPENDS LIB_DEPENDS \
|
2006-11-27 11:08:05 -05:00
|
|
|
WANTLIB CATEGORIES DESCR
|
2004-01-06 10:02:57 -05:00
|
|
|
|
|
|
|
# special purpose user settings
|
2006-11-27 10:28:40 -05:00
|
|
|
PATCH_CHECK_ONLY ?= No
|
|
|
|
REFETCH ?= false
|
2004-01-06 10:02:57 -05:00
|
|
|
|
|
|
|
# Constants used by the ports tree
|
2007-07-09 09:32:56 -04:00
|
|
|
ARCH ?!= uname -m
|
2006-11-27 10:28:40 -05:00
|
|
|
OPSYS = OpenBSD
|
|
|
|
OPSYS_VER = ${OSREV}
|
2004-01-06 10:02:57 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
LP64_ARCHS = alpha amd64 hppa64 sparc64 mips64
|
2008-03-28 21:58:33 -04:00
|
|
|
NO_SHARED_ARCHS = m88k vax
|
2004-01-06 10:02:57 -05:00
|
|
|
|
2004-08-02 09:01:52 -04:00
|
|
|
# Set NO_SHARED_LIBS for those machines that don't support shared libraries.
|
2004-01-06 10:02:57 -05:00
|
|
|
.for _m in ${MACHINE_ARCH}
|
|
|
|
. if !empty(NO_SHARED_ARCHS:M${_m})
|
2006-11-27 10:28:40 -05:00
|
|
|
NO_SHARED_LIBS ?= Yes
|
2004-01-06 10:02:57 -05:00
|
|
|
. endif
|
|
|
|
.endfor
|
2006-11-27 10:28:40 -05:00
|
|
|
NO_SHARED_LIBS ?= No
|
2004-01-06 10:02:57 -05:00
|
|
|
|
|
|
|
# Global path locations.
|
2006-11-27 10:28:40 -05:00
|
|
|
PORTSDIR ?= /usr/ports
|
|
|
|
LOCALBASE ?= /usr/local
|
|
|
|
X11BASE ?= /usr/X11R6
|
|
|
|
DISTDIR ?= ${PORTSDIR}/distfiles
|
|
|
|
BULK_COOKIES_DIR ?= ${PORTSDIR}/bulk/${MACHINE_ARCH}
|
|
|
|
UPDATE_COOKIES_DIR ?= ${PORTSDIR}/update/${MACHINE_ARCH}
|
|
|
|
TEMPLATES ?= ${PORTSDIR}/infrastructure/templates
|
|
|
|
PLIST_DB ?=
|
|
|
|
|
|
|
|
PACKAGE_REPOSITORY ?= ${PORTSDIR}/packages
|
2004-01-06 10:02:57 -05:00
|
|
|
|
2004-02-07 17:34:02 -05:00
|
|
|
# local path locations
|
|
|
|
.include "${PORTSDIR}/infrastructure/mk/pkgpath.mk"
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
WRKOBJDIR_${PKGPATH} ?= ${WRKOBJDIR}
|
|
|
|
FAKEOBJDIR_${PKGPATH} ?= ${FAKEOBJDIR}
|
|
|
|
BULK_${PKGPATH} ?= ${BULK}
|
|
|
|
BULK_TARGETS_${PKGPATH} ?= ${BULK_TARGETS}
|
|
|
|
BULK_DO_${PKGPATH} ?= ${BULK_DO}
|
|
|
|
CLEANDEPENDS_${PKGPATH} ?= ${CLEANDEPENDS}
|
2004-02-07 17:34:02 -05:00
|
|
|
|
2004-01-06 10:02:57 -05:00
|
|
|
# Commands and command settings.
|
2006-11-27 10:28:40 -05:00
|
|
|
PKG_DBDIR ?= /var/db/pkg
|
2004-01-06 10:02:57 -05:00
|
|
|
|
2007-06-29 06:24:23 -04:00
|
|
|
FTP_KEEPALIVE ?= 0
|
|
|
|
FETCH_CMD ?= /usr/bin/ftp -V -m -k ${FTP_KEEPALIVE}
|
2004-01-06 10:02:57 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
PKG_TMPDIR ?= /var/tmp
|
2007-12-28 07:46:03 -05:00
|
|
|
|
|
|
|
PKGDB_LOCK ?=
|
|
|
|
_PKG_QUERY = pkg_info ${PKGDB_LOCK} -e
|
2006-11-27 10:28:40 -05:00
|
|
|
PKG_CMD ?= /usr/sbin/pkg_create
|
|
|
|
PKG_DELETE ?= /usr/sbin/pkg_delete
|
2007-12-28 07:46:03 -05:00
|
|
|
PKG_CMD += ${PKGDB_LOCK}
|
|
|
|
PKG_DELETE += ${PKGDB_LOCK}
|
|
|
|
|
2004-01-06 10:02:57 -05:00
|
|
|
# remount those mount points ro before fake.
|
|
|
|
# XXX tends to panic the OS
|
2006-11-27 10:28:40 -05:00
|
|
|
PROTECT_MOUNT_POINTS ?=
|
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-09-30 08:26:57 -04:00
|
|
|
.if !defined(PERMIT_PACKAGE_CDROM) || !defined(PERMIT_PACKAGE_FTP) || \
|
2006-11-27 10:28:40 -05:00
|
|
|
!defined(PERMIT_DISTFILES_CDROM) || !defined(PERMIT_DISTFILES_FTP)
|
|
|
|
ERRORS += "The licensing info for ${FULLPKGNAME} is incomplete."
|
|
|
|
ERRORS += "Please notify the OpenBSD port maintainer:"
|
|
|
|
ERRORS += " ${MAINTAINER}"
|
|
|
|
_BAD_LICENSING = Yes
|
2001-09-30 08:26:57 -04:00
|
|
|
PERMIT_PACKAGE_CDROM = No
|
|
|
|
PERMIT_DISTFILES_CDROM = No
|
|
|
|
PERMIT_PACKAGE_FTP = No
|
|
|
|
PERMIT_DISTFILES_FTP = No
|
|
|
|
.endif
|
|
|
|
|
2006-07-09 07:10:16 -04:00
|
|
|
.if defined(verbose-show)
|
|
|
|
.MAIN: verbose-show
|
|
|
|
.elif defined(show)
|
2001-08-16 10:49:31 -04:00
|
|
|
.MAIN: show
|
|
|
|
.elif defined(clean)
|
|
|
|
.MAIN: clean
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
.elif defined(_internal-clean)
|
2006-11-27 10:28:40 -05:00
|
|
|
clean = ${_internal-clean}
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
.MAIN: _internal-clean
|
2001-08-16 10:49:31 -04:00
|
|
|
.else
|
|
|
|
.MAIN: all
|
|
|
|
.endif
|
|
|
|
|
2006-11-27 11:08:05 -05:00
|
|
|
# need to go through an extra var because clean is set in stone,
|
2003-08-01 04:07:30 -04:00
|
|
|
# on the cmdline.
|
2006-11-27 10:28:40 -05:00
|
|
|
_clean = ${clean}
|
2003-08-01 04:07:30 -04:00
|
|
|
.if empty(_clean) || ${_clean:L} == "depends"
|
2006-11-27 10:28:40 -05:00
|
|
|
_clean += work
|
2003-08-01 04:07:30 -04:00
|
|
|
.endif
|
2004-02-07 17:34:02 -05:00
|
|
|
.if ${CLEANDEPENDS_${PKGPATH}:L} == "yes"
|
2006-11-27 10:28:40 -05:00
|
|
|
_clean += depends
|
2001-08-16 10:49:31 -04:00
|
|
|
.endif
|
2008-08-20 04:56:53 -04:00
|
|
|
.if ${_clean:L:Mwork} || ${_clean:L:Mbuild}
|
2006-11-27 10:28:40 -05:00
|
|
|
_clean += fake
|
2001-08-16 10:49:31 -04:00
|
|
|
.endif
|
2003-08-01 04:07:30 -04:00
|
|
|
.if ${_clean:L:Mforce}
|
2006-11-27 10:28:40 -05:00
|
|
|
_clean += -f
|
2001-08-16 10:49:31 -04:00
|
|
|
.endif
|
2004-12-19 07:20:12 -05:00
|
|
|
# check that clean is clean
|
2006-11-27 10:28:40 -05:00
|
|
|
_okay_words = depends work fake -f flavors dist install sub packages package \
|
2008-08-20 04:56:53 -04:00
|
|
|
readmes bulk force plist build
|
2004-12-19 07:20:12 -05:00
|
|
|
.for _w in ${_clean:L}
|
|
|
|
. if !${_okay_words:M${_w}}
|
2006-11-27 10:28:40 -05:00
|
|
|
ERRORS += "Fatal: unknown clean command: ${_w}"
|
2004-12-19 07:20:12 -05:00
|
|
|
. endif
|
|
|
|
.endfor
|
2001-08-16 10:49:31 -04:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
NOMANCOMPRESS ?= Yes
|
|
|
|
DEF_UMASK ?= 022
|
1996-08-23 07:37:41 -04:00
|
|
|
|
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}"
|
2004-01-06 11:27:11 -05:00
|
|
|
.elif exists(${.CURDIR}/Makefile.${MACHINE_ARCH})
|
2001-05-05 19:42:03 -04:00
|
|
|
.include "${.CURDIR}/Makefile.${MACHINE_ARCH}"
|
|
|
|
.endif
|
1997-09-09 11:11:28 -04:00
|
|
|
|
2006-07-11 02:34:32 -04:00
|
|
|
# MODULES support
|
|
|
|
# reserved name spaces: for module=NAME, modname*, _modname* variables and
|
|
|
|
# targets.
|
|
|
|
|
|
|
|
# These variables must be defined before modules
|
2006-11-27 10:28:40 -05:00
|
|
|
CONFIGURE_STYLE ?=
|
|
|
|
USE_X11 ?= No
|
|
|
|
NO_DEPENDS ?= No
|
|
|
|
NO_BUILD ?= No
|
|
|
|
NO_REGRESS ?= No
|
|
|
|
INSTALL_TARGET ?= install
|
|
|
|
|
|
|
|
.if ${CONFIGURE_STYLE:L:Mautomake} || ${CONFIGURE_STYLE:L:Mautoconf} || \
|
|
|
|
${CONFIGURE_STYLE:L:Mautoupdate}
|
2006-07-11 02:34:32 -04:00
|
|
|
. if !${CONFIGURE_STYLE:L:Mgnu}
|
2006-11-27 10:28:40 -05:00
|
|
|
CONFIGURE_STYLE += gnu
|
2006-07-11 02:34:32 -04:00
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.for _i in perl gnu imake
|
|
|
|
. if ${CONFIGURE_STYLE:L:M${_i}}
|
2006-11-27 10:28:40 -05:00
|
|
|
MODULES += ${_i}
|
2006-07-11 02:34:32 -04:00
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.if defined(MODULES)
|
2006-11-27 10:28:40 -05:00
|
|
|
_MODULES_DONE =
|
2006-07-11 02:34:32 -04:00
|
|
|
. include "${PORTSDIR}/infrastructure/mk/modules.port.mk"
|
|
|
|
.endif
|
|
|
|
|
|
|
|
###
|
|
|
|
### Variable setup that can happen after modules
|
|
|
|
###
|
|
|
|
|
2006-11-12 05:52:59 -05:00
|
|
|
.if ${MACHINE_ARCH} != ${ARCH}
|
2006-11-27 10:28:40 -05:00
|
|
|
PKG_ARCH ?= ${MACHINE_ARCH},${ARCH}
|
2006-11-12 05:52:59 -05:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
PKG_ARCH ?= ${MACHINE_ARCH}
|
2006-11-12 05:52:59 -05:00
|
|
|
.endif
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
SHARED_ONLY ?= No
|
|
|
|
SEPARATE_BUILD ?= No
|
2004-08-03 15:30:25 -04:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
DIST_SUBDIR ?=
|
2001-10-03 04:41:16 -04:00
|
|
|
|
2004-02-07 17:36:13 -05:00
|
|
|
.if !empty(DIST_SUBDIR)
|
2006-11-27 10:28:40 -05:00
|
|
|
FULLDISTDIR ?= ${DISTDIR}/${DIST_SUBDIR}
|
2000-02-02 10:28:17 -05:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
FULLDISTDIR ?= ${DISTDIR}
|
2000-02-02 10:28:17 -05:00
|
|
|
.endif
|
2000-04-09 08:04:13 -04:00
|
|
|
|
1999-11-28 09:12:24 -05:00
|
|
|
.if exists(${.CURDIR}/patches.${ARCH})
|
2006-11-27 10:28:40 -05:00
|
|
|
PATCHDIR ?= ${.CURDIR}/patches.${ARCH}
|
2004-02-07 17:14:21 -05:00
|
|
|
.elif exists(${.CURDIR}/patches.${MACHINE_ARCH})
|
2006-11-27 10:28:40 -05:00
|
|
|
PATCHDIR ?= ${.CURDIR}/patches.${MACHINE_ARCH}
|
2001-05-05 19:42:03 -04:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
PATCHDIR ?= ${.CURDIR}/patches
|
1997-09-09 11:11:28 -04:00
|
|
|
.endif
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
PATCH_LIST ?= patch-*
|
1998-11-18 23:20:09 -05:00
|
|
|
|
1999-11-28 09:12:24 -05:00
|
|
|
.if exists(${.CURDIR}/files.${ARCH})
|
2006-11-27 10:28:40 -05:00
|
|
|
FILESDIR ?= ${.CURDIR}/files.${ARCH}
|
2004-02-07 17:14:21 -05:00
|
|
|
.elif exists(${.CURDIR}/files.${MACHINE_ARCH})
|
2006-11-27 10:28:40 -05:00
|
|
|
FILESDIR ?= ${.CURDIR}/files.${MACHINE_ARCH}
|
2001-05-05 19:42:03 -04:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
FILESDIR ?= ${.CURDIR}/files
|
1997-09-09 11:11:28 -04:00
|
|
|
.endif
|
|
|
|
|
1999-11-28 09:12:24 -05:00
|
|
|
.if exists(${.CURDIR}/pkg.${ARCH})
|
2006-11-27 10:28:40 -05:00
|
|
|
PKGDIR ?= ${.CURDIR}/pkg.${ARCH}
|
2004-02-07 17:14:21 -05:00
|
|
|
.elif exists(${.CURDIR}/pkg.${MACHINE_ARCH})
|
2006-11-27 10:28:40 -05:00
|
|
|
PKGDIR ?= ${.CURDIR}/pkg.${MACHINE_ARCH}
|
2001-05-05 19:42:03 -04:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
PKGDIR ?= ${.CURDIR}/pkg
|
1997-09-09 11:11:28 -04:00
|
|
|
.endif
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
PREFIX ?= ${LOCALBASE}
|
|
|
|
TRUEPREFIX ?= ${PREFIX}
|
|
|
|
DESTDIRNAME ?= DESTDIR
|
|
|
|
DESTDIR ?= ${WRKINST}
|
1999-03-16 18:35:37 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
MAKE_FLAGS ?=
|
2008-05-11 07:19:19 -04:00
|
|
|
FAKE_FLAGS ?=
|
2006-11-27 10:28:40 -05:00
|
|
|
LIBTOOL_FLAGS ?=
|
2001-08-26 17:42:18 -04:00
|
|
|
|
1999-03-16 18:35:37 -05:00
|
|
|
# where configuration files should go
|
2006-11-27 10:28:40 -05:00
|
|
|
SYSCONFDIR ?= /etc
|
|
|
|
USE_GMAKE ?= No
|
2002-04-09 09:52:58 -04:00
|
|
|
.if ${USE_GMAKE:L} == "yes"
|
2006-11-27 10:28:40 -05:00
|
|
|
BUILD_DEPENDS += ::devel/gmake
|
|
|
|
MAKE_PROGRAM = ${GMAKE}
|
1998-09-07 18:33:19 -04:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
MAKE_PROGRAM = ${MAKE}
|
1997-09-09 11:11:28 -04:00
|
|
|
.endif
|
2002-03-15 20:09:23 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
USE_LIBTOOL ?= No
|
|
|
|
_lt_libs =
|
2002-04-09 09:52:58 -04:00
|
|
|
.if ${USE_LIBTOOL:L} == "yes"
|
2006-11-27 10:28:40 -05:00
|
|
|
LIBTOOL ?= ${DEPBASE}/bin/libtool
|
|
|
|
BUILD_DEPENDS += ::devel/libtool
|
|
|
|
CONFIGURE_ENV += LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}" ${_lt_libs}
|
|
|
|
MAKE_ENV += LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}" ${_lt_libs}
|
|
|
|
MAKE_FLAGS += LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}" ${_lt_libs}
|
1999-05-04 14:12:24 -04:00
|
|
|
.endif
|
2006-11-27 10:28:40 -05:00
|
|
|
MAKE_FLAGS += SHARED_LIBS_LOG=${WRKBUILD}/shared_libs.log
|
1998-09-07 18:33:19 -04:00
|
|
|
|
2008-01-04 12:48:33 -05:00
|
|
|
ALL_FAKE_FLAGS= ${MAKE_FLAGS} ${DESTDIRNAME}=${WRKINST} ${FAKE_FLAGS}
|
|
|
|
|
|
|
|
|
2007-12-28 07:49:12 -05:00
|
|
|
PARALLEL_BUILD ?= Yes
|
|
|
|
PARALLEL_INSTALL ?= ${PARALLEL_BUILD}
|
|
|
|
MAKE_JOBS ?= 1
|
|
|
|
|
|
|
|
.if ${MAKE_JOBS} != 1
|
|
|
|
. if ${PARALLEL_BUILD:L} == "yes"
|
|
|
|
MAKE_FLAGS += -j${MAKE_JOBS}
|
|
|
|
. endif
|
|
|
|
. if ${PARALLEL_INSTALL:L} == "yes"
|
2008-01-04 12:48:33 -05:00
|
|
|
ALL_FAKE_FLAGS += -j${MAKE_JOBS}
|
2007-12-28 07:49:12 -05:00
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
2006-11-28 13:25:42 -05:00
|
|
|
.if !defined(MULTI_PACKAGES) || empty(MULTI_PACKAGES)
|
|
|
|
# XXX let's cheat so we always have MULTI_PACKAGES
|
|
|
|
MULTI_PACKAGES = -
|
|
|
|
SUBPACKAGE ?= -
|
2006-11-17 19:15:33 -05:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
SUBPACKAGE ?= -main
|
2006-11-17 19:15:33 -05:00
|
|
|
.endif
|
2006-11-28 13:25:42 -05:00
|
|
|
|
2008-07-26 07:16:04 -04:00
|
|
|
_FETCH_MAKEFILE_NAMES =
|
2006-11-27 10:28:40 -05:00
|
|
|
FLAVOR ?=
|
|
|
|
FLAVORS ?=
|
|
|
|
PSEUDO_FLAVORS ?=
|
|
|
|
FLAVORS += ${PSEUDO_FLAVORS}
|
2001-10-03 04:53:18 -04:00
|
|
|
|
|
|
|
.if !empty(FLAVORS:L:Mregress) && empty(FLAVOR:L:Mregress)
|
2006-11-27 10:28:40 -05:00
|
|
|
NO_REGRESS = Yes
|
2001-10-03 04:53:18 -04: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
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
USE_MOTIF ?= No
|
2001-04-18 10:43:55 -04:00
|
|
|
|
|
|
|
.if ${USE_MOTIF:L} != "no"
|
|
|
|
. if ${USE_MOTIF:L} == "lesstif"
|
2006-11-27 10:28:40 -05:00
|
|
|
LIB_DEPENDS += Xm.>=1::x11/lesstif
|
2001-04-18 10:43:55 -04:00
|
|
|
. elif ${USE_MOTIF:L} == "openmotif"
|
2006-11-27 10:28:40 -05:00
|
|
|
LIB_DEPENDS += Xm.>=2::x11/openmotif
|
2001-04-18 10:43:55 -04:00
|
|
|
. elif ${USE_MOTIF:L} == "any" || ${USE_MOTIF:L} == "yes"
|
2006-11-27 10:28:40 -05:00
|
|
|
FLAVORS += lesstif
|
2002-03-17 20:55:40 -05:00
|
|
|
. if ${FLAVOR:L:Mlesstif} && ${FLAVOR:L:Mmotif}
|
2006-11-27 10:28:40 -05:00
|
|
|
ERRORS += "Fatal: choose motif or lesstif, not both."
|
2002-03-17 20:55:40 -05:00
|
|
|
. endif
|
2001-04-18 10:43:55 -04:00
|
|
|
. if ${FLAVOR:L:Mlesstif}
|
2006-11-27 10:28:40 -05:00
|
|
|
LIB_DEPENDS += Xm.>=1::x11/lesstif
|
2001-04-18 10:43:55 -04:00
|
|
|
. else
|
2006-11-27 10:28:40 -05:00
|
|
|
LIB_DEPENDS += Xm.>=2::x11/openmotif
|
2001-04-18 10:43:55 -04:00
|
|
|
. endif
|
|
|
|
. else
|
2006-11-27 10:28:40 -05:00
|
|
|
ERRORS += "Fatal: Unknown USE_MOTIF=${USE_MOTIF} settings."
|
2001-04-18 10:43:55 -04:00
|
|
|
. endif
|
2006-11-27 10:28:40 -05:00
|
|
|
MOTIFLIB = -L${DEPBASE}/lib -lXm
|
2001-04-18 10:43:55 -04:00
|
|
|
.endif
|
|
|
|
|
2006-12-05 14:23:42 -05:00
|
|
|
.if empty(SUBPACKAGE)
|
|
|
|
ERRORS += "Fatal: empty SUBPACKAGE is invalid."
|
|
|
|
.else
|
2001-04-17 12:45:14 -04:00
|
|
|
. for _i in ${SUBPACKAGE}
|
2006-11-28 13:25:42 -05:00
|
|
|
. if empty(MULTI_PACKAGES:M${_i})
|
2006-11-27 10:28:40 -05:00
|
|
|
ERRORS += "Fatal: Subpackage ${SUBPACKAGE} does not exist."
|
2001-04-17 12:45:14 -04:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.endif
|
2006-11-28 13:25:42 -05:00
|
|
|
.if !empty(MULTI_PACKAGES:N-*)
|
2006-11-28 15:26:38 -05:00
|
|
|
ERRORS += "Fatal: SUBPACKAGES should always begin with -: ${MULTI_PACKAGES:N-*}."
|
2006-03-24 14:28:13 -05:00
|
|
|
.endif
|
2001-04-17 12:45:14 -04:00
|
|
|
|
2001-07-18 14:23:04 -04:00
|
|
|
# Build FLAVOR_EXT, checking that no flavors are misspelled
|
2006-11-27 10:28:40 -05:00
|
|
|
FLAVOR_EXT :=
|
|
|
|
BASE_PKGPATH := ${PKGPATH}
|
2002-08-07 11:48:19 -04:00
|
|
|
# _FLAVOR_EXT2 is used internally for working directories.
|
|
|
|
# It encodes flavors and pseudo-flavors.
|
2006-11-27 10:28:40 -05:00
|
|
|
_FLAVOR_EXT2 :=
|
|
|
|
BUILD_PKGPATH := ${PKGPATH}
|
2006-11-28 14:59:15 -05:00
|
|
|
_PKG_ARGS =
|
2001-07-20 09:13:47 -04:00
|
|
|
|
|
|
|
# (applies only to PLIST for now)
|
2001-10-03 04:53:18 -04:00
|
|
|
.if !empty(FLAVORS)
|
2001-07-20 09:13:47 -04:00
|
|
|
. for _i in ${FLAVORS:L}
|
|
|
|
. if empty(FLAVOR:L:M${_i})
|
2006-11-28 14:59:15 -05:00
|
|
|
_PKG_ARGS += -D${_i}=0
|
2001-07-20 09:13:47 -04:00
|
|
|
. else
|
2006-11-27 10:28:40 -05:00
|
|
|
_FLAVOR_EXT2 := ${_FLAVOR_EXT2}-${_i}
|
|
|
|
BUILD_PKGPATH := ${BUILD_PKGPATH},${_i}
|
2002-08-07 11:48:19 -04:00
|
|
|
. if empty(PSEUDO_FLAVORS:L:M${_i})
|
2006-11-27 10:28:40 -05:00
|
|
|
FLAVOR_EXT := ${FLAVOR_EXT}-${_i}
|
|
|
|
BASE_PKGPATH := ${BASE_PKGPATH},${_i}
|
2002-08-07 11:48:19 -04:00
|
|
|
. endif
|
2006-11-28 14:59:15 -05:00
|
|
|
_PKG_ARGS += -D${_i}=1
|
2001-07-20 09:13:47 -04:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.endif
|
2004-09-15 14:57:31 -04:00
|
|
|
.if ${NO_SHARED_LIBS:L} == "yes"
|
2006-11-28 14:59:15 -05:00
|
|
|
_PKG_ARGS += -DSHARED_LIBS=0
|
2004-09-15 14:57:31 -04:00
|
|
|
.else
|
2006-11-28 14:59:15 -05:00
|
|
|
_PKG_ARGS += -DSHARED_LIBS=1
|
2004-09-15 14:57:31 -04:00
|
|
|
.endif
|
2004-09-14 19:06:02 -04:00
|
|
|
.if !empty(FLAVORS:M[0-9]*)
|
2006-11-27 10:28:40 -05:00
|
|
|
ERRORS += "Fatal: flavor should never start with a digit"
|
2004-09-14 19:06:02 -04:00
|
|
|
.endif
|
2004-09-15 14:57:31 -04:00
|
|
|
|
2001-07-20 09:13:47 -04:00
|
|
|
.if !empty(FLAVOR)
|
2001-10-03 04:53:18 -04:00
|
|
|
. if !empty(FLAVORS)
|
2001-07-18 14:23:04 -04:00
|
|
|
. for _i in ${FLAVOR:L}
|
|
|
|
. if empty(FLAVORS:L:M${_i})
|
2006-11-27 10:28:40 -05:00
|
|
|
ERRORS += "Fatal: Unknown flavor: ${_i}"
|
|
|
|
ERRORS += " (Possible flavors are: ${FLAVORS})."
|
2001-07-18 14:23:04 -04:00
|
|
|
. endif
|
|
|
|
. endfor
|
2001-07-20 09:13:47 -04:00
|
|
|
. else
|
2006-11-27 10:28:40 -05:00
|
|
|
ERRORS += "Fatal: no flavors for this port."
|
2001-07-18 14:23:04 -04:00
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
PKG_SUFX ?= .tgz
|
2001-07-30 10:13:16 -04:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
PKGNAME ?= ${DISTNAME}
|
|
|
|
FULLPKGNAME ?= ${PKGNAME}${FLAVOR_EXT}
|
|
|
|
_MASTER ?=
|
|
|
|
_SOLVING_DEP ?= No
|
2001-07-30 10:13:16 -04:00
|
|
|
|
2006-12-01 12:33:16 -05:00
|
|
|
_READMES =
|
2006-11-28 13:25:42 -05:00
|
|
|
.if ${MULTI_PACKAGES} == "-"
|
|
|
|
FULLPKGNAME- = ${FULLPKGNAME}
|
2006-12-02 06:27:46 -05:00
|
|
|
_READMES += ${READMES_TOP}/${PKGPATH}/${FULLPKGNAME}.html
|
2006-11-28 13:25:42 -05:00
|
|
|
.else
|
2001-07-30 10:13:16 -04:00
|
|
|
. 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
|
2006-12-02 06:27:46 -05:00
|
|
|
_READMES += ${READMES_TOP}/${PKGPATH}/${FULLPKGNAME${_s}}.html
|
2001-07-30 10:13:16 -04:00
|
|
|
. endfor
|
|
|
|
.endif
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_SYSTRACE_COOKIE = ${WRKDIR}/systrace.policy
|
|
|
|
_WRKDIR_COOKIE = ${WRKDIR}/.extract_started
|
|
|
|
_EXTRACT_COOKIE = ${WRKDIR}/.extract_done
|
|
|
|
_PATCH_COOKIE = ${WRKDIR}/.patch_done
|
|
|
|
_DISTPATCH_COOKIE = ${WRKDIR}/.distpatch_done
|
|
|
|
_PREPATCH_COOKIE = ${WRKDIR}/.prepatch_done
|
|
|
|
_BULK_COOKIE = ${BULK_COOKIES_DIR}/${FULLPKGNAME}
|
|
|
|
_FAKE_COOKIE = ${WRKINST}/.fake_done
|
|
|
|
_INSTALL_PRE_COOKIE = ${WRKINST}/.install_started
|
2006-11-28 15:20:25 -05:00
|
|
|
_UPDATE_COOKIES =
|
2008-07-26 06:59:20 -04:00
|
|
|
_FUPDATE_COOKIES =
|
2006-11-28 15:40:55 -05:00
|
|
|
_INSTALL_COOKIES =
|
2006-11-28 15:20:25 -05:00
|
|
|
.for _S in ${MULTI_PACKAGES}
|
|
|
|
. if !empty(UPDATE_COOKIES_DIR)
|
2006-11-28 15:40:55 -05:00
|
|
|
_UPDATE_COOKIE${_S} = ${UPDATE_COOKIES_DIR}/${FULLPKGNAME${_S}}
|
2008-07-26 06:59:20 -04:00
|
|
|
_FUPDATE_COOKIE${_S} = ${UPDATE_COOKIES_DIR}/F${FULLPKGNAME${_S}}
|
2006-11-28 15:20:25 -05:00
|
|
|
. else
|
2006-11-28 15:40:55 -05:00
|
|
|
_UPDATE_COOKIE${_S} = ${WRKDIR}/.update_${FULLPKGNAME${_S}}
|
2008-07-26 06:59:20 -04:00
|
|
|
_FUPDATE_COOKIE${_S} = ${WRKDIR}/.fupdate_${FULLPKGNAME${_S}}
|
2006-11-28 15:20:25 -05:00
|
|
|
. endif
|
2006-11-28 15:40:55 -05:00
|
|
|
_INSTALL_COOKIE${_S} = ${PKG_DBDIR}/${FULLPKGNAME${_S}}/+CONTENTS
|
|
|
|
_UPDATE_COOKIES += ${_UPDATE_COOKIE${_S}}
|
2008-07-26 06:59:20 -04:00
|
|
|
_FUPDATE_COOKIES += ${_FUPDATE_COOKIE${_S}}
|
2006-11-28 15:40:55 -05:00
|
|
|
_INSTALL_COOKIES += ${_INSTALL_COOKIE${_S}}
|
2006-11-28 15:20:25 -05:00
|
|
|
.endfor
|
2005-04-20 21:44:50 -04:00
|
|
|
.if ${SEPARATE_BUILD:L} != "no"
|
2006-11-27 10:28:40 -05:00
|
|
|
_CONFIGURE_COOKIE = ${WRKBUILD}/.configure_done
|
|
|
|
_BUILD_COOKIE = ${WRKBUILD}/.build_done
|
|
|
|
_REGRESS_COOKIE = ${WRKBUILD}/.regress_done
|
1999-02-28 18:23:47 -05:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
_CONFIGURE_COOKIE = ${WRKDIR}/.configure_done
|
|
|
|
_BUILD_COOKIE = ${WRKDIR}/.build_done
|
|
|
|
_REGRESS_COOKIE = ${WRKDIR}/.regress_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
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_ALL_COOKIES = ${_EXTRACT_COOKIE} ${_PATCH_COOKIE} ${_CONFIGURE_COOKIE} \
|
|
|
|
${_INSTALL_PRE_COOKIE} ${_BUILD_COOKIE} ${_REGRESS_COOKIE} \
|
|
|
|
${_SYSTRACE_COOKIE} ${_PACKAGE_COOKIES} \
|
|
|
|
${_DISTPATCH_COOKIE} ${_PREPATCH_COOKIE} ${_FAKE_COOKIE} \
|
|
|
|
${_WRKDIR_COOKIE} ${_DEPBUILD_COOKIES} \
|
2006-11-28 15:20:25 -05:00
|
|
|
${_DEPRUN_COOKIES} ${_DEPREGRESS_COOKIES} ${_UPDATE_COOKIES} \
|
2006-11-27 10:28:40 -05:00
|
|
|
${_DEPBUILDLIB_COOKIES} ${_DEPRUNLIB_COOKIES} \
|
|
|
|
${_DEPBUILDWANTLIB_COOKIE} ${_DEPRUNWANTLIB_COOKIE} ${_DEPLIBSPECS_COOKIES}
|
1999-12-08 12:11:09 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_MAKE_COOKIE = touch
|
1996-06-03 18:47:10 -04:00
|
|
|
|
|
|
|
# Miscellaneous overridable commands:
|
2006-11-27 10:28:40 -05:00
|
|
|
GMAKE ?= gmake
|
1999-03-03 13:18:46 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
CHECKSUM_FILE ?= ${.CURDIR}/distinfo
|
1999-03-03 13:18:46 -05:00
|
|
|
|
|
|
|
# Don't touch !!! Used for generating checksums.
|
2007-04-05 14:32:26 -04:00
|
|
|
_CIPHERS = sha256 sha1 rmd160 md5
|
1999-03-03 13:18:46 -05:00
|
|
|
|
|
|
|
# This is the one you can override
|
2006-11-27 10:28:40 -05:00
|
|
|
PREFERRED_CIPHERS ?= ${_CIPHERS}
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
PORTPATH ?= ${WRKDIR}/bin:/usr/bin:/bin:/usr/sbin:/sbin:${DEPBASE}/bin:${LOCALBASE}/bin:${X11BASE}/bin
|
1998-11-24 20:08:35 -05:00
|
|
|
|
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)
|
2006-11-27 10:28:40 -05:00
|
|
|
CFLAGS += ${COPTS}
|
2001-07-11 08:57:20 -04:00
|
|
|
.endif
|
2001-07-18 10:52:27 -04:00
|
|
|
.if defined(CXXOPTS)
|
2006-11-27 10:28:40 -05:00
|
|
|
CXXFLAGS += ${CXXOPTS}
|
2001-07-18 10:52:27 -04:00
|
|
|
.endif
|
|
|
|
.if defined(WARNINGS) && ${WARNINGS:L} == "yes"
|
|
|
|
. if defined(CDIAGFLAGS)
|
2006-11-27 10:28:40 -05:00
|
|
|
CFLAGS += ${CDIAGFLAGS}
|
2001-07-18 10:52:27 -04:00
|
|
|
. endif
|
|
|
|
. if defined(CXXDIAGFLAGS)
|
2006-11-27 10:28:40 -05:00
|
|
|
CXXFLAGS += ${CXXDIAGFLAGS}
|
2001-07-18 10:52:27 -04:00
|
|
|
. endif
|
|
|
|
.endif
|
1999-03-10 18:22:19 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
MAKE_FILE ?= Makefile
|
|
|
|
PORTHOME ?= /${PKGNAME}_writes_to_HOME
|
2002-03-02 08:38:25 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
MAKE_ENV += PATH='${PORTPATH}' PREFIX='${PREFIX}' \
|
2005-04-17 06:10:07 -04:00
|
|
|
LOCALBASE='${LOCALBASE}' DEPBASE='${DEPBASE}' X11BASE='${X11BASE}' \
|
2004-09-14 19:07:20 -04:00
|
|
|
MOTIFLIB='${MOTIFLIB}' CFLAGS='${CFLAGS:C/ *$//}' \
|
2002-03-02 08:38:25 -05:00
|
|
|
TRUEPREFIX='${PREFIX}' ${DESTDIRNAME}='' \
|
|
|
|
HOME='${PORTHOME}'
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
DISTORIG ?= .bak.orig
|
|
|
|
PATCH ?= /usr/bin/patch
|
|
|
|
PATCHORIG ?= .orig
|
|
|
|
PATCH_STRIP ?= -p0
|
|
|
|
PATCH_DIST_STRIP ?= -p0
|
2000-09-16 09:54:56 -04:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
PATCH_DEBUG ?= No
|
2000-09-16 09:54:56 -04:00
|
|
|
.if ${PATCH_DEBUG:L} != "no"
|
2006-11-27 10:28:40 -05:00
|
|
|
PATCH_ARGS ?= -d ${WRKDIST} -z ${PATCHORIG} -E ${PATCH_STRIP}
|
|
|
|
PATCH_DIST_ARGS ?= -z ${DISTORIG} -d ${WRKDIST} -E ${PATCH_DIST_STRIP}
|
1996-06-03 18:47:10 -04:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
PATCH_ARGS ?= -d ${WRKDIST} -z ${PATCHORIG} --forward --quiet -E ${PATCH_STRIP}
|
|
|
|
PATCH_DIST_ARGS ?= -z ${DISTORIG} -d ${WRKDIST} --forward --quiet -E \
|
|
|
|
${PATCH_DIST_STRIP}
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
|
|
|
|
2000-09-23 18:03:21 -04:00
|
|
|
.if ${PATCH_CHECK_ONLY:L} == "yes"
|
2006-11-27 10:28:40 -05:00
|
|
|
PATCH_ARGS += -C
|
|
|
|
PATCH_DIST_ARGS += -C
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
TAR ?= /bin/tar
|
|
|
|
UNZIP ?= unzip
|
|
|
|
BZIP2 ?= bzip2
|
1999-05-14 00:38:36 -04:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2006-11-27 10:28:40 -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
|
|
|
|
2004-02-07 17:34:02 -05:00
|
|
|
.if !empty(FAKEOBJDIR_${PKGPATH})
|
2006-11-27 10:28:40 -05:00
|
|
|
WRKINST ?= ${FAKEOBJDIR_${PKGPATH}}/${PKGNAME}${_FLAVOR_EXT2}
|
2003-08-21 16:22:45 -04:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
WRKINST ?= ${WRKDIR}/fake-${ARCH}${_FLAVOR_EXT2}
|
2003-08-21 16:22:45 -04:00
|
|
|
.endif
|
|
|
|
|
2004-02-07 17:34:02 -05:00
|
|
|
.if !empty(WRKOBJDIR_${PKGPATH})
|
2005-04-20 21:44:50 -04:00
|
|
|
. if ${SEPARATE_BUILD:L:Mflavored}
|
2006-11-27 10:28:40 -05:00
|
|
|
WRKDIR ?= ${WRKOBJDIR_${PKGPATH}}/${PKGNAME}
|
2003-01-14 13:18:23 -05:00
|
|
|
. else
|
2006-11-27 10:28:40 -05:00
|
|
|
WRKDIR ?= ${WRKOBJDIR_${PKGPATH}}/${PKGNAME}${_FLAVOR_EXT2}
|
2003-01-14 13:18:23 -05:00
|
|
|
. endif
|
1998-09-07 18:33:19 -04:00
|
|
|
.else
|
2005-04-20 21:44:50 -04:00
|
|
|
. if ${SEPARATE_BUILD:L:Mflavored}
|
2006-11-27 10:28:40 -05:00
|
|
|
WRKDIR ?= ${.CURDIR}/w-${PKGNAME}
|
2000-04-03 13:32:42 -04:00
|
|
|
. else
|
2006-11-27 10:28:40 -05:00
|
|
|
WRKDIR ?= ${.CURDIR}/w-${PKGNAME}${_FLAVOR_EXT2}
|
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
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
WRKDIST ?= ${WRKDIR}/${DISTNAME}
|
1998-09-07 18:33:19 -04:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
WRKSRC ?= ${WRKDIST}
|
2000-02-08 19:23:26 -05:00
|
|
|
|
2005-04-20 21:44:50 -04:00
|
|
|
.if ${SEPARATE_BUILD:L} != "no"
|
2006-11-27 10:28:40 -05:00
|
|
|
WRKBUILD ?= ${WRKDIR}/build-${MACHINE_ARCH}${_FLAVOR_EXT2}
|
1999-02-28 18:23:47 -05:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
WRKBUILD ?= ${WRKSRC}
|
1999-02-28 18:23:47 -05:00
|
|
|
.endif
|
2006-11-27 10:28:40 -05:00
|
|
|
WRKCONF ?= ${WRKBUILD}
|
1999-02-03 12:53:13 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
ALL_TARGET ?= all
|
2001-08-25 07:23:46 -04:00
|
|
|
|
|
|
|
FAKE_TARGET ?= ${INSTALL_TARGET}
|
|
|
|
|
2001-10-04 18:20:38 -04:00
|
|
|
REGRESS_TARGET ?= regress
|
2008-01-04 13:38:51 -05:00
|
|
|
REGRESS_FLAGS ?=
|
|
|
|
ALL_REGRESS_FLAGS = ${MAKE_FLAGS} ${REGRESS_FLAGS}
|
2007-06-23 05:39:18 -04:00
|
|
|
REGRESS_LOGFILE ?= ${WRKDIR}/regress.log
|
|
|
|
REGRESS_LOG ?= | tee ${REGRESS_LOGFILE}
|
2008-08-20 06:33:50 -04:00
|
|
|
REGRESS_STATUS_IGNORE ?=
|
2001-10-03 04:53:18 -04:00
|
|
|
|
2001-07-30 10:13:16 -04:00
|
|
|
_PACKAGE_COOKIE_DEPS=${_FAKE_COOKIE}
|
|
|
|
|
|
|
|
.for _s in ${MULTI_PACKAGES}
|
2005-09-04 18:32:37 -04:00
|
|
|
PKGNAMES += ${FULLPKGNAME${_s}}
|
2001-04-02 06:35:51 -04:00
|
|
|
.endfor
|
|
|
|
|
2006-12-01 12:56:38 -05:00
|
|
|
.for _s in ${MULTI_PACKAGES}
|
2006-11-23 19:10:00 -05:00
|
|
|
. for _v in PKG_ARCH PERMIT_PACKAGE_FTP PERMIT_PACKAGE_CDROM \
|
2006-11-20 08:50:16 -05:00
|
|
|
RUN_DEPENDS WANTLIB LIB_DEPENDS PREFIX CATEGORIES
|
2006-11-13 09:14:57 -05:00
|
|
|
${_v}${_s} ?= ${${_v}}
|
|
|
|
. endfor
|
2006-11-23 19:10:00 -05:00
|
|
|
.endfor
|
|
|
|
|
2006-12-01 12:56:38 -05:00
|
|
|
.for _s in ${MULTI_PACKAGES}
|
2006-11-23 19:10:00 -05:00
|
|
|
. for _v in MESSAGE UNMESSAGE DESCR PLIST
|
|
|
|
. if defined(${_v})
|
|
|
|
${_v}${_s} ?= ${${_v}}
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.endfor
|
2006-11-13 09:14:57 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_PACKAGE_LINKS =
|
|
|
|
NO_ARCH ?= no-arch
|
|
|
|
_PKG_REPO = ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/all/
|
|
|
|
_CACHE_REPO = ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/cache/
|
2006-11-28 11:28:56 -05:00
|
|
|
PKGFILE = ${_PKG_REPO}${_PKGFILE${SUBPACKAGE}}
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
|
2006-11-28 15:20:25 -05:00
|
|
|
.for _S in ${MULTI_PACKAGES}
|
|
|
|
_PKGFILE${_S} = ${FULLPKGNAME${_S}}${PKG_SUFX}
|
|
|
|
. if ${PKG_ARCH${_S}} == "*" && ${NO_ARCH} != ${MACHINE_ARCH}/all
|
|
|
|
_PACKAGE_COOKIE${_S} = ${PACKAGE_REPOSITORY}/${NO_ARCH}/${_PKGFILE${_S}}
|
|
|
|
_PACKAGE_LINKS += ${MACHINE_ARCH}/all/${_PKGFILE${_S}} ${NO_ARCH}/${_PKGFILE${_S}}
|
|
|
|
_PACKAGE_COOKIES${_S} += ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/all/${_PKGFILE${_S}}
|
|
|
|
. else
|
|
|
|
_PACKAGE_COOKIE${_S} = ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/all/${_PKGFILE${_S}}
|
|
|
|
. endif
|
|
|
|
_PACKAGE_COOKIES${_S} += ${_PACKAGE_COOKIE${_S}}
|
|
|
|
. if ${PERMIT_PACKAGE_FTP${_S}:L} == "yes"
|
|
|
|
_PACKAGE_COOKIES${_S} += ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/ftp/${_PKGFILE${_S}}
|
|
|
|
_PACKAGE_LINKS += ${MACHINE_ARCH}/ftp/${_PKGFILE${_S}} ${MACHINE_ARCH}/all/${_PKGFILE${_S}}
|
|
|
|
. endif
|
|
|
|
. if ${PERMIT_PACKAGE_CDROM${_S}:L} == "yes"
|
|
|
|
_PACKAGE_COOKIES${_S} += ${PACKAGE_REPOSITORY}/${MACHINE_ARCH}/cdrom/${_PKGFILE${_S}}
|
|
|
|
_PACKAGE_LINKS += ${MACHINE_ARCH}/cdrom/${_PKGFILE${_S}} ${MACHINE_ARCH}/all/${_PKGFILE${_S}}
|
|
|
|
. endif
|
|
|
|
_PACKAGE_COOKIES += ${_PACKAGE_COOKIES${_S}}
|
|
|
|
_PACKAGE_COOKIE += ${_PACKAGE_COOKIE${_S}}
|
|
|
|
PKGFILE${_S} = ${_PKG_REPO}${_PKGFILE${_S}}
|
|
|
|
.endfor
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
|
2006-11-28 13:25:42 -05:00
|
|
|
.if empty(SUBPACKAGE) || ${SUBPACKAGE} == "-"
|
2006-12-01 06:34:04 -05:00
|
|
|
FULLPKGPATH ?= ${PKGPATH}${FLAVOR_EXT:S/-/,/g}
|
2006-11-28 14:59:15 -05:00
|
|
|
FULLPKGPATH- = ${FULLPKGPATH}
|
2007-02-06 15:04:01 -05:00
|
|
|
_ALLPKGPATHS = ${FULLPKGPATH}
|
2001-04-08 12:55:17 -04:00
|
|
|
.else
|
2007-02-06 15:04:01 -05:00
|
|
|
_ALLPKGPATHS = ${PKGPATH}${FLAVOR_EXT:S/-/,/g}
|
2006-11-28 14:59:15 -05:00
|
|
|
. for _S in ${MULTI_PACKAGES}
|
2006-12-01 06:34:04 -05:00
|
|
|
FULLPKGPATH${_S} ?= ${PKGPATH},${_S}${FLAVOR_EXT:S/-/,/g}
|
2007-02-06 15:04:01 -05:00
|
|
|
_ALLPKGPATHS += ${FULLPKGPATH${_S}}
|
2006-11-28 14:59:15 -05:00
|
|
|
. endfor
|
2007-02-06 15:04:01 -05:00
|
|
|
FULLPKGPATH = ${FULLPKGPATH${SUBPACKAGE}}
|
2001-04-08 12:55:17 -04:00
|
|
|
.endif
|
|
|
|
|
1996-08-23 07:37:41 -04:00
|
|
|
# A few aliases for *-install targets
|
2006-11-27 10:28:40 -05:00
|
|
|
INSTALL_PROGRAM = \
|
1997-04-27 17:38:33 -04:00
|
|
|
${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
|
2006-11-27 10:28:40 -05:00
|
|
|
INSTALL_SCRIPT = \
|
1997-04-27 17:38:33 -04:00
|
|
|
${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
|
2006-11-27 10:28:40 -05:00
|
|
|
INSTALL_DATA = \
|
1997-04-27 17:38:33 -04:00
|
|
|
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}
|
2006-11-27 10:28:40 -05: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
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
INSTALL_PROGRAM_DIR = \
|
2000-02-08 19:26:32 -05:00
|
|
|
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${DIRMODE}
|
2006-11-27 10:28:40 -05:00
|
|
|
INSTALL_SCRIPT_DIR = \
|
1998-09-07 18:33:19 -04:00
|
|
|
${INSTALL_PROGRAM_DIR}
|
2006-11-27 10:28:40 -05:00
|
|
|
INSTALL_DATA_DIR = \
|
2000-02-08 19:26:32 -05:00
|
|
|
${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${DIRMODE}
|
2006-11-27 10:28:40 -05: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
|
|
|
|
2006-11-27 11:08:05 -05:00
|
|
|
_INSTALL_MACROS = BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
|
2006-11-27 10:28:40 -05:00
|
|
|
BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
|
|
|
|
BSD_INSTALL_DATA="${INSTALL_DATA}" \
|
|
|
|
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}"
|
2006-11-27 11:08:05 -05:00
|
|
|
MAKE_ENV += ${_INSTALL_MACROS}
|
1997-09-09 11:11:28 -04:00
|
|
|
|
2004-01-10 19:49:01 -05:00
|
|
|
# setup systrace variables
|
2006-11-27 10:28:40 -05:00
|
|
|
NO_SYSTRACE ?= No
|
2003-07-28 13:17:04 -04:00
|
|
|
.if ${USE_SYSTRACE:L} == "yes" && ${NO_SYSTRACE:L} == "no"
|
2006-11-27 10:28:40 -05:00
|
|
|
_SYSTRACE_CMD ?= /bin/systrace -e -i -a -f ${_SYSTRACE_COOKIE}
|
2003-07-28 13:17:04 -04:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
_SYSTRACE_CMD =
|
2003-07-28 13:17:04 -04:00
|
|
|
.endif
|
2006-11-27 11:08:05 -05:00
|
|
|
SYSTRACE_FILTER ?= ${PORTSDIR}/infrastructure/db/systrace.filter
|
|
|
|
_SYSTRACE_POLICIES += /bin/sh /usr/bin/env /usr/bin/make \
|
2006-06-18 06:10:04 -04:00
|
|
|
/usr/bin/patch ${DEPBASE}/bin/gmake
|
2006-11-27 11:08:05 -05:00
|
|
|
SYSTRACE_SUBST_VARS += DISTDIR PKG_TMPDIR PORTSDIR TMPDIR WRKDIR
|
2003-07-28 13:17:04 -04:00
|
|
|
.for _v in ${SYSTRACE_SUBST_VARS}
|
2006-11-27 10:28:40 -05:00
|
|
|
_SYSTRACE_SED_SUBST += -e 's,$${${_v}},${${_v}},g'
|
2003-07-28 13:17:04 -04:00
|
|
|
.endfor
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
SHARED_LIBS ?=
|
2005-12-23 07:41:37 -05:00
|
|
|
|
|
|
|
.for _n _v in ${SHARED_LIBS}
|
2006-11-27 10:28:40 -05:00
|
|
|
LIB${_n}_VERSION = ${_v}
|
|
|
|
SUBST_VARS += LIB${_n}_VERSION
|
|
|
|
_lt_libs += LIB${_n}_LTVERSION='-version-info ${_v:S/./:/}:0'
|
|
|
|
_lt_libs += lib${_n:S/+/_/g:S/-/_/g:S/./_/g}_ltversion=${_v}
|
2005-12-23 07:41:37 -05:00
|
|
|
.endfor
|
|
|
|
|
2000-06-09 12:26:54 -04:00
|
|
|
# Create the generic variable substitution list, from subst vars
|
2008-04-12 09:04:21 -04:00
|
|
|
SUBST_VARS += MACHINE_ARCH ARCH HOMEPAGE ^PREFIX ^SYSCONFDIR FLAVOR_EXT \
|
2008-09-17 09:42:10 -04:00
|
|
|
MAINTAINER ^BASE_PKGPATH ^LOCALBASE ^X11BASE ^TRUEPREFIX
|
2006-11-27 10:28:40 -05:00
|
|
|
_tmpvars =
|
2004-09-18 09:45:23 -04:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_PKG_ADD_AUTO ?=
|
2004-09-18 09:45:23 -04:00
|
|
|
.if ${_SOLVING_DEP:L} == "yes"
|
2006-11-27 10:28:40 -05:00
|
|
|
_PKG_ADD_AUTO += -a
|
2004-09-18 09:45:23 -04:00
|
|
|
.endif
|
|
|
|
|
2007-05-25 09:07:41 -04:00
|
|
|
_PKG_ARGS += -DFLAVORS=${FLAVOR_EXT:Q}
|
|
|
|
_tmpvars += FLAVORS=${FLAVOR_EXT:Q}
|
2006-11-28 14:59:15 -05:00
|
|
|
_PKG_ARGS += -B ${WRKINST}
|
|
|
|
.if ${LOCALBASE} != "/usr/local"
|
|
|
|
_PKG_ARGS += -L${LOCALBASE}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.for _S in ${MULTI_PACKAGES}
|
|
|
|
PKG_ARGS${_S} ?= ${PKG_ARGS}
|
|
|
|
PKG_ARGS${_S} += ${_PKG_ARGS}
|
2006-12-31 08:12:35 -05:00
|
|
|
. for _v in ${SUBST_VARS}
|
2008-04-12 09:04:21 -04:00
|
|
|
. if defined(${_v:S/^^//}${_S})
|
|
|
|
PKG_ARGS${_S} += -D${_v}=${${_v:S/^^//}${_S}:Q}
|
|
|
|
_tmpvars += ${_v}${_S}=${${_v:S/^^//}${_S}:Q}
|
2006-12-31 08:12:35 -05:00
|
|
|
. else
|
2008-04-12 09:04:21 -04:00
|
|
|
PKG_ARGS${_S} += -D${_v}=${${_v:S/^^//}:Q}
|
|
|
|
_tmpvars += ${_v}=${${_v:S/^^//}:Q}
|
2006-12-31 08:12:35 -05:00
|
|
|
. endif
|
|
|
|
. endfor
|
2008-04-07 07:12:42 -04:00
|
|
|
|
|
|
|
SUBST_CMD = perl ${PORTSDIR}/infrastructure/build/pkg_subst
|
|
|
|
.for _v in ${SUBST_VARS}
|
2008-04-12 09:04:21 -04:00
|
|
|
SUBST_CMD += -D${_v}=${${_v:S/^^//}:Q}
|
2008-04-07 07:12:42 -04:00
|
|
|
.endfor
|
|
|
|
|
2006-11-28 14:59:15 -05:00
|
|
|
PKG_ARGS${_S} += -DFULLPKGPATH=${FULLPKGPATH${_S}}
|
|
|
|
PKG_ARGS${_S} += -DPERMIT_PACKAGE_CDROM=${PERMIT_PACKAGE_CDROM${_S}:Q}
|
|
|
|
PKG_ARGS${_S} += -DPERMIT_PACKAGE_FTP=${PERMIT_PACKAGE_FTP${_S}:Q}
|
|
|
|
.endfor
|
2000-03-29 10:59:50 -05:00
|
|
|
|
2006-11-28 13:25:42 -05:00
|
|
|
# XXX
|
|
|
|
.if ${MULTI_PACKAGES} == "-"
|
|
|
|
PLIST ?= ${PKGDIR}/PLIST
|
1997-09-09 11:11:28 -04:00
|
|
|
|
2006-11-28 13:25:42 -05:00
|
|
|
. if defined(COMMENT${FLAVOR_EXT})
|
|
|
|
_COMMENT = ${COMMENT${FLAVOR_EXT}}
|
|
|
|
. elif defined(COMMENT)
|
|
|
|
_COMMENT = ${COMMENT}
|
|
|
|
. endif
|
2000-06-09 12:26:54 -04:00
|
|
|
|
2006-11-28 13:25:42 -05:00
|
|
|
. if exists(${PKGDIR}/MESSAGE)
|
|
|
|
MESSAGE ?= ${PKGDIR}/MESSAGE
|
|
|
|
. endif
|
2006-11-27 11:08:05 -05:00
|
|
|
|
2006-11-28 13:25:42 -05:00
|
|
|
. if exists(${PKGDIR}/UNMESSAGE)
|
|
|
|
UNMESSAGE ?= ${PKGDIR}/UNMESSAGE
|
|
|
|
. endif
|
|
|
|
|
2006-11-28 14:59:15 -05:00
|
|
|
. if exists(${PKGDIR}/INSTALL)
|
2008-07-26 07:14:07 -04:00
|
|
|
ERRORS += "Fatal: INSTALL script support is obsolete"
|
2006-11-28 14:59:15 -05:00
|
|
|
. endif
|
|
|
|
. if exists(${PKGDIR}/DEINSTALL)
|
2008-07-26 07:14:07 -04:00
|
|
|
ERRORS += "Fatal: DEINSTALL script support is obsolete"
|
2006-11-28 14:59:15 -05:00
|
|
|
. endif
|
|
|
|
. if exists(${PKGDIR}/REQ)
|
2007-05-31 06:52:16 -04:00
|
|
|
ERRORS += "Fatal: REQ script support is obsolete"
|
2006-11-28 14:59:15 -05:00
|
|
|
. endif
|
|
|
|
. if exists(${PKGDIR}/MODULE.pm)
|
|
|
|
PKG_ARGS- += -m ${PKGDIR}/MODULE.pm
|
|
|
|
. endif
|
2006-11-28 13:25:42 -05:00
|
|
|
DESCR ?= ${PKGDIR}/DESCR
|
2000-06-09 12:26:54 -04:00
|
|
|
|
2006-11-28 13:25:42 -05:00
|
|
|
. for _v in PLIST _COMMENT MESSAGE UNMESSAGE DESCR
|
|
|
|
. if defined(${_v})
|
|
|
|
${_v}- = ${${_v}}
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.else
|
|
|
|
. for _S in ${MULTI_PACKAGES}
|
|
|
|
PLIST${_S} ?= ${PKGDIR}/PLIST${_S}
|
|
|
|
|
|
|
|
. if defined(COMMENT${_S}${FLAVOR_EXT})
|
|
|
|
_COMMENT${_S} = ${COMMENT${_S}${FLAVOR_EXT}}
|
|
|
|
. elif defined(COMMENT${_S})
|
|
|
|
_COMMENT${_S} = ${COMMENT${_S}}
|
|
|
|
. endif
|
|
|
|
|
|
|
|
. if exists(${PKGDIR}/MESSAGE${_S})
|
|
|
|
MESSAGE${_S} ?= ${PKGDIR}/MESSAGE${_S}
|
|
|
|
. endif
|
|
|
|
|
|
|
|
. if exists(${PKGDIR}/UNMESSAGE${_S})
|
|
|
|
UNMESSAGE${_S} ?= ${PKGDIR}/UNMESSAGE${_S}
|
|
|
|
. endif
|
|
|
|
|
|
|
|
DESCR${_S} ?= ${PKGDIR}/DESCR${_S}
|
2006-11-28 15:26:38 -05:00
|
|
|
|
|
|
|
. if exists(${PKGDIR}/INSTALL${_S})
|
2008-07-26 07:22:59 -04:00
|
|
|
ERRORS += "Fatal: INSTALL script support is obsolete"
|
2006-11-28 15:26:38 -05:00
|
|
|
. endif
|
|
|
|
. if exists(${PKGDIR}/DEINSTALL${_S})
|
2008-07-26 07:22:59 -04:00
|
|
|
ERRORS += "Fatal: DEINSTALL script support is obsolete"
|
2006-11-28 15:26:38 -05:00
|
|
|
. endif
|
|
|
|
. if exists(${PKGDIR}/REQ${_S})
|
2007-05-31 06:52:16 -04:00
|
|
|
ERRORS += "Fatal: REQ script support is obsolete"
|
2006-11-28 15:26:38 -05:00
|
|
|
. endif
|
|
|
|
. if exists(${PKGDIR}/MODULE${_S}.pm)
|
|
|
|
PKG_ARGS${_S} += -m ${PKGDIR}/MODULE${_S}.pm
|
|
|
|
. endif
|
2006-11-28 13:25:42 -05:00
|
|
|
. endfor
|
|
|
|
.endif
|
2000-03-29 10:59:50 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
MTREE_FILE ?=
|
|
|
|
MTREE_FILE += ${PORTSDIR}/infrastructure/db/fake.mtree
|
2001-03-06 13:59:38 -05:00
|
|
|
|
2006-11-28 14:59:15 -05:00
|
|
|
.for _S in ${MULTI_PACKAGES}
|
|
|
|
# Fill out package command, and package dependencies
|
2007-05-25 09:07:41 -04:00
|
|
|
PKG_ARGS${_S} += -DCOMMENT=${_COMMENT${_S}:Q} -d ${DESCR${_S}}
|
2006-11-28 14:59:15 -05:00
|
|
|
PKG_ARGS${_S} += -f ${PLIST${_S}} -p ${PREFIX${_S}}
|
|
|
|
. if defined(MESSAGE${_S})
|
|
|
|
PKG_ARGS${_S} += -M ${MESSAGE${_S}}
|
|
|
|
. endif
|
|
|
|
. if defined(UNMESSAGE${_S})
|
|
|
|
PKG_ARGS${_S} += -U ${UNMESSAGE${_S}}
|
|
|
|
. endif
|
|
|
|
PKG_ARGS${_S} += -A'${PKG_ARCH${_S}}'
|
|
|
|
. if !defined(_COMMENT${_S})
|
2008-11-18 06:45:41 -05:00
|
|
|
ERRORS += "Fatal: Missing comment for ${_S:S/^-$/main package/}."
|
2006-11-28 14:59:15 -05:00
|
|
|
. endif
|
|
|
|
.endfor
|
2000-03-03 16:24:50 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
CHMOD ?= /bin/chmod
|
|
|
|
CHOWN ?= /usr/sbin/chown
|
|
|
|
GUNZIP_CMD ?= /usr/bin/gunzip -f
|
|
|
|
GZCAT ?= /usr/bin/gzcat
|
|
|
|
GZIP ?= -9
|
|
|
|
GZIP_CMD ?= /usr/bin/gzip -nf ${GZIP}
|
|
|
|
M4 ?= /usr/bin/m4
|
|
|
|
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
|
2006-11-27 10:28:40 -05:00
|
|
|
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
|
2006-11-27 10:28:40 -05:00
|
|
|
SETENV ?= /usr/bin/env -i
|
|
|
|
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.
|
2006-11-27 10:28:40 -05:00
|
|
|
ECHO_MSG ?= echo
|
1996-06-03 18:47:10 -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
|
|
|
|
2008-07-29 07:25:44 -04:00
|
|
|
# XXX temporary, until people have correct network.conf
|
|
|
|
MASTER_SITE_OPENBSD ?= \
|
|
|
|
ftp://ftp.openbsd.org/pub/OpenBSD/distfiles/ \
|
|
|
|
ftp://ftp.usa.openbsd.org/pub/OpenBSD/distfiles/
|
|
|
|
|
1999-09-26 06:50:07 -04:00
|
|
|
# Empty declarations to avoid "variable XXX is recursive" errors
|
2006-11-27 10:28:40 -05:00
|
|
|
MASTER_SITES ?=
|
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)
|
2006-11-27 10:28:40 -05:00
|
|
|
MASTER_SITES := ${MASTER_SITES} ${MASTER_SITE_BACKUP}
|
1996-06-03 18:47:10 -04:00
|
|
|
.else
|
2006-11-27 10:28:40 -05: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.
|
2006-11-27 10:28:40 -05:00
|
|
|
_SITE_SELECTOR = case $$select in
|
2000-02-04 06:15:16 -05:00
|
|
|
|
|
|
|
|
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})
|
|
|
|
. if !defined(MASTER_SITE_OVERRIDE)
|
2006-11-27 10:28:40 -05:00
|
|
|
MASTER_SITES${_I} := ${MASTER_SITES${_I}} ${MASTER_SITE_BACKUP}
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
2006-11-27 10:28:40 -05:00
|
|
|
MASTER_SITES${_I} := ${MASTER_SITE_OVERRIDE} ${MASTER_SITES${_I}}
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
2006-11-27 10:28:40 -05:00
|
|
|
_SITE_SELECTOR += *:${_I}) sites="${MASTER_SITES${_I}}";;
|
2003-08-11 16:07:59 -04:00
|
|
|
. else
|
2006-11-27 10:28:40 -05:00
|
|
|
_SITE_SELECTOR += *:${_I}) echo >&2 "Error: MASTER_SITES${_I} not defined";;
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1999-12-21 16:43:37 -05:00
|
|
|
.endfor
|
2006-11-27 10:28:40 -05:00
|
|
|
_SITE_SELECTOR += *) sites="${MASTER_SITES}";; esac
|
1999-12-21 16:43:37 -05:00
|
|
|
|
|
|
|
|
2004-09-19 05:00:15 -04:00
|
|
|
# OpenBSD code to handle ports distfiles on a CDROM.
|
1998-04-06 17:46:00 -04:00
|
|
|
#
|
2006-11-27 10:28:40 -05:00
|
|
|
#CDROM_SITE ?= /cdrom/distfiles/${DIST_SUBDIR}
|
|
|
|
CDROM_SITE ?=
|
1998-04-06 17:46:00 -04:00
|
|
|
|
2004-01-28 17:13:40 -05:00
|
|
|
.if !empty(CDROM_SITE)
|
2000-01-13 12:40:20 -05:00
|
|
|
. if defined(FETCH_SYMLINK_DISTFILES)
|
2006-11-27 10:28:40 -05:00
|
|
|
_CDROM_OVERRIDE = if ln -s ${CDROM_SITE}/$$f .; then exit 0; fi
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
2006-11-27 10:28:40 -05: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
|
2006-11-27 10:28:40 -05:00
|
|
|
_CDROM_OVERRIDE =:
|
1999-12-23 19:27:58 -05:00
|
|
|
.endif
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
EXTRACT_SUFX ?= .tar.gz
|
2000-09-11 14:06:24 -04:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
DISTFILES ?= ${DISTNAME}${EXTRACT_SUFX}
|
2000-02-04 06:15:16 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_EVERYTHING = ${DISTFILES}
|
|
|
|
_DISTFILES = ${DISTFILES:C/:[0-9]$//}
|
2000-02-04 06:15:16 -05:00
|
|
|
|
|
|
|
.if defined(PATCHFILES)
|
2006-11-27 10:28:40 -05:00
|
|
|
_PATCHFILES = ${PATCHFILES:C/:[0-9]$//}
|
|
|
|
_EVERYTHING += ${PATCHFILES}
|
2000-02-04 06:15:16 -05:00
|
|
|
.endif
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2008-05-15 05:51:17 -04:00
|
|
|
.if defined(SUPDISTFILES)
|
2006-11-27 10:28:40 -05:00
|
|
|
_EVERYTHING += ${SUPDISTFILES}
|
1999-04-20 14:04:27 -04:00
|
|
|
.endif
|
1996-12-25 15:10:09 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
__CKSUMFILES =
|
2000-02-22 09:07:09 -05:00
|
|
|
# First, remove duplicates
|
2008-05-18 06:05:21 -04:00
|
|
|
.for _file in ${_DISTFILES} ${_PATCHFILES}
|
2003-07-14 09:33:04 -04:00
|
|
|
. if empty(__CKSUMFILES:M${_file})
|
2006-11-27 10:28:40 -05:00
|
|
|
__CKSUMFILES += ${_file}
|
2000-02-04 15:33:42 -05:00
|
|
|
. endif
|
|
|
|
.endfor
|
2000-02-22 09:07:09 -05:00
|
|
|
|
2008-05-15 05:51:17 -04:00
|
|
|
# List of all files, with ${DIST_SUBDIR} in front. Used for checksum.
|
|
|
|
.if !empty(DIST_SUBDIR)
|
|
|
|
CHECKSUMFILES = ${__CKSUMFILES:S/^/${DIST_SUBDIR}\//}
|
|
|
|
.else
|
|
|
|
CHECKSUMFILES = ${__CKSUMFILES}
|
2000-02-22 09:07:09 -05:00
|
|
|
.endif
|
1996-12-25 15:10:09 -05:00
|
|
|
|
2008-05-15 06:09:29 -04:00
|
|
|
__MKSUMFILES = ${__CKSUMFILES}
|
|
|
|
.if defined(SUPDISTFILES)
|
2008-05-15 05:51:17 -04:00
|
|
|
# First, remove duplicates
|
2008-05-15 06:09:29 -04:00
|
|
|
. for _file in ${SUPDISTFILES:C/:[0-9]$//}
|
|
|
|
. if empty(__MKSUMFILES:M${_file})
|
2008-05-15 05:51:17 -04:00
|
|
|
__MKSUMFILES += ${_file}
|
2008-05-15 06:09:29 -04:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.endif
|
2008-05-15 05:51:17 -04:00
|
|
|
|
2008-07-26 07:22:59 -04:00
|
|
|
# List of all files, with ${DIST_SUBDIR} in front. Used for makesum.
|
2004-02-07 17:36:13 -05:00
|
|
|
.if !empty(DIST_SUBDIR)
|
2008-05-15 05:51:17 -04:00
|
|
|
MAKESUMFILES = ${__MKSUMFILES:S/^/${DIST_SUBDIR}\//}
|
1996-12-25 15:10:09 -05:00
|
|
|
.else
|
2008-05-15 05:51:17 -04:00
|
|
|
MAKESUMFILES = ${__MKSUMFILES}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(IGNOREFILES)
|
|
|
|
ERRORS += "Fatal: don't use 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.
|
2006-11-27 10:28:40 -05: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)
|
2006-11-27 10:28:40 -05:00
|
|
|
_USE_ZIP ?= Yes
|
2000-12-23 07:27:17 -05:00
|
|
|
.endif
|
2007-12-05 01:55:41 -05:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.tar.bz2) || !empty(EXTRACT_ONLY:M*.tbz2) || \
|
2006-11-27 10:28:40 -05:00
|
|
|
(defined(PATCHFILES) && !empty(_PATCHFILES:M*.bz2))
|
|
|
|
_USE_BZIP2 ?= Yes
|
2003-07-18 15:02:13 -04:00
|
|
|
.endif
|
2006-11-27 10:28:40 -05:00
|
|
|
_USE_ZIP ?= No
|
|
|
|
_USE_BZIP2 ?= No
|
2000-09-11 14:06:24 -04:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
EXTRACT_CASES ?=
|
2000-09-11 14:06:24 -04:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_PERL_FIX_SHAR ?= perl -ne 'print if $$s || ($$s = m:^\#(\!\s*/bin/sh\s*| This is a shell archive):)'
|
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"
|
2006-11-27 10:28:40 -05:00
|
|
|
BUILD_DEPENDS += :unzip-*:archivers/unzip
|
|
|
|
EXTRACT_CASES += *.zip) \
|
|
|
|
${UNZIP} -oq ${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"
|
2006-11-27 10:28:40 -05:00
|
|
|
BUILD_DEPENDS += :bzip2-*:archivers/bzip2
|
2007-12-05 01:55:41 -05:00
|
|
|
EXTRACT_CASES += *.tar.bz2|*.tbz2) \
|
2006-11-27 10:28:40 -05:00
|
|
|
${BZIP2} -dc ${FULLDISTDIR}/$$archive | ${TAR} xf -;;
|
|
|
|
.endif
|
|
|
|
EXTRACT_CASES += *.tar) \
|
|
|
|
${TAR} xf ${FULLDISTDIR}/$$archive;;
|
|
|
|
EXTRACT_CASES += *.shar.gz|*.shar.Z|*.sh.gz|*.sh.Z) \
|
|
|
|
${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive | ${_PERL_FIX_SHAR} | /bin/sh;;
|
|
|
|
EXTRACT_CASES += *.shar | *.sh) \
|
|
|
|
${_PERL_FIX_SHAR} ${FULLDISTDIR}/$$archive | /bin/sh;;
|
|
|
|
EXTRACT_CASES += *.tar.gz) \
|
|
|
|
${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive | ${TAR} xf -;;
|
|
|
|
EXTRACT_CASES += *.gz) \
|
|
|
|
${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive >`basename $$archive .gz`;;
|
|
|
|
EXTRACT_CASES += *) \
|
|
|
|
${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive | ${TAR} xf -;;
|
|
|
|
|
|
|
|
PATCH_CASES ?=
|
2001-08-18 19:16:57 -04:00
|
|
|
.if ${_USE_BZIP2:L} != "no"
|
2006-11-27 10:28:40 -05:00
|
|
|
PATCH_CASES += *.bz2) \
|
|
|
|
${BZIP2} -dc $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
|
2001-06-03 10:42:07 -04:00
|
|
|
.endif
|
2006-11-27 10:28:40 -05:00
|
|
|
PATCH_CASES += *.Z|*.gz) \
|
|
|
|
${GZCAT} $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
|
|
|
|
PATCH_CASES += *) \
|
|
|
|
${PATCH} ${PATCH_DIST_ARGS} < $$patchfile;;
|
2001-06-03 10:42:07 -04:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
# Documentation
|
2006-11-27 10:28:40 -05:00
|
|
|
MAINTAINER ?= The OpenBSD ports mailing-list <ports@openbsd.org>
|
1996-12-25 15:10:09 -05:00
|
|
|
|
|
|
|
.if !defined(CATEGORIES)
|
2006-11-27 10:28:40 -05:00
|
|
|
ERRORS += "Fatal: CATEGORIES is mandatory."
|
2008-05-08 18:35:51 -04:00
|
|
|
.else
|
|
|
|
_badcat = Yes
|
|
|
|
. for _i in ${CATEGORIES}
|
|
|
|
. if ${_badcat} == "Yes"
|
|
|
|
. if ${PKGPATH:M${_i}/*}
|
|
|
|
_badcat = No
|
|
|
|
. endif
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
|
|
|
|
. if ${_badcat} == "Yes"
|
2008-11-18 06:45:41 -05:00
|
|
|
ERRORS += "Fatal: one category in ${CATEGORIES} should match PKGPATH=${PKGPATH}"
|
|
|
|
. if ${PKGPATH:N*/*}
|
|
|
|
ERRORS += "Fatal: bogus PKGPATH=${PKGPATH} (no subdirectory)"
|
|
|
|
. endif
|
2008-05-08 18:35:51 -04:00
|
|
|
. endif
|
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
|
|
|
|
2008-05-08 18:35:51 -04:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
CONFIGURE_SCRIPT ?= configure
|
2001-09-16 10:56:42 -04:00
|
|
|
.if ${CONFIGURE_SCRIPT:M/*}
|
2006-11-27 10:28:40 -05:00
|
|
|
_CONFIGURE_SCRIPT = ${CONFIGURE_SCRIPT}
|
1999-03-02 23:16:03 -05:00
|
|
|
.else
|
2005-04-20 21:44:50 -04:00
|
|
|
. if ${SEPARATE_BUILD:L} != "no"
|
2006-11-27 10:28:40 -05:00
|
|
|
_CONFIGURE_SCRIPT = ${WRKSRC}/${CONFIGURE_SCRIPT}
|
2001-09-16 10:56:42 -04:00
|
|
|
. else
|
2006-11-27 10:28:40 -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
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
CONFIGURE_ENV += PATH=${PORTPATH}
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2004-08-02 09:01:52 -04:00
|
|
|
.if ${NO_SHARED_LIBS:L} == "yes"
|
2006-11-27 10:28:40 -05:00
|
|
|
CONFIGURE_SHARED ?= --disable-shared
|
1999-03-01 14:44:18 -05:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
CONFIGURE_SHARED ?= --enable-shared
|
1999-03-01 14:44:18 -05:00
|
|
|
.endif
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
FETCH_MANUALLY ?= No
|
2003-07-25 08:46:26 -04:00
|
|
|
.if ${FETCH_MANUALLY:L} != "no"
|
2008-05-18 05:58:09 -04:00
|
|
|
_MISSING_FILES =
|
|
|
|
. for _F in ${CHECKSUMFILES}
|
|
|
|
. if !exists(${DISTDIR}/${_F})
|
|
|
|
_MISSING_FILES += ${_F}
|
2003-07-25 08:46:26 -04:00
|
|
|
. endif
|
|
|
|
. endfor
|
2008-05-18 05:58:09 -04:00
|
|
|
. if !empty(_MISSING_FILES)
|
2006-11-27 10:28:40 -05:00
|
|
|
IS_INTERACTIVE = Yes
|
2003-07-25 08:46:26 -04:00
|
|
|
. 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 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
|
|
|
################################################################
|
|
|
|
|
2006-11-13 08:55:10 -05:00
|
|
|
.if !defined(NO_IGNORE) && !defined(DESCRIBE_TARGET)
|
2006-11-27 10:28:40 -05:00
|
|
|
. if defined(REGRESS_IS_INTERACTIVE) && defined(BATCH)
|
|
|
|
_IGNORE_REGRESS = "has interactive tests"
|
|
|
|
. elif !defined(REGRESS_IS_INTERACTIVE) && defined(INTERACTIVE)
|
|
|
|
_IGNORE_REGRESS = "does not have interactive tests"
|
|
|
|
. endif
|
|
|
|
. if defined(IS_INTERACTIVE) && defined(BATCH)
|
|
|
|
IGNORE = "is an interactive port"
|
|
|
|
. elif !defined(IS_INTERACTIVE) && defined(INTERACTIVE)
|
|
|
|
IGNORE = "is not an interactive port"
|
2002-04-09 09:52:58 -04:00
|
|
|
. elif ${USE_X11:L} == "yes" && !exists(${X11BASE})
|
2006-11-27 10:28:40 -05:00
|
|
|
IGNORE = "uses X11, but ${X11BASE} not found"
|
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})
|
2006-11-27 10:28:40 -05:00
|
|
|
_ARCH_OK = 1
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. if !defined(_ARCH_OK)
|
|
|
|
. if ${MACHINE_ARCH} == "${ARCH}"
|
2006-11-27 10:28:40 -05:00
|
|
|
IGNORE = "is only for ${ONLY_FOR_ARCHS}, not ${MACHINE_ARCH}"
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
2006-11-27 10:28:40 -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})
|
2006-11-27 10:28:40 -05:00
|
|
|
IGNORE = "is not for ${NOT_FOR_ARCHS}"
|
2001-03-28 05:25:38 -05:00
|
|
|
. endif
|
|
|
|
. endfor
|
2004-08-03 04:04:02 -04:00
|
|
|
. elif ${SHARED_ONLY:L} == "yes" && ${NO_SHARED_LIBS:L} == "yes"
|
2006-11-27 10:28:40 -05:00
|
|
|
IGNORE = "requires shared libraries"
|
2000-04-09 07:34:01 -04:00
|
|
|
. endif
|
2006-11-13 08:55:10 -05:00
|
|
|
.endif # NO_IGNORE
|
|
|
|
|
|
|
|
.if !defined(NO_IGNORE)
|
|
|
|
. if defined(BROKEN)
|
2007-09-21 02:58:21 -04:00
|
|
|
IGNORE = "is marked as broken: ${BROKEN:Q}"
|
2006-11-13 08:55:10 -05:00
|
|
|
. elif defined(COMES_WITH)
|
2006-11-27 10:28:40 -05: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
|
2006-11-13 08:55:10 -05:00
|
|
|
.endif
|
1999-12-19 18:48:36 -05:00
|
|
|
|
1997-09-09 11:11:28 -04:00
|
|
|
.if !defined(DEPENDS_TARGET)
|
2000-01-13 12:40:20 -05:00
|
|
|
. if make(reinstall)
|
2006-11-27 10:28:40 -05:00
|
|
|
DEPENDS_TARGET = reinstall
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
2006-11-27 10:28:40 -05:00
|
|
|
DEPENDS_TARGET = install
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
|
|
|
|
2001-03-28 06:48:12 -05:00
|
|
|
################################################################
|
|
|
|
# Dependency checking
|
|
|
|
################################################################
|
2001-04-02 07:45:11 -04:00
|
|
|
|
|
|
|
# Various dependency styles
|
2001-03-28 06:48:12 -05:00
|
|
|
|
2004-08-02 09:01:52 -04:00
|
|
|
.if ${NO_SHARED_LIBS:L} == "yes"
|
2006-11-27 10:28:40 -05:00
|
|
|
_noshared = -noshared
|
2001-04-20 12:25:24 -04:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
_noshared =
|
2001-11-12 09:24:06 -05:00
|
|
|
.endif
|
|
|
|
|
|
|
|
_libresolve_fragment = \
|
2006-11-27 10:28:40 -05:00
|
|
|
case "$$d" in \
|
|
|
|
*/*) shdir="${LOCALBASE}/$${d%/*}";; \
|
|
|
|
*) shdir="${LOCALBASE}/lib";; \
|
|
|
|
esac; \
|
|
|
|
check=`eval $$listlibs 2>/dev/null| \
|
|
|
|
LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} \
|
|
|
|
perl ${PORTSDIR}/infrastructure/build/resolve-lib \
|
|
|
|
${_noshared} $$d` \
|
2005-11-02 15:28:11 -05:00
|
|
|
|| check=Failed
|
2001-11-12 09:24:06 -05:00
|
|
|
|
2004-11-21 05:43:48 -05:00
|
|
|
_syslibresolve_fragment = \
|
2006-11-27 10:28:40 -05:00
|
|
|
case "$$d" in \
|
|
|
|
/*) \
|
|
|
|
shdir="$${d%/*}/";; \
|
|
|
|
*/*) \
|
|
|
|
shdir="${DEPBASE}/$${d%/*}";; \
|
|
|
|
*) \
|
|
|
|
shdir="${DEPBASE}/lib"; \
|
|
|
|
listlibs="$$listlibs /usr/lib/lib* ${X11BASE}/lib/lib*";; \
|
|
|
|
esac; \
|
|
|
|
check=`eval $$listlibs 2>/dev/null| \
|
|
|
|
LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} \
|
|
|
|
perl ${PORTSDIR}/infrastructure/build/resolve-lib ${_noshared} $$d` \
|
|
|
|
|| check=Failed
|
2001-11-12 09:24:06 -05:00
|
|
|
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
PORT_LD_LIBRARY_PATH = ${LOCALBASE}/lib:${X11BASE}/lib:/usr
|
|
|
|
_set_ld_library_path = :
|
|
|
|
DEPBASE = ${LOCALBASE}
|
|
|
|
DEPDIR =
|
2004-10-23 06:02:51 -04:00
|
|
|
|
2006-10-02 13:26:34 -04:00
|
|
|
.if ${FORCE_UPDATE:L} == "yes" || ${FORCE_UPDATE:L} == "hard"
|
2006-11-28 13:17:57 -05:00
|
|
|
_force_update_fragment = { \
|
|
|
|
${ECHO_MSG} "===> Verifying update for $$what in $$dir"; \
|
2006-12-09 09:56:41 -05:00
|
|
|
if ( eval $$toset exec ${MAKE} subupdate ); then \
|
|
|
|
${ECHO_MSG} "===> Returning to build of ${FULLPKGNAME${SUBPACKAGE}}${_MASTER}"; \
|
|
|
|
else \
|
|
|
|
${REPORT_PROBLEM}; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2006-11-28 13:17:57 -05:00
|
|
|
}
|
2006-11-27 10:28:40 -05:00
|
|
|
_PKG_ADD_FORCE = -F update -F updatedepends -r
|
2006-10-02 13:26:34 -04:00
|
|
|
. if ${FORCE_UPDATE:L} == "hard"
|
2006-11-27 10:28:40 -05:00
|
|
|
_PKG_ADD_FORCE += -F installed
|
2006-10-02 13:26:34 -04:00
|
|
|
. endif
|
2004-11-15 08:52:03 -05:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
_force_update_fragment = :
|
|
|
|
_PKG_ADD_FORCE =
|
2004-11-15 08:52:03 -05:00
|
|
|
.endif
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_FULL_PACKAGE_NAME ?= No
|
2004-01-10 19:49:01 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_BUILDLIB_DEPENDS = ${LIB_DEPENDS}
|
|
|
|
_BUILDWANTLIB = ${WANTLIB}
|
2006-11-20 05:49:22 -05:00
|
|
|
# strip inter-multi-packages dependencies during building
|
|
|
|
.for _path in ${PKGPATH:S,^mystuff/,,}
|
|
|
|
. for _s in ${MULTI_PACKAGES}
|
2006-11-27 10:28:40 -05:00
|
|
|
_BUILDLIB_DEPENDS += ${LIB_DEPENDS${_s}:N*\:${_path}:N*\:${_path},*}
|
|
|
|
_BUILDWANTLIB += ${WANTLIB${_s}}
|
2006-11-20 05:49:22 -05:00
|
|
|
. endfor
|
|
|
|
.endfor
|
2006-11-20 05:36:13 -05:00
|
|
|
|
2006-11-19 07:32:53 -05:00
|
|
|
.if ${NO_DEPENDS:L} == "no"
|
2006-11-27 10:28:40 -05:00
|
|
|
_BUILD_DEPLIST = ${BUILD_DEPENDS:S/^://}
|
|
|
|
_RUN_DEPLIST = ${RUN_DEPENDS${SUBPACKAGE}:S/^://}
|
|
|
|
_REGRESS_DEPLIST = ${REGRESS_DEPENDS:S/^://}
|
|
|
|
_BUILDLIB_DEPLIST = ${_BUILDLIB_DEPENDS:C/^[^:]*://}
|
|
|
|
_RUNLIB_DEPLIST = ${LIB_DEPENDS${SUBPACKAGE}:C/^[^:]*://}
|
2006-11-19 07:32:53 -05:00
|
|
|
.endif
|
2006-11-27 10:28:40 -05:00
|
|
|
_DEPLIST = ${_BUILD_DEPLIST} ${_RUN_DEPLIST} ${_REGRESS_DEPLIST} \
|
|
|
|
${_BUILDLIB_DEPLIST} ${_RUNLIB_DEPLIST}
|
2006-11-19 07:32:53 -05:00
|
|
|
|
2006-11-20 05:36:13 -05:00
|
|
|
.for _DEP in BUILD RUN BUILDLIB RUNLIB REGRESS
|
2006-11-27 10:28:40 -05:00
|
|
|
_DEP${_DEP}_COOKIES =
|
2006-11-19 07:32:53 -05:00
|
|
|
. for _i in ${_${_DEP}_DEPLIST}
|
2006-11-27 10:28:40 -05:00
|
|
|
_DEP${_DEP}_COOKIES += ${WRKDIR}/.dep${_i:C,[|:/<=>*],-,g}
|
2006-11-19 07:32:53 -05:00
|
|
|
. endfor
|
2004-01-10 19:49:01 -05:00
|
|
|
.endfor
|
|
|
|
|
|
|
|
# Normal user-mode targets are PHONY targets, e.g., don't create the
|
|
|
|
# corresponding file. However, there is nothing phony about the cookie.
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
MODSIMPLE_configure = \
|
2004-09-15 14:58:49 -04:00
|
|
|
cd ${WRKCONF} && ${_SYSTRACE_CMD} ${SETENV} \
|
2004-09-18 09:45:23 -04:00
|
|
|
CC="${CC}" ac_cv_path_CC="${CC}" CFLAGS="${CFLAGS:C/ *$//}" \
|
|
|
|
CXX="${CXX}" ac_cv_path_CXX="${CXX}" CXXFLAGS="${CXXFLAGS:C/ *$//}" \
|
2004-01-10 19:49:01 -05:00
|
|
|
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}
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
VMEM_WARNING ?= No
|
2004-01-10 19:49:01 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_FAKE_SETUP = TRUEPREFIX=${PREFIX} PREFIX=${WRKINST}${PREFIX} \
|
|
|
|
${DESTDIRNAME}=${WRKINST}
|
2004-01-10 19:49:01 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_CLEANDEPENDS ?= Yes
|
2004-01-10 19:49:01 -05:00
|
|
|
|
2006-11-28 13:25:42 -05:00
|
|
|
.for _S in ${MULTI_PACKAGES}
|
2008-07-26 07:16:04 -04:00
|
|
|
_FETCH_MAKEFILE_NAMES += ${PKGPATH}/${FULLPKGNAME${_S}}
|
2006-11-28 13:25:42 -05:00
|
|
|
.endfor
|
2004-01-10 19:49:01 -05:00
|
|
|
|
|
|
|
# Internal variables, used by dependencies targets
|
|
|
|
# Only keep pkg:dir spec
|
2006-11-20 04:59:11 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_BUILD_DEP2 = ${BUILD_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
|
|
|
_BUILD_DEP3 = ${BUILD_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
2006-11-20 04:59:11 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_RUN_DEP2 = ${RUN_DEPENDS${SUBPACKAGE}:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
|
|
|
_RUN_DEP3 = ${RUN_DEPENDS${SUBPACKAGE}:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
2006-11-20 04:59:11 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_REGRESS_DEP2 = ${REGRESS_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
2006-11-20 04:59:11 -05:00
|
|
|
|
|
|
|
.if ${NO_SHARED_LIBS:L} != "yes"
|
2006-11-27 10:28:40 -05:00
|
|
|
_RUN_DEP2 += ${LIB_DEPENDS${SUBPACKAGE}:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
|
|
|
_LIB_DEP3 = ${LIB_DEPENDS${SUBPACKAGE}}
|
|
|
|
_DEPRUNLIBS = ${LIB_DEPENDS${SUBPACKAGE}:C/:.*//:S/,/ /g}
|
2004-01-10 19:49:01 -05:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
_LIB_DEP3 =
|
|
|
|
_DEPRUNLIBS =
|
2005-10-09 08:01:22 -04:00
|
|
|
.endif
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_BUILD_DEP2 += ${_BUILDLIB_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
|
|
|
_DEPBUILDLIBS = ${_BUILDLIB_DEPENDS:C/:.*//:S/,/ /g}
|
2006-11-20 04:59:11 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_DEPBUILDLIBS += ${_BUILDWANTLIB}
|
|
|
|
_DEPRUNLIBS += ${WANTLIB${SUBPACKAGE}}
|
2004-01-10 19:49:01 -05:00
|
|
|
|
2006-11-20 05:36:13 -05:00
|
|
|
.if ${NO_DEPENDS:L} == "no"
|
|
|
|
. for i in ${_DEPBUILDLIBS:C,[|:/<=>*],-,g}
|
2006-11-27 10:28:40 -05:00
|
|
|
_DEPBUILDLIBSPECS_COOKIES += ${WRKDIR}/.spec-$i
|
2005-10-09 09:31:50 -04:00
|
|
|
. endfor
|
2006-11-27 10:28:40 -05:00
|
|
|
_DEPBUILDWANTLIB_COOKIE = ${WRKDIR}/.buildwantlibs
|
2006-11-20 05:36:13 -05:00
|
|
|
. for i in ${_DEPRUNLIBS:C,[|:/<=>*],-,g}
|
2006-11-27 10:28:40 -05:00
|
|
|
_DEPRUNLIBSPECS_COOKIES += ${WRKDIR}/.spec-$i
|
2006-11-20 05:36:13 -05:00
|
|
|
. endfor
|
2006-11-27 10:28:40 -05:00
|
|
|
_DEPRUNWANTLIB_COOKIE = ${WRKDIR}/.runwantlibs${SUBPACKAGE}
|
2005-10-09 09:31:50 -04:00
|
|
|
.else
|
2006-11-27 10:28:40 -05:00
|
|
|
_DEPBUILDWANTLIB_COOKIE =
|
|
|
|
_DEPRUNWANTLIB_COOKIE =
|
2005-10-09 09:31:50 -04:00
|
|
|
.endif
|
2004-01-10 19:49:01 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_DEPLIBSPECS_COOKIES = ${_DEPBUILDLIBSPECS_COOKIES} ${_DEPRUNLIBSPECS_COOKIES}
|
2004-01-10 19:49:01 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_BUILD_DEP = ${_BUILD_DEP2:C/[^:]*://}
|
|
|
|
_RUN_DEP = ${_RUN_DEP2:C/[^:]*://}
|
|
|
|
_REGRESS_DEP = ${_REGRESS_DEP2:C/[^:]*://}
|
2006-11-20 04:59:11 -05:00
|
|
|
|
2006-11-28 13:25:42 -05:00
|
|
|
.for _S in ${MULTI_PACKAGES}
|
2006-11-27 10:28:40 -05:00
|
|
|
_BUILD_DEP3${_S} = ${_BUILD_DEP3}
|
|
|
|
_RUN_DEP3${_S} = ${RUN_DEPENDS${_S}:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
2006-11-28 13:25:42 -05:00
|
|
|
. if ${NO_SHARED_LIBS:L} != "yes"
|
2006-11-27 10:28:40 -05:00
|
|
|
_LIB_DEP3${_S} = ${LIB_DEPENDS${_S}}
|
2006-11-28 13:25:42 -05:00
|
|
|
. else
|
2006-11-26 18:39:41 -05:00
|
|
|
_LIB_DEP3${_S} =
|
2006-11-28 13:25:42 -05:00
|
|
|
. endif
|
|
|
|
.endfor
|
2006-11-26 15:02:28 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
README_NAME ?= ${TEMPLATES}/README.port
|
2004-01-10 19:49:01 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
REORDER_DEPENDENCIES ?=
|
2007-03-30 09:44:50 -04:00
|
|
|
ECHO_REORDER ?= :
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
|
|
|
|
# Lock infrastructure:
|
2005-09-18 08:20:00 -04:00
|
|
|
# nothing happens unless LOCKDIR is defined to a non-empty value
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
LOCKDIR ?=
|
|
|
|
LOCK_CMD ?= perl ${PORTSDIR}/infrastructure/build/dolock
|
|
|
|
UNLOCK_CMD ?= rm -f
|
|
|
|
_LOCKS_HELD ?=
|
|
|
|
LOCK_VERBOSE ?= No
|
2005-09-18 08:20:00 -04:00
|
|
|
.if !empty(LOCKDIR)
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
. if ${LOCK_VERBOSE:L} == "yes"
|
2007-06-03 07:03:06 -04:00
|
|
|
_LOCK = echo "Locking $$lock (${BUILD_PKGPATH}) from $@"; ${LOCK_CMD} ${LOCKDIR}/$$lock.lock ${BUILD_PKGPATH}
|
2006-11-27 10:28:40 -05:00
|
|
|
_UNLOCK = echo "Unlocking $$lock from $@"; ${UNLOCK_CMD} ${LOCKDIR}/$$lock.lock
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
. else
|
2007-06-03 07:03:06 -04:00
|
|
|
_LOCK = ${LOCK_CMD} ${LOCKDIR}/$$lock.lock ${BUILD_PKGPATH}
|
2006-11-27 10:28:40 -05:00
|
|
|
_UNLOCK = ${UNLOCK_CMD} ${LOCKDIR}/$$lock.lock
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
. endif
|
2005-04-20 21:44:50 -04:00
|
|
|
. if ${SEPARATE_BUILD:L:Mflavored}
|
2006-11-27 10:28:40 -05:00
|
|
|
_LOCKNAME = ${PKGNAME}
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
. else
|
2006-11-27 10:28:40 -05:00
|
|
|
_LOCKNAME = ${FULLPKGNAME}
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
. endif
|
2006-09-17 15:08:59 -04:00
|
|
|
|
|
|
|
. for _i in ${_LOCKNAME}
|
|
|
|
. if empty(_LOCKS_HELD:M${_i})
|
2006-11-27 10:28:40 -05:00
|
|
|
_DO_LOCK = \
|
2006-09-17 15:08:59 -04:00
|
|
|
lock=${_LOCKNAME}; \
|
|
|
|
_LOCKS_HELD="${_LOCKS_HELD} ${_LOCKNAME}"; export _LOCKS_HELD; \
|
|
|
|
${_SIMPLE_LOCK}
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_SIMPLE_LOCK = \
|
2006-09-17 15:08:59 -04:00
|
|
|
${_LOCK}; trap '${_UNLOCK}' 0 1 2 3 13 15
|
|
|
|
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
.endif
|
2006-11-27 10:28:40 -05:00
|
|
|
_SIMPLE_LOCK ?= :
|
|
|
|
_DO_LOCK ?= :
|
2005-01-04 15:44:45 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_size_fragment = wc -c $$file 2>/dev/null| \
|
2006-11-27 11:08:05 -05:00
|
|
|
awk '{print "SIZE (" $$2 ") = " $$1}'
|
2005-11-05 06:11:17 -05:00
|
|
|
|
|
|
|
# commands used all the time
|
2006-11-27 10:28:40 -05:00
|
|
|
_lines2list = tr '\012' '\040' | sed -e 's, $$,,'
|
2005-11-05 06:11:17 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_zap_last_line = sed -e '$$d'
|
2005-11-05 06:11:17 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_sort_dependencies = tsort -r|${_zap_last_line}
|
2005-11-05 06:11:17 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_version2default = sed -e 's,-[0-9].*,-*,'
|
2005-11-05 06:11:17 -05:00
|
|
|
|
2006-11-27 10:28:40 -05:00
|
|
|
_grab_libs_from_plist = sed -n -e '/^@lib /{ s///; p; }' \
|
2005-11-05 06:11:17 -05:00
|
|
|
-e '/^@file .*\/lib\/lib.*\.a$$/{ s/^@file //; p; }'
|
|
|
|
|
|
|
|
|
2005-11-27 07:31:18 -05:00
|
|
|
###
|
|
|
|
### end of variable setup. Only targets now
|
|
|
|
###
|
|
|
|
|
2006-11-28 15:20:25 -05:00
|
|
|
.for _S in ${MULTI_PACKAGES}
|
2006-10-02 05:37:14 -04:00
|
|
|
|
2006-11-28 15:20:25 -05:00
|
|
|
${_CACHE_REPO}/${_PKGFILE${_S}}:
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
@mkdir -p ${@D}
|
2006-11-28 15:20:25 -05:00
|
|
|
@${ECHO_MSG} -n "===> Looking for ${_PKGFILE${_S}} in \$$PKG_PATH - "
|
2008-07-03 13:36:47 -04:00
|
|
|
@if ${SETENV} ftp_proxy=${ftp_proxy} http_proxy=${http_proxy} PKG_CACHE=${_CACHE_REPO} PKG_PATH=${_CACHE_REPO}:${_PKG_REPO}:${PACKAGE_REPOSITORY}/${NO_ARCH}/:${PKG_PATH} PKG_TMPDIR=${PKG_TMPDIR} pkg_add -n -q ${_PKG_ADD_FORCE} ${_PKGFILE${_S}} >/dev/null 2>&1; then \
|
2006-10-02 05:37:14 -04:00
|
|
|
${ECHO_MSG} "found"; \
|
|
|
|
exit 0; \
|
|
|
|
else \
|
|
|
|
${ECHO_MSG} "not found"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
|
2006-11-28 15:40:55 -05:00
|
|
|
|
|
|
|
# The real package
|
|
|
|
|
2006-11-28 15:20:25 -05:00
|
|
|
${_PACKAGE_COOKIE${_S}}:
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
@mkdir -p ${@D}
|
2007-05-01 13:17:54 -04:00
|
|
|
. if ${FETCH_PACKAGES:L} == "yes" && !defined(_TRIED_FETCHING_${_PACKAGE_COOKIE${_S}})
|
2006-11-28 15:20:25 -05:00
|
|
|
@f=${_CACHE_REPO}/${_PKGFILE${_S}}; \
|
2006-10-02 05:37:14 -04:00
|
|
|
cd ${.CURDIR} && ${MAKE} $$f && \
|
|
|
|
{ ln $$f $@ 2>/dev/null || cp -p $$f $@ ; } || \
|
2007-06-16 05:57:03 -04:00
|
|
|
cd ${.CURDIR} && ${MAKE} _TRIED_FETCHING_${_PACKAGE_COOKIE${_S}}=Yes _internal-package-only
|
2006-11-28 15:20:25 -05:00
|
|
|
. else
|
2007-05-31 06:52:16 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} ${_PACKAGE_COOKIE_DEPS}
|
2006-11-28 15:20:25 -05:00
|
|
|
. if target(pre-package)
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} pre-package
|
2006-11-28 15:20:25 -05:00
|
|
|
. endif
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
. if target(do-package)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} do-package
|
2006-11-28 15:20:25 -05:00
|
|
|
. else
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
# What PACKAGE normally does:
|
2006-11-28 15:20:25 -05:00
|
|
|
@${ECHO_MSG} "===> Building package for ${FULLPKGNAME${_S}}"
|
|
|
|
@${ECHO_MSG} "Create ${_PACKAGE_COOKIE${_S}}"
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
@cd ${.CURDIR} && \
|
2006-11-28 15:20:25 -05:00
|
|
|
deps=`SUBPACKAGE=${_S} ${MAKE} _print-package-args` && \
|
2007-05-25 09:07:41 -04:00
|
|
|
if ${SUDO} ${PKG_CMD} $$deps ${PKG_ARGS${_S}} ${_PACKAGE_COOKIE${_S}}; then \
|
2006-11-28 15:20:25 -05:00
|
|
|
mode=`id -u`:`id -g`; ${SUDO} ${CHOWN} $${mode} ${_PACKAGE_COOKIE${_S}}; \
|
2007-04-03 09:32:45 -04:00
|
|
|
if ${_check_lib_depends} ${_PACKAGE_COOKIE${_S}} && \
|
|
|
|
${_register_plist} ${_PACKAGE_COOKIE${_S}}; then \
|
2007-04-03 06:14:14 -04:00
|
|
|
exit 0; \
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
fi; \
|
|
|
|
fi && \
|
|
|
|
${SUDO} ${MAKE} _internal-clean=package && \
|
|
|
|
exit 1
|
|
|
|
# End of PACKAGE.
|
2006-11-28 15:20:25 -05:00
|
|
|
. endif
|
|
|
|
. if target(post-package)
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-package
|
2006-11-28 15:20:25 -05:00
|
|
|
. endif
|
2008-07-26 06:59:20 -04:00
|
|
|
@rm -f ${_BULK_COOKIE} ${_UPDATE_COOKIE${_S}} ${_FUPDATE_COOKIE${_S}}
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
. endif
|
2006-11-28 15:20:25 -05:00
|
|
|
|
2006-11-28 15:40:55 -05:00
|
|
|
|
|
|
|
# The real install
|
|
|
|
|
|
|
|
${_INSTALL_COOKIE${_S}}:
|
2007-06-16 05:57:03 -04:00
|
|
|
. if ${FETCH_PACKAGES:L} == "yes"
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} subpackage
|
|
|
|
. else
|
2006-11-28 15:40:55 -05:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} package
|
2007-06-16 05:57:03 -04:00
|
|
|
. endif
|
2006-11-28 15:40:55 -05:00
|
|
|
@cd ${.CURDIR} && SUBPACKAGE=${_S} DEPENDS_TARGET=install \
|
|
|
|
exec ${MAKE} _internal-run-depends _internal-runlib-depends \
|
|
|
|
_internal-runwantlib-depends
|
|
|
|
@${ECHO_MSG} "===> Installing ${FULLPKGNAME${_S}} from ${_PKG_REPO}"
|
2008-05-11 15:36:12 -04:00
|
|
|
. for _m in ${MODULES:T:U}
|
|
|
|
. if defined(MOD${_m}_pre-install)
|
|
|
|
@${MOD${_m}_pre-install}
|
|
|
|
. elif defined(MOD${_m}_pre_install)
|
|
|
|
@${MOD${_m}_pre_install}
|
2006-11-28 15:40:55 -05:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. if ${TRUST_PACKAGES:L} == "yes"
|
2007-12-28 07:46:03 -05:00
|
|
|
@if ${_PKG_QUERY} ${FULLPKGNAME${_S}}; then \
|
2006-11-28 15:40:55 -05:00
|
|
|
echo "Package ${FULLPKGNAME${_S}} is already installed"; \
|
|
|
|
else \
|
|
|
|
${SUDO} ${SETENV} PKG_PATH=${_PKG_REPO} PKG_TMPDIR=${PKG_TMPDIR} pkg_add ${_PKG_ADD_AUTO} ${PKGFILE${_S}}; \
|
|
|
|
fi
|
|
|
|
. else
|
|
|
|
@${SUDO} ${SETENV} PKG_PATH=${_PKG_REPO} PKG_TMPDIR=${PKG_TMPDIR} pkg_add ${_PKG_ADD_AUTO} ${PKGFILE${_S}}
|
|
|
|
. endif
|
|
|
|
@-${SUDO} ${_MAKE_COOKIE} $@
|
|
|
|
|
|
|
|
|
2006-11-28 15:31:25 -05:00
|
|
|
${_UPDATE_COOKIE${_S}}:
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} _internal-package
|
|
|
|
. if empty(UPDATE_COOKIES_DIR)
|
|
|
|
@exec ${MAKE} ${WRKDIR}
|
|
|
|
. else
|
|
|
|
@mkdir -p ${UPDATE_COOKIES_DIR}
|
|
|
|
. endif
|
|
|
|
@${ECHO_MSG} "===> Updating for ${FULLPKGNAME${_S}}"
|
2007-12-28 07:46:03 -05:00
|
|
|
@a=`${_PKG_QUERY} ${FULLPKGPATH${_S}} 2>/dev/null || true`; \
|
2006-11-28 15:31:25 -05:00
|
|
|
case $$a in \
|
|
|
|
'') ${ECHO_MSG} "Not installed, no update";; \
|
2008-07-26 08:23:43 -04:00
|
|
|
*) cd ${.CURDIR} && SUBPACKAGE=${_S} DEPENDS_TARGET=package \
|
|
|
|
${MAKE} _internal-run-depends _internal-runlib-depends \
|
|
|
|
_internal-runwantlib-depends; \
|
|
|
|
${ECHO_MSG} "Upgrading from $$a"; \
|
2007-01-04 06:34:14 -05:00
|
|
|
${SUDO} ${SETENV} PKG_PATH=${_PKG_REPO} PKG_TMPDIR=${PKG_TMPDIR} pkg_add ${_PKG_ADD_AUTO} -r ${_PKG_ADD_FORCE} ${PKGFILE${_S}};; \
|
2006-11-28 15:31:25 -05:00
|
|
|
esac
|
|
|
|
@${_MAKE_COOKIE} $@
|
2008-07-26 06:59:20 -04:00
|
|
|
|
|
|
|
${_FUPDATE_COOKIE${_S}}:
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} _internal-package
|
2008-07-26 08:23:43 -04:00
|
|
|
@cd ${.CURDIR} && SUBPACKAGE=${_S} DEPENDS_TARGET=package \
|
|
|
|
exec ${MAKE} _internal-run-depends _internal-runlib-depends \
|
|
|
|
_internal-runwantlib-depends
|
2008-07-26 06:59:20 -04:00
|
|
|
. if empty(UPDATE_COOKIES_DIR)
|
|
|
|
@exec ${MAKE} ${WRKDIR}
|
|
|
|
. else
|
|
|
|
@mkdir -p ${UPDATE_COOKIES_DIR}
|
|
|
|
. endif
|
|
|
|
@${ECHO_MSG} "===> Updating/installing for ${FULLPKGNAME${_S}}"
|
|
|
|
@${SUDO} ${SETENV} PKG_PATH=${_PKG_REPO} PKG_TMPDIR=${PKG_TMPDIR} pkg_add ${_PKG_ADD_AUTO} -r ${_PKG_ADD_FORCE} ${PKGFILE${_S}}
|
|
|
|
@${_MAKE_COOKIE} $@
|
2006-11-28 15:20:25 -05:00
|
|
|
.endfor
|
2004-01-10 19:49:01 -05:00
|
|
|
|
2006-11-28 15:40:55 -05:00
|
|
|
.PRECIOUS: ${_PACKAGE_COOKIES} ${_INSTALL_COOKIES}
|
2004-01-10 19:49:01 -05:00
|
|
|
|
2004-06-22 12:09:05 -04:00
|
|
|
${_SYSTRACE_COOKIE}: ${_WRKDIR_COOKIE}
|
2004-01-10 19:49:01 -05:00
|
|
|
@rm -f $@
|
|
|
|
.for _i in ${_SYSTRACE_POLICIES}
|
|
|
|
@echo "Policy: ${_i}, Emulation: native" >> $@
|
2004-01-18 02:52:49 -05:00
|
|
|
@if [ -f ${.CURDIR}/systrace.filter ]; then \
|
2006-06-16 14:48:58 -04:00
|
|
|
sed ${_SYSTRACE_SED_SUBST} ${.CURDIR}/systrace.filter >> $@; \
|
2004-01-18 02:52:49 -05:00
|
|
|
fi
|
2004-01-10 19:49:01 -05:00
|
|
|
@sed ${_SYSTRACE_SED_SUBST} ${SYSTRACE_FILTER} >> $@
|
|
|
|
.endfor
|
2004-05-01 10:27:07 -04:00
|
|
|
@if [ -f ${.CURDIR}/systrace.policy ]; then \
|
|
|
|
sed ${_SYSTRACE_SED_SUBST} ${.CURDIR}/systrace.policy >> $@; \
|
|
|
|
fi
|
2004-01-10 19:49:01 -05:00
|
|
|
|
|
|
|
makesum: fetch-all
|
2008-05-15 05:51:17 -04:00
|
|
|
.if !defined(NO_CHECKSUM) && !empty(MAKESUMFILES)
|
2004-01-10 19:49:01 -05:00
|
|
|
@rm -f ${CHECKSUM_FILE}
|
2008-05-15 05:51:17 -04:00
|
|
|
@cd ${DISTDIR} && cksum -b -a "${_CIPHERS}" ${MAKESUMFILES} >> ${CHECKSUM_FILE}
|
2005-01-04 15:44:45 -05:00
|
|
|
@cd ${DISTDIR} && \
|
2008-05-15 05:51:17 -04:00
|
|
|
for file in ${MAKESUMFILES}; do \
|
2005-01-04 15:44:45 -05:00
|
|
|
${_size_fragment} >> ${CHECKSUM_FILE}; \
|
|
|
|
done
|
2004-01-10 19:49:01 -05:00
|
|
|
@sort -u -o ${CHECKSUM_FILE} ${CHECKSUM_FILE}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
|
|
addsum: fetch-all
|
|
|
|
.if !defined(NO_CHECKSUM)
|
|
|
|
@touch ${CHECKSUM_FILE}
|
|
|
|
@cd ${DISTDIR} && \
|
|
|
|
for cipher in ${_CIPHERS}; do \
|
2008-05-15 05:51:17 -04:00
|
|
|
cksum -b -a $$cipher ${MAKESUMFILES} >> ${CHECKSUM_FILE}; \
|
2004-01-10 19:49:01 -05:00
|
|
|
done
|
2005-01-04 15:44:45 -05:00
|
|
|
@cd ${DISTDIR} && \
|
2008-05-15 05:51:17 -04:00
|
|
|
for file in ${MAKESUMFILES}; do \
|
2005-01-04 15:44:45 -05:00
|
|
|
${_size_fragment} >> ${CHECKSUM_FILE}; \
|
|
|
|
done
|
2004-01-10 19:49:01 -05:00
|
|
|
@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
|
|
|
|
.endif
|
|
|
|
|
|
|
|
################################################################
|
|
|
|
# Dependency checking
|
|
|
|
################################################################
|
|
|
|
|
|
|
|
|
2001-03-28 06:48:12 -05:00
|
|
|
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
_internal-depends: _internal-lib-depends _internal-build-depends \
|
2006-11-19 11:39:41 -05:00
|
|
|
_internal-run-depends _internal-buildwantlib-depends \
|
|
|
|
_internal-runwantlib-depends _internal-regress-depends
|
2001-03-28 06:48:12 -05:00
|
|
|
|
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:
|
2003-07-30 15:31:31 -04:00
|
|
|
.if ${_FULL_PACKAGE_NAME:L} == "yes"
|
|
|
|
@echo '${PKGPATH}/${FULLPKGNAME${SUBPACKAGE}}'
|
|
|
|
.else
|
2001-08-12 07:33:10 -04:00
|
|
|
@echo ${FULLPKGNAME${SUBPACKAGE}}
|
2003-07-30 15:31:31 -04:00
|
|
|
.endif
|
2001-08-12 07:33:10 -04:00
|
|
|
|
2006-11-19 13:07:38 -05:00
|
|
|
.for _i in ${_DEPLIST}
|
|
|
|
. if !target(${WRKDIR}/.dep${_i:C,[|:/<=>*],-,g})
|
2006-11-19 12:48:14 -05:00
|
|
|
${WRKDIR}/.dep${_i:C,[|:/<=>*],-,g}: ${_WRKDIR_COOKIE}
|
2006-11-26 12:45:59 -05:00
|
|
|
@unset DEPENDS_TARGET _MASTER WRKDIR|| true; \
|
2001-04-12 16:35:59 -04:00
|
|
|
echo '${_i}'|{ \
|
2006-11-19 12:48:14 -05:00
|
|
|
IFS=:; read pkg subdir target; \
|
2006-11-19 13:07:38 -05:00
|
|
|
extra_msg="(DEPENDS ${_i})"; \
|
2006-11-19 13:20:01 -05:00
|
|
|
${_flavor_fragment}; defaulted=false; checkinstall=true; \
|
2006-11-19 13:01:44 -05:00
|
|
|
case "X$$target" in X) target=${DEPENDS_TARGET};; esac; \
|
2002-04-24 17:29:26 -04:00
|
|
|
case "X$$target" in \
|
|
|
|
Xinstall|Xreinstall) early_exit=false;; \
|
2006-08-07 04:57:18 -04:00
|
|
|
Xpackage|Xfake) early_exit=true;; \
|
2006-11-28 14:13:47 -05:00
|
|
|
Xpatch|Xconfigure|Xlicense-check|Xbuild) \
|
2002-04-24 17:29:26 -04:00
|
|
|
early_exit=true; mkdir -p ${WRKDIR}/$$dir; \
|
2004-08-12 15:02:45 -04:00
|
|
|
toset="$$toset _MASTER='[${FULLPKGNAME${SUBPACKAGE}}]${_MASTER}' WRKDIR=${WRKDIR}/$$dir"; \
|
2006-11-19 13:20:01 -05:00
|
|
|
checkinstall=false;; \
|
|
|
|
Xextract) \
|
|
|
|
${ECHO_MSG} "===> Error: bad dependency ${_i}"; \
|
2006-12-09 09:56:41 -05:00
|
|
|
${REPORT_PROBLEM}; \
|
2006-11-19 13:20:01 -05:00
|
|
|
exit 1;; \
|
|
|
|
*) \
|
|
|
|
${ECHO_MSG} "===> Error: don't know how to depend on $$target"; \
|
2006-12-09 09:56:41 -05:00
|
|
|
${REPORT_PROBLEM}; \
|
2006-11-19 13:20:01 -05:00
|
|
|
exit 1;; \
|
2002-04-24 17:29:26 -04:00
|
|
|
esac; \
|
2004-09-18 09:45:23 -04:00
|
|
|
toset="$$toset _SOLVING_DEP=Yes"; \
|
2006-06-04 10:56:10 -04:00
|
|
|
case "X$$pkg" in X) \
|
|
|
|
if pkg=`eval $$toset ${MAKE} _print-packagename`; \
|
|
|
|
then \
|
|
|
|
defaulted=true; \
|
2006-11-19 12:40:35 -05:00
|
|
|
pkg=`echo $$pkg|${_version2default}`; \
|
2006-06-04 10:56:10 -04:00
|
|
|
else \
|
|
|
|
${ECHO_MSG} "===> Error in evaluating dependency ${_i}"; \
|
2006-12-09 09:56:41 -05:00
|
|
|
${REPORT_PROBLEM}; \
|
2006-06-04 10:56:10 -04:00
|
|
|
exit 1; \
|
|
|
|
fi;; esac; \
|
2001-04-12 16:35:59 -04:00
|
|
|
for abort in false false true; do \
|
|
|
|
if $$abort; then \
|
|
|
|
${ECHO_MSG} "Dependency check failed"; \
|
2006-12-09 09:56:41 -05:00
|
|
|
${REPORT_PROBLEM}; \
|
2001-04-12 16:35:59 -04:00
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
found=false; \
|
2001-09-30 07:27:05 -04:00
|
|
|
what=$$pkg; \
|
2006-11-19 13:20:01 -05:00
|
|
|
if $$checkinstall; then \
|
2004-11-15 08:52:03 -05:00
|
|
|
$$early_exit || ${_force_update_fragment}; \
|
2007-12-28 07:46:03 -05:00
|
|
|
if ${_PKG_QUERY} "$$pkg" -q; then \
|
2002-04-24 17:29:26 -04:00
|
|
|
${ECHO_MSG} "===> ${FULLPKGNAME${SUBPACKAGE}}${_MASTER} depends on: $$what - 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}; \
|
2002-04-24 17:29:26 -04:00
|
|
|
${ECHO_MSG} "===> ${FULLPKGNAME${SUBPACKAGE}}${_MASTER} depends on: $$what -$$msg"; \
|
2006-11-19 13:20:01 -05:00
|
|
|
fi; \
|
|
|
|
fi; \
|
2001-09-19 11:16:39 -04:00
|
|
|
${ECHO_MSG} "===> Verifying $$target for $$what in $$dir"; \
|
2006-12-09 09:56:41 -05:00
|
|
|
if (eval $$toset exec ${MAKE} $$target); then \
|
2002-04-24 17:29:26 -04:00
|
|
|
${ECHO_MSG} "===> Returning to build of ${FULLPKGNAME${SUBPACKAGE}}${_MASTER}"; \
|
2001-04-12 16:35:59 -04:00
|
|
|
else \
|
2006-12-09 09:56:41 -05:00
|
|
|
${REPORT_PROBLEM}; \
|
2001-04-12 16:35:59 -04:00
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2001-10-10 20:01:27 -04:00
|
|
|
if $$early_exit; then \
|
2001-04-12 16:35:59 -04:00
|
|
|
break; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
}
|
2004-08-13 19:28:40 -04:00
|
|
|
@mkdir -p ${WRKDIR} ${WRKDIR}/bin
|
2001-09-05 05:13:18 -04:00
|
|
|
@${_MAKE_COOKIE} $@
|
2006-11-19 13:07:38 -05:00
|
|
|
. endif
|
2001-03-28 06:48:12 -05:00
|
|
|
.endfor
|
2006-11-19 13:07:38 -05:00
|
|
|
|
|
|
|
_internal-build-depends: ${_DEPBUILD_COOKIES}
|
|
|
|
_internal-run-depends: ${_DEPRUN_COOKIES}
|
2006-11-20 05:36:13 -05:00
|
|
|
_internal-lib-depends: ${_DEPBUILDLIB_COOKIES}
|
2006-11-19 13:07:38 -05:00
|
|
|
_internal-regress-depends: ${_DEPREGRESS_COOKIES}
|
2006-11-19 11:39:41 -05:00
|
|
|
_internal-buildlib-depends: ${_DEPBUILDLIB_COOKIES}
|
|
|
|
_internal-runlib-depends: ${_DEPRUNLIB_COOKIES}
|
2001-03-28 06:48:12 -05:00
|
|
|
|
2006-11-20 05:36:13 -05:00
|
|
|
. if !empty(_DEPLIBSPECS_COOKIES)
|
|
|
|
${_DEPLIBSPECS_COOKIES}: ${_WRKDIR_COOKIE}
|
2005-10-09 20:29:38 -04:00
|
|
|
@${_MAKE_COOKIE} $@
|
2006-11-20 05:36:13 -05:00
|
|
|
.endif
|
2005-10-09 20:29:38 -04:00
|
|
|
|
2006-11-20 05:36:13 -05:00
|
|
|
.for _m in BUILD RUN
|
|
|
|
. if !empty(_DEP${_m}WANTLIB_COOKIE)
|
2006-11-27 10:28:40 -05:00
|
|
|
${_DEP${_m}WANTLIB_COOKIE}: ${_DEP${_m}LIBSPECS_COOKIES} \
|
|
|
|
${_DEP${_m}LIB_COOKIES} ${_DEPBUILD_COOKIES} ${_WRKDIR_COOKIE}
|
2006-12-11 06:05:43 -05:00
|
|
|
. if !empty(_DEP${_m}LIBS)
|
2006-11-19 11:39:41 -05:00
|
|
|
@${ECHO_MSG} "===> Verifying specs: ${_DEP${_m}LIBS}"
|
2005-10-09 09:31:50 -04:00
|
|
|
@listlibs="echo ${LOCALBASE}/lib/lib* /usr/lib/lib* ${X11BASE}/lib/lib*"; \
|
2006-11-19 11:39:41 -05:00
|
|
|
for d in ${_DEP${_m}LIBS:S/>/\>/g}; do \
|
2005-10-09 09:31:50 -04:00
|
|
|
case "$$d" in \
|
|
|
|
/*) listlibs="$$listlibs $${d%/*}/lib*";; \
|
|
|
|
*/*) listlibs="$$listlibs ${DEPBASE}/$${d%/*}/lib*";; \
|
|
|
|
esac; \
|
|
|
|
done; \
|
|
|
|
if found=`eval $$listlibs 2>/dev/null| \
|
|
|
|
LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} perl \
|
2006-11-19 11:39:41 -05:00
|
|
|
${PORTSDIR}/infrastructure/build/resolve-lib ${_noshared} ${_DEP${_m}LIBS:S/>/\>/g}`; then \
|
2005-10-10 12:07:33 -04:00
|
|
|
line="===> found"; \
|
2005-10-09 09:31:50 -04:00
|
|
|
for k in $$found; do line="$$line $$k"; done; \
|
|
|
|
${ECHO_MSG} "$$line"; \
|
|
|
|
else \
|
|
|
|
echo 1>&2 "Fatal error"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2006-12-11 06:05:43 -05:00
|
|
|
. endif
|
2005-10-09 09:31:50 -04:00
|
|
|
@${_MAKE_COOKIE} $@
|
2006-11-19 11:39:41 -05:00
|
|
|
. endif
|
2005-10-09 09:31:50 -04:00
|
|
|
|
2006-11-19 11:39:41 -05:00
|
|
|
_internal-${_m:L}wantlib-depends: ${_DEP${_m}WANTLIB_COOKIE}
|
|
|
|
.endfor
|
2005-10-09 09:31:50 -04:00
|
|
|
|
2008-05-15 05:51:17 -04:00
|
|
|
_internal-fetch-all:
|
|
|
|
# See ports/infrastructure/templates/Makefile.template
|
|
|
|
@${ECHO_MSG} "===> Checking files for ${FULLPKGNAME}${_MASTER}"
|
|
|
|
.if target(pre-fetch)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} pre-fetch __FETCH_ALL=Yes
|
|
|
|
.endif
|
|
|
|
.if target(do-fetch)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} do-fetch __FETCH_ALL=Yes
|
|
|
|
.else
|
2008-05-15 05:57:03 -04:00
|
|
|
# What FETCH-ALL normally does:
|
2008-05-18 06:05:21 -04:00
|
|
|
. if !empty(MAKESUMFILES)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} ${MAKESUMFILES:S@^@${DISTDIR}/@}
|
2008-05-15 05:51:17 -04:00
|
|
|
. endif
|
|
|
|
# End of FETCH
|
|
|
|
.endif
|
|
|
|
.if target(post-fetch)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-fetch __FETCH_ALL=Yes
|
|
|
|
.endif
|
|
|
|
|
2001-03-29 14:01:05 -05:00
|
|
|
.if defined(IGNORE) && !defined(NO_IGNORE)
|
2008-06-05 04:14:00 -04:00
|
|
|
_internal-all _internal-build _internal-checksum _internal-configure \
|
|
|
|
_internal-deinstall _internal-extract _internal-fake _internal-fetch \
|
|
|
|
_internal-install _internal-install-all _internal-manpages-check \
|
|
|
|
_internal-package _internal-patch _internal-plist _internal-regress \
|
|
|
|
_internal-subpackage _internal-subupdate _internal-uninstall \
|
2008-07-26 06:59:20 -04:00
|
|
|
_internal-update _internal-update-or-install \
|
|
|
|
_internal-update-or-install-all _internal-update-plist describe dump-vars \
|
2008-06-05 04:14:00 -04:00
|
|
|
port-lib-depends-check update-patches:
|
2001-03-29 14:01:05 -05:00
|
|
|
. if !defined(IGNORE_SILENT)
|
2002-04-24 17:29:26 -04:00
|
|
|
@${ECHO_MSG} "===> ${FULLPKGNAME${SUBPACKAGE}}${_MASTER} ${IGNORE}."
|
2001-03-29 14:01:05 -05:00
|
|
|
. endif
|
|
|
|
|
2003-07-18 15:02:13 -04:00
|
|
|
.else
|
2005-01-31 05:12:24 -05:00
|
|
|
|
|
|
|
. if ${ELF_TOOLCHAIN:L} == "no"
|
2007-06-01 09:15:21 -04:00
|
|
|
_LIB_DEPENDS_FLAGS=-o
|
2005-01-31 05:12:24 -05:00
|
|
|
. else
|
2007-06-01 09:15:21 -04:00
|
|
|
_LIB_DEPENDS_FLAGS=
|
2005-01-31 05:12:24 -05:00
|
|
|
. endif
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
|
2006-11-28 15:20:25 -05:00
|
|
|
lib-depends-check:
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} package
|
2007-06-18 19:04:02 -04:00
|
|
|
@PORTSDIR=${PORTSDIR} perl ${PORTSDIR}/infrastructure/package/check-lib-depends \
|
2007-06-01 09:15:21 -04:00
|
|
|
${_LIB_DEPENDS_FLAGS} -d ${_PKG_REPO} ${_PACKAGE_COOKIE}
|
2001-10-24 07:57:34 -04:00
|
|
|
|
2007-06-03 07:03:06 -04:00
|
|
|
${WRKINST}/.saved_libs: ${_FAKE_COOKIE}
|
|
|
|
@${SUDO} perl ${PORTSDIR}/infrastructure/package/check-lib-depends -F ${WRKINST} -O $@
|
|
|
|
|
|
|
|
port-lib-depends-check: ${WRKINST}/.saved_libs
|
2007-03-31 11:36:43 -04:00
|
|
|
. for _S in ${MULTI_PACKAGES}
|
2007-04-08 07:26:39 -04:00
|
|
|
@-SUBPACKAGE=${_S} ${MAKE} print-plist-with-depends | \
|
2007-06-18 19:04:02 -04:00
|
|
|
PORTSDIR=${PORTSDIR} perl ${PORTSDIR}/infrastructure/package/check-lib-depends \
|
2007-06-03 07:03:06 -04:00
|
|
|
${_LIB_DEPENDS_FLAGS} -d ${_PKG_REPO} -B ${WRKINST} -s ${WRKINST}/.saved_libs
|
2007-03-31 11:36:43 -04:00
|
|
|
. endfor
|
|
|
|
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
_internal-manpages-check: ${_FAKE_COOKIE}
|
2002-04-02 10:55:55 -05:00
|
|
|
@cd ${WRKINST}${TRUEPREFIX}/man && \
|
|
|
|
${SUDO} /usr/libexec/makewhatis -p . && \
|
|
|
|
cat whatis.db
|
2001-03-29 14:01:05 -05:00
|
|
|
|
|
|
|
# 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.
|
2003-07-18 15:02:13 -04:00
|
|
|
#
|
2001-03-29 14:01:05 -05:00
|
|
|
# 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.
|
|
|
|
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
_internal-fetch:
|
2001-03-29 14:01:05 -05:00
|
|
|
# See ports/infrastructure/templates/Makefile.template
|
2002-04-24 17:29:26 -04:00
|
|
|
@${ECHO_MSG} "===> Checking files for ${FULLPKGNAME}${_MASTER}"
|
2001-03-29 14:01:05 -05:00
|
|
|
. 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:
|
2008-05-18 06:05:21 -04:00
|
|
|
. if !empty(CHECKSUMFILES)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} ${CHECKSUMFILES:S@^@${DISTDIR}/@}
|
2001-03-29 14:01:05 -05:00
|
|
|
. endif
|
|
|
|
# End of FETCH
|
|
|
|
. endif
|
|
|
|
. if target(post-fetch)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-fetch
|
|
|
|
. endif
|
|
|
|
|
|
|
|
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
_internal-checksum: _internal-fetch
|
2001-03-29 14:01:05 -05:00
|
|
|
. if ! defined(NO_CHECKSUM)
|
2007-03-30 09:41:44 -04:00
|
|
|
@if [ -z "${DISTFILES}" ]; then \
|
2006-10-18 12:53:04 -04:00
|
|
|
${ECHO_MSG} ">> No distfiles."; \
|
2007-03-30 09:41:44 -04:00
|
|
|
elif [ ! -f ${CHECKSUM_FILE} ]; then \
|
2001-03-29 14:01:05 -05:00
|
|
|
${ECHO_MSG} ">> No checksum file."; \
|
2006-10-18 12:53:04 -04:00
|
|
|
exit 1; \
|
2001-03-29 14:01:05 -05:00
|
|
|
else \
|
|
|
|
cd ${DISTDIR}; OK=true; list=''; \
|
2008-05-15 05:51:17 -04:00
|
|
|
for file in ${CHECKSUMFILES}; do \
|
2001-03-29 14:01:05 -05:00
|
|
|
for cipher in ${PREFERRED_CIPHERS}; do \
|
2007-03-30 09:41:44 -04:00
|
|
|
set -- `grep -i "^$$cipher ($$file)" ${CHECKSUM_FILE}` && break || \
|
2001-03-29 14:01:05 -05:00
|
|
|
${ECHO_MSG} ">> No $$cipher checksum recorded for $$file."; \
|
|
|
|
done; \
|
|
|
|
case "$$4" in \
|
|
|
|
"") \
|
|
|
|
${ECHO_MSG} ">> No checksum recorded for $$file."; \
|
|
|
|
OK=false;; \
|
|
|
|
"IGNORE") \
|
2004-07-11 16:44:33 -04:00
|
|
|
echo ">> Error: checksum for $$file is set to IGNORE in distinfo"; \
|
2001-03-29 14:01:05 -05:00
|
|
|
OK=false;; \
|
|
|
|
*) \
|
2007-03-28 09:21:43 -04:00
|
|
|
echo -n '>> '; \
|
|
|
|
if ! echo "$$@" | cksum -c; then \
|
2001-03-29 14:01:05 -05:00
|
|
|
echo ">> Checksum mismatch for $$file. ($$cipher)"; \
|
|
|
|
list="$$list $$file $$cipher $$4"; \
|
2007-03-28 09:21:43 -04:00
|
|
|
OK=false; \
|
|
|
|
fi;; \
|
2001-03-29 14:01:05 -05:00
|
|
|
esac; \
|
|
|
|
done; \
|
|
|
|
set --; \
|
|
|
|
if ! $$OK; then \
|
|
|
|
if ${REFETCH}; then \
|
2003-07-30 15:59:48 -04:00
|
|
|
cd ${.CURDIR} && ${MAKE} _refetch _PROBLEMS="$$list"; \
|
2001-03-29 14:01:05 -05:00
|
|
|
else \
|
2007-03-30 09:41:44 -04:00
|
|
|
echo "Make sure the Makefile and checksum file (${CHECKSUM_FILE})"; \
|
2003-03-02 12:54:27 -05:00
|
|
|
echo "are up to date. If you want to fetch a good copy of this"; \
|
|
|
|
echo "file from the OpenBSD main archive, type"; \
|
|
|
|
echo "\"make REFETCH=true [other args]\"."; \
|
2001-03-29 14:01:05 -05:00
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
fi ; \
|
|
|
|
fi
|
|
|
|
. endif
|
|
|
|
|
2003-07-30 15:59:48 -04:00
|
|
|
_refetch:
|
2003-07-09 07:16:21 -04:00
|
|
|
. for file cipher value in ${_PROBLEMS}
|
2003-07-30 15:59:48 -04:00
|
|
|
@rm ${DISTDIR}/${file}
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} ${DISTDIR}/${file} \
|
2008-07-29 13:54:52 -04:00
|
|
|
MASTER_SITE_OVERRIDE="${MASTER_SITE_OPENBSD:=by_cipher/${cipher}/${value:C/(..).*/\1/}/${value}/} ${MASTER_SITE_OPENBSD:=${cipher}/${value}/}"
|
2001-08-16 11:13:17 -04:00
|
|
|
. endfor
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
cd ${.CURDIR} && exec ${MAKE} _internal-checksum REFETCH=false
|
2001-03-29 14:01:05 -05:00
|
|
|
|
|
|
|
|
2001-03-28 06:48:12 -05:00
|
|
|
# The cookie's recipe hold the real rule for each of those targets.
|
|
|
|
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
_internal-extract: ${_EXTRACT_COOKIE}
|
2006-11-27 10:28:40 -05:00
|
|
|
_internal-patch: ${_DEPBUILD_COOKIES} ${_DEPBUILDLIB_COOKIES} \
|
|
|
|
${_DEPBUILDWANTLIB_COOKIE} ${_PATCH_COOKIE}
|
|
|
|
_internal-distpatch: ${_DEPBUILD_COOKIES} ${_DEPBUILDLIB_COOKIES} \
|
|
|
|
${_DEPBUILDWANTLIB_COOKIE} ${_DISTPATCH_COOKIE}
|
|
|
|
_internal-configure: ${_DEPBUILD_COOKIES} ${_DEPBUILDLIB_COOKIES} \
|
|
|
|
${_DEPBUILDWANTLIB_COOKIE} ${_CONFIGURE_COOKIE}
|
2006-11-19 11:39:41 -05:00
|
|
|
_internal-build _internal-all: ${_DEPBUILD_COOKIES} ${_DEPBUILDLIB_COOKIES} \
|
|
|
|
${_DEPBUILDWANTLIB_COOKIE} ${_BUILD_COOKIE}
|
2006-11-28 15:40:55 -05:00
|
|
|
_internal-install: ${_INSTALL_COOKIE${SUBPACKAGE}}
|
|
|
|
_internal-install-all: ${_INSTALL_COOKIES}
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
_internal-fake: ${_FAKE_COOKIE}
|
2006-11-28 15:20:25 -05:00
|
|
|
_internal-subupdate: ${_UPDATE_COOKIE${SUBPACKAGE}}
|
|
|
|
_internal-update: ${_UPDATE_COOKIES}
|
2008-07-26 06:59:20 -04:00
|
|
|
_internal-update-or-install: ${_FUPDATE_COOKIE${SUBPACKAGE}
|
|
|
|
_internal-update-or-install-all: ${_FUPDATE_COOKIES}
|
2006-11-28 15:20:25 -05:00
|
|
|
|
2002-04-17 11:58:48 -04:00
|
|
|
|
2001-10-07 07:30:30 -04:00
|
|
|
. if defined(_IGNORE_REGRESS)
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
_internal-regress:
|
2001-10-07 07:30:30 -04:00
|
|
|
. if !defined(IGNORE_SILENT)
|
2002-04-24 17:29:26 -04:00
|
|
|
@${ECHO_MSG} "===> ${FULLPKGNAME${SUBPACKAGE}}${_MASTER} ${_IGNORE_REGRESS}."
|
2001-10-07 07:30:30 -04:00
|
|
|
. endif
|
|
|
|
. else
|
2006-11-19 07:05:10 -05:00
|
|
|
_internal-regress: ${_BUILD_COOKIE} ${_DEPREGRESS_COOKIES} ${_REGRESS_COOKIE}
|
2001-10-07 07:30:30 -04:00
|
|
|
. endif
|
|
|
|
|
2005-03-09 10:40:37 -05: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.
|
|
|
|
# Note: add @comment PACKAGE(arch=${MACHINE_ARCH}, opsys=${OPSYS}, vers=${OPSYS_VER})
|
|
|
|
# when port is installed or package created.
|
|
|
|
#
|
2006-10-15 15:29:06 -04:00
|
|
|
.if ${SHARED_ONLY:L} == "yes"
|
2006-12-11 06:05:43 -05:00
|
|
|
_do_libs_too =
|
2006-10-15 15:29:06 -04:00
|
|
|
.else
|
2006-12-11 06:05:43 -05:00
|
|
|
_do_libs_too = NO_SHARED_LIBS=Yes
|
2006-10-15 15:29:06 -04:00
|
|
|
.endif
|
2005-03-09 10:40:37 -05:00
|
|
|
|
2006-12-11 08:36:06 -05:00
|
|
|
_extra_info =
|
2006-11-28 13:25:42 -05:00
|
|
|
.for _s in ${MULTI_PACKAGES}
|
2006-12-11 08:36:06 -05:00
|
|
|
_extra_info += PLIST${_s}='${PLIST${_s}}'
|
2007-09-30 11:07:40 -04:00
|
|
|
_extra_info += DEPPATHS${_s}="`${SETENV} FLAVOR=${FLAVOR:Q} SUBPACKAGE=${_s} ${MAKE} run-dir-depends ${_do_libs_too}|${_sort_dependencies}`"
|
2006-11-28 13:25:42 -05:00
|
|
|
.endfor
|
2005-03-09 10:40:37 -05:00
|
|
|
|
2006-11-09 03:16:22 -05:00
|
|
|
_internal-plist _internal-update-plist: _internal-fake
|
2005-03-09 10:40:37 -05:00
|
|
|
@${ECHO_MSG} "===> Updating plist for ${FULLPKGNAME}${_MASTER}"
|
|
|
|
@mkdir -p ${PKGDIR}
|
2006-12-11 08:36:06 -05:00
|
|
|
@DESTDIR=${WRKINST} \
|
|
|
|
PREFIX=${TRUEPREFIX} \
|
2005-03-09 10:40:37 -05:00
|
|
|
INSTALL_PRE_COOKIE=${_INSTALL_PRE_COOKIE} \
|
2006-11-09 03:16:22 -05:00
|
|
|
MAKE="${MAKE}" \
|
|
|
|
PORTSDIR=${PORTSDIR} \
|
2005-03-09 10:40:37 -05:00
|
|
|
FLAVORS='${FLAVORS}' MULTI_PACKAGES='${MULTI_PACKAGES}' \
|
2007-06-03 07:06:41 -04:00
|
|
|
OKAY_FILES='${_FAKE_COOKIE} ${_INSTALL_PRE_COOKIE} ${WRKINST}/.saved_libs' \
|
2005-03-09 10:40:37 -05:00
|
|
|
SHARED_ONLY="${SHARED_ONLY}" \
|
|
|
|
OWNER=`id -u` \
|
|
|
|
GROUP=`id -g` \
|
|
|
|
${SUDO} perl ${PORTSDIR}/infrastructure/install/make-plist \
|
2006-12-11 08:36:06 -05:00
|
|
|
${_extra_info} ${_tmpvars}
|
2005-03-09 10:40:37 -05:00
|
|
|
|
|
|
|
update-patches:
|
|
|
|
@toedit=`WRKDIST=${WRKDIST} PATCHDIR=${PATCHDIR} \
|
|
|
|
PATCH_LIST='${PATCH_LIST}' DIFF_ARGS='${DIFF_ARGS}' \
|
|
|
|
DISTORIG=${DISTORIG} PATCHORIG=${PATCHORIG} \
|
|
|
|
/bin/sh ${PORTSDIR}/infrastructure/build/update-patches`; \
|
|
|
|
case $$toedit in "");; \
|
|
|
|
*) read i?'edit patches: '; \
|
|
|
|
cd ${PATCHDIR} && $${VISUAL:-$${EDITOR:-/usr/bin/vi}} $$toedit;; esac
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-03-29 14:01:05 -05:00
|
|
|
.endif # IGNORECMD
|
|
|
|
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
|
|
|
|
# Top-level targets redirect to the real _internal-target, along with locking
|
|
|
|
# if locking exists.
|
|
|
|
|
2006-10-23 09:42:50 -04:00
|
|
|
.for _t in extract patch distpatch configure build all install fake \
|
2008-07-26 06:59:20 -04:00
|
|
|
subupdate fetch fetch-all checksum regress \
|
|
|
|
depends lib-depends build-depends run-depends regress-depends \
|
|
|
|
clean manpages-check plist update-plist \
|
|
|
|
update update-or-install update-or-install-all package install-all
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
. if defined(_LOCK)
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
${_t}:
|
|
|
|
@${_DO_LOCK}; cd ${.CURDIR} && ${MAKE} _internal-${_t}
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
. else
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
${_t}: _internal-${_t}
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
2008-01-12 09:12:43 -05:00
|
|
|
lock:
|
|
|
|
@lock=${_LOCKNAME}; ${_LOCK}
|
|
|
|
export _LOCKS_HELD="${_LOCKS_HELD} ${_LOCKNAME}"
|
|
|
|
|
|
|
|
unlock:
|
|
|
|
@lock=${_LOCKNAME}; ${_UNLOCK}
|
|
|
|
.for _i in ${_LOCKNAME}
|
|
|
|
export _LOCKS_HELD="${_LOCKS_HELD:N${_i}}"
|
|
|
|
.endfor
|
|
|
|
|
2006-10-23 09:42:50 -04:00
|
|
|
subpackage:
|
2006-11-26 12:45:59 -05:00
|
|
|
@${_DO_LOCK}; cd ${.CURDIR} && ${MAKE} _internal-subpackage
|
2006-10-23 09:42:50 -04:00
|
|
|
|
2006-11-28 15:20:25 -05:00
|
|
|
_internal-package:
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} _internal-package-only
|
2006-10-23 09:42:50 -04:00
|
|
|
.if ${BULK_${PKGPATH}:L} == "yes"
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} ${_BULK_COOKIE}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
2006-11-27 11:08:05 -05:00
|
|
|
${_BULK_COOKIE}:
|
2006-10-23 09:42:50 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} _internal-package-only
|
2002-04-17 11:58:48 -04:00
|
|
|
@mkdir -p ${BULK_COOKIES_DIR}
|
2004-02-07 17:34:02 -05:00
|
|
|
.for _i in ${BULK_TARGETS_${PKGPATH}}
|
2002-04-17 11:58:48 -04:00
|
|
|
@${ECHO_MSG} "===> Running ${_i}"
|
2003-07-30 15:59:48 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} ${_i} ${BULK_FLAGS}
|
2002-04-17 11:58:48 -04:00
|
|
|
.endfor
|
2006-10-23 10:33:01 -04:00
|
|
|
.if !empty(BULK_DO_${PKGPATH})
|
|
|
|
@${BULK_DO_${PKGPATH}}
|
|
|
|
.endif
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${MAKE} _internal-clean
|
2002-04-17 11:58:48 -04:00
|
|
|
@${_MAKE_COOKIE} $@
|
|
|
|
|
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}:
|
|
|
|
@rm -rf ${WRKDIR}
|
2005-04-17 06:10:07 -04:00
|
|
|
@mkdir -p ${WRKDIR} ${WRKDIR}/bin ${DEPDIR}
|
2006-12-16 06:53:46 -05:00
|
|
|
# @ln -s ${LOCALBASE}/bin/pkg-config ${WRKDIR}/bin
|
2008-09-19 09:00:30 -04:00
|
|
|
.if !empty(WRKDIR_LINKNAME)
|
|
|
|
@ln -sf ${WRKDIR} ${.CURDIR}/${WRKDIR_LINKNAME}
|
|
|
|
.endif
|
2001-09-05 05:13:18 -04:00
|
|
|
@${_MAKE_COOKIE} $@
|
|
|
|
|
2003-07-28 13:17:04 -04:00
|
|
|
${_EXTRACT_COOKIE}: ${_WRKDIR_COOKIE} ${_SYSTRACE_COOKIE}
|
2006-11-27 10:28:40 -05:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} \
|
|
|
|
_internal-checksum _internal-build-depends \
|
|
|
|
_internal-buildlib-depends _internal-buildwantlib-depends
|
2002-04-24 17:29:26 -04:00
|
|
|
@${ECHO_MSG} "===> Extracting for ${FULLPKGNAME}${_MASTER}"
|
2000-06-16 19:10:41 -04:00
|
|
|
.if target(pre-extract)
|
2003-07-28 13:17:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} pre-extract
|
2000-06-16 19:10:41 -04:00
|
|
|
.endif
|
2003-07-28 13:17:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} do-extract
|
2003-08-11 14:42:07 -04:00
|
|
|
.if target(post-extract)
|
|
|
|
@cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} post-extract
|
|
|
|
.endif
|
|
|
|
@${_MAKE_COOKIE} $@
|
|
|
|
|
|
|
|
.if !target(do-extract)
|
|
|
|
do-extract:
|
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}; \
|
2005-04-23 11:24:49 -04:00
|
|
|
${_set_ld_library_path}; \
|
2000-09-11 14:06:24 -04:00
|
|
|
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
|
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}:
|
2006-06-18 06:10:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${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
|
2006-06-18 06:10:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} do-distpatch
|
|
|
|
.if target(post-distpatch)
|
|
|
|
@cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} post-distpatch
|
|
|
|
.endif
|
|
|
|
.if ${PATCH_CHECK_ONLY:L} != "yes"
|
|
|
|
@${_MAKE_COOKIE} $@
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(do-distpatch)
|
|
|
|
do-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
|
|
|
# What DISTPATCH normally does
|
2000-06-16 19:10:41 -04:00
|
|
|
. if defined(_PATCHFILES)
|
2002-04-24 17:29:26 -04:00
|
|
|
@${ECHO_MSG} "===> Applying distribution patches for ${FULLPKGNAME}${_MASTER}"
|
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
|
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}
|
2002-04-24 17:29:26 -04:00
|
|
|
@${ECHO_MSG} "===> Patching for ${FULLPKGNAME}${_MASTER}"
|
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)
|
2006-06-18 06:10:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${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
|
2003-07-18 15:02:13 -04:00
|
|
|
. if target(do-distpatch) || target(post-distpatch) || defined(PATCHFILES)
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} _internal-distpatch
|
2003-07-18 15:02:13 -04:00
|
|
|
. endif
|
2001-10-04 18:43:45 -04:00
|
|
|
@if cd ${PATCHDIR} 2>/dev/null || [ x"${PATCH_LIST:M/*}" != x"" ]; 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; \
|
2006-06-18 06:10:04 -04:00
|
|
|
${_SYSTRACE_CMD} ${PATCH} ${PATCH_ARGS} < $$i || \
|
1999-07-27 18:12:26 -04:00
|
|
|
{ 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 \
|
2001-09-27 06:34:19 -04:00
|
|
|
if [ $$i != "patch-*" ]; then \
|
|
|
|
echo "===> Can't find patch matching $$i"; \
|
|
|
|
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)
|
2006-06-18 06:10:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} post-patch
|
2000-02-04 06:09:33 -05:00
|
|
|
.endif
|
2008-05-11 15:36:12 -04:00
|
|
|
.for _m in ${MODULES:T:U}
|
|
|
|
. if defined(MOD${_m}_post-patch)
|
|
|
|
@${MOD${_m}_post-patch}
|
2000-09-23 08:36:39 -04:00
|
|
|
. endif
|
2002-03-15 20:09:23 -05:00
|
|
|
.endfor
|
2004-06-06 07:49:08 -04:00
|
|
|
.if !empty(REORDER_DEPENDENCIES)
|
2004-07-18 18:45:14 -04:00
|
|
|
@sed -e '/^#/d' ${REORDER_DEPENDENCIES} | \
|
2004-06-06 07:49:08 -04:00
|
|
|
tsort -r|while read f; do \
|
|
|
|
cd ${WRKSRC}; \
|
|
|
|
case $$f in \
|
|
|
|
/*) \
|
|
|
|
find . -name $${f#/} -print| while read i; \
|
2007-03-30 09:44:50 -04:00
|
|
|
do ${ECHO_REORDER} "Touching $$i"; touch $$i; done \
|
2004-06-06 07:49:08 -04:00
|
|
|
;; \
|
|
|
|
*) \
|
|
|
|
if test -e $$f ; then \
|
2007-03-30 09:44:50 -04:00
|
|
|
${ECHO_REORDER} "Touching $$f"; touch $$f; \
|
2004-06-06 07:49:08 -04:00
|
|
|
fi \
|
|
|
|
;; \
|
|
|
|
esac; done
|
|
|
|
.endif
|
2002-03-15 20:09:23 -05: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-02-04 06:09:33 -05:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
|
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}
|
2002-04-24 17:29:26 -04:00
|
|
|
@${ECHO_MSG} "===> Configuring for ${FULLPKGNAME}${_MASTER}"
|
2007-05-25 09:07:41 -04:00
|
|
|
@mkdir -p ${WRKBUILD}
|
2000-06-16 19:10:41 -04:00
|
|
|
.if target(pre-configure)
|
2003-07-28 13:17:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} pre-configure
|
2000-06-16 19:10:41 -04:00
|
|
|
.endif
|
|
|
|
.if target(do-configure)
|
2003-07-28 13:17:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} do-configure
|
2000-06-16 19:10:41 -04:00
|
|
|
.else
|
2000-01-26 18:11:08 -05:00
|
|
|
# What CONFIGURE normally does
|
2008-05-11 15:36:12 -04:00
|
|
|
. for _c in ${CONFIGURE_STYLE:U}
|
|
|
|
. if defined(MOD${_c}_configure)
|
|
|
|
@${MOD${_c}_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)
|
2003-07-28 13:17:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${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
|
|
|
|
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"
|
2002-04-24 17:29:26 -04:00
|
|
|
@${ECHO_MSG} "===> Building for ${FULLPKGNAME}${_MASTER}"
|
2008-11-18 06:45:41 -05:00
|
|
|
. if ${VMEM_WARNING:L} == "yes"
|
2001-11-11 08:57:32 -05:00
|
|
|
@echo ""; \
|
|
|
|
echo "*** WARNING: you may see an error such as"; \
|
|
|
|
echo "*** virtual memory exhausted"; \
|
|
|
|
echo "*** when building this package. If you do you must increase"; \
|
|
|
|
echo "*** your limits. See the man page for your shell and look"; \
|
|
|
|
echo "*** for the 'limit' or 'ulimit' command. You may also want to"; \
|
|
|
|
echo "*** see the login.conf(5) manual page."; \
|
|
|
|
echo "*** Some examples are: "; \
|
2002-03-10 01:02:16 -05:00
|
|
|
echo "*** csh(1) and tcsh(1): limit datasize <kbytes of memory>"; \
|
2001-11-11 08:57:32 -05:00
|
|
|
echo "*** ksh(1), zsh(1) and bash(1): ulimit -d <kbytes of memory>"; \
|
2003-07-18 15:02:13 -04:00
|
|
|
echo ""
|
2008-11-18 06:45:41 -05:00
|
|
|
. endif
|
2000-02-04 06:09:33 -05:00
|
|
|
. if target(pre-build)
|
2003-07-28 13:17:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} pre-build
|
2000-02-04 06:09:33 -05:00
|
|
|
. endif
|
|
|
|
. if target(do-build)
|
2003-07-28 13:17:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${MAKE} do-build
|
2000-02-04 06:09:33 -05:00
|
|
|
. else
|
2000-01-26 18:11:08 -05:00
|
|
|
# What BUILD normally does:
|
2006-11-27 10:28:40 -05:00
|
|
|
@cd ${WRKBUILD} && exec ${_SYSTRACE_CMD} ${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)
|
2003-07-28 13:17:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${_SYSTRACE_CMD} ${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-10-03 04:53:18 -04:00
|
|
|
${_REGRESS_COOKIE}: ${_BUILD_COOKIE}
|
|
|
|
.if ${NO_REGRESS:L} == "no"
|
2002-04-24 17:29:26 -04:00
|
|
|
@${ECHO_MSG} "===> Regression check for ${FULLPKGNAME}${_MASTER}"
|
2001-10-03 04:53:18 -04:00
|
|
|
. if target(pre-regress)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} pre-regress
|
|
|
|
. endif
|
|
|
|
. if target(do-regress)
|
2008-08-20 06:33:50 -04:00
|
|
|
@${REGRESS_STATUS_IGNORE}cd ${.CURDIR} && exec 3>&1 && exit `exec 4>&1 1>&3; \
|
|
|
|
(exec; set +e; ${MAKE} do-regress; \
|
|
|
|
echo $$? >&4) 2>&1 ${REGRESS_LOG}`
|
2001-10-03 04:53:18 -04:00
|
|
|
. else
|
|
|
|
# What REGRESS normally does:
|
2008-08-20 06:33:50 -04:00
|
|
|
@${REGRESS_STATUS_IGNORE}cd ${WRKBUILD} && exec 3>&1 && exit `exec 4>&1 1>&3; \
|
|
|
|
(exec; set +e; ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} \
|
|
|
|
${ALL_REGRESS_FLAGS} -f ${MAKE_FILE} ${REGRESS_TARGET}; \
|
|
|
|
echo $$? >&4) 2>&1 ${REGRESS_LOG}`
|
2001-10-03 04:53:18 -04:00
|
|
|
# End of REGRESS
|
|
|
|
. endif
|
|
|
|
. if target(post-regress)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-regress
|
|
|
|
. endif
|
|
|
|
.else
|
|
|
|
@echo 1>&2 "No regression check for ${FULLPKGNAME}"
|
|
|
|
.endif
|
|
|
|
@${_MAKE_COOKIE} $@
|
|
|
|
|
2006-11-22 07:40:50 -05:00
|
|
|
${_FAKE_COOKIE}: ${_BUILD_COOKIE}
|
2002-04-24 17:29:26 -04:00
|
|
|
@${ECHO_MSG} "===> Faking installation for ${FULLPKGNAME}${_MASTER}"
|
2006-11-09 03:29:47 -05:00
|
|
|
@if [ x`${SUDO} /bin/sh -c umask` != x${DEF_UMASK} ]; then \
|
|
|
|
echo >&2 "Error: your umask is \"`/bin/sh -c umask`"\".; \
|
2000-03-03 16:24:50 -05:00
|
|
|
exit 1; \
|
|
|
|
fi
|
2000-05-16 13:06:46 -04:00
|
|
|
@${SUDO} install -d -m 755 -o root -g wheel ${WRKINST}
|
2007-05-25 09:07:41 -04:00
|
|
|
@cat ${MTREE_FILE}| \
|
2006-11-22 07:40:50 -05:00
|
|
|
${SUDO} /usr/sbin/mtree -U -e -d -n -p ${WRKINST} >/dev/null
|
2006-10-15 15:29:06 -04:00
|
|
|
.for _p in ${PROTECT_MOUNT_POINTS}
|
2002-04-09 19:55:11 -04:00
|
|
|
@${SUDO} mount -u -r ${_p}
|
2006-10-15 15:29:06 -04:00
|
|
|
.endfor
|
2008-05-11 15:36:12 -04:00
|
|
|
.for _m in ${MODULES:T:U}
|
|
|
|
. if defined(MOD${_m}_pre-fake)
|
|
|
|
@${MOD${_m}_pre-fake}
|
2006-10-15 15:29:06 -04:00
|
|
|
. endif
|
|
|
|
.endfor
|
2000-06-02 07:42:53 -04:00
|
|
|
|
2006-10-15 15:29:06 -04:00
|
|
|
.if target(pre-fake)
|
2006-11-27 10:28:40 -05:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${_SYSTRACE_CMD} \
|
|
|
|
${MAKE} pre-fake ${_FAKE_SETUP}
|
2006-10-15 15:29:06 -04:00
|
|
|
.endif
|
2000-05-16 13:06:46 -04:00
|
|
|
@${SUDO} ${_MAKE_COOKIE} ${_INSTALL_PRE_COOKIE}
|
2006-10-15 15:29:06 -04:00
|
|
|
.if target(pre-install)
|
2006-11-27 10:28:40 -05:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${_SYSTRACE_CMD} \
|
|
|
|
${MAKE} pre-install ${_FAKE_SETUP}
|
2006-10-15 15:29:06 -04:00
|
|
|
.endif
|
|
|
|
.if target(do-install)
|
2006-11-27 10:28:40 -05:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${_SYSTRACE_CMD} \
|
|
|
|
${MAKE} do-install ${_FAKE_SETUP}
|
2006-10-15 15:29:06 -04:00
|
|
|
.else
|
2000-03-03 16:24:50 -05:00
|
|
|
# What FAKE normally does:
|
2006-11-27 10:28:40 -05:00
|
|
|
@cd ${WRKBUILD} && exec ${SUDO} ${_SYSTRACE_CMD} \
|
|
|
|
${SETENV} ${MAKE_ENV} ${_FAKE_SETUP} \
|
2008-01-04 12:48:33 -05:00
|
|
|
${MAKE_PROGRAM} ${ALL_FAKE_FLAGS} -f ${MAKE_FILE} ${FAKE_TARGET}
|
2000-03-03 16:24:50 -05:00
|
|
|
# End of FAKE.
|
2006-10-15 15:29:06 -04:00
|
|
|
.endif
|
|
|
|
.if target(post-install)
|
2003-07-28 13:17:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${_SYSTRACE_CMD} ${MAKE} post-install ${_FAKE_SETUP}
|
2006-10-15 15:29:06 -04:00
|
|
|
.endif
|
|
|
|
.for _p in ${PROTECT_MOUNT_POINTS}
|
2002-04-09 19:55:11 -04:00
|
|
|
@${SUDO} mount -u -w ${_p}
|
2006-10-15 15:29:06 -04:00
|
|
|
.endfor
|
2001-03-28 06:32:29 -05:00
|
|
|
@${SUDO} ${_MAKE_COOKIE} $@
|
2000-03-03 16:24:50 -05:00
|
|
|
|
2005-09-05 08:43:07 -04:00
|
|
|
.if empty(PLIST_DB)
|
2006-12-11 06:05:43 -05:00
|
|
|
_register_plist =:
|
2005-09-05 08:43:07 -04:00
|
|
|
.else
|
2007-12-01 09:44:47 -05:00
|
|
|
_register_plist = mkdir -p ${PLIST_DB} && perl ${PORTSDIR}/infrastructure/package/register-plist ${PLIST_DB}
|
2005-09-05 08:43:07 -04:00
|
|
|
.endif
|
2007-04-03 06:14:14 -04:00
|
|
|
.if ${CHECK_LIB_DEPENDS:L} == "yes"
|
2007-12-01 09:44:47 -05:00
|
|
|
_check_lib_depends = perl ${PORTSDIR}/infrastructure/package/check-lib-depends -d ${_PKG_REPO} -B ${WRKINST}
|
2007-04-03 06:14:14 -04:00
|
|
|
.else
|
|
|
|
_check_lib_depends =:
|
|
|
|
.endif
|
2005-09-05 08:43:07 -04:00
|
|
|
|
2007-01-15 08:43:52 -05:00
|
|
|
CLEAN_PLIST_OUTPUT?=No
|
|
|
|
.if ${CLEAN_PLIST_OUTPUT:L} == "yes"
|
|
|
|
_plist_header=echo "@+++ new plist"
|
|
|
|
_plist_footer=echo "@--- end plist"
|
|
|
|
.else
|
|
|
|
_plist_header=:
|
|
|
|
_plist_footer=:
|
|
|
|
.endif
|
|
|
|
|
2005-09-24 15:46:56 -04:00
|
|
|
print-plist:
|
2007-01-15 08:43:52 -05:00
|
|
|
@${_plist_header}; ${PKG_CMD} -n -q ${PKG_ARGS${SUBPACKAGE}} ${_PACKAGE_COOKIE${SUBPACKAGE}}; ${_plist_footer}
|
2005-09-24 15:46:56 -04:00
|
|
|
|
2006-12-18 07:52:34 -05:00
|
|
|
print-plist-with-depends:
|
2007-06-03 18:30:25 -04:00
|
|
|
@${_plist_header}; \
|
|
|
|
if a=`SUBPACKAGE=${SUBPACKAGE} ${MAKE} _print-package-args`; \
|
|
|
|
then \
|
|
|
|
${PKG_CMD} -n -q $$a ${PKG_ARGS${SUBPACKAGE}} ${_PACKAGE_COOKIE${SUBPACKAGE}}; \
|
|
|
|
else \
|
|
|
|
exit 1; \
|
|
|
|
fi ; \
|
|
|
|
${_plist_footer}
|
2006-12-18 07:52:34 -05:00
|
|
|
|
2006-11-28 15:20:25 -05:00
|
|
|
print-plist-all:
|
|
|
|
.for _S in ${MULTI_PACKAGES}
|
2006-12-11 10:52:14 -05:00
|
|
|
@${ECHO_MSG} "===> ${FULLPKGNAME${_S}}"
|
2007-01-15 08:43:52 -05:00
|
|
|
@${_plist_header}; ${PKG_CMD} -n -q ${PKG_ARGS${_S}} ${_PACKAGE_COOKIE${_S}};${_plist_footer}
|
2006-11-28 15:20:25 -05:00
|
|
|
.endfor
|
|
|
|
|
2006-12-18 07:52:34 -05:00
|
|
|
print-plist-all-with-depends:
|
|
|
|
.for _S in ${MULTI_PACKAGES}
|
|
|
|
@${ECHO_MSG} "===> ${FULLPKGNAME${_S}}"
|
2007-06-03 18:30:25 -04:00
|
|
|
@${_plist_header}; \
|
|
|
|
if a=`SUBPACKAGE=${_S} ${MAKE} _print-package-args`; \
|
|
|
|
then \
|
|
|
|
${PKG_CMD} -n -q $$a ${PKG_ARGS${_S}} ${_PACKAGE_COOKIE${_S}}; \
|
|
|
|
else \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
${_plist_footer}
|
2006-12-18 07:52:34 -05:00
|
|
|
.endfor
|
|
|
|
|
2005-09-24 15:46:56 -04:00
|
|
|
print-plist-contents:
|
2007-01-15 08:43:52 -05:00
|
|
|
@${_plist_header}; ${PKG_CMD} -n -Q ${PKG_ARGS${SUBPACKAGE}} ${_PACKAGE_COOKIE${SUBPACKAGE}};${_plist_footer}
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
|
2006-11-28 15:20:25 -05:00
|
|
|
_internal-package-only: ${_PACKAGE_COOKIES}
|
2005-09-24 15:46:56 -04:00
|
|
|
|
2006-11-28 15:20:25 -05:00
|
|
|
_internal-subpackage: ${_PACKAGE_COOKIES${SUBPACKAGE}
|
2000-02-04 06:09:33 -05:00
|
|
|
|
2008-05-15 05:51:17 -04:00
|
|
|
# Separate target for each file fetch-all will retrieve
|
2000-02-04 06:09:33 -05:00
|
|
|
|
2008-05-18 06:05:21 -04:00
|
|
|
.for _F in ${MAKESUMFILES:S@^@${DISTDIR}/@}
|
2000-02-04 06:09:33 -05:00
|
|
|
${_F}:
|
2003-07-25 08:46:26 -04:00
|
|
|
. if ${FETCH_MANUALLY:L} != "no"
|
2008-05-18 05:58:09 -04:00
|
|
|
. if !empty(_MISSING_FILES)
|
|
|
|
@echo "*** You're missing files: ${_MISSING_FILES}"
|
|
|
|
. endif
|
2003-07-25 08:46:26 -04:00
|
|
|
. for _M in ${FETCH_MANUALLY}
|
|
|
|
@echo "*** ${_M}"
|
|
|
|
. endfor
|
|
|
|
@exit 1
|
|
|
|
. else
|
2006-09-17 15:08:59 -04:00
|
|
|
@lock=${_F:T}.dist; ${_SIMPLE_LOCK}; mkdir -p ${_F:H}; \
|
2000-02-04 06:09:33 -05:00
|
|
|
cd ${_F:H}; \
|
2008-05-04 08:53:14 -04:00
|
|
|
test -f ${_F:T} && exit 0; \
|
2008-06-05 21:17:13 -04: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 \
|
2005-09-04 18:32:37 -04:00
|
|
|
${ECHO_MSG} ">> Fetch $${site}$$f."; \
|
2003-07-14 09:33:04 -04:00
|
|
|
if ${FETCH_CMD} $${site}$$f; then \
|
2005-01-04 15:44:45 -05:00
|
|
|
file=${_F:S@^${DISTDIR}/@@}; \
|
2005-01-06 14:30:34 -05:00
|
|
|
ck=`cd ${DISTDIR} && ${_size_fragment}`; \
|
2006-10-18 12:53:04 -04:00
|
|
|
if [ ! -f ${CHECKSUM_FILE} ]; then \
|
|
|
|
${ECHO_MSG} ">> Checksum file does not exist"; \
|
|
|
|
exit 0; \
|
|
|
|
elif grep -q "^$$ck\$$" ${CHECKSUM_FILE}; then \
|
2005-01-04 15:44:45 -05:00
|
|
|
${ECHO_MSG} ">> Size matches for ${_F}"; \
|
|
|
|
exit 0; \
|
|
|
|
else \
|
|
|
|
if grep -q "SIZE ($$file)" ${CHECKSUM_FILE}; then \
|
|
|
|
${ECHO_MSG} ">> Size does not match for ${_F}"; \
|
2006-03-24 14:28:13 -05:00
|
|
|
test `{ wc -c "$$file" 2>/dev/null || echo 0 ; }| awk '{print $$1}'` -lt 30000 && rm -f $$file; \
|
2005-01-04 15:44:45 -05:00
|
|
|
else \
|
|
|
|
${ECHO_MSG} ">> No size recorded for ${_F}"; \
|
|
|
|
exit 0; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
2000-02-04 06:09:33 -05:00
|
|
|
fi; \
|
|
|
|
done; exit 1
|
2003-07-25 08:46:26 -04:00
|
|
|
. endif
|
2000-02-04 06:09:33 -05:00
|
|
|
.endfor
|
|
|
|
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
.for _l _o in ${_PACKAGE_LINKS}
|
2006-11-28 11:28:56 -05:00
|
|
|
${PACKAGE_REPOSITORY}/${_l}: ${PACKAGE_REPOSITORY}/${_o}
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
@echo "Link to $@"
|
|
|
|
@mkdir -p ${@D}
|
|
|
|
@rm -f $@
|
|
|
|
@ln $? $@ 2>/dev/null || \
|
|
|
|
cp -p $? $@
|
2003-07-18 14:34:26 -04:00
|
|
|
.endfor
|
1996-06-03 18:47:10 -04:00
|
|
|
|
|
|
|
# Cleaning up
|
|
|
|
|
Lock infrastructure for the ports tree.
If LOCK_CMD, UNLOCK_CMD and LOCK_DIR are defined, those are used to
perform `big-lock' style locking on top-level targets, such as
extract, patch, build.
The internals of the ports tree do not use any finer grained locking.
Those top-level targets now redirect to _internal-targets, without
any behavioral change.
Any dependency computation will recurse to another directory, and
invoke a top-level target, thus triggering the locking of the dependency.
All locking is done using FULLPKGNAME, except for fetch with uses
the DISTFILES names for independent files.
If no locking is desired, the top-level targets simply redirect to
the _internal-targets. The cost is close to zero: make just needs to
handle an extra ~20 phony targets.
Much testing and approval by brad@, naddy@, pval@, fries@ and other
people. Thanks to niklas@ for some useful discussion.
2004-07-18 18:44:36 -04:00
|
|
|
_internal-clean:
|
2003-08-01 04:07:30 -04:00
|
|
|
.if ${_clean:L:Mdepends} && ${_CLEANDEPENDS:L} == "yes"
|
2006-11-26 12:45:59 -05:00
|
|
|
@${MAKE} all-dir-depends|tsort -r|${_zap_last_line}|while read subdir; do \
|
2003-07-30 15:31:31 -04:00
|
|
|
${_flavor_fragment}; \
|
2006-09-17 15:08:59 -04:00
|
|
|
eval $$toset ${MAKE} _CLEANDEPENDS=No clean; \
|
2003-07-30 15:31:31 -04:00
|
|
|
done
|
2005-11-11 06:31:53 -05:00
|
|
|
.endif
|
2001-08-12 07:33:10 -04:00
|
|
|
@${ECHO_MSG} "===> Cleaning for ${FULLPKGNAME${SUBPACKAGE}}"
|
2005-11-11 06:31:53 -05: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
|
2005-11-11 06:31:53 -05:00
|
|
|
.endif
|
2008-08-20 04:56:53 -04:00
|
|
|
.if ${_clean:L:Mwork} || (${_clean:L:Mbuild} && ${SEPARATE_BUILD:L} == "no")
|
2005-11-11 06:31:53 -05:00
|
|
|
. if ${_clean:L:Mflavors}
|
2001-08-16 10:49:31 -04:00
|
|
|
@for i in ${.CURDIR}/w-*; do \
|
|
|
|
if [ -L $$i ]; then ${SUDO} rm -rf `readlink $$i`; fi; \
|
|
|
|
${SUDO} rm -rf $$i; \
|
|
|
|
done
|
2005-11-11 06:31:53 -05:00
|
|
|
. else
|
2000-02-04 06:09:33 -05:00
|
|
|
@if [ -L ${WRKDIR} ]; then rm -rf `readlink ${WRKDIR}`; fi
|
|
|
|
@rm -rf ${WRKDIR}
|
2003-07-18 15:02:13 -04:00
|
|
|
. endif
|
2008-08-20 04:56:53 -04:00
|
|
|
.elif ${_clean:L:Mbuild} && ${SEPARATE_BUILD:L} != "no"
|
|
|
|
@rm -rf ${WRKBUILD} ${_CONFIGURE_COOKIE} ${_BUILD_COOKIE}
|
2005-11-11 06:31:53 -05:00
|
|
|
.endif
|
|
|
|
.if ${_clean:L:Mdist}
|
2001-08-24 10:39:36 -04:00
|
|
|
@${ECHO_MSG} "===> Dist cleaning for ${FULLPKGNAME${SUBPACKAGE}}"
|
2007-02-16 14:08:54 -05:00
|
|
|
@if cd ${DISTDIR} 2>/dev/null; then \
|
2008-05-15 05:51:17 -04:00
|
|
|
rm -f ${MAKESUMFILES}; \
|
2001-08-24 10:39:36 -04:00
|
|
|
fi
|
2008-05-15 05:51:17 -04:00
|
|
|
. if !empty(DIST_SUBDIR)
|
2003-07-18 15:02:13 -04:00
|
|
|
-@rmdir ${FULLDISTDIR}
|
2001-08-16 10:49:31 -04:00
|
|
|
. endif
|
2005-11-11 06:31:53 -05:00
|
|
|
.endif
|
|
|
|
.if ${_clean:L:Minstall}
|
|
|
|
. if ${_clean:L:Msub}
|
2006-11-28 15:40:55 -05:00
|
|
|
-${SUDO} ${PKG_DELETE} ${PKGNAMES}
|
2005-11-11 06:31:53 -05:00
|
|
|
. else
|
2004-01-28 15:16:14 -05:00
|
|
|
-${SUDO} ${PKG_DELETE} ${FULLPKGNAME${SUBPACKAGE}}
|
2001-08-16 10:49:31 -04:00
|
|
|
. endif
|
2005-11-11 06:31:53 -05:00
|
|
|
.endif
|
|
|
|
.if ${_clean:L:Mpackages} || ${_clean:L:Mpackage} && ${_clean:L:Msub}
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
rm -f ${_PACKAGE_COOKIES}
|
2006-11-28 15:20:25 -05:00
|
|
|
.elif ${_clean:L:Mpackage}
|
|
|
|
rm -f ${_PACKAGE_COOKIES${SUBPACKAGE}}
|
2005-11-11 06:31:53 -05:00
|
|
|
.endif
|
|
|
|
.if ${_clean:L:Mreadmes}
|
2006-12-01 12:33:16 -05:00
|
|
|
rm -f ${_READMES}
|
2005-11-11 06:31:53 -05:00
|
|
|
.endif
|
|
|
|
.if ${_clean:L:Mbulk}
|
2002-04-17 11:58:48 -04:00
|
|
|
rm -f ${_BULK_COOKIE}
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
2007-05-21 07:18:10 -04:00
|
|
|
.if ${_clean:L:Mplist}
|
2007-05-25 09:07:41 -04:00
|
|
|
. for _d in ${PLIST_DB:S/:/ /}
|
|
|
|
cd ${_d} && rm -f ${PKGNAMES}
|
|
|
|
. endfor
|
2007-05-21 07:18:10 -04:00
|
|
|
.endif
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2000-03-03 12:51:37 -05:00
|
|
|
# mirroring utilities
|
|
|
|
fetch-makefile:
|
2007-07-28 08:58:34 -04:00
|
|
|
@mk=`mktemp ${TMPDIR}/mk.XXXXXXX`; \
|
2008-05-04 08:58:03 -04:00
|
|
|
trap "rm -f $$mk" 0 1 2 3 13 15; \
|
2008-05-15 05:51:17 -04:00
|
|
|
if ${MAKE} _fetch-makefile >$$mk; then \
|
2007-07-28 08:58:34 -04:00
|
|
|
cat $$mk >>${_FETCH_MAKEFILE}; \
|
|
|
|
else \
|
|
|
|
echo >&2 "Problem in ${PKGPATH}"; \
|
2008-05-04 08:58:03 -04:00
|
|
|
fi
|
2004-07-12 04:45:32 -04:00
|
|
|
|
2007-06-30 10:43:49 -04:00
|
|
|
mirror-maker-fetch:
|
|
|
|
@mk=`mktemp ${TMPDIR}/mk.XXXXXXXX`; ${MAKE} fetch-makefile >$$mk; \
|
|
|
|
echo "Check and remove $$mk"; \
|
2007-06-30 10:48:04 -04:00
|
|
|
cd ${DISTDIR} && \
|
|
|
|
${MAKE} -f $$mk all FETCH=${PORTSDIR}/infrastructure/fetch/fetch-all
|
2007-06-30 10:43:49 -04:00
|
|
|
|
2004-07-12 04:45:32 -04:00
|
|
|
_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-09-30 08:26:57 -04:00
|
|
|
. if ${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
|
2001-09-30 08:26:57 -04:00
|
|
|
. if ${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
|
2008-07-26 07:16:04 -04:00
|
|
|
@echo ":: ${_FETCH_MAKEFILE_NAMES}"
|
2003-07-30 15:31:31 -04:00
|
|
|
# write generic package dependencies
|
2008-07-26 07:16:04 -04:00
|
|
|
@echo ".PHONY: ${_FETCH_MAKEFILE_NAMES}"
|
2003-07-30 15:31:31 -04:00
|
|
|
. if ${RECURSIVE_FETCH_LIST:L} == "yes"
|
2008-07-26 07:16:04 -04:00
|
|
|
@echo "${_FETCH_MAKEFILE_NAMES}: ${MAKESUMFILES} "`_FULL_PACKAGE_NAME=Yes ${MAKE} full-all-depends|fgrep -v ${PKGPATH}/`
|
2003-07-30 15:31:31 -04:00
|
|
|
. else
|
2008-07-26 07:16:04 -04:00
|
|
|
@echo "${_FETCH_MAKEFILE_NAMES}: ${MAKESUMFILES}"
|
2003-07-30 15:31:31 -04:00
|
|
|
. endif
|
2001-06-30 15:06:09 -04:00
|
|
|
.endif
|
2008-05-15 05:51:17 -04:00
|
|
|
.if !empty(MAKESUMFILES)
|
|
|
|
. for _F in ${MAKESUMFILES}
|
2006-11-17 19:15:33 -05:00
|
|
|
@: $${_DONE_FILES:=/dev/null}; if ! fgrep -q "|${_F}|" $${_DONE_FILES}; then \
|
2003-12-15 12:56:40 -05:00
|
|
|
echo "|${_F}|" >>$${_DONE_FILES}; \
|
2003-12-23 19:08:48 -05:00
|
|
|
${MAKE} _fetch-onefile _file=${_F}; \
|
2003-12-15 12:56:40 -05:00
|
|
|
fi
|
|
|
|
. endfor
|
|
|
|
.endif
|
|
|
|
@echo
|
|
|
|
|
|
|
|
|
|
|
|
_fetch-onefile:
|
2003-12-23 19:08:48 -05:00
|
|
|
# XXX loop so that M${_F} will work
|
|
|
|
.for _F in ${_file}
|
2000-03-03 12:51:37 -05:00
|
|
|
@echo '${_F}: $$F'
|
2008-05-18 07:22:14 -04:00
|
|
|
@echo '\t@lock=$${@F}; $${SIMPLE_LOCK}; \\'
|
|
|
|
@echo -n '\t MAINTAINER="${MAINTAINER}" '
|
2004-02-07 17:36:13 -05:00
|
|
|
. if !empty(DIST_SUBDIR)
|
2000-03-03 12:51:37 -05:00
|
|
|
@echo -n 'DIST_SUBDIR="${DIST_SUBDIR}" '
|
2003-12-23 19:08:48 -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\" \\"
|
2003-12-23 19:08:48 -05:00
|
|
|
. if ${FETCH_MANUALLY:L} != "no"
|
2003-08-28 12:19:00 -04:00
|
|
|
@echo '\t FETCH_MANUALLY="Yes" \\'
|
2003-12-23 19:08:48 -05:00
|
|
|
. endif
|
2008-05-15 05:51:17 -04:00
|
|
|
. if !defined(NO_CHECKSUM) && !empty(MAKESUMFILES:M${_F})
|
2007-03-30 09:41:44 -04:00
|
|
|
@if [ ! -f ${CHECKSUM_FILE} ]; then \
|
|
|
|
echo >&2 "Missing checksum file: ${CHECKSUM_FILE}"; \
|
2000-03-03 12:51:37 -05:00
|
|
|
echo '\t ERROR="no checksum file" \\'; \
|
|
|
|
else \
|
|
|
|
for c in ${PREFERRED_CIPHERS}; do \
|
2007-03-30 09:41:44 -04:00
|
|
|
if set -- `grep -i "^$$c (${_F})" ${CHECKSUM_FILE}`; then break; fi; \
|
2000-03-03 12:51:37 -05:00
|
|
|
done; \
|
|
|
|
case "$$4" in \
|
|
|
|
"") \
|
|
|
|
echo >&2 "No checksum recorded for ${_F}."; \
|
|
|
|
echo '\t ERROR="no checksum" \\';; \
|
|
|
|
"IGNORE") \
|
2007-03-30 09:41:44 -04:00
|
|
|
echo >&2 "Checksum for ${_F} is IGNORE in ${CHECKSUM_FILE}"; \
|
2000-03-03 12:51:37 -05:00
|
|
|
echo >&2 'but file is not in $${IGNORE_FILES}'; \
|
|
|
|
echo '\t ERROR="IGNORE inconsistent" \\';; \
|
|
|
|
*) \
|
2007-03-28 11:45:03 -04:00
|
|
|
echo "\t CIPHER=\"$$c\" CKSUM=\"$$4\" CHECK=\""$$@"\" \\";; \
|
2000-03-03 12:51:37 -05:00
|
|
|
esac; \
|
|
|
|
fi
|
2003-12-23 19:08:48 -05:00
|
|
|
. endif
|
2003-12-15 12:56:40 -05:00
|
|
|
@echo '\t $${EXEC} $${FETCH} "$$@"'
|
2003-12-23 19:08:48 -05:00
|
|
|
.endfor
|
1998-09-07 18:33:19 -04:00
|
|
|
|
2003-07-18 15:02:13 -04:00
|
|
|
|
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| \
|
2001-11-22 11:02:26 -05:00
|
|
|
# description-file|maintainer|categories|lib-deps|build-deps|run-deps| \
|
|
|
|
# for-arch|package-cdrom|package-ftp|distfiles-cdrom|distfiles-ftp
|
1996-06-03 18:47:10 -04:00
|
|
|
#
|
2006-11-28 13:25:42 -05:00
|
|
|
describe:
|
|
|
|
.for _S in ${MULTI_PACKAGES}
|
2006-11-30 18:08:07 -05:00
|
|
|
@echo -n "${FULLPKGNAME${_S}}|${FULLPKGPATH${_S}}|"
|
2006-11-28 13:25:42 -05:00
|
|
|
. if ${PREFIX${_S}} == ${LOCALBASE}
|
2000-03-28 04:27:03 -05:00
|
|
|
@echo -n "|"
|
2006-11-28 13:25:42 -05:00
|
|
|
. else
|
|
|
|
@echo -n "${PREFIX${_S}}|"
|
|
|
|
. endif
|
2007-05-27 07:53:39 -04:00
|
|
|
@echo -n ${_COMMENT${_S}:S/^"//:S/"$//:S/^'//:S/'$//:Q}"|"; \
|
2006-11-28 13:25:42 -05:00
|
|
|
if [ -f ${DESCR${_S}} ]; then \
|
|
|
|
echo -n "${DESCR${_S}: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; \
|
2006-11-28 13:25:42 -05:00
|
|
|
echo -n "${MAINTAINER}|${CATEGORIES${_S}}|"
|
|
|
|
. for _d in LIB BUILD RUN
|
|
|
|
@echo -n '${_${_d}_DEP3${_S}:C/ +/ /g}'| tr '\040' '\012'|sort -u|tr '\012' '\040' | sed -e 's, $$,,'
|
2006-11-26 15:02:28 -05:00
|
|
|
@echo -n '|'
|
2006-11-28 13:25:42 -05:00
|
|
|
. endfor
|
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
|
|
|
|
2006-11-28 13:25:42 -05:00
|
|
|
. if defined(_BAD_LICENSING)
|
2001-09-30 08:26:57 -04:00
|
|
|
@echo "?|?|?|?"
|
somewhat big change: zap the package-link/package-unlink stuff, turn these
into real targets.
- now make package will create missing ftp/cdrom links when PERMIT says so.
- PKG_ARCH=* packages get built into packages/no-arch, and linked from
elsewhere.
Everything gets based off PACKAGE_REPOSITORY, PKGREPOSITORYBASE and friends
get ditched.
All `package' targets go through the same routine: iterate through every
subpackage with PACKAGING set.
This includes describe, lib-depends-check, package, dump-vars, install-all,
which will iterate through subdescribe, sublib-depends-check, subpackage,
subdump-vars, and install.
(names are subject to change).
Much simpler logic, plus hey, you get an install-all target !
Might be some minor breakage, most stuff appear to work just fine...
2006-09-17 18:08:19 -04:00
|
|
|
. else
|
2006-11-28 13:25:42 -05:00
|
|
|
. if ${PERMIT_PACKAGE_CDROM${_S}:L} == "yes"
|
|
|
|
@echo -n "y|"
|
|
|
|
. else
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "n|"
|
2006-11-28 13:25:42 -05:00
|
|
|
. endif
|
|
|
|
. if ${PERMIT_PACKAGE_FTP${_S}:L} == "yes"
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "y|"
|
2006-11-28 13:25:42 -05:00
|
|
|
. else
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "n|"
|
2006-11-28 13:25:42 -05:00
|
|
|
. endif
|
|
|
|
. if ${PERMIT_DISTFILES_CDROM:L} == "yes"
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "y|"
|
2006-11-28 13:25:42 -05:00
|
|
|
. else
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "n|"
|
2006-11-28 13:25:42 -05:00
|
|
|
. endif
|
|
|
|
. if ${PERMIT_DISTFILES_FTP:L} == "yes"
|
2000-03-04 09:40:21 -05:00
|
|
|
@echo "y"
|
2006-11-28 13:25:42 -05:00
|
|
|
. else
|
2000-03-04 09:40:21 -05:00
|
|
|
@echo "n"
|
2006-11-28 13:25:42 -05:00
|
|
|
. endif
|
2003-07-14 09:33:04 -04:00
|
|
|
. endif
|
2006-11-28 13:25:42 -05:00
|
|
|
.endfor
|
2003-07-30 15:31:31 -04:00
|
|
|
|
2006-12-01 12:33:16 -05:00
|
|
|
readme:
|
2006-12-02 06:27:46 -05:00
|
|
|
@tmpdir=`mktemp -d ${TMPDIR}/readme.XXXXXX`; \
|
|
|
|
trap 'rm -r $$tmpdir' 0 1 2 3 13 15; \
|
|
|
|
cd ${.CURDIR} && ${MAKE} TMPDIR=$$tmpdir README_NAME=${README_NAME} \
|
|
|
|
${READMES_TOP}/${PKGPATH}/${FULLPKGNAME${SUBPACKAGE}}.html
|
1999-09-30 13:28:31 -04:00
|
|
|
|
2006-12-01 12:33:16 -05:00
|
|
|
readmes:
|
2006-12-02 06:27:46 -05:00
|
|
|
@tmpdir=`mktemp -d ${TMPDIR}/readme.XXXXXX`; \
|
|
|
|
trap 'rm -r $$tmpdir' 0 1 2 3 13 15; \
|
|
|
|
cd ${.CURDIR} && ${MAKE} TMPDIR=$$tmpdir README_NAME=${README_NAME} \
|
|
|
|
${_READMES}
|
2006-12-01 12:33:16 -05:00
|
|
|
|
|
|
|
.for _S in ${MULTI_PACKAGES}
|
2006-12-02 06:27:46 -05:00
|
|
|
${READMES_TOP}/${PKGPATH}/${FULLPKGNAME${_S}}.html:
|
|
|
|
@mkdir -p ${@D}
|
2007-09-16 17:38:34 -04:00
|
|
|
@echo ${_COMMENT${_S}:Q} | ${HTMLIFY} >${TMPDIR}/comment${_S}
|
2006-12-02 06:08:49 -05:00
|
|
|
@echo ${FULLPKGNAME${_S}} | ${HTMLIFY} > ${TMPDIR}/pkgname${_S}
|
2006-12-01 12:33:16 -05:00
|
|
|
. if defined(HOMEPAGE)
|
2006-12-02 06:08:49 -05:00
|
|
|
@echo 'See <a href="${HOMEPAGE}">${HOMEPAGE}</a> for details.' >${TMPDIR}/home${_S}
|
2006-12-01 12:33:16 -05:00
|
|
|
. else
|
2006-12-02 06:08:49 -05:00
|
|
|
@echo "" >${TMPDIR}/home${_S}
|
2006-12-01 12:33:16 -05:00
|
|
|
. endif
|
2006-12-02 05:27:40 -05:00
|
|
|
. if ${MULTI_PACKAGES} != "-"
|
2006-12-02 06:08:49 -05:00
|
|
|
@echo "<h2>Part of a Multi-Package set</h2>" >${TMPDIR}/subpackages${_S}
|
|
|
|
@echo "<ul>" >>${TMPDIR}/subpackages${_S}
|
2006-12-01 12:33:16 -05:00
|
|
|
. for _T in ${MULTI_PACKAGES}
|
2006-12-02 06:08:49 -05:00
|
|
|
@echo "<li><a href=\"${FULLPKGNAME${_T}}.html\">${FULLPKGNAME${_T}}</a>" >>${TMPDIR}/subpackages${_S}
|
2003-08-02 05:53:27 -04:00
|
|
|
. endfor
|
2006-12-02 06:08:49 -05:00
|
|
|
@echo "</ul>" >>${TMPDIR}/subpackages${_S}
|
2003-08-02 05:53:27 -04:00
|
|
|
. else
|
2006-12-02 06:08:49 -05:00
|
|
|
@>${TMPDIR}/subpackages${_S}
|
2006-12-01 12:33:16 -05:00
|
|
|
. endif
|
|
|
|
. for _I in build run
|
|
|
|
. if !empty(_${_I:U}_DEP)
|
|
|
|
@cd ${.CURDIR} && SUBPACKAGE=${_S} ${MAKE} full-${_I}-depends _FULL_PACKAGE_NAME=Yes| \
|
2003-07-30 15:31:31 -04:00
|
|
|
while read n; do \
|
1999-09-30 17:07:09 -04:00
|
|
|
j=`dirname $$n|${HTMLIFY}`; k=`basename $$n|${HTMLIFY}`; \
|
2003-08-02 05:53:27 -04:00
|
|
|
echo "<li><a href=\"${PKGDEPTH}$$j/$$k.html\">$$k</a>"; \
|
2006-12-02 06:08:49 -05:00
|
|
|
done >${TMPDIR}/${_I}${_S}
|
2006-12-01 12:33:16 -05:00
|
|
|
. else
|
2006-12-02 06:08:49 -05:00
|
|
|
@echo "<li>none" >${TMPDIR}/${_I}${_S}
|
2006-12-01 12:33:16 -05:00
|
|
|
. endif
|
|
|
|
. endfor
|
2006-12-02 06:08:49 -05:00
|
|
|
@sed -e 's|%%PORT%%|'"`echo ${FULLPKGPATH${_S}} | ${HTMLIFY}`"'|g' \
|
|
|
|
-e '/%%PKG%%/r${TMPDIR}/pkgname${_S}' -e '//d' \
|
|
|
|
-e '/%%COMMENT%%/r${TMPDIR}/comment${_S}' -e '//d' \
|
|
|
|
-e '/%%DESCR%%/r${DESCR${_S}}' -e '//d' \
|
|
|
|
-e '/%%HOMEPAGE%%/r${TMPDIR}/home${_S}' -e '//d' \
|
|
|
|
-e '/%%BUILD_DEPENDS%%/r${TMPDIR}/build${_S}' -e '//d' \
|
|
|
|
-e '/%%RUN_DEPENDS%%/r${TMPDIR}/run${_S}' -e '//d' \
|
|
|
|
-e '/%%SUBPACKAGES%%/r${TMPDIR}/subpackages${_S}' -e '//d' \
|
|
|
|
${README_NAME} > $@
|
|
|
|
@rm -f ${TMPDIR}/*${_S}
|
2006-12-01 12:33:16 -05:00
|
|
|
.endfor
|
2003-07-30 15:31:31 -04:00
|
|
|
|
|
|
|
print-build-depends:
|
2006-11-20 04:59:11 -05:00
|
|
|
.if !empty(_BUILD_DEP)
|
1999-11-22 18:44:01 -05:00
|
|
|
@echo -n 'This port requires package(s) "'
|
2005-11-05 06:11:17 -05:00
|
|
|
@${MAKE} full-build-depends| ${_lines2list}
|
1999-11-22 18:44:01 -05:00
|
|
|
@echo '" to build.'
|
1999-09-30 13:34:22 -04:00
|
|
|
.endif
|
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
print-run-depends:
|
2006-11-20 04:59:11 -05:00
|
|
|
.if !empty(_RUN_DEP)
|
1999-11-22 18:44:01 -05:00
|
|
|
@echo -n 'This port requires package(s) "'
|
2005-11-05 06:11:17 -05:00
|
|
|
@${MAKE} full-run-depends| ${_lines2list}
|
1999-11-22 18:44:01 -05:00
|
|
|
@echo '" to run.'
|
1999-09-30 13:34:22 -04:00
|
|
|
.endif
|
|
|
|
|
2006-11-05 10:46:51 -05:00
|
|
|
# full-build-depends, full-all-depends, full-run-depends full-regress-depends
|
|
|
|
.for _i in build all run regress
|
2003-07-30 15:31:31 -04:00
|
|
|
full-${_i}-depends:
|
2005-11-05 06:11:17 -05:00
|
|
|
@${MAKE} ${_i}-dir-depends|${_sort_dependencies}|while read subdir; do \
|
2001-11-12 09:14:46 -05:00
|
|
|
${_flavor_fragment}; \
|
2003-07-30 15:31:31 -04:00
|
|
|
eval $$toset ${MAKE} _print-packagename ; \
|
2003-07-18 15:02:13 -04:00
|
|
|
done
|
2003-07-30 15:31:31 -04:00
|
|
|
.endfor
|
1999-11-15 13:37:58 -05:00
|
|
|
|
2003-08-11 16:10:41 -04:00
|
|
|
license-check:
|
2006-12-01 12:56:38 -05:00
|
|
|
.for _S in ${MULTI_PACKAGES}
|
|
|
|
. if ${PERMIT_PACKAGE_CDROM${_S}:L} == "yes" || \
|
|
|
|
${PERMIT_PACKAGE_FTP${_S}:L} == "yes"
|
|
|
|
@SUBPACKAGE=${_S} ${MAKE} all-dir-depends|${_sort_dependencies}|while read subdir; do \
|
2003-08-11 16:10:41 -04:00
|
|
|
${_flavor_fragment}; \
|
2006-12-01 12:56:38 -05:00
|
|
|
_MASTER_PERMIT_CDROM=${PERMIT_PACKAGE_CDROM${_S}:Q}; \
|
|
|
|
_MASTER_PERMIT_FTP=${PERMIT_PACKAGE_FTP${_S}:Q}; \
|
2003-08-11 16:10:41 -04:00
|
|
|
export _MASTER_PERMIT_CDROM _MASTER_PERMIT_FTP; \
|
|
|
|
eval $$toset ${MAKE} _license-check; \
|
|
|
|
done
|
2006-12-01 12:56:38 -05:00
|
|
|
. endif
|
|
|
|
.endfor
|
2003-08-11 16:10:41 -04:00
|
|
|
|
|
|
|
_license-check:
|
|
|
|
.for _i in FTP CDROM
|
2006-11-27 10:28:40 -05:00
|
|
|
. if defined(_MASTER_PERMIT_${_i}) && ${_MASTER_PERMIT_${_i}:L} == "yes" && \
|
|
|
|
${PERMIT_PACKAGE_${_i}:L} != "yes"
|
2003-08-11 16:10:41 -04:00
|
|
|
@echo >&2 "Warning: dependency ${PKGPATH} is not allowed for ${_i}"
|
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
2005-11-05 18:39:51 -05:00
|
|
|
# run-depends-list, build-depends-list, lib-depends-list
|
2003-07-30 15:31:31 -04:00
|
|
|
.for _i in RUN BUILD LIB
|
|
|
|
${_i:L}-depends-list:
|
2006-11-20 05:36:13 -05:00
|
|
|
. if !empty(_${_i}_DEP3)
|
2006-11-26 14:46:16 -05:00
|
|
|
@echo -n "This port requires \""
|
2006-11-26 15:02:28 -05:00
|
|
|
@echo -n '${_${_i}_DEP3:C/ +/ /g}'| tr '\040' '\012'|sort -u|tr '\012' '\040' | sed -e 's, $$,,'
|
2006-11-26 14:46:16 -05:00
|
|
|
@echo "\" for ${_i:L}."
|
2003-07-30 15:31:31 -04:00
|
|
|
. endif
|
|
|
|
.endfor
|
1999-09-30 13:28:31 -04:00
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
# recursive depend targets
|
1999-11-15 13:37:58 -05:00
|
|
|
|
2005-09-04 18:32:37 -04:00
|
|
|
print-package-signature:
|
|
|
|
@echo -n ${FULLPKGNAME${SUBPACKAGE}}
|
2006-11-20 05:36:13 -05:00
|
|
|
.if !empty(_DEPRUNLIBS)
|
2006-11-26 12:45:59 -05:00
|
|
|
@cd ${.CURDIR} && LIST_LIBS=`${MAKE} _list-port-libs` ${MAKE} _print-package-signature-lib _print-package-signature-run| \
|
2005-10-09 08:01:22 -04:00
|
|
|
sort -u| \
|
|
|
|
while read i; do echo -n ",$$i"; done
|
|
|
|
.else
|
2006-11-26 12:45:59 -05:00
|
|
|
@cd ${.CURDIR} && ${MAKE} _print-package-signature-run | \
|
2005-09-24 15:46:56 -04:00
|
|
|
sort -u| \
|
2005-09-04 18:32:37 -04:00
|
|
|
while read i; do echo -n ",$$i"; done
|
2005-10-09 08:01:22 -04:00
|
|
|
.endif
|
2005-09-04 18:32:37 -04:00
|
|
|
@echo
|
|
|
|
|
2004-11-21 05:43:48 -05:00
|
|
|
_print-package-args:
|
2006-11-19 07:37:55 -05:00
|
|
|
.for _i in ${RUN_DEPENDS${SUBPACKAGE}}
|
2005-11-02 15:30:12 -05:00
|
|
|
@echo '${_i}' |{ \
|
|
|
|
IFS=:; read dep pkg subdir target; \
|
|
|
|
${_flavor_fragment}; \
|
2006-12-08 05:19:08 -05:00
|
|
|
if default=`eval $$toset ${MAKE} _print-packagename`; then \
|
|
|
|
case "X$$pkg" in X) pkg=`echo $$default|${_version2default}`;; \
|
|
|
|
esac; \
|
|
|
|
echo "-P $$subdir:$$pkg:$$default"; \
|
|
|
|
else \
|
|
|
|
echo 1>&2 "Problem with dependency ${_i}"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2004-11-21 05:43:48 -05:00
|
|
|
}
|
|
|
|
.endfor
|
|
|
|
.if ${NO_SHARED_LIBS:L} != "yes"
|
2006-11-20 05:49:22 -05:00
|
|
|
. for _i in ${LIB_DEPENDS${SUBPACKAGE}}
|
2005-11-02 15:30:12 -05:00
|
|
|
@echo '${_i}'|{ \
|
|
|
|
IFS=:; read dep pkg subdir target; \
|
|
|
|
${_flavor_fragment}; \
|
2004-11-21 05:43:48 -05:00
|
|
|
libspecs='';comma=''; \
|
2006-12-08 05:19:08 -05:00
|
|
|
if default=`eval $$toset ${MAKE} _print-packagename`; then \
|
2009-01-05 07:43:49 -05:00
|
|
|
case "X$$pkg" in X) pkg=`echo "$$default" |${_version2default}`;; \
|
2006-10-18 07:09:30 -04:00
|
|
|
esac; \
|
2009-01-05 07:43:49 -05:00
|
|
|
if ${_PKG_QUERY} "$$pkg" -q; then \
|
2006-12-08 05:19:08 -05:00
|
|
|
listlibs='echo ${DEPDIR}$$shdir/lib*'; \
|
2009-01-05 07:43:49 -05:00
|
|
|
case "$$dir" in ${PKGPATH}) \
|
2006-12-08 05:19:08 -05:00
|
|
|
listlibs="$$toset ${MAKE} print-plist-contents|${_grab_libs_from_plist}; $$listlibs";; \
|
|
|
|
esac; \
|
|
|
|
else \
|
|
|
|
listlibs="$$toset ${MAKE} print-plist-contents|${_grab_libs_from_plist}"; \
|
|
|
|
fi; \
|
|
|
|
IFS=,; for d in $$dep; do \
|
|
|
|
${_libresolve_fragment}; \
|
|
|
|
case "$$check" in \
|
|
|
|
*.a) continue;; \
|
|
|
|
Failed) \
|
|
|
|
echo 1>&2 "Can't resolve libspec $$d"; \
|
|
|
|
exit 1;; \
|
|
|
|
*) \
|
|
|
|
echo "-W $$check";; \
|
|
|
|
esac; \
|
|
|
|
done; \
|
|
|
|
echo "-P $$subdir:$$pkg:$$default"; \
|
2004-11-27 07:36:14 -05:00
|
|
|
else \
|
2006-12-08 05:19:08 -05:00
|
|
|
echo 1>&2 "Problem with dependency ${_i}"; \
|
|
|
|
exit 1; \
|
2004-11-27 07:36:14 -05:00
|
|
|
fi; \
|
2004-11-21 05:43:48 -05:00
|
|
|
}
|
|
|
|
. endfor
|
2006-11-20 05:49:22 -05:00
|
|
|
. for _i in ${WANTLIB${SUBPACKAGE}}
|
2006-08-04 19:29:47 -04:00
|
|
|
@d='${_i}'; listlibs='echo $$shdir/lib*'; \
|
2004-11-21 05:43:48 -05:00
|
|
|
${_syslibresolve_fragment}; \
|
|
|
|
case "$$check" in \
|
2005-10-07 17:08:16 -04:00
|
|
|
*.a) ;; \
|
2005-11-02 15:28:11 -05:00
|
|
|
Failed) \
|
2004-11-21 05:43:48 -05:00
|
|
|
echo 1>&2 "Can't resolve libspec $$d"; \
|
|
|
|
exit 1;; \
|
|
|
|
*) \
|
2005-10-09 08:01:22 -04:00
|
|
|
echo "-W $$check";; \
|
2004-11-21 05:43:48 -05:00
|
|
|
esac
|
|
|
|
. endfor
|
|
|
|
.endif
|
|
|
|
|
2005-09-24 15:46:56 -04:00
|
|
|
_list-port-libs:
|
2006-11-27 10:28:40 -05:00
|
|
|
.if defined(_PORT_LIBS_CACHE) && defined(_DEPENDS_CACHE) && \
|
|
|
|
defined(_DEPENDS_FILE)
|
2005-10-09 08:01:22 -04:00
|
|
|
@if ! fgrep -q -e "r|${FULLPKGPATH}|" -e "a|${FULLPKGPATH}" $${_DEPENDS_FILE}; then \
|
|
|
|
${MAKE} run-dir-depends >>${_DEPENDS_CACHE}; \
|
|
|
|
fi
|
2005-11-02 15:30:12 -05:00
|
|
|
@perl ${PORTSDIR}/infrastructure/build/extract-dependencies ${FULLPKGPATH} <${_DEPENDS_CACHE}|while read subdir; do \
|
|
|
|
fulldir=${_PORT_LIBS_CACHE}/$$subdir; \
|
2005-10-10 15:20:00 -04:00
|
|
|
if test -f $$fulldir; then \
|
|
|
|
cat $$fulldir; \
|
2005-10-09 08:01:22 -04:00
|
|
|
else \
|
2005-10-10 15:20:00 -04:00
|
|
|
mkdir -p $${fulldir%/*}; \
|
2005-10-09 08:01:22 -04:00
|
|
|
${_flavor_fragment}; \
|
2005-11-02 15:28:11 -05:00
|
|
|
eval $$toset ${MAKE} print-plist-contents | \
|
2005-11-05 06:11:17 -05:00
|
|
|
${_grab_libs_from_plist}|tee $$fulldir; \
|
2005-10-09 08:01:22 -04:00
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
.else
|
2005-11-05 06:11:17 -05:00
|
|
|
@${MAKE} run-dir-depends|${_sort_dependencies}|while read subdir; do \
|
2005-09-24 15:46:56 -04:00
|
|
|
${_flavor_fragment}; \
|
2005-11-02 15:28:11 -05:00
|
|
|
eval $$toset ${MAKE} print-plist-contents ; \
|
2005-11-05 06:11:17 -05:00
|
|
|
done | ${_grab_libs_from_plist}
|
2005-10-09 08:01:22 -04:00
|
|
|
.endif
|
|
|
|
@echo /usr/lib/lib* ${X11BASE}/lib/lib*
|
2005-09-24 15:46:56 -04:00
|
|
|
|
2005-10-09 08:01:22 -04:00
|
|
|
_print-package-signature-run:
|
2006-11-19 07:37:55 -05:00
|
|
|
.for _i in ${RUN_DEPENDS${SUBPACKAGE}}
|
2005-11-02 15:30:12 -05:00
|
|
|
@echo '${_i}' |{ \
|
|
|
|
IFS=:; read dep pkg subdir target; \
|
|
|
|
${_flavor_fragment}; \
|
2005-09-24 15:46:56 -04:00
|
|
|
default=`eval $$toset ${MAKE} _print-packagename`; \
|
|
|
|
echo "$$default"; \
|
|
|
|
}
|
|
|
|
.endfor
|
2005-10-09 08:01:22 -04:00
|
|
|
|
|
|
|
_print-package-signature-lib:
|
2006-11-20 05:38:31 -05:00
|
|
|
@echo $$LIST_LIBS| LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} perl ${PORTSDIR}/infrastructure/build/resolve-lib ${_DEPRUNLIBS:S/>/\>/g}
|
2006-11-20 05:49:22 -05:00
|
|
|
.for _i in ${LIB_DEPENDS${SUBPACKAGE}}
|
2005-11-02 15:30:12 -05:00
|
|
|
@echo '${_i}' |{ \
|
|
|
|
IFS=:; read dep pkg subdir target; \
|
|
|
|
${_flavor_fragment}; \
|
2005-09-24 15:46:56 -04:00
|
|
|
default=`eval $$toset ${MAKE} _print-packagename`; \
|
|
|
|
echo "$$default"; \
|
|
|
|
}
|
2005-10-09 08:01:22 -04:00
|
|
|
.endfor
|
2005-09-24 15:46:56 -04:00
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
# recursively build a list of dirs for package running, ready for tsort
|
|
|
|
_recurse-run-dir-depends:
|
2006-11-20 04:59:11 -05:00
|
|
|
.for _dir in ${_RUN_DEP}
|
2005-11-02 15:30:12 -05:00
|
|
|
@echo "$$self ${_dir}"; \
|
2004-07-24 09:53:12 -04:00
|
|
|
if ! fgrep -q -e "r|${_dir}|" -e "a|${_dir}|" $${_DEPENDS_FILE}; then \
|
|
|
|
echo "r|${_dir}|" >> $${_DEPENDS_FILE}; \
|
2005-11-02 15:30:12 -05:00
|
|
|
subdir=${_dir}; ${_flavor_fragment}; \
|
2003-07-30 15:31:31 -04:00
|
|
|
toset="$$toset self=\"${_dir}\""; \
|
|
|
|
if ! eval $$toset ${MAKE} _recurse-run-dir-depends; then \
|
2001-11-12 09:14:46 -05:00
|
|
|
echo 1>&2 "*** Problem checking deps in \"$$dir\"."; \
|
2001-04-04 04:17:31 -04:00
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2003-07-30 15:31:31 -04:00
|
|
|
fi
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
run-dir-depends:
|
2006-11-20 04:59:11 -05:00
|
|
|
.if !empty(_RUN_DEP)
|
2003-08-04 10:00:46 -04:00
|
|
|
@${_depfile_fragment}; \
|
2004-07-24 09:53:12 -04:00
|
|
|
if ! fgrep -q -e "r|${FULLPKGPATH}|" -e "a|${FULLPKGPATH}" $${_DEPENDS_FILE}; then \
|
|
|
|
echo "r|${FULLPKGPATH}|" >>$${_DEPENDS_FILE}; \
|
2006-11-26 12:45:59 -05:00
|
|
|
self=${FULLPKGPATH} ${MAKE} _recurse-run-dir-depends; \
|
2003-08-04 10:37:10 -04:00
|
|
|
fi
|
2001-04-04 04:17:31 -04:00
|
|
|
.else
|
2001-04-08 12:55:17 -04:00
|
|
|
@echo "${FULLPKGPATH} ${FULLPKGPATH}"
|
2001-04-04 04:17:31 -04:00
|
|
|
.endif
|
|
|
|
|
2006-11-05 10:46:51 -05:00
|
|
|
# recursively build a list of dirs for package regression, ready for tsort
|
|
|
|
_recurse-regress-dir-depends:
|
|
|
|
.for _dir in ${_REGRESS_DEP}
|
|
|
|
@echo "$$self ${_dir}"; \
|
|
|
|
if ! fgrep -q -e "R|${_dir}|" $${_DEPENDS_FILE}; then \
|
|
|
|
echo "R|${_dir}|" >> $${_DEPENDS_FILE}; \
|
|
|
|
subdir=${_dir}; ${_flavor_fragment}; \
|
|
|
|
toset="$$toset self=\"${_dir}\""; \
|
|
|
|
if ! eval $$toset ${MAKE} _recurse-run-dir-depends; then \
|
|
|
|
echo 1>&2 "*** Problem checking deps in \"$$dir\"."; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
fi
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
regress-dir-depends:
|
|
|
|
.if !empty(_REGRESS_DEP)
|
|
|
|
@${_depfile_fragment}; \
|
|
|
|
if ! fgrep -q -e "R|${FULLPKGPATH}|" $${_DEPENDS_FILE}; then \
|
|
|
|
echo "R|${FULLPKGPATH}|" >>$${_DEPENDS_FILE}; \
|
2006-11-26 12:45:59 -05:00
|
|
|
self=${FULLPKGPATH} ${MAKE} _recurse-regress-dir-depends; \
|
2006-11-05 10:46:51 -05:00
|
|
|
fi
|
|
|
|
.else
|
|
|
|
@echo "${FULLPKGPATH} ${FULLPKGPATH}"
|
|
|
|
.endif
|
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
# recursively build a list of dirs for package building, ready for tsort
|
|
|
|
# second and further stages need _RUN_DEP.
|
|
|
|
_recurse-all-dir-depends:
|
2006-11-20 04:59:11 -05:00
|
|
|
.for _dir in ${_BUILD_DEP} ${_RUN_DEP}
|
2005-11-02 15:30:12 -05:00
|
|
|
@echo "$$self ${_dir}"; \
|
2004-07-24 09:53:12 -04:00
|
|
|
if ! fgrep -q "a|${_dir}|" $${_DEPENDS_FILE}; then \
|
|
|
|
echo "a|${_dir}|" >> $${_DEPENDS_FILE}; \
|
2005-11-02 15:30:12 -05:00
|
|
|
subdir=${_dir}; ${_flavor_fragment}; \
|
2003-07-30 15:31:31 -04:00
|
|
|
toset="$$toset self=\"${_dir}\""; \
|
|
|
|
if ! eval $$toset ${MAKE} _recurse-all-dir-depends; then \
|
2001-11-12 09:14:46 -05:00
|
|
|
echo 1>&2 "*** Problem checking deps in \"$$dir\"."; \
|
2001-04-18 10:43:55 -04:00
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2003-07-30 15:31:31 -04:00
|
|
|
fi
|
|
|
|
.endfor
|
2001-04-18 10:43:55 -04:00
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
# first stage does not need _RUN_DEP
|
|
|
|
_build-dir-depends:
|
2006-11-20 04:59:11 -05:00
|
|
|
.for _dir in ${_BUILD_DEP}
|
2005-11-02 15:30:12 -05:00
|
|
|
@echo "$$self ${_dir}"; \
|
2004-07-24 09:53:12 -04:00
|
|
|
if ! fgrep -q -e "b|${_dir}|" -e "a|${_dir}|" $${_DEPENDS_FILE}; then \
|
|
|
|
echo "b|${_dir}|" >> $${_DEPENDS_FILE}; \
|
2005-11-02 15:30:12 -05:00
|
|
|
subdir=${_dir}; ${_flavor_fragment}; \
|
2003-07-30 15:31:31 -04:00
|
|
|
toset="$$toset self=\"${_dir}\""; \
|
|
|
|
if ! eval $$toset ${MAKE} _recurse-all-dir-depends; then \
|
2001-11-12 09:14:46 -05:00
|
|
|
echo 1>&2 "*** Problem checking deps in \"$$dir\"."; \
|
2001-04-18 10:43:55 -04:00
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2003-07-30 15:31:31 -04:00
|
|
|
fi
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
build-dir-depends:
|
2006-11-20 04:59:11 -05:00
|
|
|
.if !empty(_BUILD_DEP)
|
2003-08-04 10:00:46 -04:00
|
|
|
@${_depfile_fragment}; \
|
2004-07-24 09:53:12 -04:00
|
|
|
if ! fgrep -q -e "b|${FULLPKGPATH}|" -e "a|${_dir}|" $${_DEPENDS_FILE}; then \
|
|
|
|
echo "b|${FULLPKGPATH}|" >>$${_DEPENDS_FILE}; \
|
2003-08-04 10:37:10 -04:00
|
|
|
self=${FULLPKGPATH} ${MAKE} _build-dir-depends; \
|
|
|
|
fi
|
2001-04-18 10:43:55 -04:00
|
|
|
.else
|
|
|
|
@echo "${FULLPKGPATH} ${FULLPKGPATH}"
|
|
|
|
.endif
|
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
all-dir-depends:
|
2006-11-20 04:59:11 -05:00
|
|
|
.if !empty(_BUILD_DEP) || !empty(_RUN_DEP)
|
2003-08-04 10:00:46 -04:00
|
|
|
@${_depfile_fragment}; \
|
2003-08-04 10:37:10 -04:00
|
|
|
if ! fgrep -q "|${FULLPKGPATH}|" $${_DEPENDS_FILE}; then \
|
|
|
|
echo "|${FULLPKGPATH}|" >>$${_DEPENDS_FILE}; \
|
|
|
|
self=${FULLPKGPATH} ${MAKE} _recurse-all-dir-depends; \
|
|
|
|
fi
|
2003-07-30 15:31:31 -04:00
|
|
|
.else
|
|
|
|
@echo "${FULLPKGPATH} ${FULLPKGPATH}"
|
Basic new lib dependency code for package.
LIB_DEPENDS are no longer part of ALWAYS_DEPEND for the new-depends code,
but use their own code.
The code does scan the list of libraries for dependent packages, and insert
corresponding @libdepend lines into the resulting package. There are a few
important consequences:
- no libdepend lines are inserted if only a static library is found. So
RUN_DEPENDS are now needed to supplement LIB_DEPENDS if a package requires
another package for something that isn't a library.
- dependency checking for installed stuff can go one step further, since
we have the major/minor number of the libraries used for the build.
At the moment, pkg resolve dependencies does nothing smart with the
inserted libdepends, but it will (soon). In fact, for most libdepends, if
the major/minor scheme are correct, no check on the installed pkgspec ought
to be necessary... which is why the `default pkgspec to check' is pkg-* for
libraries.
- resolving recursive run dependencies need to go one step further: a
RUN_DEPENDS pkg may have some LIB_DEPENDS, and the RUN_DEPENDS pkg will be
needed to explicitly write the required information into the resulting
package... Hence the necessity of being able to tune the list of libraries
to ask the uninstalled package (and to make sure the uninstalled package
is built).
This is only preliminary work. Currently, this doesn't yield any real
benefits to the old approach, as a few semantic details need to be
sharpened out. Also, there are now quite a few old targets that are a
complete mess and will need to be cleaned up/removed entirely.
Thanks to naddy@ for testing various preliminary versions of this patch
and helping me iron bugs out.
2001-11-12 09:32:52 -05:00
|
|
|
.endif
|
|
|
|
|
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
|
2003-07-18 15:02:13 -04:00
|
|
|
|
2002-03-13 08:51:59 -05:00
|
|
|
homepage-links:
|
|
|
|
.if defined(HOMEPAGE)
|
|
|
|
@echo '<li><A HREF="${HOMEPAGE}">${PKGNAME}</A>'
|
|
|
|
.else
|
|
|
|
@echo '<li>${PKGNAME}'
|
|
|
|
.endif
|
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
#####################################################
|
|
|
|
# convenience targets, not really needed
|
|
|
|
#####################################################
|
|
|
|
|
|
|
|
checkpatch:
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} PATCH_CHECK_ONLY=Yes patch
|
|
|
|
|
|
|
|
clean-depends:
|
2003-07-30 15:59:48 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} clean=depends
|
|
|
|
|
|
|
|
distclean:
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} clean=dist
|
2003-07-30 15:31:31 -04:00
|
|
|
|
|
|
|
delete-package:
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} clean=package
|
|
|
|
|
|
|
|
reinstall:
|
2003-08-28 19:42:44 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} clean='install force'
|
2003-07-30 15:31:31 -04:00
|
|
|
@cd ${.CURDIR} && DEPENDS_TARGET=${DEPENDS_TARGET} exec ${MAKE} install
|
|
|
|
|
|
|
|
repackage:
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} clean=packages
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} package
|
|
|
|
|
|
|
|
rebuild:
|
|
|
|
@rm -f ${_BUILD_COOKIE}
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} build
|
|
|
|
|
|
|
|
uninstall deinstall:
|
|
|
|
@${ECHO_MSG} "===> Deinstalling for ${FULLPKGNAME${SUBPACKAGE}}"
|
2004-01-28 15:16:14 -05:00
|
|
|
@${SUDO} ${PKG_DELETE} ${FULLPKGNAME${SUBPACKAGE}}
|
2003-07-30 15:31:31 -04:00
|
|
|
|
2001-10-03 04:41:16 -04:00
|
|
|
.if defined(ERRORS)
|
|
|
|
.BEGIN:
|
|
|
|
. for _m in ${ERRORS}
|
2004-08-03 17:18:24 -04:00
|
|
|
@echo 1>&2 ${_m} "(in ${PKGPATH})"
|
2001-10-03 04:41:16 -04:00
|
|
|
. endfor
|
2002-03-17 20:52:46 -05:00
|
|
|
. if !empty(ERRORS:M"Fatal\:*") || !empty(ERRORS:M'Fatal\:*')
|
2001-10-03 04:41:16 -04:00
|
|
|
@exit 1
|
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
2006-07-01 07:08:05 -04:00
|
|
|
peek-ftp:
|
2006-10-17 18:32:45 -04:00
|
|
|
@mkdir -p ${FULLDISTDIR}; cd ${FULLDISTDIR}; echo "cd ${FULLDISTDIR}"; \
|
2006-11-27 10:28:40 -05:00
|
|
|
for i in ${MASTER_SITES:Mftp*}; do \
|
|
|
|
echo "Connecting to $$i"; ${FETCH_CMD} $$i ; break; \
|
|
|
|
done
|
2006-07-01 07:08:05 -04:00
|
|
|
|
2005-11-01 09:04:21 -05:00
|
|
|
show-required-by:
|
2007-02-06 15:04:01 -05:00
|
|
|
@cd ${PORTSDIR} && make all-dir-depends | perl ${PORTSDIR}/infrastructure/build/extract-dependencies -r ${_ALLPKGPATHS}
|
|
|
|
|
2005-11-01 09:04:21 -05:00
|
|
|
|
2006-07-09 07:10:16 -04:00
|
|
|
show:
|
|
|
|
.for _s in ${show}
|
|
|
|
@echo ${${_s}:Q}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
verbose-show:
|
|
|
|
.for _s in ${verbose-show}
|
|
|
|
. if defined(${_s})
|
|
|
|
@echo ${_s}=${${_s}:Q}
|
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
2006-11-29 04:42:08 -05:00
|
|
|
dump-vars:
|
|
|
|
.if ${MULTI_PACKAGES} == "-"
|
|
|
|
. for _v in ${_ALL_VARIABLES} ${_ALL_VARIABLES_INDEXED}
|
|
|
|
. if defined(${_v})
|
|
|
|
@echo ${FULLPKGPATH}.${_v}=${${_v}:Q}
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.else
|
|
|
|
. for _S in ${MULTI_PACKAGES}
|
|
|
|
. for _v in ${_ALL_VARIABLES}
|
|
|
|
. if defined(${_v})
|
|
|
|
@echo ${FULLPKGPATH${_S}}.${_v}=${${_v}:Q}
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. for _v in ${_ALL_VARIABLES_INDEXED}
|
|
|
|
. if defined(${_v}${_S})
|
|
|
|
@echo ${FULLPKGPATH${_S}}.${_v}=${${_v}${_S}:Q}
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. endfor
|
|
|
|
.endif
|
2006-07-09 07:10:16 -04:00
|
|
|
|
2007-06-04 08:15:09 -04:00
|
|
|
_all_phony = ${_recursive_depends_targets} ${_recursive_describe_targets} \
|
|
|
|
${_recursive_targets} _build-dir-depends _fetch-makefile _fetch-onefile \
|
|
|
|
_internal-all _internal-build _internal-build-depends \
|
|
|
|
_internal-buildlib-depends _internal-buildwantlib-depends \
|
|
|
|
_internal-checksum _internal-clean _internal-configure _internal-depends \
|
|
|
|
_internal-distpatch _internal-extract _internal-fake _internal-fetch \
|
2008-05-15 05:51:17 -04:00
|
|
|
_internal-fetch-all \
|
2007-06-04 08:15:09 -04:00
|
|
|
_internal-install-all _internal-lib-depends _internal-manpages-check \
|
|
|
|
_internal-package _internal-package-only _internal-plist \
|
|
|
|
_internal-regress _internal-regress-depends _internal-run-depends \
|
2007-06-03 08:51:59 -04:00
|
|
|
_internal-runwantlib-depends _internal-subpackage _internal-subupdate \
|
|
|
|
_internal-update _internal-update _internal-update-plist \
|
|
|
|
_internal_install _internal_runlib-depends _license-check \
|
|
|
|
_list-port-libs _print-package-args _print-package-signature-lib \
|
|
|
|
_print-package-signature-run _print-packagename _recurse-all-dir-depends \
|
|
|
|
_recurse-regress-dir-depends _recurse-run-dir-depends _refetch addsum \
|
|
|
|
build-depends build-depends-list checkpatch clean clean-depends \
|
|
|
|
delete-package depends distpatch do-build do-configure do-distpatch \
|
|
|
|
do-extract do-fetch do-install do-package do-regress fetch-all \
|
2008-07-03 11:43:22 -04:00
|
|
|
install-all lib-depends lib-depends-list makesum \
|
2007-06-03 08:51:59 -04:00
|
|
|
peek-ftp plist port-lib-depends-check post-build post-configure \
|
|
|
|
post-distpatch post-extract post-fetch post-install post-package \
|
|
|
|
post-patch post-regress pre-build pre-configure pre-extract pre-fake \
|
|
|
|
pre-fetch pre-install pre-package pre-patch pre-regress \
|
|
|
|
print-build-depends print-run-depends readme readmes rebuild \
|
|
|
|
regress-depends repackage run-depends run-depends-list show-required-by \
|
2008-01-12 09:12:43 -05:00
|
|
|
subpackage uninstall update-patches update-plist mirror-maker-fetch \
|
|
|
|
lock unlock
|
2007-06-04 08:15:09 -04:00
|
|
|
|
|
|
|
.if defined(_DEBUG_TARGETS)
|
|
|
|
. for _t in ${_all_phony}
|
|
|
|
. if !target(${_t})
|
|
|
|
ERRORS += "Fatal: phony target ${_t} does not exist"
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.PHONY: ${_all_phony}
|