diff options
author | reed <reed@pkgsrc.org> | 2004-10-11 22:04:19 +0000 |
---|---|---|
committer | reed <reed@pkgsrc.org> | 2004-10-11 22:04:19 +0000 |
commit | 15fee44a6ca90ee69da62ebfdc56244e4aece5e7 (patch) | |
tree | 98bcbe4bc8de1c9598b03b359fde8d92a659ce6a | |
parent | 3ad222cc6fa7141ad1081c16fdcdbf58dbed1191 (diff) | |
download | pkgsrc-15fee44a6ca90ee69da62ebfdc56244e4aece5e7.tar.gz |
Make it so RCD_SCRIPTS_EXAMPLEDIR is a directory relative to
${PREFIX}. It is not an absolute path because with the automatic
addition of the entry to the PLIST would be bogus if someone
defined it to some RCD_SCRIPTS_EXAMPLEDIR outside of PREFIX.
(This may cause multiple rc.d directories if there are multiple
PREFIXes, but I think that is fine.)
Note that at this time, this doesn't change the RCD_SCRIPTS_EXAMPLEDIR
default directory. This will change soon.
Most of this has been in use for over a year.
Also some of this is from Greg Woods. Thank you Greg.
I will next update a few other references to RCD_SCRIPTS_EXAMPLEDIR.
-rw-r--r-- | mk/bsd.pkg.install.mk | 30 | ||||
-rw-r--r-- | mk/install/deinstall | 4 | ||||
-rw-r--r-- | mk/install/install | 4 |
3 files changed, 22 insertions, 16 deletions
diff --git a/mk/bsd.pkg.install.mk b/mk/bsd.pkg.install.mk index 0abb2fb6580..d18a141bda7 100644 --- a/mk/bsd.pkg.install.mk +++ b/mk/bsd.pkg.install.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.install.mk,v 1.64 2004/10/11 21:49:00 reed Exp $ +# $NetBSD: bsd.pkg.install.mk,v 1.65 2004/10/11 22:04:19 reed Exp $ # # This Makefile fragment is included by bsd.pkg.mk to use the common # INSTALL/DEINSTALL scripts. To use this Makefile fragment, simply: @@ -161,9 +161,9 @@ FILES_SUBST+= SPECIAL_PERMS=${SPECIAL_PERMS:Q} # at post-install time. # # RCD_SCRIPTS works lists the basenames of the rc.d scripts. They are -# expected to be found in ${RCD_SCRIPTS_EXAMPLEDIR}, and the scripts -# will be copied into ${RCD_SCRIPTS_DIR} with ${RCD_SCRIPTS_MODE} -# permissions. +# expected to be found in ${PREFIX}/${RCD_SCRIPTS_EXAMPLEDIR}, and +# the scripts will be copied into ${RCD_SCRIPTS_DIR} with +# ${RCD_SCRIPTS_MODE} permissions. # CONF_FILES?= # empty CONF_FILES_MODE?= 0644 @@ -173,7 +173,11 @@ SUPPORT_FILES_MODE?= 0644 SUPPORT_FILES_PERMS?= # empty RCD_SCRIPTS?= # empty RCD_SCRIPTS_MODE?= 0755 -RCD_SCRIPTS_EXAMPLEDIR?= ${PREFIX}/etc/rc.d +RCD_SCRIPTS_EXAMPLEDIR?= etc/rc.d +.if !empty(RCD_SCRIPTS_EXAMPLEDIR:M/*) +PKG_FAIL_REASON+= \ + "bsd.pkg.install.mk: RCD_SCRIPTS_EXAMPLEDIR can't be an absolute path." +.endif RCD_SCRIPTS_SHELL?= ${SH} FILES_SUBST+= CONF_FILES=${CONF_FILES:Q} FILES_SUBST+= CONF_FILES_MODE=${CONF_FILES_MODE} @@ -333,10 +337,11 @@ ${INSTALL_FILE}: ${INSTALL_SRC} # # RCD_SCRIPT_SRC.<script> the source file for <script>; this will # be run through FILES_SUBST to generate -# the rc.d script +# the rc.d script (defaults to +# ${FILESDIR}/<script>.sh) # -# RCD_SCRIPTS_EXAMPLEDIR the directory in which to install the -# example rc.d scripts +# RCD_SCRIPTS_EXAMPLEDIR the directory relative to ${PREFIX} 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. @@ -353,12 +358,13 @@ install-rcd-scripts: # do nothing RCD_SCRIPT_SRC.${_script_}?= ${FILESDIR}/${_script_}.sh RCD_SCRIPT_WRK.${_script_}?= ${WRKDIR}/${_script_} -GENERATE_PLIST+= ${ECHO} ${RCD_SCRIPTS_EXAMPLEDIR:S|${PREFIX}/||}/${_script_}; +GENERATE_PLIST+= ${ECHO} ${RCD_SCRIPTS_EXAMPLEDIR}/${_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} @@ -366,14 +372,14 @@ ${RCD_SCRIPT_WRK.${_script_}}: ${RCD_SCRIPT_SRC.${_script_}} install-rcd-scripts: install-rcd-${_script_} install-rcd-${_script_}: ${RCD_SCRIPT_WRK.${_script_}} ${_PKG_SILENT}${_PKG_DEBUG} \ - if [ ! -d ${RCD_SCRIPTS_EXAMPLEDIR} ]; then \ + if [ ! -d ${PREFIX}/${RCD_SCRIPTS_EXAMPLEDIR} ]; then \ ${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} \ - -m 0755 ${RCD_SCRIPTS_EXAMPLEDIR}; \ + -m 0755 ${PREFIX}/${RCD_SCRIPTS_EXAMPLEDIR}; \ fi ${_PKG_SILENT}${_PKG_DEBUG} \ if [ -f ${RCD_SCRIPT_WRK.${_script_}} ]; then \ ${INSTALL_SCRIPT} ${RCD_SCRIPT_WRK.${_script_}} \ - ${RCD_SCRIPTS_EXAMPLEDIR}/${_script_}; \ + ${PREFIX}/${RCD_SCRIPTS_EXAMPLEDIR}/${_script_}; \ fi . endif . endif diff --git a/mk/install/deinstall b/mk/install/deinstall index 8e30d2674d7..2cb733b8f8a 100644 --- a/mk/install/deinstall +++ b/mk/install/deinstall @@ -1,6 +1,6 @@ # start of deinstall # -# $NetBSD: deinstall,v 1.28 2004/07/10 20:42:37 salo Exp $ +# $NetBSD: deinstall,v 1.29 2004/10/11 22:04:19 reed Exp $ eval set -- ${PKG_USERS} for userset; do @@ -31,7 +31,7 @@ done if [ "${_PKG_RCD_SCRIPTS}" = "YES" ]; then eval set -- ${RCD_SCRIPTS} for script; do - samplefile="${RCD_SCRIPTS_EXAMPLEDIR}/${script}" + samplefile="${PKG_PREFIX}/${RCD_SCRIPTS_EXAMPLEDIR}/${script}" file="${RCD_SCRIPTS_DIR}/${script}" shift ALL_FILES="${ALL_FILES} \"${samplefile}\" \"${file}\"" diff --git a/mk/install/install b/mk/install/install index df8e063b963..a28fb956c8a 100644 --- a/mk/install/install +++ b/mk/install/install @@ -1,6 +1,6 @@ # start of install # -# $NetBSD: install,v 1.31 2004/07/10 20:42:37 salo Exp $ +# $NetBSD: install,v 1.32 2004/10/11 22:04:19 reed Exp $ if [ -z "${CONF_FILES}" -a -z "${CONF_FILES_PERMS}" -a \ -z "${SUPPORT_FILES}" -a -z "${SUPPORT_FILES_PERMS}" -o \ @@ -311,7 +311,7 @@ EOF done eval set -- ${RCD_SCRIPTS} for script; do - samplefile="${RCD_SCRIPTS_EXAMPLEDIR}/${script}" + samplefile="${PKG_PREFIX}/${RCD_SCRIPTS_EXAMPLEDIR}/${script}" file="${RCD_SCRIPTS_DIR}/${script}" if [ "${_PKG_CONFIG}" = "NO" -o \ |