pkgsrc/mk/install/bsd.install.mk
agc 4b9f0a9c84 Add a new definition, PKGSRC_KEEP_BIN_PKGS, which defaults to "no".
This definition controls whether the binary package which is built
during package installation will be copied to pkgsrc/packages/All.

To retain binary packages in pkgsrc/packages/All, set

	PKGSRC_KEEP_BIN_PKGS=yes

in environment or MAKECONF. If this is not set, binary packages
will not be preserved after their WRKDIR is removed. This may not
be what you want.

To preserve the status quo since 2013/05/22, and just delete the
binary package after it's built, the default for PKGSRC_KEEP_BIN_PKGS
is "no", or it can be explicitly set.

As reviewed on tech-pkg.
2014-12-06 23:28:18 +00:00

66 lines
2 KiB
Makefile

# $NetBSD: bsd.install.mk,v 1.15 2014/12/06 23:28:18 agc Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and provides all
# variables and targets related to installing packages.
#
# The following are the "public" targets provided this module:
#
# install, stage-install, deinstall, reinstall, replace, undo-replace
#
# The following targets may be overridden in a package Makefile:
#
# pre-install, do-install, post-install
#
_COOKIE.install= ${WRKDIR}/.install_done
######################################################################
### install (PUBLIC)
######################################################################
### install is a public target to install the package either by
### depending on stage-install (_USE_DESTDIR=no) or package-install
### (_USE_DESTDIR!=no).
###
.PHONY: install
.if ${_USE_DESTDIR} == "no"
install: stage-install
.elif ${_KEEP_BIN_PKGS} == "no"
install: stage-package-install
.else
install: package-install
.endif
######################################################################
### stage-install (PUBLIC)
######################################################################
### stage-install is a public target to install the package to
### ${PREFIX} (_USE_DESTDIR=no) or to ${DESTDIR}${PREFIX}
### (_USE_DESTDIR!=no)
###
.PHONY: stage-install
.if !defined(NO_INSTALL)
. include "install.mk"
.else
. if exists(${_COOKIE.install})
stage-install:
@${DO_NADA}
. elif defined(_PKGSRC_BARRIER)
stage-install: ${_PKGSRC_BUILD_TARGETS} install-cookie
. else
stage-install: barrier
. endif
.endif
.include "deinstall.mk"
.include "replace.mk"
######################################################################
### install-cookie (PRIVATE)
######################################################################
### install-cookie creates the "install" cookie file.
###
.PHONY: install-cookie
install-cookie:
${RUN} [ ! -f ${_COOKIE.install} ]
${RUN} ${MKDIR} ${_COOKIE.install:H}
${RUN} ${ECHO} ${PKGNAME} > ${_COOKIE.install}