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:
|
2004-09-19 05:00:15 -04:00
|
|
|
# $OpenBSD: bsd.port.mk,v 1.649 2004/09/19 09:00:15 pvalchev 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=*}
|
2001-07-17 12:11:45 -04:00
|
|
|
ERRORS+= "Fatal: Use 'env FLAVOR=${FLAVOR} ${MAKE}' instead."
|
2001-03-28 10:01:01 -05:00
|
|
|
.endif
|
2001-09-29 13:36:02 -04:00
|
|
|
.if ${.MAKEFLAGS:MSUBPACKAGE=*}
|
|
|
|
ERRORS+= "Fatal: Use 'env SUBPACKAGE=${SUBPACKAGE} ${MAKE}' instead."
|
|
|
|
.endif
|
2001-03-28 10:01:01 -05:00
|
|
|
|
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
|
|
|
#
|
1996-08-23 07:37:41 -04:00
|
|
|
# NO_PKG_REGISTER - Don't register a port install as a package.
|
1997-09-09 11:11:28 -04:00
|
|
|
# SCRIPTS_ENV - Additional environment vars passed to scripts in
|
|
|
|
# ${SCRIPTDIR} executed by bsd.port.mk.
|
1996-06-03 18:47:10 -04:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
TRUST_PACKAGES?=No
|
|
|
|
BIN_PACKAGES?=No
|
|
|
|
CLEANDEPENDS?=No
|
|
|
|
USE_SYSTRACE?= No
|
|
|
|
BULK?=No
|
|
|
|
RECURSIVE_FETCH_LIST?= Yes
|
2004-02-07 17:18:49 -05:00
|
|
|
WRKOBJDIR?=
|
|
|
|
FAKEOBJDIR?=
|
|
|
|
BULK_TARGETS?=
|
2004-01-06 10:02:57 -05:00
|
|
|
|
|
|
|
# special purpose user settings
|
|
|
|
PATCH_CHECK_ONLY?=No
|
|
|
|
REFETCH?=false
|
|
|
|
|
|
|
|
# Constants used by the ports tree
|
|
|
|
ARCH!= uname -m
|
|
|
|
OPSYS= OpenBSD
|
|
|
|
OPSYS_VER= ${OSREV}
|
|
|
|
|
2004-06-01 17:06:29 -04:00
|
|
|
LP64_ARCHS=alpha amd64 sparc64
|
|
|
|
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})
|
2004-08-02 09:01:52 -04:00
|
|
|
NO_SHARED_LIBS?= Yes
|
2004-01-06 10:02:57 -05:00
|
|
|
. endif
|
|
|
|
.endfor
|
2004-08-02 09:01:52 -04:00
|
|
|
NO_SHARED_LIBS?= No
|
2004-01-06 10:02:57 -05:00
|
|
|
|
|
|
|
# Global path locations.
|
|
|
|
PORTSDIR?= /usr/ports
|
|
|
|
LOCALBASE?= /usr/local
|
|
|
|
X11BASE?= /usr/X11R6
|
|
|
|
DISTDIR?= ${PORTSDIR}/distfiles
|
|
|
|
BULK_COOKIES_DIR?= ${PORTSDIR}/bulk/${MACHINE_ARCH}
|
|
|
|
TEMPLATES?= ${PORTSDIR}/infrastructure/templates
|
2004-05-31 08:27:07 -04:00
|
|
|
TMPDIR?= /tmp
|
2004-01-06 10:02:57 -05:00
|
|
|
|
|
|
|
PKGREPOSITORYBASE?= ${PORTSDIR}/packages/${MACHINE_ARCH}
|
|
|
|
PKGREPOSITORY?= ${PKGREPOSITORYBASE}/all
|
|
|
|
CDROM_PACKAGES?= ${PKGREPOSITORYBASE}/cdrom
|
|
|
|
FTP_PACKAGES?= ${PKGREPOSITORYBASE}/ftp
|
|
|
|
|
2004-02-07 17:34:02 -05:00
|
|
|
# local path locations
|
|
|
|
.include "${PORTSDIR}/infrastructure/mk/pkgpath.mk"
|
|
|
|
|
|
|
|
WRKOBJDIR_${PKGPATH}?= ${WRKOBJDIR}
|
|
|
|
FAKEOBJDIR_${PKGPATH}?= ${FAKEOBJDIR}
|
|
|
|
BULK_${PKGPATH}?= ${BULK}
|
|
|
|
BULK_TARGETS_${PKGPATH}?= ${BULK_TARGETS}
|
|
|
|
CLEANDEPENDS_${PKGPATH}?= ${CLEANDEPENDS}
|
|
|
|
|
2004-01-06 10:02:57 -05:00
|
|
|
# Commands and command settings.
|
|
|
|
PKG_DBDIR?= /var/db/pkg
|
|
|
|
|
|
|
|
FETCH_CMD?= /usr/bin/ftp -V -m
|
|
|
|
|
|
|
|
PKG_TMPDIR?= /var/tmp
|
|
|
|
PKG_CMD?= /usr/sbin/pkg_create
|
|
|
|
PKG_DELETE?= /usr/sbin/pkg_delete
|
2004-01-22 16:28:49 -05:00
|
|
|
.if ${MACHINE_ARCH} != ${ARCH}
|
|
|
|
PKG_ARCH?=${MACHINE_ARCH},${ARCH}
|
|
|
|
.else
|
|
|
|
PKG_ARCH?=${MACHINE_ARCH}
|
|
|
|
.endif
|
2004-01-06 10:02:57 -05:00
|
|
|
|
|
|
|
# remount those mount points ro before fake.
|
|
|
|
# XXX tends to panic the OS
|
|
|
|
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) || \
|
|
|
|
!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
|
|
|
|
PERMIT_PACKAGE_CDROM = No
|
|
|
|
PERMIT_DISTFILES_CDROM = No
|
|
|
|
PERMIT_PACKAGE_FTP = No
|
|
|
|
PERMIT_DISTFILES_FTP = No
|
|
|
|
.endif
|
|
|
|
|
2001-08-25 07:23:46 -04:00
|
|
|
# MODULES support
|
|
|
|
# reserved name spaces: for module=NAME, modname*, _modname* variables and
|
|
|
|
# targets.
|
|
|
|
|
2001-08-16 10:49:31 -04:00
|
|
|
.if defined(show)
|
|
|
|
.MAIN: show
|
2003-07-14 09:33:04 -04:00
|
|
|
show:
|
2004-02-07 17:02:40 -05:00
|
|
|
. for _s in ${show}
|
|
|
|
@echo ${${_s}:Q}
|
|
|
|
. endfor
|
2001-08-16 10:49:31 -04:00
|
|
|
.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)
|
|
|
|
clean=${_internal-clean}
|
|
|
|
.MAIN: _internal-clean
|
2001-08-16 10:49:31 -04:00
|
|
|
.else
|
|
|
|
.MAIN: all
|
|
|
|
.endif
|
|
|
|
|
2000-05-30 10:51:59 -04:00
|
|
|
FAKE?=Yes
|
2002-08-07 11:48:19 -04:00
|
|
|
_LIBLIST=${WRKDIR}/.liblist-${ARCH}${_FLAVOR_EXT2}
|
|
|
|
_BUILDLIBLIST=${WRKDIR}/.buildliblist-${ARCH}${_FLAVOR_EXT2}
|
2001-10-24 07:53:54 -04:00
|
|
|
|
2000-03-03 16:24:50 -05:00
|
|
|
|
2003-08-01 04:07:30 -04:00
|
|
|
# need to go through an extra var because clean is set in stone,
|
|
|
|
# on the cmdline.
|
|
|
|
_clean=${clean}
|
|
|
|
.if empty(_clean) || ${_clean:L} == "depends"
|
|
|
|
_clean+=work
|
|
|
|
.endif
|
2004-02-07 17:34:02 -05:00
|
|
|
.if ${CLEANDEPENDS_${PKGPATH}:L} == "yes"
|
2003-08-01 04:07:30 -04:00
|
|
|
_clean+=depends
|
2001-08-16 10:49:31 -04:00
|
|
|
.endif
|
2003-08-01 04:07:30 -04:00
|
|
|
.if ${_clean:L:Mwork}
|
|
|
|
_clean+=fake
|
2001-08-16 10:49:31 -04:00
|
|
|
.endif
|
2003-08-01 04:07:30 -04:00
|
|
|
.if ${_clean:L:Mforce}
|
|
|
|
_clean+=-f
|
2001-08-16 10:49:31 -04:00
|
|
|
.endif
|
|
|
|
|
1999-09-26 06:47:30 -04:00
|
|
|
NOMANCOMPRESS?= Yes
|
1997-09-21 06:58:41 -04:00
|
|
|
DEF_UMASK?= 022
|
1996-08-23 07:37:41 -04:00
|
|
|
|
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
|
|
|
|
2001-10-03 04:41:16 -04:00
|
|
|
NO_DEPENDS?= No
|
|
|
|
NO_BUILD?= No
|
2001-10-03 04:53:18 -04:00
|
|
|
NO_REGRESS?= No
|
2004-08-03 15:30:25 -04:00
|
|
|
SHARED_ONLY?= No
|
|
|
|
|
2004-02-07 17:36:13 -05:00
|
|
|
DIST_SUBDIR?=
|
2001-10-03 04:41:16 -04:00
|
|
|
|
2004-02-07 17:36:13 -05:00
|
|
|
.if !empty(DIST_SUBDIR)
|
1999-09-22 06:16:58 -04:00
|
|
|
FULLDISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
|
2000-02-02 10:28:17 -05:00
|
|
|
.else
|
|
|
|
FULLDISTDIR?= ${DISTDIR}
|
|
|
|
.endif
|
2000-04-09 08:04:13 -04:00
|
|
|
|
1999-11-28 09:12:24 -05:00
|
|
|
.if exists(${.CURDIR}/patches.${ARCH})
|
1997-09-09 11:11:28 -04:00
|
|
|
PATCHDIR?= ${.CURDIR}/patches.${ARCH}
|
2004-02-07 17:14:21 -05:00
|
|
|
.elif exists(${.CURDIR}/patches.${MACHINE_ARCH})
|
2001-05-05 19:42:03 -04:00
|
|
|
PATCHDIR?= ${.CURDIR}/patches.${MACHINE_ARCH}
|
|
|
|
.else
|
1996-06-03 18:47:10 -04:00
|
|
|
PATCHDIR?= ${.CURDIR}/patches
|
1997-09-09 11:11:28 -04:00
|
|
|
.endif
|
|
|
|
|
1998-11-18 23:20:09 -05:00
|
|
|
PATCH_LIST?= patch-*
|
|
|
|
|
1999-11-28 09:12:24 -05:00
|
|
|
.if exists(${.CURDIR}/scripts.${ARCH})
|
1997-09-09 11:11:28 -04:00
|
|
|
SCRIPTDIR?= ${.CURDIR}/scripts.${ARCH}
|
2004-02-07 17:14:21 -05:00
|
|
|
.elif exists(${.CURDIR}/scripts.${MACHINE_ARCH})
|
2001-05-05 19:42:03 -04:00
|
|
|
SCRIPTDIR?= ${.CURDIR}/scripts.${MACHINE_ARCH}
|
2004-02-07 17:14:21 -05:00
|
|
|
.else
|
1996-06-03 18:47:10 -04:00
|
|
|
SCRIPTDIR?= ${.CURDIR}/scripts
|
2001-05-05 19:42:03 -04:00
|
|
|
.endif
|
1997-09-09 11:11:28 -04:00
|
|
|
|
1999-11-28 09:12:24 -05:00
|
|
|
.if exists(${.CURDIR}/files.${ARCH})
|
1997-09-09 11:11:28 -04:00
|
|
|
FILESDIR?= ${.CURDIR}/files.${ARCH}
|
2004-02-07 17:14:21 -05:00
|
|
|
.elif exists(${.CURDIR}/files.${MACHINE_ARCH})
|
2001-05-05 19:42:03 -04:00
|
|
|
FILESDIR?= ${.CURDIR}/files.${MACHINE_ARCH}
|
|
|
|
.else
|
1996-06-03 18:47:10 -04:00
|
|
|
FILESDIR?= ${.CURDIR}/files
|
1997-09-09 11:11:28 -04:00
|
|
|
.endif
|
|
|
|
|
1999-11-28 09:12:24 -05:00
|
|
|
.if exists(${.CURDIR}/pkg.${ARCH})
|
1997-09-09 11:11:28 -04:00
|
|
|
PKGDIR?= ${.CURDIR}/pkg.${ARCH}
|
2004-02-07 17:14:21 -05:00
|
|
|
.elif exists(${.CURDIR}/pkg.${MACHINE_ARCH})
|
2001-05-05 19:42:03 -04:00
|
|
|
PKGDIR?= ${.CURDIR}/pkg.${MACHINE_ARCH}
|
|
|
|
.else
|
1996-06-03 18:47:10 -04:00
|
|
|
PKGDIR?= ${.CURDIR}/pkg
|
1997-09-09 11:11:28 -04:00
|
|
|
.endif
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
PREFIX?= ${LOCALBASE}
|
2001-01-08 17:10:36 -05:00
|
|
|
TRUEPREFIX?= ${PREFIX}
|
2001-07-18 12:19:47 -04:00
|
|
|
DESTDIRNAME?= DESTDIR
|
2001-01-08 17:10:36 -05:00
|
|
|
DESTDIR?= ${WRKINST}
|
1999-03-16 18:35:37 -05:00
|
|
|
|
2001-08-26 17:42:18 -04:00
|
|
|
MAKE_FLAGS?=
|
|
|
|
LIBTOOL_FLAGS?=
|
|
|
|
.if !defined(FAKE_FLAGS)
|
|
|
|
FAKE_FLAGS=${DESTDIRNAME}=${WRKINST}
|
|
|
|
.endif
|
|
|
|
|
2000-06-10 11:27:54 -04:00
|
|
|
CONFIGURE_STYLE?=
|
|
|
|
|
1999-03-16 18:35:37 -05:00
|
|
|
# where configuration files should go
|
|
|
|
SYSCONFDIR?= /etc
|
2002-04-09 09:52:58 -04:00
|
|
|
USE_GMAKE?= No
|
|
|
|
.if ${USE_GMAKE:L} == "yes"
|
2002-12-08 06:04:47 -05:00
|
|
|
BUILD_DEPENDS+= ::devel/gmake
|
1998-09-07 18:33:19 -04:00
|
|
|
MAKE_PROGRAM= ${GMAKE}
|
|
|
|
.else
|
|
|
|
MAKE_PROGRAM= ${MAKE}
|
1997-09-09 11:11:28 -04:00
|
|
|
.endif
|
2002-03-15 20:09:23 -05:00
|
|
|
|
|
|
|
.if ${CONFIGURE_STYLE:L:Mautomake} || ${CONFIGURE_STYLE:L:Mautoconf} || ${CONFIGURE_STYLE:L:Mautoupdate}
|
2003-04-06 10:34:36 -04:00
|
|
|
. if !${CONFIGURE_STYLE:L:Mgnu}
|
2000-06-10 11:27:54 -04:00
|
|
|
CONFIGURE_STYLE+=gnu
|
2003-04-06 10:34:36 -04:00
|
|
|
. endif
|
1998-11-24 20:08:35 -05:00
|
|
|
.endif
|
2000-06-10 11:27:54 -04:00
|
|
|
|
2002-04-09 09:52:58 -04:00
|
|
|
USE_LIBTOOL?=No
|
|
|
|
.if ${USE_LIBTOOL:L} == "yes"
|
1999-05-04 14:12:24 -04:00
|
|
|
LIBTOOL?= ${LOCALBASE}/bin/libtool
|
2001-09-19 12:03:09 -04:00
|
|
|
BUILD_DEPENDS+= ::devel/libtool
|
1999-05-04 14:12:24 -04:00
|
|
|
CONFIGURE_ENV+= LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}"
|
|
|
|
MAKE_ENV+= LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}"
|
2001-08-26 17:42:18 -04:00
|
|
|
MAKE_FLAGS+= LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}"
|
1999-05-04 14:12:24 -04:00
|
|
|
.endif
|
1998-09-07 18:33:19 -04:00
|
|
|
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
SUBPACKAGE?=
|
2001-03-28 09:33:24 -05:00
|
|
|
FLAVOR?=
|
2001-10-03 04:53:18 -04:00
|
|
|
FLAVORS?=
|
2002-08-07 11:48:19 -04:00
|
|
|
PSEUDO_FLAVORS?=
|
|
|
|
FLAVORS+=${PSEUDO_FLAVORS}
|
2001-10-03 04:53:18 -04:00
|
|
|
|
|
|
|
.if !empty(FLAVORS:L:Mregress) && empty(FLAVOR:L:Mregress)
|
|
|
|
NO_REGRESS= Yes
|
|
|
|
.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
|
|
|
|
2001-04-18 10:43:55 -04:00
|
|
|
USE_MOTIF?=No
|
|
|
|
|
|
|
|
.if ${USE_MOTIF:L} != "no"
|
|
|
|
. if ${USE_MOTIF:L} == "lesstif"
|
2001-09-19 12:03:09 -04:00
|
|
|
LIB_DEPENDS+= Xm.1::x11/lesstif
|
2001-04-18 10:43:55 -04:00
|
|
|
. elif ${USE_MOTIF:L} == "openmotif"
|
2001-09-19 12:03:09 -04:00
|
|
|
LIB_DEPENDS+= Xm.2::x11/openmotif
|
2001-04-18 10:43:55 -04:00
|
|
|
. elif ${USE_MOTIF:L} == "any" || ${USE_MOTIF:L} == "yes"
|
|
|
|
FLAVORS+=lesstif
|
2002-03-17 20:55:40 -05:00
|
|
|
. if ${FLAVOR:L:Mlesstif} && ${FLAVOR:L:Mmotif}
|
|
|
|
ERRORS+="Fatal: choose motif or lesstif, not both."
|
|
|
|
. endif
|
2001-04-18 10:43:55 -04:00
|
|
|
. if ${FLAVOR:L:Mlesstif}
|
2001-09-19 12:03:09 -04:00
|
|
|
LIB_DEPENDS+= Xm.1::x11/lesstif
|
2001-04-18 10:43:55 -04:00
|
|
|
. else
|
2001-09-19 12:03:09 -04:00
|
|
|
LIB_DEPENDS+= Xm.2::x11/openmotif
|
2001-04-18 10:43:55 -04:00
|
|
|
. endif
|
|
|
|
. else
|
2001-07-17 12:11:45 -04:00
|
|
|
ERRORS+= "Fatal: Unknown USE_MOTIF=${USE_MOTIF} settings."
|
2001-04-18 10:43:55 -04:00
|
|
|
. endif
|
2001-04-18 21:56:53 -04:00
|
|
|
MOTIFLIB=-L${LOCALBASE}/lib -lXm
|
2001-04-18 10:43:55 -04:00
|
|
|
.endif
|
|
|
|
|
2001-04-17 12:45:14 -04:00
|
|
|
.if !empty(SUBPACKAGE)
|
|
|
|
. for _i in ${SUBPACKAGE}
|
|
|
|
. if !defined(MULTI_PACKAGES) || empty(MULTI_PACKAGES:M${_i})
|
2001-07-17 12:11:45 -04:00
|
|
|
ERRORS+= "Fatal: Subpackage ${SUBPACKAGE} does not exist."
|
2001-04-17 12:45:14 -04:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.endif
|
|
|
|
|
2004-09-15 14:57:31 -04:00
|
|
|
.if defined(SED_PLIST)
|
|
|
|
ERRORS+="Fatal: SED_PLIST deprecated"
|
|
|
|
.endif
|
2001-07-20 09:13:47 -04:00
|
|
|
|
2001-07-18 14:23:04 -04:00
|
|
|
# Build FLAVOR_EXT, checking that no flavors are misspelled
|
|
|
|
FLAVOR_EXT:=
|
2002-08-07 11:48:19 -04:00
|
|
|
# _FLAVOR_EXT2 is used internally for working directories.
|
|
|
|
# It encodes flavors and pseudo-flavors.
|
|
|
|
_FLAVOR_EXT2:=
|
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})
|
2004-09-15 14:57:31 -04:00
|
|
|
PKG_ARGS+=-D${_i}=0
|
2001-07-20 09:13:47 -04:00
|
|
|
. else
|
2002-08-07 11:48:19 -04:00
|
|
|
_FLAVOR_EXT2:=${_FLAVOR_EXT2}-${_i}
|
|
|
|
. if empty(PSEUDO_FLAVORS:L:M${_i})
|
2001-07-20 09:13:47 -04:00
|
|
|
FLAVOR_EXT:=${FLAVOR_EXT}-${_i}
|
2002-08-07 11:48:19 -04:00
|
|
|
. endif
|
2004-09-15 14:57:31 -04: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"
|
|
|
|
PKG_ARGS+=-DSHARED_LIBS=0
|
|
|
|
.else
|
|
|
|
PKG_ARGS+=-DSHARED_LIBS=1
|
|
|
|
.endif
|
2004-09-14 19:06:02 -04:00
|
|
|
.if !empty(FLAVORS:M[0-9]*)
|
|
|
|
ERRORS+="Fatal: flavor should never start with a digit"
|
|
|
|
.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})
|
|
|
|
ERRORS+= "Fatal: Unknown flavor: ${_i}"
|
|
|
|
ERRORS+= " (Possible flavors are: ${FLAVORS})."
|
|
|
|
. endif
|
|
|
|
. endfor
|
2001-07-20 09:13:47 -04:00
|
|
|
. else
|
|
|
|
ERRORS+= "Fatal: no flavors for this port."
|
2001-07-18 14:23:04 -04:00
|
|
|
. endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
PKG_SUFX?= .tgz
|
2001-07-30 10:13:16 -04:00
|
|
|
|
2001-08-12 07:33:10 -04:00
|
|
|
PKGNAME?=${DISTNAME}
|
|
|
|
FULLPKGNAME?=${PKGNAME}${FLAVOR_EXT}
|
|
|
|
PKGFILE=${PKGREPOSITORY}/${FULLPKGNAME}${PKG_SUFX}
|
2002-04-24 17:29:26 -04:00
|
|
|
_MASTER?=
|
2004-09-18 09:45:23 -04:00
|
|
|
_SOLVING_DEP?=No
|
2001-07-30 10:13:16 -04:00
|
|
|
|
|
|
|
.if defined(MULTI_PACKAGES)
|
|
|
|
. for _s in ${MULTI_PACKAGES}
|
2001-08-12 07:33:10 -04:00
|
|
|
. if !defined(FULLPKGNAME${_s})
|
|
|
|
. if defined(PKGNAME${_s})
|
|
|
|
FULLPKGNAME${_s} = ${PKGNAME${_s}}${FLAVOR_EXT}
|
|
|
|
. else
|
|
|
|
FULLPKGNAME${_s} = ${PKGNAME}${_s}${FLAVOR_EXT}
|
|
|
|
. endif
|
2001-07-30 10:13:16 -04:00
|
|
|
. endif
|
2001-08-12 07:33:10 -04:00
|
|
|
PKGFILE${_s} = ${PKGREPOSITORY}/${FULLPKGNAME${_s}}${PKG_SUFX}
|
2001-07-30 10:13:16 -04:00
|
|
|
. endfor
|
|
|
|
.endif
|
|
|
|
|
2003-07-28 13:17:04 -04:00
|
|
|
_SYSTRACE_COOKIE= ${WRKDIR}/systrace.policy
|
2001-09-05 05:13:18 -04:00
|
|
|
_WRKDIR_COOKIE= ${WRKDIR}/.extract_started
|
1999-12-08 12:11:09 -05:00
|
|
|
_EXTRACT_COOKIE= ${WRKDIR}/.extract_done
|
|
|
|
_PATCH_COOKIE= ${WRKDIR}/.patch_done
|
Add intermediate `distpatch' target.
This is done in a tricky way, so as not to disturb the usual sequence
of targets. Namely, you still have
fetch, extract, patch, configure, build, install, package,
but patch does invoke a subtarget distpatch when needed,
and you can
fetch, extract, distpatch, patch, configure, build, install, package
for the same results.
Mostly useful for porters: provide an intermediate point to work on
patches, and make it easy to override distpatch/OpenBSD patches separately.
2000-01-30 10:19:40 -05:00
|
|
|
_DISTPATCH_COOKIE= ${WRKDIR}/.distpatch_done
|
|
|
|
_PREPATCH_COOKIE= ${WRKDIR}/.prepatch_done
|
2001-08-12 07:33:10 -04:00
|
|
|
_INSTALL_COOKIE= ${PKG_DBDIR}/${FULLPKGNAME${SUBPACKAGE}}/+CONTENTS
|
2002-04-17 11:58:48 -04:00
|
|
|
_BULK_COOKIE= ${BULK_COOKIES_DIR}/${FULLPKGNAME}
|
2001-01-08 17:34:51 -05:00
|
|
|
.if ${FAKE:L} == "yes"
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
_FAKE_COOKIE= ${WRKINST}/.fake_done
|
2000-03-03 16:24:50 -05:00
|
|
|
_INSTALL_PRE_COOKIE=${WRKINST}/.install_started
|
|
|
|
.elif defined(SEPARATE_BUILD)
|
|
|
|
_INSTALL_PRE_COOKIE=${WRKBUILD}/.install_started
|
|
|
|
.else
|
|
|
|
_INSTALL_PRE_COOKIE=${WRKDIR}/.install_started
|
2000-04-17 17:53:38 -04:00
|
|
|
_FAKE_COOKIE= ${WRKDIR}/.fake_done
|
2000-03-03 16:24:50 -05:00
|
|
|
.endif
|
2001-08-12 07:33:10 -04:00
|
|
|
_PACKAGE_COOKIE= ${PKGFILE}
|
1999-02-28 18:23:47 -05:00
|
|
|
.if defined(SEPARATE_BUILD)
|
1999-12-08 12:11:09 -05:00
|
|
|
_CONFIGURE_COOKIE= ${WRKBUILD}/.configure_done
|
|
|
|
_BUILD_COOKIE= ${WRKBUILD}/.build_done
|
2001-10-03 04:53:18 -04:00
|
|
|
_REGRESS_COOKIE= ${WRKBUILD}/.regress_done
|
1999-02-28 18:23:47 -05:00
|
|
|
.else
|
1999-12-08 12:11:09 -05:00
|
|
|
_CONFIGURE_COOKIE= ${WRKDIR}/.configure_done
|
|
|
|
_BUILD_COOKIE= ${WRKDIR}/.build_done
|
2001-10-03 04:53:18 -04:00
|
|
|
_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
|
|
|
|
1999-12-08 12:11:09 -05:00
|
|
|
_ALL_COOKIES=${_EXTRACT_COOKIE} ${_PATCH_COOKIE} ${_CONFIGURE_COOKIE} \
|
2001-10-03 04:53:18 -04:00
|
|
|
${_INSTALL_PRE_COOKIE} ${_BUILD_COOKIE} ${_REGRESS_COOKIE} \
|
2004-06-22 16:05:46 -04:00
|
|
|
${_SYSTRACE_COOKIE} ${_PACKAGE_COOKIES} \
|
2001-09-05 05:13:18 -04:00
|
|
|
${_DISTPATCH_COOKIE} ${_PREPATCH_COOKIE} ${_FAKE_COOKIE} \
|
2003-07-23 05:58:33 -04:00
|
|
|
${_WRKDIR_COOKIE} ${_DEPlib_COOKIES} ${_DEPbuild_COOKIES} \
|
|
|
|
${_DEPrun_COOKIES} ${_DEPregress_COOKIES}
|
1999-12-08 12:11:09 -05:00
|
|
|
|
1999-12-03 09:57:12 -05:00
|
|
|
_MAKE_COOKIE=touch -f
|
1996-06-03 18:47:10 -04:00
|
|
|
|
|
|
|
# Miscellaneous overridable commands:
|
|
|
|
GMAKE?= gmake
|
1999-03-03 13:18:46 -05:00
|
|
|
|
2001-11-11 07:59:50 -05:00
|
|
|
CHECKSUM_FILE?= ${.CURDIR}/distinfo
|
1999-03-03 13:18:46 -05:00
|
|
|
|
|
|
|
# Don't touch !!! Used for generating checksums.
|
2003-07-18 15:02:13 -04:00
|
|
|
_CIPHERS= sha1 rmd160 md5
|
1999-03-03 13:18:46 -05:00
|
|
|
|
|
|
|
# This is the one you can override
|
1999-12-03 09:57:12 -05:00
|
|
|
PREFERRED_CIPHERS?= ${_CIPHERS}
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2002-03-15 08:29:13 -05:00
|
|
|
PORTPATH?= ${WRKDIR}/bin:/usr/bin:/bin:/usr/sbin:/sbin:${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)
|
1999-03-10 18:22:19 -05:00
|
|
|
CFLAGS+= ${COPTS}
|
2001-07-11 08:57:20 -04:00
|
|
|
.endif
|
2001-07-18 10:52:27 -04:00
|
|
|
.if defined(CXXOPTS)
|
|
|
|
CXXFLAGS+= ${CXXOPTS}
|
|
|
|
.endif
|
|
|
|
.if defined(WARNINGS) && ${WARNINGS:L} == "yes"
|
|
|
|
. if defined(CDIAGFLAGS)
|
|
|
|
CFLAGS+= ${CDIAGFLAGS}
|
|
|
|
. endif
|
|
|
|
. if defined(CXXDIAGFLAGS)
|
|
|
|
CXXFLAGS+= ${CXXDIAGFLAGS}
|
|
|
|
. endif
|
|
|
|
.endif
|
1999-03-10 18:22:19 -05:00
|
|
|
|
2000-02-22 12:08:31 -05:00
|
|
|
MAKE_FILE?= Makefile
|
2002-03-02 08:38:25 -05:00
|
|
|
PORTHOME?= /${PKGNAME}_writes_to_HOME
|
|
|
|
|
2000-06-10 11:27:54 -04:00
|
|
|
MAKE_ENV+= PATH='${PORTPATH}' PREFIX='${PREFIX}' \
|
2001-04-18 11:00:53 -04:00
|
|
|
LOCALBASE='${LOCALBASE}' X11BASE='${X11BASE}' \
|
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
|
|
|
|
2000-03-03 15:41:11 -05:00
|
|
|
DISTORIG?= .bak.orig
|
1996-06-03 18:47:10 -04:00
|
|
|
PATCH?= /usr/bin/patch
|
2001-08-24 10:43:28 -04:00
|
|
|
PATCHORIG?= .orig
|
1996-06-03 18:47:10 -04:00
|
|
|
PATCH_STRIP?= -p0
|
|
|
|
PATCH_DIST_STRIP?= -p0
|
2000-09-16 09:54:56 -04:00
|
|
|
|
|
|
|
PATCH_DEBUG?=No
|
|
|
|
.if ${PATCH_DEBUG:L} != "no"
|
2003-07-24 22:17:51 -04: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
|
2003-07-24 22:17:51 -04: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"
|
1996-06-03 18:47:10 -04:00
|
|
|
PATCH_ARGS+= -C
|
|
|
|
PATCH_DIST_ARGS+= -C
|
|
|
|
.endif
|
|
|
|
|
1999-05-14 00:38:36 -04:00
|
|
|
TAR?= /bin/tar
|
|
|
|
UNZIP?= unzip
|
|
|
|
BZIP2?= bzip2
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
|
1997-01-11 06:58:11 -05:00
|
|
|
MAKE_ENV+= EXTRA_SYS_MK_INCLUDES="<bsd.own.mk>"
|
1998-09-07 18:33:19 -04:00
|
|
|
|
2000-04-03 13:32:42 -04:00
|
|
|
|
2004-02-07 17:34:02 -05:00
|
|
|
.if !empty(FAKEOBJDIR_${PKGPATH})
|
|
|
|
WRKINST?= ${FAKEOBJDIR_${PKGPATH}}/${PKGNAME}${_FLAVOR_EXT2}
|
2003-08-21 16:22:45 -04:00
|
|
|
.else
|
|
|
|
WRKINST?= ${WRKDIR}/fake-${ARCH}${_FLAVOR_EXT2}
|
|
|
|
.endif
|
|
|
|
|
2004-02-07 17:34:02 -05:00
|
|
|
.if !empty(WRKOBJDIR_${PKGPATH})
|
2003-01-14 13:18:23 -05:00
|
|
|
. if defined(SEPARATE_BUILD) && ${SEPARATE_BUILD:L:Mflavored}
|
2004-02-07 17:34:02 -05:00
|
|
|
WRKDIR?= ${WRKOBJDIR_${PKGPATH}}/${PKGNAME}
|
2003-01-14 13:18:23 -05:00
|
|
|
. else
|
2004-02-07 17:34:02 -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
|
2000-04-03 13:32:42 -04:00
|
|
|
. if defined(SEPARATE_BUILD) && ${SEPARATE_BUILD:L:Mflavored}
|
2001-08-16 10:49:31 -04:00
|
|
|
WRKDIR?= ${.CURDIR}/w-${PKGNAME}
|
2000-04-03 13:32:42 -04:00
|
|
|
. else
|
2002-08-07 11:48:19 -04: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
|
|
|
|
2000-02-08 19:23:26 -05:00
|
|
|
WRKDIST?= ${WRKDIR}/${DISTNAME}
|
1998-09-07 18:33:19 -04:00
|
|
|
|
2000-02-08 19:54:33 -05:00
|
|
|
WRKSRC?= ${WRKDIST}
|
2000-02-08 19:23:26 -05:00
|
|
|
|
1999-02-28 18:23:47 -05:00
|
|
|
.if defined(SEPARATE_BUILD)
|
2002-08-07 11:48:19 -04:00
|
|
|
WRKBUILD?= ${WRKDIR}/build-${MACHINE_ARCH}${_FLAVOR_EXT2}
|
2001-08-16 10:49:31 -04:00
|
|
|
WRKPKG?= ${WRKBUILD}/pkg
|
1999-02-28 18:23:47 -05:00
|
|
|
.else
|
1999-02-03 12:53:13 -05:00
|
|
|
WRKBUILD?= ${WRKSRC}
|
2001-08-16 10:49:31 -04:00
|
|
|
WRKPKG?= ${WRKDIR}/pkg
|
1999-02-28 18:23:47 -05:00
|
|
|
.endif
|
2004-09-15 14:58:49 -04:00
|
|
|
WRKCONF?= ${WRKBUILD}
|
1999-02-03 12:53:13 -05:00
|
|
|
|
2001-08-25 07:23:46 -04:00
|
|
|
ALL_TARGET?= all
|
|
|
|
INSTALL_TARGET?= install
|
|
|
|
|
|
|
|
FAKE_TARGET ?= ${INSTALL_TARGET}
|
|
|
|
|
2001-08-28 04:09:31 -04:00
|
|
|
.for _i in perl gnu imake
|
2001-08-25 07:23:46 -04:00
|
|
|
. if ${CONFIGURE_STYLE:L:M${_i}}
|
|
|
|
MODULES+=${_i}
|
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
2001-10-29 07:51:59 -05:00
|
|
|
.if defined(MODULES)
|
|
|
|
_MODULES_DONE=
|
|
|
|
. include "${PORTSDIR}/infrastructure/mk/modules.port.mk"
|
|
|
|
.endif
|
2000-06-16 19:53:40 -04:00
|
|
|
|
2004-01-10 19:49:01 -05:00
|
|
|
###
|
|
|
|
### Variable setup that can happen after modules
|
|
|
|
###
|
|
|
|
|
2001-10-04 18:20:38 -04:00
|
|
|
REGRESS_TARGET ?= regress
|
2001-10-07 06:50:47 -04:00
|
|
|
REGRESS_FLAGS ?= ${MAKE_FLAGS}
|
2001-10-03 04:53:18 -04:00
|
|
|
|
2001-07-30 10:13:16 -04:00
|
|
|
.if ${FAKE:L} == "yes"
|
|
|
|
_PACKAGE_COOKIE_DEPS=${_FAKE_COOKIE}
|
|
|
|
.else
|
|
|
|
_PACKAGE_COOKIE_DEPS=${_INSTALL_COOKIE}
|
|
|
|
.endif
|
|
|
|
|
2001-04-02 06:35:51 -04:00
|
|
|
_PACKAGE_COOKIES= ${_PACKAGE_COOKIE}
|
2001-07-30 10:13:16 -04:00
|
|
|
.for _s in ${MULTI_PACKAGES}
|
2001-08-12 07:33:10 -04:00
|
|
|
_PACKAGE_COOKIE${_s} = ${PKGFILE${_s}}
|
2001-07-30 10:13:16 -04:00
|
|
|
_PACKAGE_COOKIES += ${_PACKAGE_COOKIE${_s}}
|
2001-04-02 06:35:51 -04:00
|
|
|
.endfor
|
|
|
|
|
2001-04-08 12:55:17 -04:00
|
|
|
.if empty(SUBPACKAGE)
|
2002-08-07 11:48:19 -04:00
|
|
|
FULLPKGPATH=${PKGPATH}${_FLAVOR_EXT2:S/-/,/g}
|
2001-04-08 12:55:17 -04:00
|
|
|
.else
|
2002-08-07 11:48:19 -04:00
|
|
|
FULLPKGPATH=${PKGPATH},${SUBPACKAGE}${_FLAVOR_EXT2:S/-/,/g}
|
2001-04-08 12:55:17 -04:00
|
|
|
.endif
|
|
|
|
|
1996-08-23 07:37:41 -04:00
|
|
|
# A few aliases for *-install targets
|
|
|
|
INSTALL_PROGRAM= \
|
1997-04-27 17:38:33 -04:00
|
|
|
${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
|
1996-08-23 07:37:41 -04:00
|
|
|
INSTALL_SCRIPT= \
|
1997-04-27 17:38:33 -04:00
|
|
|
${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}
|
1996-08-23 07:37:41 -04:00
|
|
|
INSTALL_DATA= \
|
1997-04-27 17:38:33 -04:00
|
|
|
${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE}
|
1996-08-23 07:37:41 -04:00
|
|
|
INSTALL_MAN= \
|
1997-04-27 17:38:33 -04:00
|
|
|
${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
|
2000-02-08 19:26:32 -05:00
|
|
|
|
1998-09-07 18:33:19 -04:00
|
|
|
INSTALL_PROGRAM_DIR= \
|
2000-02-08 19:26:32 -05:00
|
|
|
${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m ${DIRMODE}
|
1998-09-07 18:33:19 -04:00
|
|
|
INSTALL_SCRIPT_DIR= \
|
|
|
|
${INSTALL_PROGRAM_DIR}
|
|
|
|
INSTALL_DATA_DIR= \
|
2000-02-08 19:26:32 -05:00
|
|
|
${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${DIRMODE}
|
1998-09-07 18:33:19 -04:00
|
|
|
INSTALL_MAN_DIR= \
|
2000-02-08 19:26:32 -05:00
|
|
|
${INSTALL} -d -o ${MANOWN} -g ${MANGRP} -m ${DIRMODE}
|
1996-08-23 07:37:41 -04:00
|
|
|
|
2000-09-17 12:26:57 -04:00
|
|
|
_INSTALL_MACROS= BSD_INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
|
1997-09-09 11:11:28 -04:00
|
|
|
BSD_INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
|
|
|
|
BSD_INSTALL_DATA="${INSTALL_DATA}" \
|
1998-09-07 18:33:19 -04:00
|
|
|
BSD_INSTALL_MAN="${INSTALL_MAN}" \
|
|
|
|
BSD_INSTALL_PROGRAM_DIR="${INSTALL_PROGRAM_DIR}" \
|
|
|
|
BSD_INSTALL_SCRIPT_DIR="${INSTALL_SCRIPT_DIR}" \
|
|
|
|
BSD_INSTALL_DATA_DIR="${INSTALL_DATA_DIR}" \
|
|
|
|
BSD_INSTALL_MAN_DIR="${INSTALL_MAN_DIR}"
|
2000-09-17 12:26:57 -04:00
|
|
|
MAKE_ENV+= ${_INSTALL_MACROS}
|
|
|
|
SCRIPTS_ENV+= ${_INSTALL_MACROS}
|
1997-09-09 11:11:28 -04:00
|
|
|
|
2004-01-10 19:49:01 -05:00
|
|
|
# setup systrace variables
|
2003-07-28 13:17:04 -04:00
|
|
|
NO_SYSTRACE?= No
|
|
|
|
.if ${USE_SYSTRACE:L} == "yes" && ${NO_SYSTRACE:L} == "no"
|
2004-01-11 10:04:01 -05:00
|
|
|
_SYSTRACE_CMD?= /bin/systrace -e -i -a -f ${_SYSTRACE_COOKIE}
|
2003-07-28 13:17:04 -04:00
|
|
|
.else
|
|
|
|
_SYSTRACE_CMD=
|
|
|
|
.endif
|
|
|
|
SYSTRACE_FILTER?= ${PORTSDIR}/infrastructure/db/systrace.filter
|
2003-08-11 14:42:07 -04:00
|
|
|
_SYSTRACE_POLICIES+= /bin/sh /usr/bin/env /usr/bin/make \
|
|
|
|
${LOCALBASE}/bin/gmake
|
2004-05-31 08:27:07 -04:00
|
|
|
SYSTRACE_SUBST_VARS+= WRKDIR PORTSDIR DISTDIR TMPDIR PKG_TMPDIR
|
2003-07-28 13:17:04 -04:00
|
|
|
.for _v in ${SYSTRACE_SUBST_VARS}
|
|
|
|
_SYSTRACE_SED_SUBST+=-e 's,$${${_v}},${${_v}},g'
|
|
|
|
.endfor
|
|
|
|
|
2000-06-09 12:26:54 -04:00
|
|
|
# Create the generic variable substitution list, from subst vars
|
2003-07-08 17:51:26 -04:00
|
|
|
SUBST_VARS+=MACHINE_ARCH ARCH HOMEPAGE PREFIX SYSCONFDIR FLAVOR_EXT MAINTAINER
|
2004-08-05 19:43:45 -04:00
|
|
|
_tmpvars=
|
2000-06-09 12:26:54 -04:00
|
|
|
_SED_SUBST=sed
|
2004-09-18 09:45:23 -04:00
|
|
|
|
|
|
|
_PKGADD_AUTO?=
|
|
|
|
.if ${_SOLVING_DEP:L} == "yes"
|
|
|
|
_PKGADD_AUTO+=-a
|
|
|
|
.endif
|
|
|
|
|
2000-06-09 12:26:54 -04:00
|
|
|
.for _v in ${SUBST_VARS}
|
2003-07-11 12:46:20 -04:00
|
|
|
_SED_SUBST+=-e 's|$${${_v}}|${${_v}}|g'
|
2004-09-15 14:57:31 -04:00
|
|
|
PKG_ARGS+=-D${_v}='${${_v}}'
|
2004-08-05 19:43:45 -04:00
|
|
|
_tmpvars += ${_v}='${${_v}}'
|
2000-06-09 12:26:54 -04:00
|
|
|
.endfor
|
2004-09-15 14:57:31 -04:00
|
|
|
PKG_ARGS+=-DFLAVORS='${FLAVOR_EXT}'
|
2004-08-05 19:43:45 -04:00
|
|
|
_tmpvars += FLAVORS='${FLAVOR_EXT}'
|
2004-09-15 14:57:31 -04:00
|
|
|
_SED_SUBST+=-e 's,$${FLAVORS},${FLAVOR_EXT},g' -e 's,$$\\,$$,g'
|
2000-03-29 10:59:50 -05:00
|
|
|
|
2000-06-09 12:26:54 -04:00
|
|
|
# find out the most appropriate PLIST source
|
2001-03-21 19:22:36 -05:00
|
|
|
.if !defined(PLIST) && exists(${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT}.${ARCH})
|
|
|
|
PLIST= ${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT}.${ARCH}
|
2001-05-05 19:42:03 -04:00
|
|
|
.else
|
2004-08-02 09:01:52 -04:00
|
|
|
. if !defined(PLIST) && exists(${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT}.${MACHINE_ARCH})
|
2001-05-05 19:42:03 -04:00
|
|
|
PLIST= ${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT}.${MACHINE_ARCH}
|
2004-08-02 09:01:52 -04:00
|
|
|
. endif
|
2001-05-05 19:42:03 -04:00
|
|
|
.endif
|
2004-08-02 09:01:52 -04:00
|
|
|
.if !defined(PLIST) && ${NO_SHARED_LIBS:L} == "yes" && exists(${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT}.noshared)
|
2001-03-21 19:22:36 -05:00
|
|
|
PLIST= ${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT}.noshared
|
2000-03-31 13:51:09 -05:00
|
|
|
.endif
|
2001-03-21 19:22:36 -05:00
|
|
|
.if !defined(PLIST) && exists(${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT})
|
|
|
|
PLIST= ${PKGDIR}/PLIST${SUBPACKAGE}${FLAVOR_EXT}
|
2000-03-31 13:51:09 -05:00
|
|
|
.endif
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
.if !defined(PLIST) && exists(${PKGDIR}/PLIST${SUBPACKAGE}.${ARCH})
|
|
|
|
PLIST= ${PKGDIR}/PLIST${SUBPACKAGE}.${ARCH}
|
2001-05-05 19:42:03 -04:00
|
|
|
.else
|
2004-08-02 09:01:52 -04:00
|
|
|
. if !defined(PLIST) && exists(${PKGDIR}/PLIST${SUBPACKAGE}.${MACHINE_ARCH})
|
2001-05-05 19:42:03 -04:00
|
|
|
PLIST= ${PKGDIR}/PLIST${SUBPACKAGE}.${MACHINE_ARCH}
|
2004-08-02 09:01:52 -04:00
|
|
|
. endif
|
2001-05-05 19:42:03 -04:00
|
|
|
.endif
|
2004-08-02 09:01:52 -04:00
|
|
|
.if !defined(PLIST) && ${NO_SHARED_LIBS:L} == "yes" && exists(${PKGDIR}/PLIST${SUBPACKAGE}.noshared)
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
PLIST= ${PKGDIR}/PLIST${SUBPACKAGE}.noshared
|
2000-03-31 13:51:09 -05:00
|
|
|
.endif
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
PLIST?= ${PKGDIR}/PLIST${SUBPACKAGE}
|
1997-09-09 11:11:28 -04:00
|
|
|
|
2000-06-09 12:26:54 -04:00
|
|
|
# Likewise for DESCR/MESSAGE/COMMENT
|
2001-03-21 19:22:36 -05:00
|
|
|
.if defined(COMMENT${SUBPACKAGE}${FLAVOR_EXT})
|
2001-05-23 09:28:14 -04:00
|
|
|
_COMMENT=${COMMENT${SUBPACKAGE}${FLAVOR_EXT}}
|
2001-03-16 09:56:41 -05:00
|
|
|
.elif defined(COMMENT${SUBPACKAGE})
|
2001-05-23 09:28:14 -04:00
|
|
|
_COMMENT=${COMMENT${SUBPACKAGE}}
|
2000-03-29 10:59:50 -05:00
|
|
|
.endif
|
2000-06-09 12:26:54 -04:00
|
|
|
|
|
|
|
.if exists(${PKGDIR}/MESSAGE${SUBPACKAGE})
|
|
|
|
MESSAGE?= ${PKGDIR}/MESSAGE${SUBPACKAGE}
|
|
|
|
.endif
|
|
|
|
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
DESCR?= ${PKGDIR}/DESCR${SUBPACKAGE}
|
2000-03-29 10:59:50 -05:00
|
|
|
|
2001-03-06 13:59:38 -05:00
|
|
|
MTREE_FILE?=
|
|
|
|
MTREE_FILE+=${PORTSDIR}/infrastructure/db/fake.mtree
|
|
|
|
|
2000-06-09 12:26:54 -04:00
|
|
|
# Fill out package command, and package dependencies
|
2001-03-16 09:56:41 -05:00
|
|
|
_PKG_PREREQ= ${WRKPKG}/PLIST${SUBPACKAGE} ${WRKPKG}/DESCR${SUBPACKAGE} ${WRKPKG}/COMMENT${SUBPACKAGE}
|
2004-09-15 14:57:31 -04:00
|
|
|
PKG_ARGS+= -v -c '${WRKPKG}/COMMENT${SUBPACKAGE}' -d ${WRKPKG}/DESCR${SUBPACKAGE}
|
|
|
|
PKG_ARGS+=-f ${WRKPKG}/PLIST${SUBPACKAGE} -f ${PLIST} -p ${PREFIX}
|
|
|
|
.if exists(${PKGDIR}/INSTALL${SUBPACKAGE})
|
|
|
|
PKG_ARGS+= -i ${PKGDIR}/INSTALL${SUBPACKAGE}
|
|
|
|
.endif
|
|
|
|
.if exists(${PKGDIR}/DEINSTALL${SUBPACKAGE})
|
|
|
|
PKG_ARGS+= -k ${PKGDIR}/DEINSTALL${SUBPACKAGE}
|
|
|
|
.endif
|
|
|
|
.if exists(${PKGDIR}/REQ${SUBPACKAGE})
|
|
|
|
PKG_ARGS+= -r ${PKGDIR}/REQ${SUBPACKAGE}
|
|
|
|
.endif
|
|
|
|
.if defined(MESSAGE)
|
|
|
|
PKG_ARGS+= -M ${MESSAGE}
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
2001-01-08 17:34:51 -05:00
|
|
|
.if ${FAKE:L} == "yes"
|
2004-08-10 09:48:21 -04:00
|
|
|
PKG_ARGS+= -B ${WRKINST}
|
2000-03-03 16:24:50 -05:00
|
|
|
.endif
|
2004-01-22 16:28:49 -05:00
|
|
|
PKG_ARGS+=-A'${PKG_ARCH}'
|
2004-01-28 17:15:21 -05:00
|
|
|
.if ${LOCALBASE} != "/usr/local"
|
|
|
|
PKG_ARGS+=-L${LOCALBASE}
|
|
|
|
.endif
|
2004-01-10 19:49:01 -05:00
|
|
|
.if !defined(_COMMENT)
|
|
|
|
ERRORS+="Fatal: Missing comment."
|
|
|
|
.endif
|
2000-03-03 16:24:50 -05:00
|
|
|
|
1999-08-22 19:44:51 -04:00
|
|
|
CHMOD?= /bin/chmod
|
|
|
|
CHOWN?= /usr/sbin/chown
|
1997-09-09 11:11:28 -04:00
|
|
|
GUNZIP_CMD?= /usr/bin/gunzip -f
|
1996-12-25 15:10:09 -05:00
|
|
|
GZCAT?= /usr/bin/gzcat
|
|
|
|
GZIP?= -9
|
|
|
|
GZIP_CMD?= /usr/bin/gzip -nf ${GZIP}
|
1998-02-10 03:33:16 -05:00
|
|
|
LDCONFIG?= [ ! -x /sbin/ldconfig ] || /sbin/ldconfig
|
2000-08-22 19:10:38 -04:00
|
|
|
LDCONFIG_SED_SCRIPT?=${PORTSDIR}/infrastructure/install/ldconfig-new.sed
|
1998-11-18 23:20:09 -05:00
|
|
|
M4?= /usr/bin/m4
|
1999-09-02 17:57:32 -04:00
|
|
|
STRIP?= /usr/bin/strip
|
1998-11-24 20:08:35 -05:00
|
|
|
|
1999-12-08 12:00:15 -05:00
|
|
|
# Autoconf scripts MAY tend to use bison by default otherwise
|
|
|
|
YACC?=yacc
|
1998-11-24 20:08:35 -05:00
|
|
|
# XXX ${SETENV} is needed in front of var=value lists whenever the next
|
|
|
|
# command is expanded from a variable, as this could be a shell construct
|
2000-05-16 14:14:29 -04:00
|
|
|
SETENV?= /usr/bin/env -i
|
1997-09-09 11:11:28 -04:00
|
|
|
SH?= /bin/sh
|
1999-12-03 09:57:12 -05:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
# Used to print all the '===>' style prompts - override this to turn them off.
|
1999-11-22 18:44:01 -05:00
|
|
|
ECHO_MSG?= echo
|
1996-06-03 18:47:10 -04:00
|
|
|
|
1999-09-26 06:50:07 -04:00
|
|
|
# basic master sites configuration
|
1998-04-04 23:20:38 -05:00
|
|
|
|
2000-01-27 10:32:15 -05:00
|
|
|
.if exists(${PORTSDIR}/infrastructure/db/network.conf)
|
1999-09-26 06:48:47 -04:00
|
|
|
.include "${PORTSDIR}/infrastructure/db/network.conf"
|
2000-01-27 10:32:15 -05:00
|
|
|
.else
|
|
|
|
.include "${PORTSDIR}/infrastructure/templates/network.conf.template"
|
|
|
|
.endif
|
1997-09-09 11:11:28 -04:00
|
|
|
# Where to put distfiles that don't have any other master site
|
2000-12-01 11:31:11 -05:00
|
|
|
# ;;; This is referenced in a few Makefiles -- we'd like to get rid of it
|
1998-04-04 23:20:38 -05:00
|
|
|
#
|
1997-09-09 11:11:28 -04:00
|
|
|
MASTER_SITE_LOCAL?= \
|
1998-09-07 18:33:19 -04:00
|
|
|
ftp://ftp.netbsd.org/pub/NetBSD/packages/distfiles/LOCAL_PORTS/ \
|
1997-09-09 11:11:28 -04:00
|
|
|
ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/LOCAL_PORTS/
|
|
|
|
|
1999-09-26 06:50:07 -04:00
|
|
|
# Empty declarations to avoid "variable XXX is recursive" errors
|
|
|
|
MASTER_SITES?=
|
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)
|
2002-05-15 14:23:21 -04:00
|
|
|
MASTER_SITES:= ${MASTER_SITES} ${MASTER_SITE_BACKUP}
|
1996-06-03 18:47:10 -04:00
|
|
|
.else
|
2002-05-15 14:23:21 -04:00
|
|
|
MASTER_SITES:= ${MASTER_SITE_OVERRIDE} ${MASTER_SITES}
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
|
|
|
|
2000-02-04 06:15:16 -05:00
|
|
|
# _SITE_SELECTOR chooses the value of sites based on select.
|
|
|
|
_SITE_SELECTOR=case $$select in
|
|
|
|
|
|
|
|
|
1999-12-21 16:43:37 -05:00
|
|
|
.for _I in 0 1 2 3 4 5 6 7 8 9
|
2000-01-13 12:40:20 -05:00
|
|
|
. if defined(MASTER_SITES${_I})
|
|
|
|
. if !defined(MASTER_SITE_OVERRIDE)
|
2002-05-15 14:23:21 -04:00
|
|
|
MASTER_SITES${_I}:= ${MASTER_SITES${_I}} ${MASTER_SITE_BACKUP}
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
2002-05-15 14:23:21 -04:00
|
|
|
MASTER_SITES${_I}:= ${MASTER_SITE_OVERRIDE} ${MASTER_SITES${_I}}
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
2000-02-04 06:15:16 -05:00
|
|
|
_SITE_SELECTOR+=*:${_I}) sites="${MASTER_SITES${_I}}";;
|
2003-08-11 16:07:59 -04:00
|
|
|
. else
|
|
|
|
_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
|
2000-02-04 06:15:16 -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
|
|
|
#
|
2004-09-19 05:00:15 -04: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)
|
2000-07-20 22:38:33 -04:00
|
|
|
_CDROM_OVERRIDE=if ln -s ${CDROM_SITE}/$$f .; then exit 0; fi
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
2000-07-20 22:38:33 -04:00
|
|
|
_CDROM_OVERRIDE=if cp -f ${CDROM_SITE}/$$f .; then exit 0; fi
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1999-12-23 19:27:58 -05:00
|
|
|
.else
|
|
|
|
_CDROM_OVERRIDE=:
|
|
|
|
.endif
|
|
|
|
|
2000-09-11 14:06:24 -04:00
|
|
|
EXTRACT_SUFX?= .tar.gz
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
|
2000-02-04 06:15:16 -05:00
|
|
|
|
2000-02-04 07:55:33 -05:00
|
|
|
_EVERYTHING=${DISTFILES}
|
|
|
|
_DISTFILES= ${DISTFILES:C/:[0-9]$//}
|
|
|
|
ALLFILES= ${_DISTFILES}
|
2000-02-04 06:15:16 -05:00
|
|
|
|
|
|
|
.if defined(PATCHFILES)
|
2000-02-04 07:55:33 -05:00
|
|
|
_PATCHFILES=${PATCHFILES:C/:[0-9]$//}
|
2000-02-04 06:15:16 -05:00
|
|
|
_EVERYTHING+=${PATCHFILES}
|
2000-02-04 07:55:33 -05:00
|
|
|
ALLFILES+= ${_PATCHFILES}
|
2000-02-04 06:15:16 -05:00
|
|
|
.endif
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
.if make(makesum) || make(addsum) || defined(__FETCH_ALL)
|
2000-01-13 12:40:20 -05:00
|
|
|
. if defined(SUPDISTFILES)
|
2000-02-04 06:15:16 -05:00
|
|
|
_EVERYTHING+= ${SUPDISTFILES}
|
|
|
|
ALLFILES+= ${SUPDISTFILES:C/:[0-9]$//}
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1999-04-20 14:04:27 -04:00
|
|
|
.endif
|
1996-12-25 15:10:09 -05:00
|
|
|
|
2003-07-14 09:33:04 -04:00
|
|
|
__CKSUMFILES=
|
2000-02-22 09:07:09 -05:00
|
|
|
# First, remove duplicates
|
|
|
|
.for _file in ${ALLFILES}
|
2003-07-14 09:33:04 -04:00
|
|
|
. if empty(__CKSUMFILES:M${_file})
|
|
|
|
__CKSUMFILES+=${_file}
|
2000-02-04 15:33:42 -05:00
|
|
|
. endif
|
|
|
|
.endfor
|
2003-07-14 09:33:04 -04:00
|
|
|
ALLFILES:=${__CKSUMFILES}
|
2000-02-22 09:07:09 -05:00
|
|
|
|
|
|
|
.if defined(IGNOREFILES)
|
2004-07-11 16:44:33 -04:00
|
|
|
ERRORS+= "Fatal: don't use IGNOREFILES"
|
2000-02-22 09:07:09 -05:00
|
|
|
.endif
|
1996-12-25 15:10:09 -05:00
|
|
|
|
|
|
|
# List of all files, with ${DIST_SUBDIR} in front. Used for checksum.
|
2004-02-07 17:36:13 -05:00
|
|
|
.if !empty(DIST_SUBDIR)
|
2003-07-14 09:33:04 -04:00
|
|
|
_CKSUMFILES= ${__CKSUMFILES:S/^/${DIST_SUBDIR}\//}
|
1996-12-25 15:10:09 -05:00
|
|
|
.else
|
2003-07-14 09:33:04 -04:00
|
|
|
_CKSUMFILES= ${__CKSUMFILES}
|
1996-12-25 15:10:09 -05:00
|
|
|
.endif
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
# This is what is actually going to be extracted, and is overridable
|
|
|
|
# by user.
|
1999-09-26 06:50:07 -04:00
|
|
|
EXTRACT_ONLY?= ${_DISTFILES}
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2000-09-11 14:06:24 -04:00
|
|
|
# okay, time for some guess work
|
2000-12-23 07:27:17 -05:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.zip)
|
2001-08-18 19:16:57 -04:00
|
|
|
_USE_ZIP?= Yes
|
2000-12-23 07:27:17 -05:00
|
|
|
.endif
|
2001-06-03 10:42:07 -04:00
|
|
|
.if !empty(EXTRACT_ONLY:M*.tar.bz2) || (defined(PATCHFILES) && !empty(_PATCHFILES:M*.bz2))
|
2001-08-18 19:16:57 -04:00
|
|
|
_USE_BZIP2?= Yes
|
2003-07-18 15:02:13 -04:00
|
|
|
.endif
|
2001-08-18 19:16:57 -04:00
|
|
|
_USE_ZIP?= No
|
|
|
|
_USE_BZIP2?= No
|
2000-09-11 14:06:24 -04:00
|
|
|
|
2003-07-18 15:02:13 -04:00
|
|
|
EXTRACT_CASES?=
|
2000-09-11 14:06:24 -04:00
|
|
|
|
2002-05-19 14:51:21 -04: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"
|
2001-10-07 06:47:01 -04:00
|
|
|
BUILD_DEPENDS+= :unzip-*:archivers/unzip
|
2000-09-11 14:06:24 -04:00
|
|
|
EXTRACT_CASES+= *.zip) ${UNZIP} -q ${FULLDISTDIR}/$$archive -d ${WRKDIR};;
|
2000-12-16 10:44:35 -05:00
|
|
|
.endif
|
2001-08-18 19:16:57 -04:00
|
|
|
.if ${_USE_BZIP2:L} != "no"
|
2001-10-07 06:47:01 -04:00
|
|
|
BUILD_DEPENDS+= :bzip2-*:archivers/bzip2
|
2000-09-11 14:06:24 -04:00
|
|
|
EXTRACT_CASES+= *.tar.bz2) ${BZIP2} -dc ${FULLDISTDIR}/$$archive | ${TAR} xf -;;
|
2000-12-16 10:44:35 -05:00
|
|
|
.endif
|
2000-09-11 14:06:24 -04:00
|
|
|
EXTRACT_CASES+= *.tar) ${TAR} xf ${FULLDISTDIR}/$$archive;;
|
2002-05-08 14:31:49 -04:00
|
|
|
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;;
|
2001-06-22 03:21:24 -04:00
|
|
|
EXTRACT_CASES+= *.tar.gz) ${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive | ${TAR} xf -;;
|
|
|
|
EXTRACT_CASES+= *.gz) ${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive >`basename $$archive .gz`;;
|
2000-09-11 14:06:24 -04:00
|
|
|
EXTRACT_CASES+= *) ${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive | ${TAR} xf -;;
|
|
|
|
|
2001-06-03 10:42:07 -04:00
|
|
|
PATCH_CASES?=
|
2001-08-18 19:16:57 -04:00
|
|
|
.if ${_USE_BZIP2:L} != "no"
|
2001-06-03 10:42:07 -04:00
|
|
|
PATCH_CASES+= *.bz2) ${BZIP2} -dc $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
|
|
|
|
.endif
|
|
|
|
PATCH_CASES+= *.Z|*.gz) ${GZCAT} $$patchfile | ${PATCH} ${PATCH_DIST_ARGS};;
|
|
|
|
PATCH_CASES+= *) ${PATCH} ${PATCH_DIST_ARGS} < $$patchfile;;
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
# Documentation
|
2001-10-24 07:43:06 -04:00
|
|
|
MAINTAINER?= The OpenBSD ports mailing-list <ports@openbsd.org>
|
1996-12-25 15:10:09 -05:00
|
|
|
|
|
|
|
.if !defined(CATEGORIES)
|
2001-07-17 12:11:45 -04:00
|
|
|
ERRORS+= "Fatal: CATEGORIES is mandatory."
|
1996-12-25 15:10:09 -05:00
|
|
|
.endif
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2000-06-02 07:42:53 -04:00
|
|
|
|
1999-03-02 23:16:03 -05:00
|
|
|
CONFIGURE_SCRIPT?= configure
|
2001-09-16 10:56:42 -04:00
|
|
|
.if ${CONFIGURE_SCRIPT:M/*}
|
|
|
|
_CONFIGURE_SCRIPT=${CONFIGURE_SCRIPT}
|
1999-03-02 23:16:03 -05:00
|
|
|
.else
|
2001-09-16 10:56:42 -04:00
|
|
|
. if defined(SEPARATE_BUILD)
|
|
|
|
_CONFIGURE_SCRIPT=${WRKSRC}/${CONFIGURE_SCRIPT}
|
|
|
|
. else
|
1999-03-02 23:16:03 -05:00
|
|
|
_CONFIGURE_SCRIPT=./${CONFIGURE_SCRIPT}
|
2001-09-16 10:56:42 -04:00
|
|
|
. endif
|
1999-03-02 23:16:03 -05:00
|
|
|
.endif
|
2001-09-16 10:56:42 -04:00
|
|
|
|
1999-03-02 23:16:03 -05:00
|
|
|
CONFIGURE_ENV+= PATH=${PORTPATH}
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2004-08-02 09:01:52 -04:00
|
|
|
.if ${NO_SHARED_LIBS:L} == "yes"
|
1999-03-01 14:44:18 -05:00
|
|
|
CONFIGURE_SHARED?= --disable-shared
|
|
|
|
.else
|
|
|
|
CONFIGURE_SHARED?= --enable-shared
|
|
|
|
.endif
|
|
|
|
|
2000-02-08 19:23:26 -05:00
|
|
|
# Passed to configure invocations, and user scripts
|
1998-09-07 18:33:19 -04:00
|
|
|
SCRIPTS_ENV+= CURDIR=${.CURDIR} DISTDIR=${DISTDIR} \
|
2000-02-08 19:23:26 -05:00
|
|
|
PATH=${PORTPATH} WRKDIR=${WRKDIR} WRKDIST=${WRKDIST} \
|
|
|
|
WRKSRC=${WRKSRC} WRKBUILD=${WRKBUILD} \
|
1999-02-03 12:53:13 -05:00
|
|
|
PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR} \
|
1997-09-09 11:11:28 -04:00
|
|
|
PORTSDIR=${PORTSDIR} DEPENDS="${DEPENDS}" \
|
|
|
|
PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE}
|
|
|
|
|
|
|
|
.if defined(BATCH)
|
|
|
|
SCRIPTS_ENV+= BATCH=yes
|
|
|
|
.endif
|
|
|
|
|
2002-04-09 09:52:58 -04:00
|
|
|
USE_X11?=No
|
2003-07-25 08:46:26 -04:00
|
|
|
|
|
|
|
FETCH_MANUALLY?=No
|
|
|
|
.if ${FETCH_MANUALLY:L} != "no"
|
|
|
|
_ALLFILES_PRESENT=Yes
|
2003-08-14 11:29:20 -04:00
|
|
|
. for _F in ${ALLFILES:S@^@${FULLDISTDIR}/@}
|
2003-07-25 08:46:26 -04:00
|
|
|
. if !exists(${_F})
|
|
|
|
_ALLFILES_PRESENT=No
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. if ${_ALLFILES_PRESENT:L} == "no"
|
|
|
|
IS_INTERACTIVE=Yes
|
|
|
|
. 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
|
|
|
################################################################
|
|
|
|
|
1997-09-09 11:11:28 -04:00
|
|
|
.if !defined(NO_IGNORE)
|
2001-10-07 07:30:30 -04:00
|
|
|
. if (defined(REGRESS_IS_INTERACTIVE) && defined(BATCH))
|
|
|
|
_IGNORE_REGRESS= "has interactive tests"
|
2002-02-28 19:49:03 -05:00
|
|
|
. elif (!defined(REGRESS_IS_INTERACTIVE) && defined(INTERACTIVE))
|
2001-10-07 07:30:30 -04:00
|
|
|
_IGNORE_REGRESS= "does not have interactive tests"
|
|
|
|
. endif
|
2000-01-13 12:40:20 -05:00
|
|
|
. if (defined(IS_INTERACTIVE) && defined(BATCH))
|
1996-12-25 15:10:09 -05:00
|
|
|
IGNORE= "is an interactive port"
|
2000-01-13 12:40:20 -05:00
|
|
|
. elif (!defined(IS_INTERACTIVE) && defined(INTERACTIVE))
|
1996-12-25 15:10:09 -05:00
|
|
|
IGNORE= "is not an interactive port"
|
2002-04-09 09:52:58 -04:00
|
|
|
. elif ${USE_X11:L} == "yes" && !exists(${X11BASE})
|
1997-09-09 11:11:28 -04:00
|
|
|
IGNORE= "uses X11, but ${X11BASE} not found"
|
2000-01-13 12:40:20 -05:00
|
|
|
. elif defined(BROKEN)
|
1996-12-25 15:10:09 -05:00
|
|
|
IGNORE= "is marked as broken: ${BROKEN}"
|
2000-01-13 12:40:20 -05:00
|
|
|
. elif defined(ONLY_FOR_ARCHS)
|
|
|
|
. for __ARCH in ${MACHINE_ARCH} ${ARCH}
|
|
|
|
. if !empty(ONLY_FOR_ARCHS:M${__ARCH})
|
1999-12-03 12:37:33 -05:00
|
|
|
_ARCH_OK=1
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. if !defined(_ARCH_OK)
|
|
|
|
. if ${MACHINE_ARCH} == "${ARCH}"
|
1998-09-07 18:33:19 -04:00
|
|
|
IGNORE= "is only for ${ONLY_FOR_ARCHS}, not ${MACHINE_ARCH}"
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
1998-11-17 01:39:25 -05:00
|
|
|
IGNORE= "is only for ${ONLY_FOR_ARCHS}, not ${MACHINE_ARCH} \(${ARCH}\)"
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
|
|
|
. endif
|
2001-03-28 05:25:38 -05:00
|
|
|
. elif defined(NOT_FOR_ARCHS)
|
|
|
|
. for __ARCH in ${MACHINE_ARCH} ${ARCH}
|
|
|
|
. if !empty(NOT_FOR_ARCHS:M${__ARCH})
|
|
|
|
IGNORE= "is not for ${NOT_FOR_ARCHS}"
|
|
|
|
. endif
|
|
|
|
. endfor
|
2004-08-03 04:04:02 -04:00
|
|
|
. elif ${SHARED_ONLY:L} == "yes" && ${NO_SHARED_LIBS:L} == "yes"
|
|
|
|
IGNORE="requires shared libraries"
|
2000-04-09 07:34:01 -04:00
|
|
|
. endif
|
|
|
|
. if !defined(IGNORE) && defined(COMES_WITH)
|
2000-01-13 12:40:20 -05:00
|
|
|
. if ( ${OPSYS_VER} >= ${COMES_WITH} )
|
2001-08-12 07:33:10 -04:00
|
|
|
IGNORE= "-- ${FULLPKGNAME${SUBPACKAGE}:C/-[0-9].*//g} comes with ${OPSYS} as of release ${COMES_WITH}"
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
|
|
|
. endif
|
1996-06-03 18:47:10 -04:00
|
|
|
|
1999-12-19 18:48:36 -05:00
|
|
|
.endif # NO_IGNORE
|
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
|
1997-09-09 11:11:28 -04:00
|
|
|
.if !defined(DEPENDS_TARGET)
|
2000-01-13 12:40:20 -05:00
|
|
|
. if make(reinstall)
|
1997-09-09 11:11:28 -04:00
|
|
|
DEPENDS_TARGET= reinstall
|
2000-01-13 12:40:20 -05:00
|
|
|
. else
|
1997-09-09 11:11:28 -04:00
|
|
|
DEPENDS_TARGET= install
|
2000-01-13 12:40:20 -05:00
|
|
|
. endif
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
|
|
|
|
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
|
|
|
|
2003-07-23 05:58:33 -04:00
|
|
|
_build_depends_fragment= \
|
2003-07-30 06:40:43 -04:00
|
|
|
if pkg dependencies check "$$pkg"; then \
|
2001-04-20 12:25:24 -04:00
|
|
|
found=true; \
|
|
|
|
fi
|
2003-07-23 05:58:33 -04:00
|
|
|
_run_depends_fragment=${_build_depends_fragment}
|
|
|
|
_regress_depends_fragment=${_build_depends_fragment}
|
2001-04-20 12:25:24 -04:00
|
|
|
|
2004-08-02 09:01:52 -04:00
|
|
|
.if ${NO_SHARED_LIBS:L} == "yes"
|
2002-09-11 15:35:21 -04:00
|
|
|
_noshared=-noshared
|
2001-04-20 12:25:24 -04:00
|
|
|
.else
|
2001-11-17 05:39:19 -05:00
|
|
|
_noshared=
|
2001-11-12 09:24:06 -05:00
|
|
|
.endif
|
|
|
|
|
|
|
|
_libresolve_fragment = \
|
|
|
|
case "$$d" in \
|
|
|
|
*/*) shprefix="$${d%/*}/"; shdir="${LOCALBASE}/$${d%/*}"; \
|
|
|
|
d=$${d\#\#*/};; \
|
|
|
|
*) shprefix="" shdir="${LOCALBASE}/lib";; \
|
|
|
|
esac; \
|
2001-11-17 05:39:19 -05:00
|
|
|
check=`eval $$listlibs| perl \
|
|
|
|
${PORTSDIR}/infrastructure/build/resolve-lib ${_noshared} $$d` \
|
|
|
|
|| true
|
2001-11-12 09:24:06 -05:00
|
|
|
|
|
|
|
|
2001-03-28 06:48:12 -05:00
|
|
|
_lib_depends_fragment = \
|
2001-09-19 11:16:39 -04:00
|
|
|
what=$$dep; \
|
2001-09-05 05:10:34 -04:00
|
|
|
IFS=,; bad=false; for d in $$dep; do \
|
2001-11-12 09:24:06 -05:00
|
|
|
listlibs='ls $$shdir 2>/dev/null'; \
|
|
|
|
${_libresolve_fragment}; \
|
2001-11-17 05:39:19 -05:00
|
|
|
case "$$check" in \
|
|
|
|
Missing\ library) bad=true; msg="$$msg $$d missing...";; \
|
|
|
|
Error:*) bad=true; msg="$$msg $$d unsolvable...";; \
|
|
|
|
esac; \
|
2001-09-05 05:10:34 -04:00
|
|
|
done; $$bad || found=true
|
2001-11-12 09:24:06 -05:00
|
|
|
|
2004-01-10 19:49:01 -05:00
|
|
|
_FULL_PACKAGE_NAME?=No
|
|
|
|
|
|
|
|
.for _DEP in build run lib regress
|
|
|
|
_DEP${_DEP}_COOKIES=
|
|
|
|
. if defined(${_DEP:U}_DEPENDS) && ${NO_DEPENDS:L} == "no"
|
|
|
|
. for _i in ${${_DEP:U}_DEPENDS}
|
|
|
|
_DEP${_DEP}_COOKIES+=${WRKDIR}/.${_DEP}${_i:C,[|:./<=>*],-,g}
|
|
|
|
. endfor
|
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
# Normal user-mode targets are PHONY targets, e.g., don't create the
|
|
|
|
# corresponding file. However, there is nothing phony about the cookie.
|
|
|
|
|
|
|
|
_INSTALL_DEPS=${_INSTALL_COOKIE}
|
|
|
|
_PACKAGE_DEPS=${_PACKAGE_COOKIES}
|
|
|
|
.if defined(ALWAYS_PACKAGE)
|
|
|
|
_INSTALL_DEPS+=${_PACKAGE_COOKIES}
|
|
|
|
.endif
|
2004-02-07 17:34:02 -05:00
|
|
|
.if ${BULK_${PKGPATH}:L} == "yes"
|
2004-01-10 19:49:01 -05:00
|
|
|
_INSTALL_DEPS+=${_BULK_COOKIE}
|
|
|
|
_PACKAGE_DEPS+=${_BULK_COOKIE}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
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}
|
|
|
|
|
|
|
|
VMEM_WARNING?= No
|
|
|
|
|
|
|
|
_FAKE_SETUP=TRUEPREFIX=${PREFIX} PREFIX=${WRKINST}${PREFIX} ${DESTDIRNAME}=${WRKINST}
|
|
|
|
|
|
|
|
_CLEANDEPENDS?=Yes
|
|
|
|
|
|
|
|
# mirroring utilities
|
2004-02-07 17:36:13 -05:00
|
|
|
.if !empty(DIST_SUBDIR)
|
2004-01-10 19:49:01 -05:00
|
|
|
_ALLFILES=${ALLFILES:S/^/${DIST_SUBDIR}\//}
|
|
|
|
.else
|
|
|
|
_ALLFILES=${ALLFILES}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
_FMN=${PKGPATH}/${FULLPKGNAME}
|
|
|
|
.if defined(MULTI_PACKAGES)
|
|
|
|
. for _S in ${MULTI_PACKAGES}
|
|
|
|
_FMN+= ${PKGPATH}/${FULLPKGNAME${_S}}
|
|
|
|
. endfor
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Internal variables, used by dependencies targets
|
|
|
|
# Only keep pkg:dir spec
|
2004-08-02 09:01:52 -04:00
|
|
|
.if defined(LIB_DEPENDS) && ${NO_SHARED_LIBS:L} != "yes"
|
2004-01-10 19:49:01 -05:00
|
|
|
_ALWAYS_DEP2 = ${LIB_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
|
|
|
_ALWAYS_DEP= ${_ALWAYS_DEP2:C/[^:]*://}
|
|
|
|
.else
|
|
|
|
_ALWAYS_DEP2=
|
|
|
|
_ALWAYS_DEP=
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(RUN_DEPENDS)
|
|
|
|
_RUN_DEP2 = ${RUN_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
|
|
|
_RUN_DEP = ${_RUN_DEP2:C/[^:]*://}
|
|
|
|
.else
|
|
|
|
_RUN_DEP2=
|
|
|
|
_RUN_DEP=
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
|
|
.if defined(BUILD_DEPENDS)
|
|
|
|
_BUILD_DEP2 = ${BUILD_DEPENDS:C/^[^:]*:([^:]*:[^:]*).*$/\1/}
|
|
|
|
_BUILD_DEP = ${_BUILD_DEP2:C/[^:]*://}
|
|
|
|
.else
|
|
|
|
_BUILD_DEP2=
|
|
|
|
_BUILD_DEP=
|
|
|
|
.endif
|
|
|
|
|
|
|
|
_LIB_DEP2= ${LIB_DEPENDS}
|
|
|
|
|
|
|
|
README_NAME?= ${TEMPLATES}/README.port
|
|
|
|
|
2004-06-06 07:49:08 -04:00
|
|
|
REORDER_DEPENDENCIES?=
|
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:
|
|
|
|
# nothing happens unless LOCKDIR, LOCK_CMD and UNLOCK_CMD are defined
|
|
|
|
|
|
|
|
LOCK_VERBOSE?=No
|
|
|
|
.if defined(LOCKDIR) && defined(LOCK_CMD) && defined(UNLOCK_CMD)
|
|
|
|
. if ${LOCK_VERBOSE:L} == "yes"
|
|
|
|
_LOCK=echo "Locking $$lock from $@"; ${LOCK_CMD} ${LOCKDIR}/$$lock.lock
|
|
|
|
_UNLOCK=echo "Unlocking $$lock from $@"; ${UNLOCK_CMD} ${LOCKDIR}/$$lock.lock
|
|
|
|
. else
|
|
|
|
_LOCK=${LOCK_CMD} ${LOCKDIR}/$$lock.lock
|
|
|
|
_UNLOCK=${UNLOCK_CMD} ${LOCKDIR}/$$lock.lock
|
|
|
|
. endif
|
|
|
|
. if defined(SEPARATE_BUILD) && ${SEPARATE_BUILD:L:Mflavored}
|
2004-08-11 18:25:23 -04: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
|
2004-08-11 18:25:23 -04: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
|
2004-08-11 18:25:23 -04:00
|
|
|
_DO_LOCK=\
|
|
|
|
: $${lock:=${_LOCKNAME}}; \
|
|
|
|
case X$$lock in \
|
|
|
|
X${_MASTER_LOCK}) \
|
|
|
|
;; \
|
|
|
|
*) \
|
|
|
|
${_LOCK}; trap '${_UNLOCK}' 0 1 2 3 13 15;; \
|
|
|
|
esac
|
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
|
|
|
|
_DO_LOCK=:
|
|
|
|
.endif
|
2004-01-10 19:49:01 -05:00
|
|
|
###
|
|
|
|
### end of variable setup. Only targets now
|
|
|
|
###
|
|
|
|
|
|
|
|
.if ${BIN_PACKAGES:L} == "yes"
|
|
|
|
${_PACKAGE_COOKIE}:
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} ${_PACKAGE_COOKIE_DEPS}
|
|
|
|
.else
|
|
|
|
${_PACKAGE_COOKIE}: ${_PACKAGE_COOKIE_DEPS}
|
|
|
|
.endif
|
|
|
|
@cd ${.CURDIR} && SUBPACKAGE='' FLAVOR='${FLAVOR}' PACKAGING='' exec ${MAKE} _package
|
|
|
|
.if !defined(PACKAGE_NOINSTALL)
|
|
|
|
@${_MAKE_COOKIE} $@
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.for _s in ${MULTI_PACKAGES}
|
|
|
|
. if ${BIN_PACKAGES:L} == "yes"
|
|
|
|
${_PACKAGE_COOKIE${_s}}:
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} ${_PACKAGE_COOKIE_DEPS}
|
|
|
|
. else
|
|
|
|
${_PACKAGE_COOKIE${_s}}: ${_PACKAGE_COOKIE_DEPS}
|
|
|
|
. endif
|
|
|
|
@cd ${.CURDIR} && SUBPACKAGE='${_s}' FLAVOR='${FLAVOR}' PACKAGING='${_s}' exec ${MAKE} _package
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.PRECIOUS: ${_PACKAGE_COOKIES} ${_INSTALL_COOKIE}
|
|
|
|
|
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 \
|
|
|
|
cat ${.CURDIR}/systrace.filter >> $@; \
|
|
|
|
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
|
|
|
|
|
|
|
# create the packing stuff from source
|
|
|
|
${WRKPKG}/COMMENT${SUBPACKAGE}:
|
|
|
|
@echo ${_COMMENT} >$@
|
|
|
|
|
2004-09-15 14:57:31 -04:00
|
|
|
${WRKPKG}/PLIST${SUBPACKAGE}: ${WRKPKG}/depends${SUBPACKAGE}
|
2004-01-10 19:49:01 -05:00
|
|
|
@echo "@comment subdir=${FULLPKGPATH} cdrom=${PERMIT_PACKAGE_CDROM:L} ftp=${PERMIT_PACKAGE_FTP:L}" >$@.tmp
|
|
|
|
@sort -u <${WRKPKG}/depends${SUBPACKAGE}>>$@.tmp
|
2004-09-15 14:57:31 -04:00
|
|
|
@mv -f $@.tmp $@
|
2004-01-10 19:49:01 -05:00
|
|
|
|
|
|
|
${WRKPKG}/depends${SUBPACKAGE}:
|
|
|
|
@mkdir -p ${WRKPKG}
|
|
|
|
@>$@
|
2004-08-02 09:01:52 -04:00
|
|
|
.if (defined(RUN_DEPENDS) && !empty(RUN_DEPENDS)) || (${NO_SHARED_LIBS:L} != "yes" && defined(LIB_DEPENDS) && !empty(LIB_DEPENDS))
|
2004-01-10 19:49:01 -05:00
|
|
|
@${_depfile_fragment}; \
|
2004-08-02 08:10:17 -04:00
|
|
|
_depends_result=$@ ${MAKE} _solve-package-depends
|
2004-01-10 19:49:01 -05:00
|
|
|
.endif
|
|
|
|
|
|
|
|
${WRKPKG}/DESCR${SUBPACKAGE}: ${DESCR}
|
|
|
|
@${_SED_SUBST} <$? >$@.tmp && mv -f $@.tmp $@
|
|
|
|
@echo "\nMaintainer: ${MAINTAINER}" >>$@
|
|
|
|
.if defined(HOMEPAGE)
|
|
|
|
@fgrep -q '$${HOMEPAGE}' $? || echo "\nWWW: ${HOMEPAGE}" >>$@
|
|
|
|
.endif
|
|
|
|
|
|
|
|
${WRKPKG}/mtree.spec: ${MTREE_FILE}
|
|
|
|
@${_SED_SUBST} ${MTREE_FILE}>$@.tmp && mv -f $@.tmp $@
|
|
|
|
|
|
|
|
|
|
|
|
makesum: fetch-all
|
|
|
|
.if !defined(NO_CHECKSUM)
|
|
|
|
@rm -f ${CHECKSUM_FILE}
|
|
|
|
@cd ${DISTDIR} && \
|
|
|
|
for cipher in ${_CIPHERS}; do \
|
|
|
|
$$cipher ${_CKSUMFILES} >> ${CHECKSUM_FILE}; \
|
|
|
|
done
|
|
|
|
@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 \
|
|
|
|
$$cipher ${_CKSUMFILES} >> ${CHECKSUM_FILE}; \
|
|
|
|
done
|
|
|
|
@sort -u -o ${CHECKSUM_FILE} ${CHECKSUM_FILE}
|
|
|
|
@if [ `sed -e 's/\=.*$$//' ${CHECKSUM_FILE} | uniq -d | wc -l` -ne 0 ]; then \
|
|
|
|
echo "Inconsistent checksum in ${CHECKSUM_FILE}"; \
|
|
|
|
exit 1; \
|
|
|
|
else \
|
|
|
|
${ECHO_MSG} "${CHECKSUM_FILE} updated okay, don't forget to remove cruft"; \
|
|
|
|
fi
|
|
|
|
.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 \
|
|
|
|
_internal-run-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
|
|
|
|
2003-07-23 05:58:33 -04:00
|
|
|
.for _DEP in build run lib regress
|
2001-03-28 06:48:12 -05:00
|
|
|
. if defined(${_DEP:U}_DEPENDS) && ${NO_DEPENDS:L} == "no"
|
2001-04-12 16:35:59 -04:00
|
|
|
. for _i in ${${_DEP:U}_DEPENDS}
|
2001-09-21 07:41:17 -04:00
|
|
|
${WRKDIR}/.${_DEP}${_i:C,[|:./<=>*],-,g}: ${_WRKDIR_COOKIE}
|
2002-04-24 17:29:26 -04:00
|
|
|
@unset PACKAGING DEPENDS_TARGET FLAVOR SUBPACKAGE _MASTER WRKDIR|| true; \
|
2001-04-12 16:35:59 -04:00
|
|
|
echo '${_i}'|{ \
|
|
|
|
IFS=:; read dep pkg dir target; \
|
2002-04-24 17:29:26 -04:00
|
|
|
${_flavor_fragment}; defaulted=false; \
|
2001-04-12 16:35:59 -04:00
|
|
|
case "X$$target" in X) target=${DEPENDS_TARGET};; esac; \
|
2004-08-12 15:02:45 -04:00
|
|
|
toset="$$toset _MASTER_LOCK=${_LOCKNAME}"; \
|
2002-04-24 17:29:26 -04:00
|
|
|
case "X$$target" in \
|
|
|
|
Xinstall|Xreinstall) early_exit=false;; \
|
2001-09-30 07:27:05 -04:00
|
|
|
Xpackage) early_exit=true;; \
|
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"; \
|
2002-04-24 17:29:26 -04:00
|
|
|
dep="/nonexistent";; \
|
|
|
|
esac; \
|
2004-09-18 09:45:23 -04:00
|
|
|
toset="$$toset _SOLVING_DEP=Yes"; \
|
2001-11-12 09:14:46 -05:00
|
|
|
case "X$$pkg" in X) pkg=`eval $$toset ${MAKE} _print-packagename`; \
|
2001-10-28 07:34:57 -05:00
|
|
|
defaulted=true;; esac; \
|
2001-04-12 16:35:59 -04:00
|
|
|
for abort in false false true; do \
|
|
|
|
if $$abort; then \
|
|
|
|
${ECHO_MSG} "Dependency check failed"; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
found=false; \
|
2001-09-30 07:27:05 -04:00
|
|
|
what=$$pkg; \
|
2001-04-12 16:35:59 -04:00
|
|
|
case "$$dep" in \
|
2001-08-27 04:47:37 -04:00
|
|
|
"/nonexistent") ;; \
|
2001-09-05 05:10:34 -04:00
|
|
|
*) \
|
2001-04-12 16:35:59 -04:00
|
|
|
${_${_DEP}_depends_fragment}; \
|
|
|
|
if $$found; then \
|
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"; \
|
2001-04-12 16:35:59 -04:00
|
|
|
fi;; \
|
|
|
|
esac; \
|
2001-09-19 11:16:39 -04:00
|
|
|
${ECHO_MSG} "===> Verifying $$target for $$what in $$dir"; \
|
2003-07-30 15:31:31 -04:00
|
|
|
if eval $$toset ${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 \
|
|
|
|
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} $@
|
2001-04-12 16:35:59 -04:00
|
|
|
. endfor
|
2001-03-28 06:48:12 -05:00
|
|
|
. 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-${_DEP}-depends: ${_DEP${_DEP}_COOKIES}
|
2001-03-28 06:48:12 -05:00
|
|
|
.endfor
|
|
|
|
|
2003-07-18 15:02:13 -04:00
|
|
|
# Do a brute-force ldd/objdump on all files under WRKINST.
|
2001-10-28 00:59:26 -04:00
|
|
|
.if ${ELF_TOOLCHAIN:L} == "no"
|
2001-10-24 07:53:54 -04:00
|
|
|
${_LIBLIST}: ${_FAKE_COOKIE}
|
|
|
|
@${SUDO} mkdir -p ${WRKINST}/usr/libexec
|
|
|
|
@-${SUDO} cp -f /usr/libexec/ld.so ${WRKINST}/usr/libexec
|
|
|
|
@-${SUDO} cp -f /usr/lib/libc.so.* ${WRKINST}
|
|
|
|
@-${SUDO} cp -f /usr/bin/ldd ${WRKINST}
|
2001-11-01 07:26:16 -05:00
|
|
|
@cd ${WRKINST} && ${SUDO} find . -type f|\
|
2001-10-24 07:53:54 -04:00
|
|
|
${SUDO} env LD_LIBRARY_PATH=. xargs chroot ${WRKINST} \
|
|
|
|
./ldd -f '\tlibrary: %o %m %n\n' -f '\tlibrary: %o %m %n\n' 2>/dev/null|\
|
|
|
|
grep '^ '|\
|
|
|
|
sort -u >$@
|
2001-10-26 13:34:31 -04:00
|
|
|
.else
|
|
|
|
${_LIBLIST}: ${_FAKE_COOKIE}
|
|
|
|
@cd ${WRKINST} && ${SUDO} find . -type f|\
|
|
|
|
xargs objdump -p 2>/dev/null |\
|
2004-02-01 18:07:30 -05:00
|
|
|
sed -n \
|
|
|
|
-e '/^ *NEEDED *\(.*\)\.so\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)$$/s//\1 \2 \3/p' \
|
|
|
|
-e '/^ *NEEDED *\(.*\)\.so$$/s//\1/p'| \
|
2001-10-26 13:34:31 -04:00
|
|
|
sort -u >$@
|
|
|
|
.endif
|
2001-10-24 07:53:54 -04:00
|
|
|
|
|
|
|
# list of libraries that can be used: libraries just built, and system libs.
|
|
|
|
${_BUILDLIBLIST}: ${_FAKE_COOKIE}
|
|
|
|
@{ \
|
|
|
|
${SUDO} find ${WRKINST} -type f -o -type l; \
|
|
|
|
find /usr/lib -path /usr/lib -o -type d -prune -o -type f -print; \
|
|
|
|
find ${X11BASE}/lib -path ${X11BASE}/lib -o -type d -prune -o -type f -print; \
|
|
|
|
}|\
|
2004-02-01 18:07:30 -05:00
|
|
|
egrep '(\.so\.|\.so$$)'|${SUDO} xargs file -L|fgrep 'shared'|cut -d\: -f1|sort -u >$@
|
2001-10-24 07:53:54 -04:00
|
|
|
|
2001-03-28 06:48:12 -05:00
|
|
|
|
2001-09-05 05:13:18 -04:00
|
|
|
|
2001-03-29 14:01:05 -05:00
|
|
|
.if defined(IGNORE) && !defined(NO_IGNORE)
|
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 _internal-checksum _internal-extract _internal-patch \
|
|
|
|
_internal-configure _internal-all _internal-build _internal-install \
|
|
|
|
_internal-regress _internal-uninstall _internal-deinstall _internal-fake \
|
|
|
|
_internal-package _internal-lib-depends-check _internal-manpages-check:
|
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
|
2001-10-24 07:57:34 -04:00
|
|
|
# For now, just check all libnames are present
|
|
|
|
# The check is done on the fake area, be wary of multi-packages situation,
|
|
|
|
# since we don't take it into account yet.
|
|
|
|
#
|
|
|
|
# Note that we cache needed library names, and libraries we're allowed to
|
|
|
|
# depend upon, but not the actual list of lib depends, since this list is
|
|
|
|
# going to be tweaked as a result of running lib-depends-check.
|
|
|
|
#
|
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-lib-depends-check: ${_LIBLIST} ${_BUILDLIBLIST}
|
2003-08-04 10:00:46 -04:00
|
|
|
@${_depfile_fragment}; \
|
|
|
|
LIB_DEPENDS="`${MAKE} _recurse-lib-depends-check`" \
|
|
|
|
PKG_DBDIR='${PKG_DBDIR}' \
|
2004-09-18 09:48:43 -04:00
|
|
|
perl ${PORTSDIR}/infrastructure/install/check-libs-elf \
|
2003-08-04 10:00:46 -04:00
|
|
|
${_LIBLIST} ${_BUILDLIBLIST}
|
2001-10-24 07:57:34 -04: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-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:
|
|
|
|
. if !empty(ALLFILES)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} ${ALLFILES:S@^@${FULLDISTDIR}/@}
|
|
|
|
. endif
|
|
|
|
# End of FETCH
|
|
|
|
. endif
|
|
|
|
. if target(post-fetch)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-fetch
|
|
|
|
. endif
|
|
|
|
|
|
|
|
|
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)
|
2001-11-11 07:59:50 -05:00
|
|
|
@checksum_file=${CHECKSUM_FILE}; \
|
|
|
|
if [ ! -f $$checksum_file ]; then \
|
2001-03-29 14:01:05 -05:00
|
|
|
${ECHO_MSG} ">> No checksum file."; \
|
|
|
|
else \
|
|
|
|
cd ${DISTDIR}; OK=true; list=''; \
|
|
|
|
for file in ${_CKSUMFILES}; do \
|
|
|
|
for cipher in ${PREFERRED_CIPHERS}; do \
|
2001-11-11 07:59:50 -05: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;; \
|
|
|
|
*) \
|
|
|
|
CKSUM=`$$cipher < $$file`; \
|
|
|
|
case "$$CKSUM" in \
|
|
|
|
"$$4") \
|
|
|
|
${ECHO_MSG} ">> Checksum OK for $$file. ($$cipher)";; \
|
|
|
|
*) \
|
|
|
|
echo ">> Checksum mismatch for $$file. ($$cipher)"; \
|
|
|
|
list="$$list $$file $$cipher $$4"; \
|
|
|
|
OK=false;; \
|
|
|
|
esac;; \
|
|
|
|
esac; \
|
|
|
|
done; \
|
|
|
|
set --; \
|
|
|
|
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 \
|
2001-11-11 07:59:50 -05: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} \
|
|
|
|
MASTER_SITE_OVERRIDE="ftp://ftp.openbsd.org/pub/OpenBSD/distfiles/${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}
|
|
|
|
_internal-patch: ${_DEPbuild_COOKIES} ${_DEPlib_COOKIES} \
|
2001-09-05 05:13:18 -04:00
|
|
|
${_PATCH_COOKIE}
|
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-distpatch: ${_DEPbuild_COOKIES} ${_DEPlib_COOKIES} \
|
2001-09-05 05:13:18 -04:00
|
|
|
${_DISTPATCH_COOKIE}
|
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-configure: ${_DEPbuild_COOKIES} ${_DEPlib_COOKIES} \
|
2001-09-05 05:13:18 -04:00
|
|
|
${_CONFIGURE_COOKIE}
|
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-build _internal-all: ${_DEPbuild_COOKIES} ${_DEPlib_COOKIES} \
|
2001-09-05 05:13:18 -04:00
|
|
|
${_BUILD_COOKIE}
|
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-install: ${_INSTALL_DEPS}
|
|
|
|
_internal-fake: ${_FAKE_COOKIE}
|
|
|
|
_internal-package: ${_PACKAGE_DEPS}
|
2002-04-17 11:58:48 -04:00
|
|
|
|
2000-02-04 06:09:33 -05: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
|
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: ${_DEPregress_COOKIES} ${_REGRESS_COOKIE}
|
2001-10-07 07:30:30 -04:00
|
|
|
. endif
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
_TOP_TARGETS=extract patch distpatch configure build all install fake package \
|
|
|
|
fetch checksum regress depends lib-depends build-depends run-depends \
|
|
|
|
regress-depends clean lib-depends-check manpages-check plist update-plist
|
|
|
|
.if defined(_LOCK)
|
|
|
|
. for _t in ${_TOP_TARGETS}
|
|
|
|
${_t}:
|
|
|
|
@${_DO_LOCK}; cd ${.CURDIR} && ${MAKE} _internal-${_t}
|
|
|
|
. endfor
|
|
|
|
.else
|
|
|
|
. for _t in ${_TOP_TARGETS}
|
|
|
|
${_t}: _internal-${_t}
|
|
|
|
. endfor
|
|
|
|
.endif
|
|
|
|
|
2002-04-17 11:58:48 -04:00
|
|
|
${_BULK_COOKIE}: ${_PACKAGE_COOKIES}
|
|
|
|
@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
|
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}
|
2003-01-14 13:18:23 -05:00
|
|
|
@mkdir -p ${WRKDIR} ${WRKDIR}/bin
|
2001-09-05 05:13:18 -04:00
|
|
|
@${_MAKE_COOKIE} $@
|
|
|
|
|
2003-07-28 13:17:04 -04:00
|
|
|
${_EXTRACT_COOKIE}: ${_WRKDIR_COOKIE} ${_SYSTRACE_COOKIE}
|
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 _internal-build-depends _internal-lib-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}; \
|
|
|
|
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}:
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} pre-patch
|
2000-09-23 08:36:39 -04:00
|
|
|
. if ${PATCH_CHECK_ONLY:L} != "yes"
|
2001-03-28 06:32:29 -05:00
|
|
|
@${_MAKE_COOKIE} $@
|
2000-09-23 08:36:39 -04:00
|
|
|
. endif
|
2000-01-26 18:11:08 -05:00
|
|
|
.endif
|
2000-02-04 06:09:33 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# The real distpatch
|
|
|
|
|
|
|
|
${_DISTPATCH_COOKIE}: ${_EXTRACT_COOKIE}
|
2000-06-16 19:10:41 -04:00
|
|
|
.if target(pre-patch)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} ${_PREPATCH_COOKIE}
|
2000-06-16 19:10:41 -04:00
|
|
|
.endif
|
|
|
|
.if target(do-distpatch)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} do-distpatch
|
2000-06-16 19:10:41 -04:00
|
|
|
.else
|
Add intermediate `distpatch' target.
This is done in a tricky way, so as not to disturb the usual sequence
of targets. Namely, you still have
fetch, extract, patch, configure, build, install, package,
but patch does invoke a subtarget distpatch when needed,
and you can
fetch, extract, distpatch, patch, configure, build, install, package
for the same results.
Mostly useful for porters: provide an intermediate point to work on
patches, and make it easy to override distpatch/OpenBSD patches separately.
2000-01-30 10:19:40 -05:00
|
|
|
# What DISTPATCH normally does
|
2000-06-16 19:10:41 -04:00
|
|
|
. if defined(_PATCHFILES)
|
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
|
|
|
|
.if target(post-distpatch)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-distpatch
|
Add intermediate `distpatch' target.
This is done in a tricky way, so as not to disturb the usual sequence
of targets. Namely, you still have
fetch, extract, patch, configure, build, install, package,
but patch does invoke a subtarget distpatch when needed,
and you can
fetch, extract, distpatch, patch, configure, build, install, package
for the same results.
Mostly useful for porters: provide an intermediate point to work on
patches, and make it easy to override distpatch/OpenBSD patches separately.
2000-01-30 10:19:40 -05:00
|
|
|
.endif
|
2000-09-23 08:36:39 -04:00
|
|
|
.if ${PATCH_CHECK_ONLY:L} != "yes"
|
2001-03-28 06:32:29 -05:00
|
|
|
@${_MAKE_COOKIE} $@
|
2000-09-23 08:36:39 -04:00
|
|
|
.endif
|
Add intermediate `distpatch' target.
This is done in a tricky way, so as not to disturb the usual sequence
of targets. Namely, you still have
fetch, extract, patch, configure, build, install, package,
but patch does invoke a subtarget distpatch when needed,
and you can
fetch, extract, distpatch, patch, configure, build, install, package
for the same results.
Mostly useful for porters: provide an intermediate point to work on
patches, and make it easy to override distpatch/OpenBSD patches separately.
2000-01-30 10:19:40 -05:00
|
|
|
|
2000-02-04 06:09:33 -05:00
|
|
|
# The real patch
|
|
|
|
|
|
|
|
${_PATCH_COOKIE}: ${_EXTRACT_COOKIE}
|
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)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} do-patch
|
2000-06-16 19:10:41 -04:00
|
|
|
.else
|
Add intermediate `distpatch' target.
This is done in a tricky way, so as not to disturb the usual sequence
of targets. Namely, you still have
fetch, extract, patch, configure, build, install, package,
but patch does invoke a subtarget distpatch when needed,
and you can
fetch, extract, distpatch, patch, configure, build, install, package
for the same results.
Mostly useful for porters: provide an intermediate point to work on
patches, and make it easy to override distpatch/OpenBSD patches separately.
2000-01-30 10:19:40 -05:00
|
|
|
# What PATCH normally does:
|
|
|
|
# XXX test for efficiency, don't bother with distpatch if it's not needed
|
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; \
|
1999-07-27 18:12:26 -04:00
|
|
|
${PATCH} ${PATCH_ARGS} < $$i || \
|
|
|
|
{ echo "***> $$i did not apply cleanly"; \
|
2001-03-28 06:52:20 -05:00
|
|
|
error=true; }\
|
1998-11-18 23:20:09 -05:00
|
|
|
else \
|
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)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-patch
|
2000-02-04 06:09:33 -05:00
|
|
|
.endif
|
2002-03-15 20:09:23 -05:00
|
|
|
.for _m in ${MODULES}
|
|
|
|
. if defined(MOD${_m:U}_post-patch)
|
|
|
|
@${MOD${_m:U}_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; \
|
|
|
|
do echo "Touching $$i"; touch $$i; done \
|
|
|
|
;; \
|
|
|
|
*) \
|
|
|
|
if test -e $$f ; then \
|
|
|
|
echo "Touching $$f"; touch $$f; \
|
|
|
|
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}"
|
2000-06-16 19:53:40 -04:00
|
|
|
@mkdir -p ${WRKBUILD} ${WRKPKG}
|
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
|
1996-10-22 10:01:19 -04:00
|
|
|
@if [ -f ${SCRIPTDIR}/configure ]; then \
|
2003-07-28 13:17:04 -04:00
|
|
|
cd ${.CURDIR} && ${_SYSTRACE_CMD} ${SETENV} \
|
|
|
|
${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure; \
|
1996-06-03 18:47:10 -04:00
|
|
|
fi
|
2001-08-28 04:09:31 -04:00
|
|
|
. for _c in ${CONFIGURE_STYLE:L}
|
|
|
|
. if defined(MOD${_c:U}_configure)
|
|
|
|
@${MOD${_c:U}_configure}
|
2001-08-25 07:23:46 -04:00
|
|
|
. endif
|
|
|
|
. endfor
|
2000-06-16 19:10:41 -04:00
|
|
|
# End of CONFIGURE.
|
|
|
|
.endif
|
|
|
|
.if target(post-configure)
|
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}"
|
2001-11-11 08:57:32 -05:00
|
|
|
.if ${VMEM_WARNING:L} == "yes"
|
|
|
|
@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 ""
|
2001-11-11 08:57:32 -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:
|
2003-07-28 13:17:04 -04: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)
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} do-regress
|
|
|
|
. else
|
|
|
|
# What REGRESS normally does:
|
2001-10-07 06:53:43 -04:00
|
|
|
@cd ${WRKBUILD} && exec ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${REGRESS_FLAGS} -f ${MAKE_FILE} ${REGRESS_TARGET}
|
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} $@
|
|
|
|
|
2001-01-08 17:34:51 -05:00
|
|
|
.if ${FAKE:L} == "yes"
|
2001-03-06 13:59:38 -05:00
|
|
|
${_FAKE_COOKIE}: ${_BUILD_COOKIE} ${WRKPKG}/mtree.spec
|
2002-04-24 17:29:26 -04:00
|
|
|
@${ECHO_MSG} "===> Faking installation for ${FULLPKGNAME}${_MASTER}"
|
2001-09-07 05:48:23 -04:00
|
|
|
@if [ x`${SUDO} ${SH} -c umask` != x${DEF_UMASK} ]; then \
|
2000-03-03 16:24:50 -05:00
|
|
|
echo >&2 "Error: your umask is \"`${SH} -c umask`"\".; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2000-05-16 13:06:46 -04:00
|
|
|
@${SUDO} install -d -m 755 -o root -g wheel ${WRKINST}
|
2000-07-11 06:32:22 -04:00
|
|
|
@${SUDO} /usr/sbin/mtree -U -e -d -n -p ${WRKINST} \
|
2001-03-06 13:59:38 -05:00
|
|
|
-f ${WRKPKG}/mtree.spec >/dev/null
|
2002-04-09 19:55:11 -04:00
|
|
|
. for _p in ${PROTECT_MOUNT_POINTS}
|
|
|
|
@${SUDO} mount -u -r ${_p}
|
|
|
|
. endfor
|
2002-04-09 18:52:24 -04:00
|
|
|
. for _m in ${MODULES}
|
|
|
|
. if defined(MOD${_m:U}_pre-fake)
|
2001-08-25 07:23:46 -04:00
|
|
|
@${MOD${_m:U}_pre-fake}
|
2002-04-09 18:52:24 -04:00
|
|
|
. endif
|
|
|
|
. endfor
|
2000-06-02 07:42:53 -04:00
|
|
|
|
2001-09-13 05:12:45 -04:00
|
|
|
. if target(pre-fake)
|
2003-07-28 13:17:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${_SYSTRACE_CMD} ${MAKE} pre-fake ${_FAKE_SETUP}
|
2000-03-10 13:09:23 -05:00
|
|
|
. endif
|
2000-05-16 13:06:46 -04:00
|
|
|
@${SUDO} ${_MAKE_COOKIE} ${_INSTALL_PRE_COOKIE}
|
2000-03-03 16:24:50 -05:00
|
|
|
. if target(pre-install)
|
2003-07-28 13:17:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${_SYSTRACE_CMD} ${MAKE} pre-install ${_FAKE_SETUP}
|
2000-03-03 16:24:50 -05:00
|
|
|
. endif
|
|
|
|
. if target(do-install)
|
2003-07-28 13:17:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${_SYSTRACE_CMD} ${MAKE} do-install ${_FAKE_SETUP}
|
2000-03-03 16:24:50 -05:00
|
|
|
. else
|
|
|
|
# What FAKE normally does:
|
2003-07-28 13:17:04 -04:00
|
|
|
@cd ${WRKBUILD} && exec ${SUDO} ${_SYSTRACE_CMD} ${SETENV} ${MAKE_ENV} ${_FAKE_SETUP} ${MAKE_PROGRAM} ${FAKE_FLAGS} -f ${MAKE_FILE} ${FAKE_TARGET}
|
2000-03-03 16:24:50 -05:00
|
|
|
# End of FAKE.
|
|
|
|
. endif
|
|
|
|
. if target(post-install)
|
2003-07-28 13:17:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${SUDO} ${_SYSTRACE_CMD} ${MAKE} post-install ${_FAKE_SETUP}
|
2000-03-03 16:24:50 -05:00
|
|
|
. endif
|
2002-04-09 19:55:11 -04:00
|
|
|
. for _p in ${PROTECT_MOUNT_POINTS}
|
|
|
|
@${SUDO} mount -u -w ${_p}
|
|
|
|
. endfor
|
2001-03-28 06:32:29 -05:00
|
|
|
@${SUDO} ${_MAKE_COOKIE} $@
|
2000-03-03 16:24:50 -05:00
|
|
|
|
2001-04-02 06:35:51 -04:00
|
|
|
# The real install
|
|
|
|
|
|
|
|
${_INSTALL_COOKIE}: ${_PACKAGE_COOKIES}
|
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} && DEPENDS_TARGET=install exec ${MAKE} _internal-run-depends _internal-lib-depends
|
2001-08-12 07:33:10 -04:00
|
|
|
@${ECHO_MSG} "===> Installing ${FULLPKGNAME${SUBPACKAGE}} from ${PKGFILE${SUBPACKAGE}}"
|
2001-08-25 07:23:46 -04:00
|
|
|
. for _m in ${MODULES}
|
|
|
|
. if defined(MOD${_m:U}_pre_install)
|
|
|
|
@${MOD${_m:U}_pre_install}
|
|
|
|
. endif
|
|
|
|
. endfor
|
2001-04-20 12:25:24 -04:00
|
|
|
. if ${TRUST_PACKAGES:L} == "yes"
|
2001-08-12 07:33:10 -04:00
|
|
|
@if pkg dependencies check ${FULLPKGNAME${SUBPACKAGE}}; then \
|
|
|
|
echo "Package ${FULLPKGNAME${SUBPACKAGE}} is already installed"; \
|
2001-04-20 12:25:24 -04:00
|
|
|
else \
|
2004-09-18 09:45:23 -04:00
|
|
|
${SUDO} ${SETENV} PKG_PATH=${PKGREPOSITORY}:${PKG_PATH} PKG_TMPDIR=${PKG_TMPDIR} pkg_add ${_PKGADD_AUTO} ${PKGFILE${SUBPACKAGE}}; \
|
2001-04-20 12:25:24 -04:00
|
|
|
fi
|
|
|
|
. else
|
2004-09-18 09:45:23 -04:00
|
|
|
@${SUDO} ${SETENV} PKG_PATH=${PKGREPOSITORY}:${PKG_PATH} PKG_TMPDIR=${PKG_TMPDIR} pkg_add ${_PKGADD_AUTO} ${PKGFILE${SUBPACKAGE}}
|
2001-04-20 12:25:24 -04:00
|
|
|
. endif
|
2001-07-30 10:13:16 -04:00
|
|
|
@-${SUDO} ${_MAKE_COOKIE} $@
|
2003-07-18 15:02:13 -04:00
|
|
|
.endif
|
2000-03-03 16:24:50 -05:00
|
|
|
|
2001-04-02 06:35:51 -04:00
|
|
|
# The real package
|
MULTI_PACKAGES framework.
This is somewhat orthogonal to FLAVORS.
Principle: one port may build several packages in one go.
For instance, egcs will build all compilers, and package stuff as
base, C++, Fortran, etc.
This simplifies some japanese ports greatly, e.g., one Canna port that
builds libs/server/app packages.
How to use:
just set
MULTI_PACKAGES=-ext1 -ext2...
in the Makefile.
Then make package will invoke itself recursively with SUBPACKAGE set to
-ext1, -ext2.
The SUBPACKAGE will fetch package info as PLIST-ext1, COMMENT-ext1,
DESCR-ext1, etc.
The port Makefile itself can test the value of SUBPACKAGE if things differ.
Some problems:
- there still is a main package (with PLIST, DESCR, etc), and it's built
last, so you can't add RUN_DEPENDS=main_package to subpackages, you have
to encode them explicitly in the PLIST for now.
- other ports can't depend on subpackages yet. This is usually not a
problem, it's just a question of choosing the `right' main package (e.g.,
for Canna, it will be canna-lib).
- PLIST.sed recognize @FLAVOR@, which is extended to the current flavor,
so that a subpackage may depend on the corresponding main package in
explicit ways.
describe is also invoked recursively, so that all subpackages appear in
the INDEX.
2000-04-17 16:12:03 -04:00
|
|
|
|
2001-04-02 06:35:51 -04:00
|
|
|
_package: ${_PKG_PREREQ}
|
2003-07-14 09:33:04 -04:00
|
|
|
.if target(pre-package)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} pre-package
|
2003-07-14 09:33:04 -04:00
|
|
|
.endif
|
|
|
|
.if target(do-package)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} do-package
|
2003-07-14 09:33:04 -04:00
|
|
|
.else
|
2000-01-26 18:11:08 -05:00
|
|
|
# What PACKAGE normally does:
|
2001-08-12 07:33:10 -04:00
|
|
|
@${ECHO_MSG} "===> Building package for ${FULLPKGNAME${SUBPACKAGE}}"
|
2000-04-02 14:08:31 -04:00
|
|
|
@if [ ! -d ${PKGREPOSITORY} ]; then \
|
|
|
|
if ! mkdir -p ${PKGREPOSITORY}; then \
|
2000-03-03 16:24:50 -05:00
|
|
|
echo ">> Can't create directory ${PKGREPOSITORY}."; \
|
|
|
|
exit 1; \
|
2000-04-02 14:08:31 -04:00
|
|
|
fi; \
|
1999-12-19 19:07:17 -05:00
|
|
|
fi
|
2000-03-03 16:24:50 -05:00
|
|
|
@cd ${.CURDIR} && \
|
2001-08-12 07:33:10 -04:00
|
|
|
if ${SUDO} ${PKG_CMD} ${PKG_ARGS} ${PKGFILE${SUBPACKAGE}}; then \
|
|
|
|
mode=`id -u`:`id -g`; ${SUDO} ${CHOWN} $${mode} ${PKGFILE${SUBPACKAGE}}; \
|
2003-07-30 15:59:48 -04:00
|
|
|
${MAKE} _package-links; \
|
2000-03-03 16:24:50 -05: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
|
|
|
${SUDO} ${MAKE} _internal-clean=package; \
|
2000-03-03 16:24:50 -05:00
|
|
|
exit 1; \
|
|
|
|
fi
|
2000-01-26 18:11:08 -05:00
|
|
|
# End of PACKAGE.
|
2003-07-14 09:33:04 -04:00
|
|
|
.endif
|
|
|
|
.if target(post-package)
|
2000-05-17 08:14:53 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} post-package
|
2000-02-04 06:09:33 -05:00
|
|
|
.endif
|
|
|
|
|
|
|
|
fetch-all:
|
2003-07-14 09:33:04 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} __FETCH_ALL=Yes __ARCH_OK=Yes NO_IGNORE=Yes fetch
|
2000-02-04 06:09:33 -05:00
|
|
|
|
|
|
|
# Separate target for each file fetch will retrieve
|
|
|
|
|
2000-02-04 06:15:16 -05:00
|
|
|
.for _F in ${ALLFILES:S@^@${FULLDISTDIR}/@}
|
2000-02-04 06:09:33 -05:00
|
|
|
${_F}:
|
2003-07-25 08:46:26 -04:00
|
|
|
. if ${FETCH_MANUALLY:L} != "no"
|
|
|
|
. for _M in ${FETCH_MANUALLY}
|
|
|
|
@echo "*** ${_M}"
|
|
|
|
. endfor
|
|
|
|
@exit 1
|
|
|
|
. else
|
2004-08-08 19:14:03 -04:00
|
|
|
@lock=${_F:T}.dist; ${_DO_LOCK}; mkdir -p ${_F:H}; \
|
2000-02-04 06:09:33 -05:00
|
|
|
cd ${_F:H}; \
|
2000-02-04 06:15:16 -05:00
|
|
|
select=${_EVERYTHING:M*${_F:S@^${FULLDISTDIR}/@@}\:[0-9]}; \
|
2000-02-04 06:09:33 -05:00
|
|
|
f=${_F:S@^${FULLDISTDIR}/@@}; \
|
|
|
|
${ECHO_MSG} ">> $$f doesn't seem to exist on this system."; \
|
|
|
|
${_CDROM_OVERRIDE}; \
|
2000-02-04 06:15:16 -05:00
|
|
|
${_SITE_SELECTOR}; \
|
2000-02-04 06:09:33 -05:00
|
|
|
for site in $$sites; do \
|
|
|
|
${ECHO_MSG} ">> Attempting to fetch ${_F} from $${site}."; \
|
2003-07-14 09:33:04 -04:00
|
|
|
if ${FETCH_CMD} $${site}$$f; then \
|
2000-02-04 06:09:33 -05:00
|
|
|
exit 0; \
|
|
|
|
fi; \
|
|
|
|
done; exit 1
|
2003-07-25 08:46:26 -04:00
|
|
|
. endif
|
2000-02-04 06:09:33 -05:00
|
|
|
.endfor
|
|
|
|
|
|
|
|
# Some support rules for do-package
|
|
|
|
|
2003-07-30 15:59:48 -04:00
|
|
|
_package-links:
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} _delete-package-links
|
2003-07-18 14:34:26 -04:00
|
|
|
.for _l in FTP CDROM
|
|
|
|
. if ${PERMIT_PACKAGE_${_l}:L} == "yes"
|
|
|
|
@echo "Link to ${${_l}_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX}"
|
|
|
|
@mkdir -p ${${_l}_PACKAGES}
|
|
|
|
@rm -f ${${_l}_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX}
|
|
|
|
@ln ${PKGFILE${SUBPACKAGE}} \
|
|
|
|
${${_l}_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX} 2>/dev/null || \
|
|
|
|
cp -p ${PKGFILE${SUBPACKAGE}} \
|
|
|
|
${${_l}_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX}
|
|
|
|
. endif
|
|
|
|
.endfor
|
2000-02-04 06:09:33 -05:00
|
|
|
|
2003-07-30 15:59:48 -04:00
|
|
|
_delete-package-links:
|
2003-07-18 14:34:26 -04:00
|
|
|
.for _l in FTP CDROM
|
|
|
|
@rm -f ${${_l}_PACKAGES}/${FULLPKGNAME${SUBPACKAGE}}${PKG_SUFX}
|
|
|
|
.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"
|
2003-08-01 04:20:43 -04:00
|
|
|
@${MAKE} all-dir-depends|tsort -r|while read dir; do \
|
2004-08-11 18:42:47 -04:00
|
|
|
case "$$dir" in ${FULLPKGPATH}) t=_internal-clean;; *) t=clean;; esac; \
|
2003-08-01 04:20:43 -04:00
|
|
|
unset FLAVOR SUBPACKAGE || true; \
|
2003-07-30 15:31:31 -04:00
|
|
|
${_flavor_fragment}; \
|
2004-07-21 10:45:33 -04:00
|
|
|
eval $$toset ${MAKE} _CLEANDEPENDS=No $$t; \
|
2003-07-30 15:31:31 -04:00
|
|
|
done
|
|
|
|
.else
|
2001-08-12 07:33:10 -04:00
|
|
|
@${ECHO_MSG} "===> Cleaning for ${FULLPKGNAME${SUBPACKAGE}}"
|
2003-08-01 04:07:30 -04:00
|
|
|
. if ${_clean:L:Mfake}
|
2000-06-07 11:46:15 -04:00
|
|
|
@if cd ${WRKINST} 2>/dev/null; then ${SUDO} rm -rf ${WRKINST}; fi
|
2003-07-30 15:31:31 -04:00
|
|
|
. endif
|
2003-08-01 04:07:30 -04:00
|
|
|
. if ${_clean:L:Mwork}
|
|
|
|
. 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
|
2003-07-30 15:31:31 -04:00
|
|
|
. else
|
2000-02-04 06:09:33 -05:00
|
|
|
@if [ -L ${WRKDIR} ]; then rm -rf `readlink ${WRKDIR}`; fi
|
|
|
|
@rm -rf ${WRKDIR}
|
2003-07-30 15:31:31 -04:00
|
|
|
. endif
|
2003-07-18 15:02:13 -04:00
|
|
|
. endif
|
2003-08-01 04:07:30 -04:00
|
|
|
. if ${_clean:L:Mdist}
|
2001-08-24 10:39:36 -04:00
|
|
|
@${ECHO_MSG} "===> Dist cleaning for ${FULLPKGNAME${SUBPACKAGE}}"
|
|
|
|
@if cd ${FULLDISTDIR} 2>/dev/null; then \
|
|
|
|
if [ "${_DISTFILES}" -o "${_PATCHFILES}" ]; then \
|
|
|
|
rm -f ${_DISTFILES} ${_PATCHFILES}; \
|
|
|
|
fi \
|
|
|
|
fi
|
2004-02-07 17:36:13 -05:00
|
|
|
. if !empty(DIST_SUBDIR)
|
2003-07-18 15:02:13 -04:00
|
|
|
-@rmdir ${FULLDISTDIR}
|
2003-07-30 15:31:31 -04:00
|
|
|
. endif
|
2001-08-16 10:49:31 -04:00
|
|
|
. endif
|
2003-08-01 04:07:30 -04:00
|
|
|
. if ${_clean:L:Minstall}
|
|
|
|
. if ${_clean:L:Msub}
|
2003-07-30 15:31:31 -04:00
|
|
|
. for _s in ${MULTI_PACKAGES}
|
2004-01-28 15:16:14 -05:00
|
|
|
-${SUDO} ${PKG_DELETE} ${FULLPKGNAME${_s}}
|
2003-07-30 15:31:31 -04:00
|
|
|
. endfor
|
|
|
|
. else
|
2004-01-28 15:16:14 -05:00
|
|
|
-${SUDO} ${PKG_DELETE} ${FULLPKGNAME${SUBPACKAGE}}
|
2003-07-30 15:31:31 -04:00
|
|
|
. endif
|
2001-08-16 10:49:31 -04:00
|
|
|
. endif
|
2003-08-01 04:07:30 -04:00
|
|
|
. if ${_clean:L:Mpackages} || ${_clean:L:Mpackage} && ${_clean:L:Msub}
|
2001-08-16 10:49:31 -04:00
|
|
|
rm -f ${_PACKAGE_COOKIES}
|
2003-07-30 15:31:31 -04:00
|
|
|
. if defined(MULTI_PACKAGES)
|
|
|
|
. for _s in ${MULTI_PACKAGES}
|
2003-07-30 15:59:48 -04:00
|
|
|
@cd ${.CURDIR} && SUBPACKAGE='${_s}' exec ${MAKE} _delete-package-links
|
2003-07-30 15:31:31 -04:00
|
|
|
. endfor
|
|
|
|
. endif
|
2003-08-01 04:07:30 -04:00
|
|
|
. elif ${_clean:L:Mpackage}
|
2003-07-30 15:59:48 -04:00
|
|
|
@cd ${.CURDIR} && exec ${MAKE} _delete-package-links
|
2001-08-16 11:15:24 -04:00
|
|
|
rm -f ${PKGFILE${SUBPACKAGE}}
|
2003-07-30 15:31:31 -04:00
|
|
|
. endif
|
2003-08-04 09:25:36 -04:00
|
|
|
. if ${_clean:L:Mreadmes}
|
|
|
|
rm -f ${.CURDIR}/${FULLPKGNAME}.html
|
|
|
|
. for _s in ${MULTI_PACKAGES}
|
|
|
|
rm -f ${.CURDIR}/${FULLPKGNAME${_s}}.html
|
|
|
|
. endfor
|
|
|
|
. endif
|
2003-08-01 04:07:30 -04:00
|
|
|
. if ${_clean:L:Mbulk}
|
2002-04-17 11:58:48 -04:00
|
|
|
rm -f ${_BULK_COOKIE}
|
2003-07-30 15:31:31 -04:00
|
|
|
. endif
|
1996-06-03 18:47:10 -04:00
|
|
|
.endif
|
|
|
|
|
1998-07-06 18:06:51 -04:00
|
|
|
# packing list utilities. This generates a packing list from a recently
|
|
|
|
# installed port. Not perfect, but pretty close. The generated file
|
|
|
|
# will have to have some tweaks done by hand.
|
2001-05-05 19:42:03 -04:00
|
|
|
# Note: add @comment PACKAGE(arch=${MACHINE_ARCH}, opsys=${OPSYS}, vers=${OPSYS_VER})
|
1998-07-08 23:12:18 -04:00
|
|
|
# when port is installed or package created.
|
1998-07-06 18:06:51 -04:00
|
|
|
#
|
2001-01-08 17:34:51 -05:00
|
|
|
.if ${FAKE:L} == "yes"
|
2004-08-03 04:04:02 -04:00
|
|
|
. if ${SHARED_ONLY:L} == "yes"
|
|
|
|
_do_libs_too=
|
|
|
|
. else
|
|
|
|
_do_libs_too=NO_SHARED_LIBS=Yes
|
|
|
|
. endif
|
2004-08-05 19:43:45 -04:00
|
|
|
|
|
|
|
_extra_prefixes=
|
|
|
|
.if defined(MULTI_PACKAGES)
|
|
|
|
. for _s in ${MULTI_PACKAGES}
|
|
|
|
_extra_prefixes+=PREFIX${_s}=`cd ${.CURDIR} && SUBPACKAGE=${_s} PACKAGING=${_s} ${MAKE} show=PREFIX`
|
|
|
|
. endfor
|
|
|
|
.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-plist _internal-update-plist: _internal-fake ${_DEPrun_COOKIES}
|
2004-08-06 07:31:22 -04:00
|
|
|
@${ECHO_MSG} "===> Updating plist for ${FULLPKGNAME}${_MASTER}"
|
2001-10-24 12:35:38 -04:00
|
|
|
@mkdir -p ${PKGDIR}
|
2004-08-03 12:18:51 -04:00
|
|
|
@DESTDIR=${WRKINST} PREFIX=${WRKINST}${PREFIX} \
|
|
|
|
TRUEPREFIX=${TRUEPREFIX} \
|
2001-03-06 13:59:38 -05:00
|
|
|
MTREE_FILE=${WRKPKG}/mtree.spec \
|
2000-03-03 16:24:50 -05:00
|
|
|
INSTALL_PRE_COOKIE=${_INSTALL_PRE_COOKIE} \
|
2004-08-03 04:04:02 -04:00
|
|
|
DEPS="`${MAKE} full-run-depends ${_do_libs_too}`" \
|
2002-04-03 10:00:30 -05:00
|
|
|
PKGREPOSITORY=${PKGREPOSITORY} \
|
2003-01-06 15:15:39 -05:00
|
|
|
PLIST=${PLIST} \
|
|
|
|
PFRAG=${PKGDIR}/PFRAG \
|
2003-01-06 15:18:23 -05:00
|
|
|
FLAVORS='${FLAVORS}' MULTI_PACKAGES='${MULTI_PACKAGES}' \
|
2003-12-25 19:26:01 -05:00
|
|
|
OKAY_FILES='${_FAKE_COOKIE} ${_INSTALL_PRE_COOKIE}' \
|
2004-08-03 07:16:30 -04:00
|
|
|
SHARED_ONLY="${SHARED_ONLY}" \
|
2004-08-08 12:43:15 -04:00
|
|
|
OWNER=`id -u` \
|
|
|
|
GROUP=`id -g` \
|
|
|
|
${SUDO} perl ${PORTSDIR}/infrastructure/install/make-plist \
|
2004-08-05 19:43:45 -04:00
|
|
|
${_extra_prefixes} ${_tmpvars}
|
2000-03-03 16:24:50 -05:00
|
|
|
.endif
|
1998-07-06 18:06:51 -04:00
|
|
|
|
2000-04-19 10:37:19 -04:00
|
|
|
update-patches:
|
2001-09-27 06:34:19 -04:00
|
|
|
@toedit=`WRKDIST=${WRKDIST} PATCHDIR=${PATCHDIR} \
|
|
|
|
PATCH_LIST='${PATCH_LIST}' DIFF_ARGS='${DIFF_ARGS}' \
|
|
|
|
DISTORIG=${DISTORIG} PATCHORIG=${PATCHORIG} \
|
2000-04-19 10:37:19 -04:00
|
|
|
/bin/sh ${PORTSDIR}/infrastructure/build/update-patches`; \
|
|
|
|
case $$toedit in "");; \
|
|
|
|
*) read i?'edit patches: '; \
|
2002-10-10 17:14:11 -04:00
|
|
|
cd ${PATCHDIR} && $${VISUAL:-$${EDITOR:-/usr/bin/vi}} $$toedit;; esac
|
2003-07-18 15:02:13 -04:00
|
|
|
|
2000-06-09 12:26:54 -04:00
|
|
|
|
1996-06-03 18:47:10 -04:00
|
|
|
|
2000-03-03 12:51:37 -05:00
|
|
|
# mirroring utilities
|
|
|
|
fetch-makefile:
|
2004-07-12 04:45:32 -04:00
|
|
|
@exec ${MAKE} __FETCH_ALL=Yes __ARCH_OK=Yes NO_IGNORE=Yes _fetch-makefile
|
|
|
|
|
|
|
|
_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
|
2003-07-30 15:31:31 -04:00
|
|
|
@echo ":: ${_FMN}"
|
|
|
|
# write generic package dependencies
|
|
|
|
@echo ".PHONY: ${_FMN}"
|
|
|
|
. if ${RECURSIVE_FETCH_LIST:L} == "yes"
|
|
|
|
@echo "${_FMN}: ${_ALLFILES} "`_FULL_PACKAGE_NAME=Yes ${MAKE} full-all-depends`
|
|
|
|
. else
|
|
|
|
@echo "${_FMN}: ${_ALLFILES}"
|
|
|
|
. endif
|
2001-06-30 15:06:09 -04:00
|
|
|
.endif
|
2000-03-05 11:33:38 -05:00
|
|
|
.if !empty(ALLFILES)
|
|
|
|
. for _F in ${_ALLFILES}
|
2003-12-15 12:56:40 -05:00
|
|
|
@if ! fgrep -q "|${_F}|" $${_DONE_FILES}; then \
|
|
|
|
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'
|
|
|
|
@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
|
|
|
|
. if !defined(NO_CHECKSUM) && !empty(_CKSUMFILES:M${_F})
|
2001-11-11 07:59:50 -05:00
|
|
|
@checksum_file=${CHECKSUM_FILE}; \
|
2001-11-13 07:52:22 -05:00
|
|
|
if [ ! -f $$checksum_file ]; then \
|
2001-11-11 07:59:50 -05:00
|
|
|
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 \
|
2001-11-11 07:59:50 -05: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") \
|
2001-11-11 07:59:50 -05: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" \\';; \
|
|
|
|
*) \
|
|
|
|
echo "\t CIPHER=\"$$c\" CKSUM=\"$$4\" \\";; \
|
|
|
|
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
|
|
|
#
|
|
|
|
describe:
|
2003-07-30 15:31:31 -04:00
|
|
|
.if defined(MULTI_PACKAGES) && !defined(PACKAGING)
|
2001-08-16 10:49:31 -04:00
|
|
|
@cd ${.CURDIR} && SUBPACKAGE='${SUBPACKAGE}' FLAVOR='${FLAVOR}' PACKAGING='${SUBPACKAGE}' exec ${MAKE} describe
|
2003-07-30 15:31:31 -04:00
|
|
|
. if empty(SUBPACKAGE)
|
|
|
|
. for _sub in ${MULTI_PACKAGES}
|
|
|
|
@cd ${.CURDIR} && SUBPACKAGE='${_sub}' FLAVOR='${FLAVOR}' PACKAGING='${_sub}' exec ${MAKE} describe
|
|
|
|
. endfor
|
|
|
|
. endif
|
2003-07-14 09:33:04 -04:00
|
|
|
.else
|
2001-08-12 07:33:10 -04:00
|
|
|
@echo -n "${FULLPKGNAME${SUBPACKAGE}}|${FULLPKGPATH}|"
|
2003-07-14 09:33:04 -04:00
|
|
|
. if ${PREFIX} == ${LOCALBASE}
|
2000-03-28 04:27:03 -05:00
|
|
|
@echo -n "|"
|
2003-07-14 09:33:04 -04:00
|
|
|
. else
|
2000-04-02 14:35:41 -04:00
|
|
|
@echo -n "${PREFIX}|"
|
2003-07-14 09:33:04 -04:00
|
|
|
. endif
|
2001-05-23 11:48:08 -04:00
|
|
|
@echo -n ${_COMMENT}"|"; \
|
1997-09-09 11:11:28 -04:00
|
|
|
if [ -f ${DESCR} ]; then \
|
2000-03-26 20:52:17 -05:00
|
|
|
echo -n "${DESCR:S,^${PORTSDIR}/,,}|"; \
|
1996-06-03 18:47:10 -04:00
|
|
|
else \
|
1999-11-22 18:44:01 -05:00
|
|
|
echo -n "/dev/null|"; \
|
1997-09-09 11:11:28 -04:00
|
|
|
fi; \
|
1999-11-22 18:44:01 -05:00
|
|
|
echo -n "${MAINTAINER}|${CATEGORIES}|"
|
2003-07-14 09:33:04 -04:00
|
|
|
. for _d in LIB BUILD RUN
|
|
|
|
. if !empty(_${_d}_DEP2)
|
2001-11-17 05:39:19 -05:00
|
|
|
@cd ${.CURDIR} && _FINAL_ECHO=: _INITIAL_ECHO=: exec ${MAKE} ${_d:L}-depends-list
|
2003-07-14 09:33:04 -04:00
|
|
|
. endif
|
1999-11-22 18:44:01 -05:00
|
|
|
@echo -n "|"
|
2003-07-14 09:33:04 -04: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
|
|
|
|
2003-07-14 09:33:04 -04:00
|
|
|
. if defined(_BAD_LICENSING)
|
2001-09-30 08:26:57 -04:00
|
|
|
@echo "?|?|?|?"
|
2003-07-14 09:33:04 -04:00
|
|
|
. else
|
|
|
|
. if ${PERMIT_PACKAGE_CDROM:L} == "yes"
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "y|"
|
2003-07-14 09:33:04 -04:00
|
|
|
. else
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "n|"
|
2003-07-14 09:33:04 -04:00
|
|
|
. endif
|
|
|
|
. if ${PERMIT_PACKAGE_FTP:L} == "yes"
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "y|"
|
2003-07-14 09:33:04 -04:00
|
|
|
. else
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "n|"
|
2003-07-14 09:33:04 -04:00
|
|
|
. endif
|
|
|
|
. if ${PERMIT_DISTFILES_CDROM:L} == "yes"
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "y|"
|
2003-07-14 09:33:04 -04:00
|
|
|
. else
|
2000-02-21 18:53:52 -05:00
|
|
|
@echo -n "n|"
|
2003-07-14 09:33:04 -04:00
|
|
|
. endif
|
|
|
|
. if ${PERMIT_DISTFILES_FTP:L} == "yes"
|
2000-03-04 09:40:21 -05:00
|
|
|
@echo "y"
|
2003-07-14 09:33:04 -04:00
|
|
|
. else
|
2000-03-04 09:40:21 -05:00
|
|
|
@echo "n"
|
2001-04-20 11:06:19 -04:00
|
|
|
. endif
|
2003-07-14 09:33:04 -04:00
|
|
|
. endif
|
2003-07-30 15:31:31 -04:00
|
|
|
.endif
|
|
|
|
|
2003-08-04 09:25:36 -04:00
|
|
|
readmes:
|
2003-07-30 15:31:31 -04:00
|
|
|
.if defined(MULTI_PACKAGES) && !defined(PACKAGING)
|
2003-08-13 15:41:01 -04:00
|
|
|
@cd ${.CURDIR} && SUBPACKAGE='${SUBPACKAGE}' FLAVOR='${FLAVOR}' PACKAGING='${SUBPACKAGE}' exec ${MAKE} readmes
|
2003-07-30 15:31:31 -04:00
|
|
|
. if empty(SUBPACKAGE)
|
2003-07-14 09:33:04 -04:00
|
|
|
. for _sub in ${MULTI_PACKAGES}
|
2003-08-13 15:41:01 -04:00
|
|
|
@cd ${.CURDIR} && SUBPACKAGE='${_sub}' FLAVOR='${FLAVOR}' PACKAGING='${_sub}' exec ${MAKE} readmes
|
2003-07-14 09:33:04 -04:00
|
|
|
. endfor
|
2001-04-20 11:06:19 -04:00
|
|
|
. endif
|
2003-07-30 15:31:31 -04:00
|
|
|
.else
|
|
|
|
@rm -f ${FULLPKGNAME${SUBPACKAGE}}.html
|
|
|
|
@cd ${.CURDIR} && exec ${MAKE} README_NAME=${README_NAME} ${FULLPKGNAME${SUBPACKAGE}}.html
|
2001-05-22 07:46:17 -04:00
|
|
|
.endif
|
2000-02-22 04:27:51 -05:00
|
|
|
|
1999-09-30 13:28:31 -04:00
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
${FULLPKGNAME${SUBPACKAGE}}.html:
|
2003-08-01 05:07:06 -04:00
|
|
|
@echo ${_COMMENT} | ${HTMLIFY} >$@.tmp-comment
|
2001-08-12 07:33:10 -04:00
|
|
|
@echo ${FULLPKGNAME${SUBPACKAGE}} | ${HTMLIFY} > $@.tmp3
|
2000-02-15 13:19:12 -05:00
|
|
|
.if defined(HOMEPAGE)
|
|
|
|
@echo 'See <a href="${HOMEPAGE}">${HOMEPAGE}</a> for details.' >$@.tmp4
|
|
|
|
.else
|
|
|
|
@echo "" >$@.tmp4
|
|
|
|
.endif
|
2003-08-02 05:53:27 -04:00
|
|
|
.if defined(MULTI_PACKAGES)
|
|
|
|
. if empty(SUBPACKAGE)
|
|
|
|
@echo "<h2>Subpackages</h2>" >$@.tmp-subpackages
|
|
|
|
@echo "<ul>" >>$@.tmp-subpackages
|
|
|
|
|
|
|
|
. for _S in ${MULTI_PACKAGES}
|
|
|
|
@name=`SUBPACKAGE=${_S} ${MAKE} _print-packagename _FULL_PACKAGE_NAME=No`; \
|
|
|
|
echo "<li><a href=\"$$name.html\">$$name</a>" >>$@.tmp-subpackages
|
|
|
|
. endfor
|
|
|
|
@echo "</ul>" >>$@.tmp-subpackages
|
|
|
|
. else
|
|
|
|
@name=`unset SUBPACKAGE; ${MAKE} _print-packagename _FULL_PACKAGE_NAME=No`; \
|
|
|
|
echo "<h2>Subpackage of <a href=\"$$name.html\">$$name</a></h2>" >$@.tmp-subpackages
|
|
|
|
. endif
|
|
|
|
.else
|
|
|
|
@>$@.tmp-subpackages
|
|
|
|
.endif
|
2003-07-30 15:31:31 -04:00
|
|
|
.for _I in build run
|
|
|
|
. if !empty(_ALWAYS_DEP) || !empty(_${_I:U}_DEP)
|
|
|
|
@cd ${.CURDIR} && ${MAKE} full-${_I}-depends _FULL_PACKAGE_NAME=Yes| \
|
|
|
|
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>"; \
|
2003-07-30 15:31:31 -04:00
|
|
|
done >$@.tmp-${_I}
|
|
|
|
. else
|
2003-08-01 05:07:06 -04:00
|
|
|
@echo "<li>none" >$@.tmp-${_I}
|
2003-07-30 15:31:31 -04:00
|
|
|
. endif
|
1999-09-30 17:07:09 -04:00
|
|
|
.endfor
|
1999-12-03 09:57:12 -05:00
|
|
|
@cat ${README_NAME} | \
|
2003-08-01 05:07:06 -04:00
|
|
|
sed -e 's|%%PORT%%|'"`echo ${FULLPKGPATH} | ${HTMLIFY}`"'|g' \
|
2000-02-28 13:13:18 -05:00
|
|
|
-e '/%%PKG%%/r$@.tmp3' -e '//d' \
|
2003-07-30 15:31:31 -04:00
|
|
|
-e '/%%COMMENT%%/r$@.tmp-comment' -e '//d' \
|
2003-08-01 05:07:06 -04:00
|
|
|
-e '/%%DESCR%%/r${PKGDIR}/DESCR${SUBPACKAGE}' -e '//d' \
|
2000-02-28 13:13:18 -05:00
|
|
|
-e '/%%HOMEPAGE%%/r$@.tmp4' -e '//d' \
|
2003-07-30 15:31:31 -04:00
|
|
|
-e '/%%BUILD_DEPENDS%%/r$@.tmp-build' -e '//d' \
|
|
|
|
-e '/%%RUN_DEPENDS%%/r$@.tmp-run' -e '//d' \
|
2003-08-02 05:53:27 -04:00
|
|
|
-e '/%%SUBPACKAGES%%/r$@.tmp-subpackages' -e '//d' \
|
1999-09-30 17:07:09 -04:00
|
|
|
>> $@
|
|
|
|
@rm -f $@.tmp*
|
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
|
|
|
|
print-build-depends:
|
2003-07-18 14:54:09 -04:00
|
|
|
.if !empty(_ALWAYS_DEP) || !empty(_BUILD_DEP)
|
1999-11-22 18:44:01 -05:00
|
|
|
@echo -n 'This port requires package(s) "'
|
2003-07-30 15:31:31 -04:00
|
|
|
@${MAKE} full-build-depends|tr '\012' '\040'|sed -e 's, $$,,'
|
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:
|
2003-07-18 14:54:09 -04:00
|
|
|
.if !empty(_ALWAYS_DEP) || !empty(_RUN_DEP)
|
1999-11-22 18:44:01 -05:00
|
|
|
@echo -n 'This port requires package(s) "'
|
2003-07-30 15:31:31 -04:00
|
|
|
@${MAKE} full-run-depends|tr '\012' '\040'|sed -e 's, $$,,'
|
1999-11-22 18:44:01 -05:00
|
|
|
@echo '" to run.'
|
1999-09-30 13:34:22 -04:00
|
|
|
.endif
|
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
.for _i in build all run
|
|
|
|
full-${_i}-depends:
|
2003-08-01 04:20:43 -04:00
|
|
|
@${MAKE} ${_i}-dir-depends|tsort -r|sed -e '$$d'|while read dir; do \
|
|
|
|
unset FLAVOR SUBPACKAGE || true; \
|
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:
|
|
|
|
.if ${PERMIT_PACKAGE_CDROM:L} == "yes" || ${PERMIT_PACKAGE_FTP:L} == "yes"
|
|
|
|
@${MAKE} all-dir-depends|tsort -r|sed -e '$$d'|while read dir; do \
|
|
|
|
unset FLAVOR SUBPACKAGE || true; \
|
|
|
|
${_flavor_fragment}; \
|
|
|
|
_MASTER_PERMIT_CDROM=${PERMIT_PACKAGE_CDROM:Q}; \
|
|
|
|
_MASTER_PERMIT_FTP=${PERMIT_PACKAGE_FTP:Q}; \
|
|
|
|
export _MASTER_PERMIT_CDROM _MASTER_PERMIT_FTP; \
|
|
|
|
eval $$toset ${MAKE} _license-check; \
|
|
|
|
done
|
|
|
|
.endif
|
|
|
|
|
|
|
|
_license-check:
|
|
|
|
.for _i in FTP CDROM
|
|
|
|
. if defined(_MASTER_PERMIT_${_i}) && ${_MASTER_PERMIT_${_i}:L} == "yes" && ${PERMIT_PACKAGE_${_i}:L} != "yes"
|
|
|
|
@echo >&2 "Warning: dependency ${PKGPATH} is not allowed for ${_i}"
|
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
.for _i in RUN BUILD LIB
|
|
|
|
${_i:L}-depends-list:
|
|
|
|
. if !empty(_${_i}_DEP2)
|
2001-03-28 09:33:24 -05:00
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
2003-07-30 15:31:31 -04:00
|
|
|
: $${_INITIAL_ECHO:='echo -n "This port requires \""'}; \
|
|
|
|
: $${_ECHO='echo -n'}; \
|
|
|
|
: $${_FINAL_ECHO:='echo "\" for ${_i:L}."'}; space=''; \
|
|
|
|
eval $${_INITIAL_ECHO}; \
|
|
|
|
for spec in `echo '${_${_i}_DEP2}' \
|
1999-11-15 13:37:58 -05:00
|
|
|
| tr '\040' '\012' | sort -u`; do \
|
2003-07-30 15:31:31 -04:00
|
|
|
$${_ECHO} "$$space$${spec}"; \
|
|
|
|
space=' '; \
|
|
|
|
done; eval $${_FINAL_ECHO}
|
|
|
|
. 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
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
# Print list of all libraries that we may depend upon.
|
|
|
|
_recurse-lib-depends-check:
|
2001-10-24 07:49:45 -04:00
|
|
|
.for _i in ${LIB_DEPENDS}
|
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
|
|
|
echo '${_i}' | { \
|
|
|
|
IFS=:; read dep pkg dir target; \
|
2003-08-01 04:29:43 -04:00
|
|
|
IFS=,; for j in $$dep; do echo $$j; done; \
|
2003-12-16 14:05:23 -05:00
|
|
|
if ! fgrep -q "|$$dir|" $${_DEPENDS_FILE}; then \
|
2003-07-30 15:31:31 -04:00
|
|
|
echo "|$$dir|" >>$${_DEPENDS_FILE}; \
|
|
|
|
${_flavor_fragment}; \
|
|
|
|
eval $$toset ${MAKE} _recurse-lib-depends-check; \
|
|
|
|
fi; \
|
2001-10-24 07:49:45 -04:00
|
|
|
}
|
|
|
|
.endfor
|
|
|
|
.for _i in ${RUN_DEPENDS}
|
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
|
|
|
echo '${_i}' | { \
|
|
|
|
IFS=:; read dep pkg dir target; \
|
2003-12-16 14:05:23 -05:00
|
|
|
if ! fgrep -q "|$$dir|" $${_DEPENDS_FILE}; then \
|
2003-07-30 15:31:31 -04:00
|
|
|
echo "|$$dir|" >>$${_DEPENDS_FILE}; \
|
|
|
|
${_flavor_fragment}; \
|
|
|
|
eval $$toset ${MAKE} _recurse-lib-depends-check; \
|
|
|
|
fi; \
|
2001-10-24 07:49:45 -04:00
|
|
|
}
|
|
|
|
.endfor
|
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
|
|
|
|
# Write a correct list of dependencies for packages.
|
2003-12-11 03:55:24 -05:00
|
|
|
_solve-package-depends:
|
2003-07-30 15:31:31 -04:00
|
|
|
.for _i in ${RUN_DEPENDS}
|
2001-03-28 09:33:24 -05:00
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
2003-07-30 15:31:31 -04:00
|
|
|
echo '${_i}' |{ \
|
2004-08-02 08:10:17 -04:00
|
|
|
IFS=:; read dep pkg pkgpath target; \
|
|
|
|
dir=$$pkgpath; ${_flavor_fragment}; \
|
2003-07-30 15:31:31 -04:00
|
|
|
default=`eval $$toset ${MAKE} _print-packagename`; \
|
|
|
|
: $${pkg:=$$default}; \
|
2004-08-02 08:10:17 -04:00
|
|
|
echo "@newdepend $$pkgpath:$$pkg:$$default" >>$${_depends_result}; }
|
2003-07-30 15:31:31 -04:00
|
|
|
.endfor
|
2004-08-02 09:01:52 -04:00
|
|
|
.if ${NO_SHARED_LIBS:L} != "yes"
|
2003-07-30 15:31:31 -04:00
|
|
|
. for _i in ${LIB_DEPENDS}
|
2001-04-04 04:17:31 -04:00
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
2003-07-30 15:31:31 -04:00
|
|
|
echo '${_i}'|{ \
|
2004-08-02 08:10:17 -04:00
|
|
|
IFS=:; read dep pkg pkgpath target; \
|
|
|
|
dir=$$pkgpath; ${_flavor_fragment}; \
|
2003-07-30 15:31:31 -04:00
|
|
|
libspecs='';comma=''; \
|
|
|
|
default=`eval $$toset ${MAKE} _print-packagename`; \
|
|
|
|
case "X$$pkg" in X) pkg=`echo $$default|sed -e 's,-[0-9].*,-*,'`;; esac; \
|
|
|
|
if pkg dependencies check $$pkg; then \
|
|
|
|
listlibs='ls $$shdir 2>/dev/null'; \
|
|
|
|
else \
|
|
|
|
eval $$toset ${MAKE} ${PKGREPOSITORY}/$$default.tgz; \
|
|
|
|
listlibs='pkg_info -L ${PKGREPOSITORY}/$$default.tgz|grep $$shdir|sed -e "s,^$$shdir/,,"'; \
|
2001-04-04 04:17:31 -04:00
|
|
|
fi; \
|
2003-07-30 15:31:31 -04:00
|
|
|
IFS=,; for d in $$dep; do \
|
|
|
|
${_libresolve_fragment}; \
|
|
|
|
case "$$check" in \
|
|
|
|
*.a) continue;; \
|
|
|
|
Missing\ library|Error:*) \
|
|
|
|
echo 1>&2 "Can't resolve libspec $$d"; \
|
|
|
|
exit 1;; \
|
|
|
|
*) \
|
|
|
|
libspecs="$$libspecs$$comma$$shprefix$$check"; \
|
|
|
|
comma=',';; \
|
|
|
|
esac; \
|
|
|
|
done; \
|
|
|
|
case "X$$libspecs" in \
|
|
|
|
X) ;;\
|
|
|
|
*) \
|
2004-08-02 08:10:17 -04:00
|
|
|
echo "@libdepend $$pkgpath:$$libspecs:$$pkg:$$default" >>$${_depends_result}; \
|
2003-07-30 15:31:31 -04:00
|
|
|
esac; \
|
|
|
|
}
|
|
|
|
. endfor
|
2001-04-04 04:17:31 -04:00
|
|
|
.endif
|
|
|
|
|
2003-07-30 15:31:31 -04:00
|
|
|
# recursively build a list of dirs for package running, ready for tsort
|
|
|
|
_recurse-run-dir-depends:
|
|
|
|
.for _dir in ${_ALWAYS_DEP} ${_RUN_DEP}
|
2001-04-04 04:17:31 -04:00
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
2003-07-30 15:31:31 -04: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}; \
|
2003-07-30 15:31:31 -04:00
|
|
|
dir=${_dir}; \
|
2001-04-04 04:17:31 -04:00
|
|
|
${_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:
|
|
|
|
.if !empty(_ALWAYS_DEP) || !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}; \
|
2003-09-28 06:57:01 -04:00
|
|
|
self=${FULLPKGPATH} PACKAGING='${SUBPACKAGE}' ${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
|
|
|
|
|
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:
|
|
|
|
.for _dir in ${_ALWAYS_DEP} ${_BUILD_DEP} ${_RUN_DEP}
|
2001-04-04 04:17:31 -04:00
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
2003-07-30 15:31:31 -04: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}; \
|
2003-07-30 15:31:31 -04:00
|
|
|
dir=${_dir}; \
|
2001-04-18 10:43:55 -04:00
|
|
|
${_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:
|
|
|
|
.for _dir in ${_ALWAYS_DEP} ${_BUILD_DEP}
|
2001-04-18 10:43:55 -04:00
|
|
|
@unset FLAVOR SUBPACKAGE || true; \
|
2003-07-30 15:31:31 -04: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}; \
|
2003-07-30 15:31:31 -04:00
|
|
|
dir=${_dir}; \
|
2001-04-18 10:43:55 -04:00
|
|
|
${_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:
|
|
|
|
.if !empty(_ALWAYS_DEP) || !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:
|
|
|
|
.if !empty(_ALWAYS_DEP) || !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
|
|
|
|
|
2001-01-08 17:34:51 -05:00
|
|
|
.if ${FAKE:L} == "no"
|
2000-12-23 07:25:57 -05:00
|
|
|
. include "${PORTSDIR}/infrastructure/mk/old-install.mk"
|
|
|
|
.endif
|
|
|
|
|
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
|
|
|
|
|
1999-02-24 07:34:46 -05:00
|
|
|
.PHONY: \
|
2003-12-15 12:56:40 -05:00
|
|
|
_build-dir-depends _delete-package-links _fetch-makefile _fetch-onefile \
|
2003-07-30 15:59:48 -04:00
|
|
|
_package _package-links _print-packagename \
|
|
|
|
_recurse-all-dir-depends _recurse-lib-depends-check \
|
2003-12-11 03:55:24 -05:00
|
|
|
_recurse-run-dir-depends _solve-package-depends _refetch \
|
2003-07-30 15:59:48 -04:00
|
|
|
addsum \
|
2003-07-30 15:51:11 -04:00
|
|
|
all all-dir-depends build \
|
|
|
|
build-depends build-depends-list build-dir-depends \
|
|
|
|
checkpatch checksum clean \
|
|
|
|
clean-depends configure deinstall \
|
2003-07-30 15:59:48 -04:00
|
|
|
delete-package \
|
|
|
|
depends \
|
2003-07-30 15:51:11 -04:00
|
|
|
describe distclean distpatch \
|
|
|
|
do-build do-configure do-distpatch \
|
|
|
|
do-extract do-fetch do-install \
|
|
|
|
do-package do-regress extract \
|
|
|
|
fake fetch fetch-all \
|
|
|
|
fetch-makefile full-all-depends full-build-depends \
|
|
|
|
full-run-depends homepage-links install \
|
|
|
|
lib-depends lib-depends-check lib-depends-list \
|
|
|
|
link-categories makesum manpages-check \
|
2003-07-30 15:59:48 -04:00
|
|
|
package patch \
|
2003-07-30 15:51:11 -04:00
|
|
|
plist 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 \
|
2003-08-04 09:25:36 -04:00
|
|
|
readmes rebuild \
|
2003-07-30 15:59:48 -04:00
|
|
|
regress regress-depends \
|
2003-07-30 15:51:11 -04:00
|
|
|
reinstall repackage run-depends \
|
|
|
|
run-depends-list run-dir-depends show \
|
|
|
|
uninstall unlink-categories update-patches \
|
2003-08-11 16:10:41 -04:00
|
|
|
update-plist \
|
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
|
|
|
license-check _license-check \
|
|
|
|
_internal-extract _internal-distpatch _internal-configure \
|
|
|
|
_internal-build _internal-all _internal_install _internal-fake \
|
|
|
|
_internal-package _internal_fetch _internal-checksum \
|
|
|
|
_internal-depends _internal-lib-depends _internal-build-depends \
|
|
|
|
_internal-run-depends _internal-regress-depends \
|
|
|
|
_internal-regress _internal-clean _internal-lib-depends-check \
|
|
|
|
_internal-manpages-check _internal-plist _internal-update-plist
|