pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Teach the pkgsrc infrastructure to Just Know when t...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8a9f836d5c82
branches:  trunk
changeset: 505028:8a9f836d5c82
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Thu Dec 29 06:18:53 2005 +0000

description:
Teach the pkgsrc infrastructure to Just Know when the pkginstall
framework should be used.  This is implemented by creating a small
file mk/install/pkginstall.mk that guards the implementation makefile
mk/install/bsd.pkginstall.mk.  This guard file just checks whether
one of the pkginstall-related variables is non-empty, and if so, then
the implementation file is automatically included.  This completely
deprecates USE_PKGINSTALL, which no longer has any affect in pkgsrc.

diffstat:

 mk/bsd.pkg.mk                |  15 +------------
 mk/install/bsd.pkginstall.mk |  10 ++++----
 mk/install/pkginstall.mk     |  47 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 54 insertions(+), 18 deletions(-)

diffs (99 lines):

diff -r 02dcb256239a -r 8a9f836d5c82 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Thu Dec 29 03:44:38 2005 +0000
+++ b/mk/bsd.pkg.mk     Thu Dec 29 06:18:53 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1774 2005/12/05 22:07:07 rillig Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1775 2005/12/29 06:18:53 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -505,18 +505,7 @@
 #
 .include "../../mk/alternatives.mk"
 
-# CONF_DEPENDS notes a dependency where the config directory for the
-# package matches the dependency's config directory.  CONF_DEPENDS is
-# only meaningful if ${PKG_INSTALLATION_TYPE} == "pkgviews".
-#
-CONF_DEPENDS?=         # empty
-.if !empty(CONF_DEPENDS)
-USE_PKGINSTALL=                yes
-.endif
-
-.if defined(USE_PKGINSTALL) && !empty(USE_PKGINSTALL:M[yY][eE][sS])
-.  include "../../mk/install/bsd.pkginstall.mk"
-.endif
+.include "../../mk/install/pkginstall.mk"
 
 # Set INSTALL_FILE to be the name of any INSTALL file
 .if !defined(INSTALL_FILE) && exists(${PKGDIR}/INSTALL)
diff -r 02dcb256239a -r 8a9f836d5c82 mk/install/bsd.pkginstall.mk
--- a/mk/install/bsd.pkginstall.mk      Thu Dec 29 03:44:38 2005 +0000
+++ b/mk/install/bsd.pkginstall.mk      Thu Dec 29 06:18:53 2005 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: bsd.pkginstall.mk,v 1.31 2005/12/29 03:44:38 jlam Exp $
+# $NetBSD: bsd.pkginstall.mk,v 1.32 2005/12/29 06:18:53 jlam Exp $
 #
-# This Makefile fragment is included by bsd.pkg.mk to use the common
-# INSTALL/DEINSTALL scripts.  To use this Makefile fragment, simply:
+# This Makefile fragment is included by mk/install/pkginstall.mk and is
+# the implemenation file for the common INSTALL/DEINSTALL scripts
+# framework.  To use the pkginstall framework, simply set the relevant
+# variables to customize the install scripts to the package.
 #
-# (1) Set the variables to customize the install scripts to the package, and
-# (2) Set USE_PKGINSTALL to YES in the package Makefile.
 
 .if defined(BSD_PKG_INSTALL_MK)
 PKG_FAIL_REASON+=      "[bsd.pkginstall.mk] Must not be included directly."
diff -r 02dcb256239a -r 8a9f836d5c82 mk/install/pkginstall.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/install/pkginstall.mk  Thu Dec 29 06:18:53 2005 +0000
@@ -0,0 +1,47 @@
+# $NetBSD: pkginstall.mk,v 1.1 2005/12/29 06:18:53 jlam Exp $
+#
+# This Makefile fragment is included by bsd.pkg.mk and determines whether
+# or not the bsd.pkginstall.mk implementation file should be included.
+#
+# _PKGINSTALL_VARS is a list of the variables that, if non-empty, indicate
+#      that the pkginstall framework should be used.  These variables
+#      should be extracted from bsd.pkginstall.mk and are typically the
+#      variables named in the INSTALL_<SCRIPT>_MEMBERS lists.
+#
+# The variables listed in _PKGINSTALL_VARS are documented in
+# mk/install/bsd.pkginstall.mk.
+#
+_PKGINSTALL_VARS+=     HEADER_EXTRA_TMPL
+_PKGINSTALL_VARS+=     DEINSTALL_PRE_TMPL DEINSTALL_EXTRA_TMPL         \
+                       DEINSTALL_TMPL
+_PKGINSTALL_VARS+=     INSTALL_TMPL INSTALL_EXTRA_TMPL                 \
+                       INSTALL_POST_TMPL INSTALL_UNPACK_TMPL
+_PKGINSTALL_VARS+=     DEINSTALL_SRC INSTALL_SRC
+
+_PKGINSTALL_VARS+=     PKG_GROUPS PKG_USERS
+_PKGINSTALL_VARS+=     SPECIAL_PERMS
+_PKGINSTALL_VARS+=     CONF_FILES CONF_FILES_PERMS                     \
+                       REQD_FILES REQD_FILES_PERMS                     \
+                       RCD_SCRIPTS
+_PKGINSTALL_VARS+=     MAKE_DIRS MAKE_DIRS_PERMS                       \
+                       REQD_DIRS REQD_DIRS_PERMS                       \
+                       OWN_DIRS OWN_DIRS_PERMS
+_PKGINSTALL_VARS+=     PKG_SHELL
+_PKGINSTALL_VARS+=     FONTS_DIRS.ttf FONTS_DIRS.type1 FONTS_DIRS.x11
+
+# CONF_DEPENDS notes a dependency where the config directory for the
+# package matches the dependency's config directory.  CONF_DEPENDS is
+# only meaningful if PKG_INSTALLATION_TYPE is "pkgviews".
+#
+_PKGINSTALL_VARS+=     CONF_DEPENDS
+
+_USE_PKGINSTALL=       no
+.for _var_ in ${_PKGINSTALL_VARS}
+.  if !empty(${_var_})
+_USE_PKGINSTALL=       yes
+.  endif
+.endfor
+
+.if !empty(_USE_PKGINSTALL:M[yY][eE][sS])
+.  include "../../mk/install/bsd.pkginstall.mk"
+.endif



Home | Main Index | Thread Index | Old Index