diff options
-rw-r--r-- | mk/bsd.pkg.defaults.mk | 7 | ||||
-rw-r--r-- | mk/bsd.pkg.install.mk | 13 | ||||
-rw-r--r-- | mk/install/deinstall | 8 | ||||
-rw-r--r-- | mk/install/header | 5 | ||||
-rw-r--r-- | mk/install/install | 9 |
5 files changed, 37 insertions, 5 deletions
diff --git a/mk/bsd.pkg.defaults.mk b/mk/bsd.pkg.defaults.mk index ee7e476bebf..f2853d1a8d9 100644 --- a/mk/bsd.pkg.defaults.mk +++ b/mk/bsd.pkg.defaults.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.defaults.mk,v 1.106 2002/11/16 05:26:28 uebayasi Exp $ +# $NetBSD: bsd.pkg.defaults.mk,v 1.107 2002/11/17 08:58:49 salo Exp $ # # A file providing defaults for pkgsrc and the packages collection. @@ -66,6 +66,11 @@ PKGSRC_SLEEPSECS?= 5 # Possible: defined, not defined # Default: not defined +#PKG_REGISTER_SHELLS= YES +# Automatically register shells in /etc/shells +# Possible: YES, NO +# Default: YES + PKGSRC_RUN_TEST?= no # Run test target before install # Possible: yes, no diff --git a/mk/bsd.pkg.install.mk b/mk/bsd.pkg.install.mk index 69a4a125784..bebf84a57df 100644 --- a/mk/bsd.pkg.install.mk +++ b/mk/bsd.pkg.install.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.install.mk,v 1.38 2002/10/23 17:43:16 jlam Exp $ +# $NetBSD: bsd.pkg.install.mk,v 1.39 2002/11/17 08:58:50 salo Exp $ # # This Makefile fragment is included by package Makefiles to use the common # INSTALL/DEINSTALL scripts. To use this Makefile fragment, simply: @@ -213,6 +213,17 @@ FILES_SUBST+= PKG_CREATE_USERGROUP=${PKG_CREATE_USERGROUP} FILES_SUBST+= PKG_CONFIG=${PKG_CONFIG} FILES_SUBST+= PKG_RCD_SCRIPTS=${PKG_RCD_SCRIPTS} +# PKG_REGISTER_SHELLS indicates whether to automatically register shells +# in /etc/shells. It is either YES or NO and defaults to YES. +# +# PKG_SHELL contains the full pathname of the shell being installed. +# + +PKG_REGISTER_SHELLS?= YES +PKG_SHELL?= # empty +FILES_SUBST+= PKG_REGISTER_SHELLS=${PKG_REGISTER_SHELLS} +FILES_SUBST+= PKG_SHELL=${PKG_SHELL:Q} + # Substitute for various programs used in the DEINSTALL/INSTALL scripts and # in the rc.d scripts. # diff --git a/mk/install/deinstall b/mk/install/deinstall index debc3c768ab..854283fa15f 100644 --- a/mk/install/deinstall +++ b/mk/install/deinstall @@ -1,6 +1,6 @@ # start of deinstall # -# $NetBSD: deinstall,v 1.14 2002/10/23 17:43:17 jlam Exp $ +# $NetBSD: deinstall,v 1.15 2002/11/17 08:58:50 salo Exp $ eval set -- ${PKG_USERS} for userset; do @@ -88,6 +88,12 @@ DEINSTALL) fi done fi + if [ -n "${PKG_SHELL}" -a "${PKG_REGISTER_SHELLS}" = "YES" ]; then + ${ECHO} "===> Updating /etc/shells" + ${CP} /etc/shells /etc/shells.pkgsrc."$$" + (${GREP} -v ${PKG_SHELL} /etc/shells.pkgsrc."$$" || ${TRUE}) > /etc/shells + ${RM} /etc/shells.pkgsrc."$$" + fi ;; POST-DEINSTALL) diff --git a/mk/install/header b/mk/install/header index fd49226ed43..32a4f0074a4 100644 --- a/mk/install/header +++ b/mk/install/header @@ -2,7 +2,7 @@ # # start of header # -# $NetBSD: header,v 1.16 2002/10/08 11:32:34 jlam Exp $ +# $NetBSD: header,v 1.17 2002/11/17 08:58:50 salo Exp $ PKGNAME=$1 STAGE=$2 @@ -65,6 +65,9 @@ OWN_DIRS_PERMS="@OWN_DIRS_PERMS@" PKG_SYSCONFBASE="@PKG_SYSCONFBASE@" PKG_SYSCONFDIR="@PKG_SYSCONFDIR@" +PKG_REGISTER_SHELLS="@PKG_REGISTER_SHELLS@" +PKG_SHELL="@PKG_SHELL@" + ALL_USERS= ALL_GROUPS= ALL_FILES= diff --git a/mk/install/install b/mk/install/install index 554e6dd0fd8..a7f939dac7f 100644 --- a/mk/install/install +++ b/mk/install/install @@ -1,6 +1,6 @@ # start of install # -# $NetBSD: install,v 1.16 2002/10/23 17:43:17 jlam Exp $ +# $NetBSD: install,v 1.17 2002/11/17 08:58:51 salo Exp $ case ${STAGE} in PRE-INSTALL) @@ -318,6 +318,13 @@ EOF EOF fi fi + if [ -n "${PKG_SHELL}" -a "${PKG_REGISTER_SHELLS}" = "YES" ]; then + ${ECHO} "===> Updating /etc/shells" + ${TOUCH} /etc/shells + ${CP} /etc/shells /etc/shells.pkgsrc."$$" + (${GREP} -v ${PKG_SHELL} /etc/shells.pkgsrc."$$" || ${TRUE}; ${ECHO} ${PKG_SHELL}) > /etc/shells + ${RM} /etc/shells.pkgsrc."$$" + fi ;; *) |