This patch provides a convenient way to install startup scripts that use rc.subr. This is based on ports/67151. Just have to put myport.sh.in in files/, and add USE_RC_SUBR=myport.sh. Fix: --- portmk-rc-script.diff begins here. --- --- portmk-rc-script.diff ends here. -----zXYRETIWaaFbL0VmdgW0cyBvfzeXNRWSaFC35bbjEXJG71LT Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" --- bsd.port.mk.old Tue Jul 6 14:41:03 2004 +++ bsd.port.mk Sun Jul 18 01:31:07 2004 @@ -344,8 +344,12 @@ # WITH_MYSQL_VER - User defined variable to set MySQL version. # # USE_RC_SUBR - Says the ports startup/shutdown script uses the common -# routines found in etc/rc.subr and may need to -# depend on the sysutils/rc_subr port. +# routines found in etc/rc.subr and may need to +# depend on the sysutils/rc_subr port. +# If this is set to a list of files, these files will be +# automatically added to ${SUB_FILES} and some "variable=value" +# pairs will be added to ${SUB_LIST}. These files will be +# installed in ${PREFIX}/etc/rc.d and added to the packing list. # # RC_SUBR - Set to path of rc.subr, defaults to ${LOCALBASE}/etc/rc.subr. # @@ -717,6 +721,18 @@ # (default: ${WRKDIR}/.PLIST.mktmp). # PLIST_SUB - List of "variable=value" pair for substitution in ${PLIST} # (default: see below). +# +# SUB_FILES - Files that should be passed through sed and redirected to ${WRKDIR}. +# - For each file specified in SUB_FILES, there must be a corresponding +# file in ${FILESDIR} whose suffix is ".in". For instance, +# if the Makefile specifies "SUB_FILES= pkg-message" then there must be +# a file called pkg-message.in in ${FILESDIR}. +# - The substitution process is the same as PLIST_FILES, as described +# below except that any line beginning with @comment is deleted. +# SUB_LIST - List of "variable=value" pair for substitution in ${SUB_FILES} +# (some pair are added by default: eg. PREFIX=${PREFIX}). +# +# # INSTALLS_SHLIB - If set, bsd.port.mk will automatically run ldconfig commands # from post-install and also add appropriate @exec/@unexec # directives to directories listed in LDCONFIG_DIRS. --- bsd.port.post.mk.old Wed Jul 7 16:51:17 2004 +++ bsd.port.post.mk Sun Jul 18 01:48:57 2004 @@ -25,6 +25,8 @@ INSTALL_WRKSRC?=${WRKSRC} PLIST_SUB+= OSREL=${OSREL} PREFIX=%D LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} +SUB_LIST+= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} X11BASE=${X11BASE} \ + DATADIR=${DATADIR} DOCSDIR=${DOCSDIR} EXAMPLESDIR=${EXAMPLESDIR} .if defined(WITHOUT_CPU_CFLAGS) .if defined(_CPUCFLAGS) @@ -178,6 +180,10 @@ .else RC_SUBR= /etc/rc.subr .endif +.if ${USE_RC_SUBR} != "yes" +SUB_LIST+= RC_SUBR=${RC_SUBR} +SUB_FILES+= ${USE_RC_SUBR} +.endif .endif .if defined(USE_ICONV) @@ -1961,11 +1967,12 @@ _INSTALL_DEP= build _INSTALL_SEQ= install-message check-conflicts \ run-depends lib-depends pre-install pre-install-script \ - generate-plist check-already-installed + apply-slist generate-plist check-already-installed _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \ pre-su-install-script do-install post-install \ post-install-script add-plist-info add-plist-docs \ - compress-man run-ldconfig fake-pkg security-check + install-rc-script compress-man run-ldconfig fake-pkg \ + security-check _PACKAGE_DEP= install _PACKAGE_SEQ= package-message pre-package pre-package-script \ do-package post-package-script @@ -2863,6 +2870,29 @@ .endif .endif +_SUB_LIST_TEMP= ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} +.if !target(apply-slist) +apply-slist: +# Apply substitutions on files specified in SUB_FILES. +.if defined(SUB_FILES) + @for file in ${SUB_FILES}; do \ + if [ ! -r ${FILESDIR}/$${file}.in ]; then \ + ${ECHO_CMD} ">> Missing file : ${FILESDIR}/$${file}.in for ${PKGNAME}."; \ + exit 1; \ + else \ + ${SED} ${_SUB_LIST_TEMP} -e '/^@comment /d' ${FILESDIR}/$${file}.in > ${WRKDIR}/$${file}; \ + fi; \ + done +.for i in pkg-message pkg-install pkg-deinstall pkg-req +.if ${SUB_FILES:M${i}*}!="" +${i:S/-//:U}= ${WRKDIR}/${SUB_FILES:M${i}*} +.endif +.endfor +.else + @${DO_NADA} +.endif +.endif + # Generate packing list. Also tests to make sure all required package # files exist. @@ -2973,6 +3003,24 @@ .else @${DO_NADA} .endif +.endif + +.if !target(install-rc-script) +install-rc-script: +# Install startup script(s) specified in USE_RC_SUBR. +.if defined(USE_RC_SUBR) && ${USE_RC_SUBR} != "yes" + @${ECHO_CMD} "===> Installing startup script(s) in ${PREFIX}/etc/rc.d" + @if ${EGREP} -qe '^@cw?d' ${TMPPLIST} && \ + [ "`${SED} -En -e '/^@cw?d[ ]*/s,,,p' ${TMPPLIST} | ${TAIL} -n 1`" != "${PREFIX}" ]; then \ + ${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}; \ + fi + @for i in ${USE_RC_SUBR}; do \ + ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${PREFIX}/etc/rc.d; \ + ${ECHO_CMD} etc/rc.d/$${i} >> ${TMPPLIST}; \ + done +.endif +.else + @${DO_NADA} .endif # Compress (or uncompress) and symlink manpages. How-To-Repeat: Apply following patch.
Responsible Changed From-To: freebsd-ports-bugs->eik Over to maintainer.
On Wed, Dec 22, 2004 at 11:47:28PM -0500, Joe Marcus Clarke wrote: > > Nothing in the patch in 69217 applies to the CVS tree, so someone will > > need to redo it. If someone else has time to do that before I get to > > it, that would be very helpful. > > Here you go. In merging it, I found a bug, so this was a good exercise. > It looks like the SUB_{LIST,FILES} stuff was already merged, so that's > probably why it didn't apply before. This patch breaks everything that sets USE_RC_SUBR=YES (e.g. security/racoon, and a few others so far). Because of the proximity of the release and the need to test other patches, I'm pulling it from the build, and we'll have to revisit it sometime later once this problem has been corrected. Kris
On Thu, Dec 23, 2004 at 11:41:49PM -0800, Kris Kennaway wrote: > This patch breaks everything that sets USE_RC_SUBR=YES > (e.g. security/racoon, and a few others so far). Could you please add it to PRs' follow-up ? -Kirill
On Fri, Dec 24, 2004 at 02:57:21AM -0500, Joe Marcus Clarke wrote: > On Thu, 2004-12-23 at 23:41 -0800, Kris Kennaway wrote: > > On Wed, Dec 22, 2004 at 11:47:28PM -0500, Joe Marcus Clarke wrote: > > > > > > Nothing in the patch in 69217 applies to the CVS tree, so someone will > > > > need to redo it. If someone else has time to do that before I get to > > > > it, that would be very helpful. > > > > > > Here you go. In merging it, I found a bug, so this was a good exercise. > > > It looks like the SUB_{LIST,FILES} stuff was already merged, so that's > > > probably why it didn't apply before. > > > > This patch breaks everything that sets USE_RC_SUBR=YES > > (e.g. security/racoon, and a few others so far). > > > > Because of the proximity of the release and the need to test other > > patches, I'm pulling it from the build, and we'll have to revisit it > > sometime later once this problem has been corrected. > > Silly me. Yeah, that will happen. Attached is a new diff with this > problem fixed. However, I understand if you want to rip this out of the > exp build for now. I already restarted it, so I'll do a run without it and reconsider this later. It doesn't seem to be urgent to get this in before 4.11 anyway. Kris
I just see there has been four emails in the audit trail, but i haven't received any of them. Is there something you'd like to be reworked before the next run ?
State Changed From-To: open->closed Committed, thanks!