ports/90070: [MAINTAINER] mail/rabl_server: per sougb request, use "new style" RC script
Pav Lucistnik
pav at FreeBSD.org
Fri Dec 9 15:13:58 UTC 2005
> > > In the end we should have only new-style RCng scripts
> > > (files/rc_script.in) whit ports setting USE_RC_SUBR= rc_script.in,
> > > installed as such on HEAD (and sometime on 6-STABLE) and .sh added
> > > for older OSVERSIONs.
> >
> > Other way around, leave USE_RC_SUBR=skript.sh and files/skript.sh.in,
> > to avoid repo churn, and strip .sh when installing on newer
> > OSVERSIONs.
>
> And end up with an other "historical" rule. (Q: Why are rc scripts
> named .sh.in and installed w/o .sh ? A: In the past scripts used to be
> sourced in a sub-shell if they had .sh .... ). And not all scripts are
> apt to be installed w/o .sh (I didn't check and I don't know if they
> would run and rcorder and fiends don't choke on them since they have
> no keywords, maybe doug can tell us).
So we have to choose between what is right and what is easy.
Let's go with the hard solution then.
> Testing the actual patch for bsd.port.mk is easy,
> just define OSVERSION=700xx after including bsd.port.pre.mk in port's
> Makefile.
Turns out that existing code is aware of .sh/non-.sh scripts and deals
with them, so, what about
diff -a -u -r1.518 bsd.port.mk
--- bsd.port.mk 8 Nov 2005 09:02:51 -0000 1.518
+++ bsd.port.mk 9 Dec 2005 15:12:11 -0000
@@ -4952,11 +4952,18 @@
.if defined(USE_RC_SUBR) && ${USE_RC_SUBR:U} != "YES"
@${ECHO_CMD} "===> Installing rcNG startup script(s)"
@${ECHO_CMD} "@cwd ${PREFIX}" >> ${TMPPLIST}
+.if ${OSVERSION} > 700006
+ @for i in ${USE_RC_SUBR}; do \
+ ${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${PREFIX}/etc/rc.d/$${i%.sh}; \
+ ${ECHO_CMD} "etc/rc.d/$${i%.sh}" >> ${TMPPLIST}; \
+ done
+.else
@for i in ${USE_RC_SUBR}; do \
${INSTALL_SCRIPT} ${WRKDIR}/$${i} ${PREFIX}/etc/rc.d/$${i%.sh}.sh; \
${ECHO_CMD} "etc/rc.d/$${i%.sh}.sh" >> ${TMPPLIST}; \
done
.endif
+.endif
.else
@${DO_NADA}
.endif
Content of USE_RC_SUBR can be either script.sh or script, both works.
--
Pav Lucistnik <pav at oook.cz>
<pav at FreeBSD.org>
You can't expect to wield supreme executive power just 'cause some
watery tart threw a sword at you.
More information about the freebsd-ports-bugs
mailing list