pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Always run the pkginstall framework targets to gene...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2dcb3280b22b
branches:  trunk
changeset: 509849:2dcb3280b22b
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed Mar 15 16:20:11 2006 +0000

description:
Always run the pkginstall framework targets to generate the
INSTALL/DEINSTALL and rc.d scripts, regardless of whether NO_BUILD is
defined or not.

We do this by renaming the main "build" target to "_build", and creating
a new "build" target that has "_build" and "pkginstall" as dependencies.
This allows the "build" and "install" targets to be consecutive, so
no changes in behavior are visible to the user.

Because the pkginstall targets are no longer run within the protection
of the locks during the build phase, we need to manage locking within
a new "pkginstall" target.

diffstat:

 mk/bsd.pkg.mk                |  36 +++++++++++++++++++-----------------
 mk/install/bsd.pkginstall.mk |  28 +++++++++++++++++++++++++---
 2 files changed, 44 insertions(+), 20 deletions(-)

diffs (125 lines):

diff -r 5dd92ddb0fe0 -r 2dcb3280b22b mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Wed Mar 15 14:06:09 2006 +0000
+++ b/mk/bsd.pkg.mk     Wed Mar 15 16:20:11 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1809 2006/03/15 14:06:09 jlam Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1810 2006/03/15 16:20:11 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -410,6 +410,16 @@
 MAKE_ENV+=     ${INSTALL_MACROS}
 SCRIPTS_ENV+=  ${INSTALL_MACROS}
 
+# If pkgsrc is supposed to ensure that tests are run before installation
+# of the package, then the build targets should be "build test", otherwise
+# just "build" suffices.
+#
+.if !empty(PKGSRC_RUN_TEST:M[yY][eE][sS])
+_PKGSRC_BUILD_TARGETS= build test
+.else
+_PKGSRC_BUILD_TARGETS= build
+.endif
+
 # The user can override the NO_PACKAGE by specifying this from
 # the make command line
 .if defined(FORCE_PACKAGE)
@@ -463,17 +473,6 @@
 MESSAGE_SUBST_SED=     ${MESSAGE_SUBST:S/=/}!/:S/$/!g/:S/^/ -e s!\\\${/}
 .endif
 
-# If pkgsrc is supposed to ensure that tests are run before installation
-# of the package, then the build targets should be "build test", otherwise
-# just "build" suffices.  _PKGSRC_BUILD_TARGETS is used in the "all",
-# "install", and "uptodate-digest" targets.
-#
-.if !empty(PKGSRC_RUN_TEST:M[yY][eE][sS])
-_PKGSRC_BUILD_TARGETS= build test
-.else
-_PKGSRC_BUILD_TARGETS= build
-.endif
-
 .PHONY: uptodate-digest
 uptodate-digest:
 .if !empty(USE_DIGEST:M[yY][eE][sS])
@@ -983,8 +982,8 @@
 
 # Disable build
 .PHONY: build
-.if defined(NO_BUILD) && !target(build)
-build: configure
+.if defined(NO_BUILD)
+_build: configure
        ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_FLAGS} ${_BUILD_COOKIE}
 .endif
 
@@ -2105,10 +2104,13 @@
 configure: wrapper acquire-configure-lock ${_CONFIGURE_COOKIE} release-configure-lock
 .endif
 
+.PHONY: _build
+.if !target(_build)
+_build: configure acquire-build-lock ${_BUILD_COOKIE} release-build-lock
+.endif
+
 .PHONY: build
-.if !target(build)
-build: configure acquire-build-lock ${_BUILD_COOKIE} release-build-lock
-.endif
+build: pkginstall
 
 .PHONY: test
 .if !target(test)
diff -r 5dd92ddb0fe0 -r 2dcb3280b22b mk/install/bsd.pkginstall.mk
--- a/mk/install/bsd.pkginstall.mk      Wed Mar 15 14:06:09 2006 +0000
+++ b/mk/install/bsd.pkginstall.mk      Wed Mar 15 16:20:11 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkginstall.mk,v 1.41 2006/03/15 04:52:57 jlam Exp $
+# $NetBSD: bsd.pkginstall.mk,v 1.42 2006/03/15 16:20:12 jlam Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and implements the
 # common INSTALL/DEINSTALL scripts framework.  To use the pkginstall
@@ -725,7 +725,6 @@
 _INSTALL_FILE_DFLT=    ${_PKGINSTALL_DIR}/INSTALL.default
 
 .PHONY: generate-install-scripts
-post-build: generate-install-scripts
 generate-install-scripts:                                              \
                ${_DEINSTALL_FILE} ${_INSTALL_FILE}                     \
                ${_DEINSTALL_FILE_DFLT} ${_INSTALL_FILE_DFLT}
@@ -818,7 +817,6 @@
 # doesn't occur.
 
 .PHONY: generate-rcd-scripts
-post-build: generate-rcd-scripts
 generate-rcd-scripts:  # do nothing
 
 .PHONY: install-rcd-scripts
@@ -849,3 +847,27 @@
 .    endif
 .  endif
 .endfor
+
+_PKGINSTALL_COOKIE=    ${WRKDIR}/.pkginstall_done
+
+_PKGINSTALL_TARGETS+=  _build
+_PKGINSTALL_TARGETS+=  acquire-pkginstall-lock
+_PKGINSTALL_TARGETS+=  ${_PKGINSTALL_COOKIE}
+_PKGINSTALL_TARGETS+=  release-pkginstall-lock
+
+.ORDER: ${_PKGINSTALL_TARGETS}
+
+.PHONY: pkginstall
+pkginstall: ${_PKGINSTALL_TARGETS}
+
+.PHONY: acquire-pkginstall-lock release-pkginstall-lock
+acquire-pkginstall-lock:
+       ${_ACQUIRE_LOCK}
+release-pkginstall-lock:
+       ${_RELEASE_LOCK}
+
+.PHONY: do-pkginstall
+do-pkginstall: generate-rcd-scripts generate-install-scripts
+
+${_PKGINSTALL_COOKIE}: do-pkginstall
+       ${_PKG_SILENT}${_PKG_DEBUG} ${TOUCH} ${TOUCH_FLAGS} ${.TARGET}



Home | Main Index | Thread Index | Old Index