pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Move mk/install to mk/pkginstall to better reflect ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4819ab2c9c7c
branches:  trunk
changeset: 513182:4819ab2c9c7c
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sun May 21 23:50:15 2006 +0000

description:
Move mk/install to mk/pkginstall to better reflect the contents (the
pkginstall framework).

diffstat:

 mk/bsd.pkg.mk                          |     4 +-
 mk/install/bsd.pkginstall.mk           |  1017 --------------------------------
 mk/install/deinstall                   |    73 --
 mk/install/deinstall-pre               |    15 -
 mk/install/dirs                        |   374 -----------
 mk/install/files                       |   459 --------------
 mk/install/fonts                       |   101 ---
 mk/install/footer                      |     4 -
 mk/install/header                      |    86 --
 mk/install/info-files                  |   136 ----
 mk/install/install                     |    97 ---
 mk/install/install-post                |    15 -
 mk/install/perms                       |    96 ---
 mk/install/shell                       |   233 -------
 mk/install/usergroup                   |   382 ------------
 mk/install/usergroup-check             |   126 ---
 mk/install/usergroupfuncs              |   148 ----
 mk/install/usergroupfuncs.DragonFly    |   142 ----
 mk/install/usergroupfuncs.FreeBSD      |   142 ----
 mk/pkginstall/bsd.pkginstall.mk        |  1017 ++++++++++++++++++++++++++++++++
 mk/pkginstall/deinstall                |    73 ++
 mk/pkginstall/deinstall-pre            |    15 +
 mk/pkginstall/dirs                     |   374 +++++++++++
 mk/pkginstall/files                    |   459 ++++++++++++++
 mk/pkginstall/fonts                    |   101 +++
 mk/pkginstall/footer                   |     4 +
 mk/pkginstall/header                   |    86 ++
 mk/pkginstall/info-files               |   136 ++++
 mk/pkginstall/install                  |    97 +++
 mk/pkginstall/install-post             |    15 +
 mk/pkginstall/perms                    |    96 +++
 mk/pkginstall/shell                    |   233 +++++++
 mk/pkginstall/usergroup                |   382 ++++++++++++
 mk/pkginstall/usergroup-check          |   126 +++
 mk/pkginstall/usergroupfuncs           |   148 ++++
 mk/pkginstall/usergroupfuncs.DragonFly |   142 ++++
 mk/pkginstall/usergroupfuncs.FreeBSD   |   142 ++++
 37 files changed, 3648 insertions(+), 3648 deletions(-)

diffs (truncated from 7454 to 300 lines):

diff -r 039614dce2ef -r 4819ab2c9c7c mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Sun May 21 23:31:14 2006 +0000
+++ b/mk/bsd.pkg.mk     Sun May 21 23:50:15 2006 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1823 2006/05/21 14:41:29 jlam Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1824 2006/05/21 23:50:15 jlam Exp $
 #
 # This file is in the public domain.
 #
@@ -438,7 +438,7 @@
 .include "../../mk/alternatives.mk"
 
 # INSTALL/DEINSTALL script framework
-.include "../../mk/install/bsd.pkginstall.mk"
+.include "../../mk/pkginstall/bsd.pkginstall.mk"
 
 # If MESSAGE hasn't been defined, then set MESSAGE_SRC to be a space-separated
 # list of files to be concatenated together to generate the MESSAGE file.
