summaryrefslogtreecommitdiff
path: root/mk/install
diff options
context:
space:
mode:
authorsalo <salo>2002-11-17 08:58:49 +0000
committersalo <salo>2002-11-17 08:58:49 +0000
commitcd2da9cf82d999d76161960824ead8d8a846ffac (patch)
tree3e155d5246ed236de0b61794dce3b642fff4045a /mk/install
parent10c70866d58aa0b6edb481a6c90d2c2dff1373b5 (diff)
downloadpkgsrc-cd2da9cf82d999d76161960824ead8d8a846ffac.tar.gz
Introduce new framework which unifies registering packages providing login
shells to /etc/shells. This feature can be disabled by setting PKG_REGISTER_SHELLS to NO in /etc/mk.conf. An excerpt from Packages.txt, section 10.28: 10.28 Packages providing login shells ===================================== If the purpose of the package is to provide a login shell, the variable PKG_SHELL should contain the full pathname of the shell executable installed by this package. The package Makefile also must include "../../mk/bsd.pkg.install.mk" prior to the inclusion of bsd.pkg.mk to use the automatically generated INSTALL/DEINSTALL scripts. An example taken from shells/zsh: PKG_SHELL= ${PREFIX}/bin/zsh .include "../../mk/bsd.pkg.install.mk" The shell is registered into /etc/shells file automatically in the post-install target by the INSTALL script generated by bsd.pkg.install.mk and removed in the deinstall target by the DEINSTALL script.
Diffstat (limited to 'mk/install')
-rw-r--r--mk/install/deinstall8
-rw-r--r--mk/install/header5
-rw-r--r--mk/install/install9
3 files changed, 19 insertions, 3 deletions
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
;;
*)