summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/bsd.pkg.install.mk9
-rw-r--r--mk/install/deinstall12
-rw-r--r--mk/install/header3
-rw-r--r--mk/install/install7
4 files changed, 22 insertions, 9 deletions
diff --git a/mk/bsd.pkg.install.mk b/mk/bsd.pkg.install.mk
index 1be158c2e7e..9ca10c26d08 100644
--- a/mk/bsd.pkg.install.mk
+++ b/mk/bsd.pkg.install.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.install.mk,v 1.2 2001/11/19 23:33:52 jlam Exp $
+# $NetBSD: bsd.pkg.install.mk,v 1.3 2001/11/21 15:43:01 jlam Exp $
#
# This Makefile fragment is included by package Makefiles to use the common
# INSTALL/DEINSTALL scripts. To use this Makefile fragment, simply:
@@ -107,8 +107,9 @@ USE_USERGROUP= YES
# same way, but the package admin isn't prompted to customize the file
# at post-install time.
#
-# RCD_SCRIPTS works like CONF_FILES but deals with rc.d startup scripts. The
-# scripts are copied with ${RCD_SCRIPTS_MODE} permissions.
+# RCD_SCRIPTS works lists the basenames of the rc.d scripts. It's assumed that
+# they live in ${PREFIX}/etc/rc.d, and the scripts will be copied into
+# ${RCD_SCRIPTS_DIR} with ${RCD_SCRIPTS_MODE} permissions.
#
CONF_FILES?= # empty
CONF_FILES_MODE?= 0644
@@ -118,6 +119,7 @@ SUPPORT_FILES_MODE?= 0644
SUPPORT_FILES_PERMS?= # empty
RCD_SCRIPTS?= # empty
RCD_SCRIPTS_MODE?= 0755
+RCD_SCRIPTS_DIR?= /etc/rc.d
FILES_SUBST+= CONF_FILES=${CONF_FILES:Q}
FILES_SUBST+= CONF_FILES_MODE=${CONF_FILES_MODE}
FILES_SUBST+= CONF_FILES_PERMS=${CONF_FILES_PERMS:Q}
@@ -126,6 +128,7 @@ FILES_SUBST+= SUPPORT_FILES_MODE=${SUPPORT_FILES_MODE}
FILES_SUBST+= SUPPORT_FILES_PERMS=${SUPPORT_FILES_PERMS:Q}
FILES_SUBST+= RCD_SCRIPTS=${RCD_SCRIPTS:Q}
FILES_SUBST+= RCD_SCRIPTS_MODE=${RCD_SCRIPTS_MODE}
+FILES_SUBST+= RCD_SCRIPTS_DIR=${RCD_SCRIPTS_DIR}
# OWN_DIRS contains a list of directories for this package that should be
# created and should attempt to be destroyed by the INSTALL/DEINSTALL
diff --git a/mk/install/deinstall b/mk/install/deinstall
index 81444ffa5ef..b67a9f09ea8 100644
--- a/mk/install/deinstall
+++ b/mk/install/deinstall
@@ -1,8 +1,16 @@
# start of deinstall
#
-# $NetBSD: deinstall,v 1.4 2001/11/21 05:38:03 jlam Exp $
+# $NetBSD: deinstall,v 1.5 2001/11/21 15:43:01 jlam Exp $
-ALL_FILES="${CONF_FILES} ${SUPPORT_FILES} ${RCD_SCRIPTS}"
+ALL_FILES="${CONF_FILES} ${SUPPORT_FILES}"
+set -- ${RCD_SCRIPTS}
+while [ $# -gt 0 ]
+do
+ samplefile="${PKG_PREFIX}/etc/rc.d/$1"
+ file="${RCD_SCRIPTS_DIR}/$1"
+ shift
+ ALL_FILES="${ALL_FILES} ${samplefile} ${file}"
+done
set -- ${CONF_FILES_PERMS} ${SUPPORT_FILES_PERMS}
while [ $# -gt 0 ]
do
diff --git a/mk/install/header b/mk/install/header
index ac2275f6a83..2f9a2fa08ba 100644
--- a/mk/install/header
+++ b/mk/install/header
@@ -2,7 +2,7 @@
#
# start of header
#
-# $NetBSD: header,v 1.2 2001/11/19 23:33:53 jlam Exp $
+# $NetBSD: header,v 1.3 2001/11/21 15:43:01 jlam Exp $
PKGNAME=$1
STAGE=$2
@@ -43,6 +43,7 @@ CONF_FILES_PERMS="@CONF_FILES_PERMS@"
SUPPORT_FILES="@SUPPORT_FILES@"
SUPPORT_FILES_PERMS="@SUPPORT_FILES_PERMS@"
RCD_SCRIPTS="@RCD_SCRIPTS@"
+RCD_SCRIPTS_DIR="@RCD_SCRIPTS_DIR@"
MAKE_DIRS="@MAKE_DIRS@"
MAKE_DIRS_PERMS="@MAKE_DIRS_PERMS@"
diff --git a/mk/install/install b/mk/install/install
index cac9be212b2..99268bfa51f 100644
--- a/mk/install/install
+++ b/mk/install/install
@@ -1,6 +1,6 @@
# start of install
#
-# $NetBSD: install,v 1.2 2001/11/19 23:33:53 jlam Exp $
+# $NetBSD: install,v 1.3 2001/11/21 15:43:01 jlam Exp $
case ${STAGE} in
PRE-INSTALL)
@@ -125,8 +125,9 @@ POST-INSTALL)
set -- ${RCD_SCRIPTS}
while [ $# -gt 0 ]
do
- samplefile="$1"; file="$2"
- shift; shift
+ samplefile="${PKG_PREFIX}/etc/rc.d/$1"
+ file="${RCD_SCRIPTS_DIR}/$1"
+ shift
if [ -e ${file} ]
then