diff -r 039614dce2ef -r 4819ab2c9c7c mk/install/bsd.pkginstall.mk
--- a/mk/install/bsd.pkginstall.mk      Sun May 21 23:31:14 2006 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,1017 +0,0 @@
-# $NetBSD: bsd.pkginstall.mk,v 1.53 2006/04/29 04:36:13 jlam Exp $
-#
-# This Makefile fragment is included by bsd.pkg.mk and implements the
-# common INSTALL/DEINSTALL scripts framework.  To use the pkginstall
-# framework, simply set the relevant variables to customize the install
-# scripts to the package.
-#
-
-# The Solaris /bin/sh does not know the ${foo#bar} shell substitution.
-# This shell function serves a similar purpose, but is specialized on
-# stripping ${PREFIX}/ from a pathname.
-_FUNC_STRIP_PREFIX= \
-       strip_prefix() {                                                \
-         ${AWK} 'END {                                                 \
-           plen = length(prefix);                                      \
-             if (substr(s, 1, plen) == prefix) {                       \
-               s = substr(s, 1 + plen, length(s) - plen);              \
-             }                                                         \
-             print s;                                                  \
-           }' s="$$1" prefix=${PREFIX:Q}/ /dev/null;                   \
-       }
-
-# This is a command that exits with a zero status if the given file
-# is zero-length.
-#
-_ZERO_FILESIZE_P=      ${AWK} 'END { exit NR ? 1 : 0; }'
-
-_PKGINSTALL_DIR=       ${WRKDIR}/.pkginstall
-
-# These are the template scripts for the INSTALL/DEINSTALL scripts.
-# Packages may do additional work in the INSTALL/DEINSTALL scripts by
-# overriding the variables DEINSTALL_TEMPLATE and INSTALL_TEMPLATE to
-# point to additional script fragments.  These bits are included after
-# the main install/deinstall script fragments.
-#
-_HEADER_TMPL?=         ${.CURDIR}/../../mk/install/header
-HEADER_TEMPLATE?=      # empty
-.if exists(${PKGDIR}/HEADER) && \
-    empty(HEADER_TEMPLATE:M${PKGDIR}/HEADER)
-HEADER_TEMPLATE+=      ${PKGDIR}/HEADER
-.endif
-_DEINSTALL_PRE_TMPL?=  ${.CURDIR}/../../mk/install/deinstall-pre
-DEINSTALL_TEMPLATE?=   # empty
-.if exists(${PKGDIR}/DEINSTALL) && \
-    empty(DEINSTALL_TEMPLATE:M${PKGDIR}/DEINSTALL)
-DEINSTALL_TEMPLATE+=   ${PKGDIR}/DEINSTALL
-.endif
-_DEINSTALL_TMPL?=      ${.CURDIR}/../../mk/install/deinstall
-_INSTALL_UNPACK_TMPL?= # empty
-_INSTALL_TMPL?=                ${.CURDIR}/../../mk/install/install
-INSTALL_TEMPLATE?=     # empty
-.if exists(${PKGDIR}/INSTALL) && \
-    empty(INSTALL_TEMPLATE:M${PKGDIR}/INSTALL)
-INSTALL_TEMPLATE+=     ${PKGDIR}/INSTALL
-.endif
-_INSTALL_POST_TMPL?=   ${.CURDIR}/../../mk/install/install-post
-_INSTALL_DATA_TMPL?=   # empty
-_FOOTER_TMPL?=         ${.CURDIR}/../../mk/install/footer
-
-# _DEINSTALL_TEMPLATES and _INSTALL_TEMPLATES are the list of source
-#      files that are concatenated to form the DEINSTALL/INSTALL
-#      scripts.
-#
-# _DEINSTALL_TEMPLATES_DFLT and _INSTALL_TEMPLATES_DFLT are the list of
-#      template files minus any user-supplied templates.
-#
-_DEINSTALL_TEMPLATES=  ${_HEADER_TMPL} ${HEADER_TEMPLATE}              \
-                       ${_DEINSTALL_PRE_TMPL}                          \
-                       ${DEINSTALL_TEMPLATE}                           \
-                       ${_DEINSTALL_TMPL}                              \
-                       ${_FOOTER_TMPL}
-_INSTALL_TEMPLATES=    ${_HEADER_TMPL} ${HEADER_TEMPLATE}              \
-                       ${_INSTALL_UNPACK_TMPL}                         \
-                       ${_INSTALL_TMPL}                                \
-                       ${INSTALL_TEMPLATE}                             \
-                       ${_INSTALL_POST_TMPL}                           \
-                       ${_FOOTER_TMPL}                                 \
-                       ${_INSTALL_DATA_TMPL}                           \
-
-_DEINSTALL_TEMPLATES_DFLT=     ${_HEADER_TMPL}                         \
-                               ${_DEINSTALL_PRE_TMPL}                  \
-                               ${_DEINSTALL_TMPL}                      \
-                               ${_FOOTER_TMPL}
-_INSTALL_TEMPLATES_DFLT=       ${_HEADER_TMPL}                         \
-                               ${_INSTALL_TMPL}                        \
-                               ${_INSTALL_POST_TMPL}                   \
-                               ${_FOOTER_TMPL}
-
-# These are the list of source files that are concatenated to form the
-# INSTALL/DEINSTALL scripts.
-#
-DEINSTALL_SRC?=                ${_DEINSTALL_TEMPLATES}
-INSTALL_SRC?=          ${_INSTALL_TEMPLATES}
-
-# FILES_SUBST lists what to substitute in DEINSTALL/INSTALL scripts and in
-# rc.d scripts.
-#
-FILES_SUBST+=          PREFIX=${PREFIX:Q}
-FILES_SUBST+=          LOCALBASE=${LOCALBASE:Q}
-FILES_SUBST+=          X11BASE=${X11BASE:Q}
-FILES_SUBST+=          DEPOTBASE=${DEPOTBASE:Q}
-FILES_SUBST+=          VARBASE=${VARBASE:Q}
-FILES_SUBST+=          PKG_SYSCONFBASE=${PKG_SYSCONFBASE:Q}
-FILES_SUBST+=          PKG_SYSCONFDEPOTBASE=${PKG_SYSCONFDEPOTBASE:Q}
-FILES_SUBST+=          PKG_SYSCONFBASEDIR=${PKG_SYSCONFBASEDIR:Q}
-FILES_SUBST+=          PKG_SYSCONFDIR=${PKG_SYSCONFDIR:Q}
-FILES_SUBST+=          CONF_DEPENDS=${CONF_DEPENDS:C/:.*//:Q}
-FILES_SUBST+=          PKGBASE=${PKGBASE:Q}
-FILES_SUBST+=          PKG_INSTALLATION_TYPE=${PKG_INSTALLATION_TYPE:Q}
-
-# PKG_USERS represents the users to create for the package.  It is a
-#      space-separated list of elements of the form
-#
-#              user:group
-#
-# The following variables are optional and specify further details of
-# the user accounts listed in PKG_USERS:
-#
-# PKG_UID.<user> is the hardcoded numeric UID for <user>.
-# PKG_GECOS.<user> is <user>'s description, as well as contact info.
-# PKG_HOME.<user> is the home directory for <user>.
-# PKG_SHELL.<user> is the login shell for <user>.
-#
-#
-# PKG_GROUPS represents the groups to create for the package.  It is a
-#      space-separated list of elements of the form
-#
-#              group
-#
-# The following variables are optional and specify further details of
-# the user accounts listed in PKG_GROUPS:
-#
-# PKG_GID.<group> is the hardcoded numeric GID for <group>.
-#
-# For example:
-#
-#      PKG_GROUPS+=    mail
-#      PKG_USERS+=     courier:mail
-#
-#      PKG_GECOS.courier=      Courier authlib and mail user
-#
-# USERGROUP_PHASE is set to the phase just before which users and
-#      groups need to be created.  Valid values are "configure" and
-#      "build".  If not defined, then by default users and groups
-#      are created prior to installation by the pre-install-script
-#      target.  If this is defined, then the numeric UIDs and GIDs
-#      of users and groups required by this package are hardcoded
-#      into the +INSTALL script.
-#
-PKG_GROUPS?=           # empty
-PKG_USERS?=            # empty
-_PKG_USER_HOME?=       /nonexistent
-_PKG_USER_SHELL?=      ${NOLOGIN}
-FILES_SUBST+=          PKG_USER_HOME=${_PKG_USER_HOME:Q}
-FILES_SUBST+=          PKG_USER_SHELL=${_PKG_USER_SHELL:Q}
-
-# Interix is very special in that users are groups cannot have the
-# same name.  Interix.mk tries to work around this by overriding
-# some specific package defaults.  If we get here and there's still a
-# conflict, add a breakage indicator to make sure the package won't
-# compile without changing something.
-#
-.if !empty(OPSYS:MInterix)
-.  for user in ${PKG_USERS:C/\\\\//g:C/:.*//}
-.    if !empty(PKG_GROUPS:M${user})
-PKG_FAIL_REASON+=      "User and group '${user}' cannot have the same name on Interix"
-.    endif
-.  endfor
-.endif
-
-.if !empty(PKG_USERS) || !empty(PKG_GROUPS)
-DEPENDS+=              ${_USER_DEPENDS}
-.endif
-
-_INSTALL_USERGROUP_FILE=       ${_PKGINSTALL_DIR}/usergroup
-.if exists(../../mk/install/usergroupfuncs.${OPSYS})
-_INSTALL_USERGROUPFUNCS_FILE?= ../../mk/install/usergroupfuncs.${OPSYS}
-.else
-_INSTALL_USERGROUPFUNCS_FILE?= ../../mk/install/usergroupfuncs
-.endif
-_INSTALL_USERGROUP_DATAFILE=   ${_PKGINSTALL_DIR}/usergroup-data
-_INSTALL_UNPACK_TMPL+=         ${_INSTALL_USERGROUP_FILE}
-_INSTALL_DATA_TMPL+=           ${_INSTALL_USERGROUP_DATAFILE}
-
-.for _group_ in ${PKG_GROUPS}
-.  if defined(USERGROUP_PHASE)
-# Determine the numeric GID of each group.
-USE_TOOLS+=    perl
-PKG_GID.${_group_}_cmd=                                                        \
-       if ${TEST} ! -x ${PERL5}; then ${ECHO} ""; exit 0; fi;          \
-       ${PERL5} -le 'print scalar getgrnam shift' ${_group_}
-PKG_GID.${_group_}?=   ${PKG_GID.${_group_}_cmd:sh:M*}
-.  endif
-_PKG_GROUPS+=  ${_group_}:${PKG_GID.${_group_}}
-.endfor
-
-.for _entry_ in ${PKG_USERS}
-.  if defined(USERGROUP_PHASE)
-# Determine the numeric UID of each user.
-USE_TOOLS+=    perl
-PKG_UID.${_entry_:C/\:.*//}_cmd=                                       \
-       if ${TEST} ! -x ${PERL5}; then ${ECHO} ""; exit 0; fi;          \
-       ${PERL5} -le 'print scalar getpwnam shift' ${_entry_:C/\:.*//}
-PKG_UID.${_entry_:C/\:.*//}?=  ${PKG_UID.${_entry_:C/\:.*//}_cmd:sh:M*}
-.  endif
-_PKG_USERS+=   ${_user_::=${_entry_:C/\:.*//}}${_entry_}:${PKG_UID.${_user_}}:${PKG_GECOS.${_user_}:Q}:${PKG_HOME.${_user_}:Q}:${PKG_SHELL.${_user_}:Q}
-.endfor
-
-${_INSTALL_USERGROUP_DATAFILE}:
-       ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
-       ${_PKG_SILENT}${_PKG_DEBUG}${RM} -f ${.TARGET} ${.TARGET}.tmp
-       ${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET}.tmp
-       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       set -- dummy ${_PKG_GROUPS:C/\:*$//}; shift;                    \
-       exec 1>>${.TARGET}.tmp;                                         \
-       while ${TEST} $$# -gt 0; do                                     \
-               i="$$1"; shift;                                         \
-               ${ECHO} "# GROUP: $$i";                                 \
-       done
-       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       set -- dummy ${_PKG_USERS:C/\:*$//}; shift;                     \
-       exec 1>>${.TARGET}.tmp;                                         \
-       while ${TEST} $$# -gt 0; do                                     \
-               i="$$1"; shift;                                         \
-               ${ECHO} "# USER: $$i";                                  \
-       done
-       ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET}
-
-${_INSTALL_USERGROUP_FILE}: ${_INSTALL_USERGROUP_DATAFILE}
-${_INSTALL_USERGROUP_FILE}:                                            \
-               ../../mk/install/usergroup                              \
-               ${INSTALL_USERGROUPFUNCS_FILE}
-       ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
-       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       ${SED}  -e "/^# platform-specific adduser\/addgroup functions/r${_INSTALL_USERGROUPFUNCS_FILE}" ../../mk/install/usergroup |                    \
-       ${SED} ${FILES_SUBST_SED} > ${.TARGET}
-       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       if ${_ZERO_FILESIZE_P} ${_INSTALL_USERGROUP_DATAFILE}; then     \
-               ${RM} -f ${.TARGET};                                    \
-               ${TOUCH} ${TOUCH_ARGS} ${.TARGET};                      \
-       fi
-
-_INSTALL_USERGROUP_UNPACKER=   ${_PKGINSTALL_DIR}/usergroup-unpack
-
-${_INSTALL_USERGROUP_UNPACKER}:                                                \
-               ${_INSTALL_USERGROUP_FILE}                              \
-               ${_INSTALL_USERGROUP_DATAFILE}
-       ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
-       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       exec 1>${.TARGET}.tmp;                                          \
-       ${ECHO} "#!${SH}";                                              \
-       ${ECHO} "";                                                     \
-       ${ECHO} "CAT="${CAT:Q};                                         \
-       ${ECHO} "CHMOD="${CHMOD:Q};                                     \
-       ${ECHO} "SED="${SED:Q};                                         \
-       ${ECHO} "";                                                     \
-       ${ECHO} "SELF=\$$0";                                            \
-       ${ECHO} "STAGE=UNPACK";                                         \
-       ${ECHO} "";                                                     \
-       ${CAT}  ${_INSTALL_USERGROUP_FILE}                              \
-               ${_INSTALL_USERGROUP_DATAFILE}
-       ${_PKG_SILENT}${_PKG_DEBUG}${MV} -f ${.TARGET}.tmp ${.TARGET}
-       ${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
-
-.if defined(USERGROUP_PHASE)
-.  if !empty(USERGROUP_PHASE:M*configure)
-pre-configure: do-su-create-usergroup
-.  elif !empty(USERGROUP_PHASE:M*build)
-pre-build: do-su-create-usergroup
-.  endif
-.endif
-
-_INSTALL_USERGROUP_CHECK=                                              \
-       ${SETENV} PERL5=${PERL5:Q}                                      \
-       ${SH} ${PKGSRCDIR}/mk/install/usergroup-check
-
-.PHONY: do-su-create-usergroup
-do-su-create-usergroup:



Home | Main Index | Thread Index | Old Index