Subject: pkg/22954: install all rc.d scripts in share/examples/rc.d
To: None <gnats-bugs@gnats.netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 09/25/2003 14:55:31
>Number: 22954
>Category: pkg
>Synopsis: install all rc.d scripts in share/examples/rc.d
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Sep 25 18:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Greg A. Woods
>Release: 2003/09/18
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD
>Description:
RC.D scripts _REALLY_ should be installed into the
share/examples/rc.d directory!!!!
they should also be auto-registered in the PLIST file.
>How-To-Repeat:
>Fix:
Index: mk/bsd.pkg.install.mk
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/mk/bsd.pkg.install.mk,v
retrieving revision 1.52
diff -c -r1.52 bsd.pkg.install.mk
*** mk/bsd.pkg.install.mk 17 Sep 2003 02:38:22 -0000 1.52
--- mk/bsd.pkg.install.mk 18 Sep 2003 23:11:36 -0000
***************
*** 154,160 ****
SUPPORT_FILES_PERMS?= # empty
RCD_SCRIPTS?= # empty
RCD_SCRIPTS_MODE?= 0755
! RCD_SCRIPTS_EXAMPLEDIR?= ${PREFIX}/etc/rc.d
RCD_SCRIPTS_SHELL?= ${SH}
FILES_SUBST+= CONF_FILES=${CONF_FILES:Q}
FILES_SUBST+= CONF_FILES_MODE=${CONF_FILES_MODE}
--- 154,160 ----
SUPPORT_FILES_PERMS?= # empty
RCD_SCRIPTS?= # empty
RCD_SCRIPTS_MODE?= 0755
! RCD_SCRIPTS_EXAMPLEDIR?= ${PREFIX}/share/examples/rc.d
RCD_SCRIPTS_SHELL?= ${SH}
FILES_SUBST+= CONF_FILES=${CONF_FILES:Q}
FILES_SUBST+= CONF_FILES_MODE=${CONF_FILES_MODE}
***************
*** 202,215 ****
#
# PKG_RCD_SCRIPTS indicates whether to automatically install rc.d scripts
# to ${RCD_SCRIPTS_DIR}. It is either YES or NO and defaults to
! # NO. This variable only takes effect if ${PKG_CONFIG} == "YES".
#
# These values merely set the defaults for INSTALL/DEINSTALL scripts, but
# they may be overridden by resetting them in the environment.
#
PKG_CREATE_USERGROUP?= YES
PKG_CONFIG?= YES
! PKG_RCD_SCRIPTS?= NO
FILES_SUBST+= PKG_CREATE_USERGROUP=${PKG_CREATE_USERGROUP}
FILES_SUBST+= PKG_CONFIG=${PKG_CONFIG}
FILES_SUBST+= PKG_RCD_SCRIPTS=${PKG_RCD_SCRIPTS}
--- 202,218 ----
#
# PKG_RCD_SCRIPTS indicates whether to automatically install rc.d scripts
# to ${RCD_SCRIPTS_DIR}. It is either YES or NO and defaults to
! # YES. This variable only takes effect if ${PKG_CONFIG} == "YES".
! #
! # Note this means adding a package with any RCD_SCRIPTS will
! # cause warnings to be displayed upon boot by /etc/rc.
#
# These values merely set the defaults for INSTALL/DEINSTALL scripts, but
# they may be overridden by resetting them in the environment.
#
PKG_CREATE_USERGROUP?= YES
PKG_CONFIG?= YES
! PKG_RCD_SCRIPTS?= YES
FILES_SUBST+= PKG_CREATE_USERGROUP=${PKG_CREATE_USERGROUP}
FILES_SUBST+= PKG_CONFIG=${PKG_CONFIG}
FILES_SUBST+= PKG_RCD_SCRIPTS=${PKG_RCD_SCRIPTS}
***************
*** 273,278 ****
--- 276,283 ----
INSTALL_SCRIPTS_ENV= PKG_PREFIX=${PREFIX}
+ # this should also run the REQUIRE script....
+
.PHONY: pre-install-script post-install-script
pre-install-script: generate-install-scripts
***************
*** 311,320 ****
#
# RCD_SCRIPT_SRC.<script> the source file for <script>; this will
# be run through FILES_SUBST to generate
! # the rc.d script
#
# RCD_SCRIPTS_EXAMPLEDIR the directory in which to install the
! # example rc.d scripts
#
# If the source rc.d script is not present, then the automatic handling
# doesn't occur.
--- 316,327 ----
#
# RCD_SCRIPT_SRC.<script> the source file for <script>; this will
# be run through FILES_SUBST to generate
! # the rc.d script (defaults to
! # ${FILESDIR}/<script>.sh)
#
# RCD_SCRIPTS_EXAMPLEDIR the directory in which to install the
! # example rc.d scripts (defaults to
! # ${PREFIX}/share/examples/rc.d)
#
# If the source rc.d script is not present, then the automatic handling
# doesn't occur.
***************
*** 331,340 ****
--- 338,350 ----
RCD_SCRIPT_SRC.${_script_}?= ${FILESDIR}/${_script_}.sh
RCD_SCRIPT_WRK.${_script_}?= ${WRKDIR}/${_script_}
+ GENERATE_PLIST+= ${ECHO} ${RCD_SCRIPTS_EXAMPLEDIR:S|${PREFIX}/||}/${_script_};
+
. if !empty(RCD_SCRIPT_SRC.${_script_})
. if exists(${RCD_SCRIPT_SRC.${_script_}})
generate-rcd-scripts: ${RCD_SCRIPT_WRK.${_script_}}
${RCD_SCRIPT_WRK.${_script_}}: ${RCD_SCRIPT_SRC.${_script_}}
+ @${ECHO_MSG} "${_PKGSRC_IN}> Creating ${.TARGET}"
${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} | \
${SED} ${FILES_SUBST_SED} > ${.TARGET}
${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
>Release-Note:
>Audit-Trail:
>Unformatted: